path-parser
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -88,3 +88,3 @@ define(['exports', 'module'], function (exports, module) { | ||
if (!trailingSlash || source === '/') return source; | ||
return source.replace(/\/$/, '') + '(?:/)?'; | ||
return source.replace(/\/$/, '') + '(?:\\/)?'; | ||
}; | ||
@@ -165,3 +165,3 @@ | ||
// Check if exact match | ||
var match = this._urlMatch(path, new RegExp('^' + source + (this.hasQueryParams ? '?.*$' : '$'))); | ||
var match = this._urlMatch(path, new RegExp('^' + source + (this.hasQueryParams ? '\\?.*$' : '$'))); | ||
// If no match, or no query params, no need to go further | ||
@@ -168,0 +168,0 @@ if (!match || !this.hasQueryParams) return match; |
@@ -91,3 +91,3 @@ 'use strict'; | ||
if (!trailingSlash || source === '/') return source; | ||
return source.replace(/\/$/, '') + '(?:/)?'; | ||
return source.replace(/\/$/, '') + '(?:\\/)?'; | ||
}; | ||
@@ -168,3 +168,3 @@ | ||
// Check if exact match | ||
var match = this._urlMatch(path, new RegExp('^' + source + (this.hasQueryParams ? '?.*$' : '$'))); | ||
var match = this._urlMatch(path, new RegExp('^' + source + (this.hasQueryParams ? '\\?.*$' : '$'))); | ||
// If no match, or no query params, no need to go further | ||
@@ -171,0 +171,0 @@ if (!match || !this.hasQueryParams) return match; |
@@ -100,3 +100,3 @@ (function (global, factory) { | ||
if (!trailingSlash || source === '/') return source; | ||
return source.replace(/\/$/, '') + '(?:/)?'; | ||
return source.replace(/\/$/, '') + '(?:\\/)?'; | ||
}; | ||
@@ -177,3 +177,3 @@ | ||
// Check if exact match | ||
var match = this._urlMatch(path, new RegExp('^' + source + (this.hasQueryParams ? '?.*$' : '$'))); | ||
var match = this._urlMatch(path, new RegExp('^' + source + (this.hasQueryParams ? '\\?.*$' : '$'))); | ||
// If no match, or no query params, no need to go further | ||
@@ -180,0 +180,0 @@ if (!match || !this.hasQueryParams) return match; |
@@ -79,3 +79,3 @@ let defaultOrConstrained = (match) => { | ||
if (!trailingSlash || source === '/') return source | ||
return source.replace(/\/$/, '') + '(?:\/)?' | ||
return source.replace(/\/$/, '') + '(?:\\/)?' | ||
} | ||
@@ -130,3 +130,3 @@ | ||
// Check if exact match | ||
let match = this._urlMatch(path, new RegExp('^' + source + (this.hasQueryParams ? '\?.*$' : '$'))) | ||
let match = this._urlMatch(path, new RegExp('^' + source + (this.hasQueryParams ? '\\?.*$' : '$'))) | ||
// If no match, or no query params, no need to go further | ||
@@ -133,0 +133,0 @@ if (!match || !this.hasQueryParams) return match |
{ | ||
"name": "path-parser", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"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
47828