path-parser
Advanced tools
Comparing version 0.2.2 to 0.2.3
@@ -41,3 +41,3 @@ define(['exports', 'module'], function (exports, module) { | ||
regex: function regex(match) { | ||
return new RegExp(match[0]); | ||
return new RegExp('\\' + match[0]); | ||
} | ||
@@ -88,4 +88,4 @@ }, { | ||
var optTrailingSlash = function optTrailingSlash(source, trailingSlash) { | ||
if (!trailingSlash || source === '/') return source; | ||
return source.replace(/\/$/, '') + '(?:\\/)?'; | ||
if (!trailingSlash || source === '\\/') return source; | ||
return source.replace(/\\\/$/, '') + '(?:\\/)?'; | ||
}; | ||
@@ -92,0 +92,0 @@ |
@@ -44,3 +44,3 @@ 'use strict'; | ||
regex: function regex(match) { | ||
return new RegExp(match[0]); | ||
return new RegExp('\\' + match[0]); | ||
} | ||
@@ -91,4 +91,4 @@ }, { | ||
var optTrailingSlash = function optTrailingSlash(source, trailingSlash) { | ||
if (!trailingSlash || source === '/') return source; | ||
return source.replace(/\/$/, '') + '(?:\\/)?'; | ||
if (!trailingSlash || source === '\\/') return source; | ||
return source.replace(/\\\/$/, '') + '(?:\\/)?'; | ||
}; | ||
@@ -95,0 +95,0 @@ |
@@ -53,3 +53,3 @@ (function (global, factory) { | ||
regex: function regex(match) { | ||
return new RegExp(match[0]); | ||
return new RegExp('\\' + match[0]); | ||
} | ||
@@ -100,4 +100,4 @@ }, { | ||
var optTrailingSlash = function optTrailingSlash(source, trailingSlash) { | ||
if (!trailingSlash || source === '/') return source; | ||
return source.replace(/\/$/, '') + '(?:\\/)?'; | ||
if (!trailingSlash || source === '\\/') return source; | ||
return source.replace(/\\\/$/, '') + '(?:\\/)?'; | ||
}; | ||
@@ -104,0 +104,0 @@ |
@@ -35,3 +35,3 @@ let defaultOrConstrained = (match) => { | ||
pattern: /^(\/|\?)/, | ||
regex: match => new RegExp(match[0]) | ||
regex: match => new RegExp('\\' + match[0]) | ||
}, | ||
@@ -79,4 +79,4 @@ { | ||
let optTrailingSlash = (source, trailingSlash) => { | ||
if (!trailingSlash || source === '/') return source | ||
return source.replace(/\/$/, '') + '(?:\\/)?' | ||
if (!trailingSlash || source === '\\/') return source | ||
return source.replace(/\\\/$/, '') + '(?:\\/)?' | ||
} | ||
@@ -83,0 +83,0 @@ |
{ | ||
"name": "path-parser", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "A small utility to parse, match and generate paths", | ||
@@ -5,0 +5,0 @@ "main": "dist/commonjs/path-parser.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
47872