New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

path-to-regex

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

path-to-regex - npm Package Compare versions

Comparing version 1.3.0 to 1.3.1

2

package.json
{
"name": "path-to-regex",
"version": "1.3.0",
"version": "1.3.1",
"description": "Turn a path string such as /user/:id or /user/:id(\\d+) into a regular expression",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -130,37 +130,50 @@ # path-to-regex

let result = parser.match('/user/123/bar/111qwertyfak/222foo/test/pictures-p01.png,p02.png,p03.png/333'); // result: { id: '123',
key: [ '111', '222', '333' ],
post: 'qwerty',
foo: [ 'foo' ],
multi: [ 'p01.png', 'p02.png', 'p03.png' ] }
let result = parser.match('/user/123/bar/111qwertyfak/222foo/test/pictures-p01.png-p02.png-p03.png'); // result: { id: '123',
key: [ '111', '222' ],
post: 'qwerty',
foo: [ 'foo' ],
multi: [ 'p01.png', 'p02.png', 'p03.png' ] }
let result = parser.match('/user/123/bar/111fak/222foo/test/pictures-p01.png,p02.png,p03.png'); // result: { id: '123',
key: [ '111', '222' ],
post: undefined,
foo: [ 'foo' ],
multi: [ 'p01.png', 'p02.png', 'p03.png' ] }
let result = parser.match('/user/123/bar/111fak/foo/test/pictures-p01.png;p02.png;p03.png'); // result: { id: '123',
key: [ '111' ],
post: undefined,
foo: [ 'foo' ],
multi: [ 'p01.png', 'p02.png', 'p03.png' ] }
let result = parser.match('/user/123/bar/111fak/foo/test/pictures-p01.png p02.png'); // result: { id: '123',
key: [ '111' ],
post: undefined,
foo: [ 'foo' ],
multi: [ 'p01.png', 'p02.png' ] }
let result = parser.match('/user/123/bar/111fak/foo/test/pictures-p01.png'); // result: { id: '123',
key: [ '111' ],
post: undefined,
foo: [ 'foo' ],
multi: [ 'p01.png' ] }
let result = parser.match('/user/123/bar/111fak/foo/test/pictures-'); // result: { id: '123',
key: [ '111' ],
post: undefined,
foo: [ 'foo' ],
multi: [] }
let result = parser.match('/user/123/bar/111qwertyfak/222foo/test/pictures-p01.png,p02.png,p03.png/333');
/* result: { id: '123',
key: [ '111', '222', '333' ],
post: 'qwerty',
foo: [ 'foo' ],
multi: [ 'p01.png', 'p02.png', 'p03.png' ] } */
let result = parser.match('/user/123/bar/111qwertyfak/222foo/test/pictures-p01.png-p02.png-p03.png');
/* result: { id: '123',
key: [ '111', '222' ],
post: 'qwerty',
foo: [ 'foo' ],
multi: [ 'p01.png', 'p02.png', 'p03.png' ] } */
let result = parser.match('/user/123/bar/111fak/222foo/test/pictures-p01.png,p02.png,p03.png');
/* result: { id: '123',
key: [ '111', '222' ],
post: undefined,
foo: [ 'foo' ],
multi: [ 'p01.png', 'p02.png', 'p03.png' ] } */
let result = parser.match('/user/123/bar/111fak/foo/test/pictures-p01.png;p02.png;p03.png');
/* result: { id: '123',
key: [ '111' ],
post: undefined,
foo: [ 'foo' ],
multi: [ 'p01.png', 'p02.png', 'p03.png' ] } */
let result = parser.match('/user/123/bar/111fak/foo/test/pictures-p01.png p02.png');
/* result: { id: '123',
key: [ '111' ],
post: undefined,
foo: [ 'foo' ],
multi: [ 'p01.png', 'p02.png' ] } */
let result = parser.match('/user/123/bar/111fak/foo/test/pictures-p01.png');
/* result: { id: '123',
key: [ '111' ],
post: undefined,
foo: [ 'foo' ],
multi: [ 'p01.png' ] } */
let result = parser.match('/user/123/bar/111fak/foo/test/pictures-');
/* result: { id: '123',
key: [ '111' ],
post: undefined,
foo: [ 'foo' ],
multi: [] } */
```

@@ -167,0 +180,0 @@

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