Use String#startsWith instead of String#indexOf
This commit is contained in:
@@ -822,7 +822,7 @@ function getTypeName(featurePrefix, featureType) {
|
||||
featurePrefix = featurePrefix ? featurePrefix : FEATURE_PREFIX;
|
||||
const prefix = featurePrefix + ':';
|
||||
// The featureType already contains the prefix.
|
||||
if (featureType.indexOf(prefix) === 0) {
|
||||
if (featureType.startsWith(prefix)) {
|
||||
return featureType;
|
||||
} else {
|
||||
return prefix + featureType;
|
||||
|
||||
@@ -864,7 +864,7 @@ class WKB extends FeatureFormat {
|
||||
options.dataProjection && getProjection(options.dataProjection);
|
||||
if (dataProjection) {
|
||||
const code = dataProjection.getCode();
|
||||
if (code.indexOf('EPSG:') === 0) {
|
||||
if (code.startsWith('EPSG:')) {
|
||||
srid = Number(code.substring(5));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user