diff --git a/lib/RequestShortener.js b/lib/RequestShortener.js index b4a803fd13b..2d3b5f1231d 100644 --- a/lib/RequestShortener.js +++ b/lib/RequestShortener.js @@ -7,7 +7,7 @@ const path = require("path"); const NORMALIZE_SLASH_DIRECTION_REGEXP = /\\/g; const PATH_CHARS_REGEXP = /[-[\]{}()*+?.,\\^$|#\s]/g; -const SEPERATOR_REGEXP = /[/\\]$/; +const SEPARATOR_REGEXP = /[/\\]$/; const FRONT_OR_BACK_BANG_REGEXP = /^!|!$/g; const INDEX_JS_REGEXP = /\/index.js(!|\?|\(query\))/g; @@ -23,14 +23,14 @@ const createRegExpForPath = (path) => { class RequestShortener { constructor(directory) { directory = normalizeBackSlashDirection(directory); - if(SEPERATOR_REGEXP.test(directory)) directory = directory.substr(0, directory.length - 1); + if(SEPARATOR_REGEXP.test(directory)) directory = directory.substr(0, directory.length - 1); if(directory) { this.currentDirectoryRegExp = createRegExpForPath(directory); } const dirname = path.dirname(directory); - const endsWithSeperator = SEPERATOR_REGEXP.test(dirname); + const endsWithSeperator = SEPARATOR_REGEXP.test(dirname); const parentDirectory = endsWithSeperator ? dirname.substr(0, dirname.length - 1) : dirname; if(parentDirectory && parentDirectory !== directory) { this.parentDirectoryRegExp = createRegExpForPath(parentDirectory);