Skip to content

Commit

Permalink
fix(sp): spelling mistake in const name
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLarkInn committed Jul 6, 2017
1 parent c2fa5d4 commit 70b7d2f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/RequestShortener.js
Expand Up @@ -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;

Expand All @@ -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);
Expand Down

0 comments on commit 70b7d2f

Please sign in to comment.