path-to-regex
Advanced tools
Comparing version 1.1.1 to 1.1.2
{ | ||
"name": "path-to-regex", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Turn a path string such as /user/:id or /user/:id(\\d+) into a regular expression", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -40,7 +40,7 @@ # path-to-regex | ||
let result = regex.match('/foo/asd'); // result: { bar: 'asd' } | ||
let result = parser.match('/foo/asd'); // result: { bar: 'asd' } | ||
let result = regex.match('/foo/123'); // result: { bar: '123' } | ||
let result = parser.match('/foo/123'); // result: { bar: '123' } | ||
let result = regex.match('/foo/123/bar'); // result: undefined | ||
let result = parser.match('/foo/123/bar'); // result: undefined | ||
``` | ||
@@ -56,9 +56,9 @@ | ||
let result = regex.match('/foo/123'); // result: { bar: '123' } | ||
let result = parser.match('/foo/123'); // result: { bar: '123' } | ||
let result = regex.match('/foo/asd'); // result: undefined | ||
let result = parser.match('/foo/asd'); // result: undefined | ||
let result = regex.match('/foo/123asd'); // result: undefined | ||
let result = parser.match('/foo/123asd'); // result: undefined | ||
let result = regex.match('/foo/123/bar'); // result: undefined | ||
let result = parser.match('/foo/123/bar'); // result: undefined | ||
``` | ||
@@ -74,5 +74,5 @@ | ||
let result = regex.match('/user/123/asd'); // result: { foo: '123', bar: 'asd' } | ||
let result = parser.match('/user/123/asd'); // result: { foo: '123', bar: 'asd' } | ||
let result = regex.match('/user/asd/123'); // result: { foo: 'asd', bar: '123' } | ||
let result = parser.match('/user/asd/123'); // result: { foo: 'asd', bar: '123' } | ||
``` | ||
@@ -88,5 +88,5 @@ | ||
let result = regex.match('/foo/123/asd'); // result: { bar: [ '123', 'asd' ] } | ||
let result = parser.match('/foo/123/asd'); // result: { bar: [ '123', 'asd' ] } | ||
let result = regex.match('/foo/asd/123'); // result: { bar: [ 'asd', '123' ] } | ||
let result = parser.match('/foo/asd/123'); // result: { bar: [ 'asd', '123' ] } | ||
``` | ||
@@ -102,7 +102,7 @@ | ||
let result = regex.match('/foo/123'); // result: { bar: '123' } | ||
let result = parser.match('/foo/123'); // result: { bar: '123' } | ||
let result = regex.match('/foo/'); // result: { bar: undefined } | ||
let result = parser.match('/foo/'); // result: { bar: undefined } | ||
let result = regex.match('/foo'); // result: { bar: undefined } | ||
let result = parser.match('/foo'); // result: { bar: undefined } | ||
``` | ||
@@ -118,11 +118,11 @@ | ||
let result = regex.match('/foo'); // result: { bar: [] } | ||
let result = parser.match('/foo'); // result: { bar: [] } | ||
let result = regex.match('/foo/'); // result: { bar: [] } | ||
let result = parser.match('/foo/'); // result: { bar: [] } | ||
let result = regex.match('/foo/123'); // result: { bar: [ '123' ] } | ||
let result = parser.match('/foo/123'); // result: { bar: [ '123' ] } | ||
let result = regex.match('/foo/123/456'); // result: { bar: [ '123', '456' ] } | ||
let result = parser.match('/foo/123/456'); // result: { bar: [ '123', '456' ] } | ||
let result = regex.match('/foo/123/456/'); // result: { bar: [ '123', '456' ] } | ||
let result = parser.match('/foo/123/456/'); // result: { bar: [ '123', '456' ] } | ||
@@ -133,5 +133,5 @@ | ||
let result = regex.match('/foo/ids: 123 456 789'); // result: { bar: [ '123 456 789' ], count: undefined } | ||
let result = parser.match('/foo/ids: 123 456 789'); // result: { bar: [ '123 456 789' ], count: undefined } | ||
let result = regex.match('/foo/ids: 123 456 789/3'); // result: { bar: [ '123 456 789' ], count: '3' } | ||
let result = parser.match('/foo/ids: 123 456 789/3'); // result: { bar: [ '123 456 789' ], count: '3' } | ||
@@ -142,11 +142,11 @@ | ||
let result = regex.match('/foo'); // result: undefined | ||
let result = parser.match('/foo'); // result: undefined | ||
let result = regex.match('/foo/'); // result: undefined | ||
let result = parser.match('/foo/'); // result: undefined | ||
let result = regex.match('/foo/123'); // result: { bar: [ '123' ] } | ||
let result = parser.match('/foo/123'); // result: { bar: [ '123' ] } | ||
let result = regex.match('/foo/123/456'); // result: { bar: [ '123', '456' ] } | ||
let result = parser.match('/foo/123/456'); // result: { bar: [ '123', '456' ] } | ||
let result = regex.match('/foo/123/456/'); // result: { bar: [ '123', '456' ] } | ||
let result = parser.match('/foo/123/456/'); // result: { bar: [ '123', '456' ] } | ||
@@ -157,5 +157,5 @@ | ||
let result = regex.match('/foo/ids-123,456,789'); // result: { bar: [ '123,456,789' ], count: undefined } | ||
let result = parser.match('/foo/ids-123,456,789'); // result: { bar: [ '123,456,789' ], count: undefined } | ||
let result = regex.match('/foo/ids-123,456,789/3'); // result: { bar: [ '123,456,789' ], count: '3' } | ||
let result = parser.match('/foo/ids-123,456,789/3'); // result: { bar: [ '123,456,789' ], count: '3' } | ||
``` | ||
@@ -171,3 +171,3 @@ | ||
let result = regex.match('/user/123/bar/111qwertyfak/222foo/test/pictures-p01.png,p02.png,p03.png'); | ||
let result = parser.match('/user/123/bar/111qwertyfak/222foo/test/pictures-p01.png,p02.png,p03.png'); | ||
/* result: | ||
@@ -181,3 +181,3 @@ { id: '123', | ||
let result = regex.match('/user/123/bar/111qwertyfak/222foo/test/pictures-p01.png,p02.png,p03.png/333'); | ||
let result = parser.match('/user/123/bar/111qwertyfak/222foo/test/pictures-p01.png,p02.png,p03.png/333'); | ||
/* result: | ||
@@ -195,3 +195,3 @@ { id: '123', | ||
let result = regex.match('/user/123/bar/111fak/222foo/test/pictures-p01.png p02.png p03.png'); | ||
let result = parser.match('/user/123/bar/111fak/222foo/test/pictures-p01.png p02.png p03.png'); | ||
/* result: | ||
@@ -205,3 +205,3 @@ { id: '123', | ||
let result = regex.match('/user/123/bar/111fak/222foo/test/pictures-p01.png p02.png p03.png/333'); | ||
let result = parser.match('/user/123/bar/111fak/222foo/test/pictures-p01.png p02.png p03.png/333'); | ||
/* result: | ||
@@ -215,3 +215,3 @@ { id: '123', | ||
let result = regex.match('/user/123/bar/111fak/222foo/test/pictures-p01.png p02.png p03.png/333/444/'); | ||
let result = parser.match('/user/123/bar/111fak/222foo/test/pictures-p01.png p02.png p03.png/333/444/'); | ||
/* result: | ||
@@ -227,2 +227,3 @@ { id: '123', | ||
... documentation in processed | ||
@@ -229,0 +230,0 @@ |
20854
227