From ee6dffa78bf9df6059986c386e8e79a0b88c7cbe Mon Sep 17 00:00:00 2001 From: Mate Hegedus Date: Mon, 20 Nov 2017 22:54:26 +0000 Subject: [PATCH] now using lastIndexOf instead of startsWith so that it's compatible with older browsers --- modules/PathUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/PathUtils.js b/modules/PathUtils.js index 7d586b69f..9ac3ec2e1 100644 --- a/modules/PathUtils.js +++ b/modules/PathUtils.js @@ -5,7 +5,7 @@ export const stripLeadingSlash = (path) => path.charAt(0) === '/' ? path.substr(1) : path export const hasBasename = (path, prefix) => - path.toLowerCase().startsWith(prefix.toLowerCase()) && "/?#".indexOf(path.charAt(prefix.length)) !== -1 + path.toLowerCase().lastIndexOf(prefix.toLowerCase(), 0) === 0 && "/?#".indexOf(path.charAt(prefix.length)) !== -1 export const stripBasename = (path, prefix) => hasBasename(path, prefix) ? path.substr(prefix.length) : path