path-to-regexp
Advanced tools
Comparing version 0.1.0 to 0.1.1
23
index.js
@@ -35,18 +35,23 @@ /** | ||
.concat(strict ? '' : '/?') | ||
.replace(/\/\(/g, '(?:/') | ||
.replace(/(\/)?(\.)?:(\w+)(?:(\(.*?\)))?(\?)?(\*)?/g, function(_, slash, format, key, capture, optional, star){ | ||
keys.push({ name: key, optional: !! optional }); | ||
.replace(/\/\(/g, '/(?:') | ||
.replace(/([\/\.])/g, '\\$1') | ||
.replace(/(\\\/)?(\\\.)?:(\w+)(\(.*?\))?(\*)?(\?)?/g, function (match, slash, format, key, capture, star, optional) { | ||
slash = slash || ''; | ||
format = format || ''; | ||
capture = capture || '([^/' + format + ']+?)'; | ||
optional = optional || ''; | ||
keys.push({ name: key, optional: !!optional }); | ||
return '' | ||
+ (optional ? '' : slash) | ||
+ '(?:' | ||
+ (optional ? slash : '') | ||
+ (format || '') + (capture || (format && '([^/.]+?)' || '([^/]+?)')) + ')' | ||
+ (optional || '') | ||
+ (star ? '(/*)?' : ''); | ||
+ format + (optional ? slash : '') + capture | ||
+ (star ? '((?:[\\/' + format + '].+?)?)' : '') | ||
+ ')' | ||
+ optional; | ||
}) | ||
.replace(/([\/.])/g, '\\$1') | ||
.replace(/\*/g, '(.*)'); | ||
return new RegExp('^' + path + (end ? '$' : ''), sensitive ? '' : 'i'); | ||
return new RegExp('^' + path + (end ? '$' : '(?=\/|$)'), sensitive ? '' : 'i'); | ||
}; |
{ | ||
"name": "path-to-regexp", | ||
"description": "Express style path to RegExp utility", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"scripts": { | ||
"test": "istanbul cover _mocha -- -R spec" | ||
}, | ||
"keywords": [ | ||
@@ -17,3 +20,7 @@ "express", | ||
"url": "https://github.com/component/path-to-regexp.git" | ||
}, | ||
"dependencies": { | ||
"mocha": "^1.17.1", | ||
"istanbul": "^0.2.6" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
17220
7
438
2
2
+ Addedistanbul@^0.2.6
+ Addedmocha@^1.17.1
+ Addedabbrev@1.0.9(transitive)
+ Addedamdefine@1.0.1(transitive)
+ Addedargparse@1.0.10(transitive)
+ Addedasync@0.2.100.9.2(transitive)
+ Addedcommander@0.6.12.3.0(transitive)
+ Addeddebug@2.0.0(transitive)
+ Addeddiff@1.0.8(transitive)
+ Addedescape-string-regexp@1.0.2(transitive)
+ Addedescodegen@1.3.3(transitive)
+ Addedesprima@1.1.11.2.54.0.1(transitive)
+ Addedestraverse@1.5.1(transitive)
+ Addedesutils@1.0.0(transitive)
+ Addedfileset@0.1.8(transitive)
+ Addedglob@3.2.113.2.3(transitive)
+ Addedgraceful-fs@2.0.3(transitive)
+ Addedgrowl@1.8.1(transitive)
+ Addedhandlebars@1.3.0(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedistanbul@0.2.16(transitive)
+ Addedjade@0.26.3(transitive)
+ Addedjs-yaml@3.14.1(transitive)
+ Addedlru-cache@2.7.3(transitive)
+ Addedminimatch@0.2.140.3.00.4.0(transitive)
+ Addedminimist@0.0.81.2.8(transitive)
+ Addedmkdirp@0.3.00.5.00.5.6(transitive)
+ Addedmocha@1.21.5(transitive)
+ Addedms@0.6.2(transitive)
+ Addednopt@3.0.6(transitive)
+ Addedoptimist@0.3.7(transitive)
+ Addedresolve@0.7.4(transitive)
+ Addedsigmund@1.0.1(transitive)
+ Addedsource-map@0.1.43(transitive)
+ Addedsprintf-js@1.0.3(transitive)
+ Addeduglify-js@2.3.6(transitive)
+ Addedwhich@1.0.9(transitive)
+ Addedwordwrap@0.0.3(transitive)