Socket
Socket
Sign inDemoInstall

path-parser

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

path-parser - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

6

dist/amd/path-parser.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc