Use String#startsWith instead of String#indexOf

This commit is contained in:
Maximilian Krög
2022-08-04 23:59:17 +02:00
parent 0b945f2321
commit bb3c5bf144
14 changed files with 51 additions and 53 deletions

View File

@@ -114,7 +114,7 @@ export function getMapTileUrlTemplate(links, mediaType) {
}
if (knownMapMediaTypes[link.type]) {
fallbackUrlTemplate = link.href;
} else if (!fallbackUrlTemplate && link.type.indexOf('image/') === 0) {
} else if (!fallbackUrlTemplate && link.type.startsWith('image/')) {
fallbackUrlTemplate = link.href;
}
}