path-parser
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -87,3 +87,3 @@ define(['exports', 'module'], function (exports, module) { | ||
var optTrailingSlash = function optTrailingSlash(source, trailingSlash) { | ||
if (!trailingSlash) return source; | ||
if (!trailingSlash || source === '/') return source; | ||
return source.replace(/\/$/, '') + '(?:/)?'; | ||
@@ -90,0 +90,0 @@ }; |
@@ -90,3 +90,3 @@ 'use strict'; | ||
var optTrailingSlash = function optTrailingSlash(source, trailingSlash) { | ||
if (!trailingSlash) return source; | ||
if (!trailingSlash || source === '/') return source; | ||
return source.replace(/\/$/, '') + '(?:/)?'; | ||
@@ -93,0 +93,0 @@ }; |
@@ -99,3 +99,3 @@ (function (global, factory) { | ||
var optTrailingSlash = function optTrailingSlash(source, trailingSlash) { | ||
if (!trailingSlash) return source; | ||
if (!trailingSlash || source === '/') return source; | ||
return source.replace(/\/$/, '') + '(?:/)?'; | ||
@@ -102,0 +102,0 @@ }; |
@@ -78,3 +78,3 @@ let defaultOrConstrained = (match) => { | ||
let optTrailingSlash = (source, trailingSlash) => { | ||
if (!trailingSlash) return source | ||
if (!trailingSlash || source === '/') return source | ||
return source.replace(/\/$/, '') + '(?:\/)?' | ||
@@ -81,0 +81,0 @@ } |
{ | ||
"name": "path-parser", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"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
47814