Agregado toping en los menus
This commit is contained in:
36
node_modules/path-to-regexp/History.md
generated
vendored
36
node_modules/path-to-regexp/History.md
generated
vendored
@@ -1,36 +0,0 @@
|
||||
0.1.7 / 2015-07-28
|
||||
==================
|
||||
|
||||
* Fixed regression with escaped round brackets and matching groups.
|
||||
|
||||
0.1.6 / 2015-06-19
|
||||
==================
|
||||
|
||||
* Replace `index` feature by outputting all parameters, unnamed and named.
|
||||
|
||||
0.1.5 / 2015-05-08
|
||||
==================
|
||||
|
||||
* Add an index property for position in match result.
|
||||
|
||||
0.1.4 / 2015-03-05
|
||||
==================
|
||||
|
||||
* Add license information
|
||||
|
||||
0.1.3 / 2014-07-06
|
||||
==================
|
||||
|
||||
* Better array support
|
||||
* Improved support for trailing slash in non-ending mode
|
||||
|
||||
0.1.0 / 2014-03-06
|
||||
==================
|
||||
|
||||
* add options.end
|
||||
|
||||
0.0.2 / 2013-02-10
|
||||
==================
|
||||
|
||||
* Update to match current express
|
||||
* add .license property to component.json
|
||||
109
node_modules/path-to-regexp/index.js
generated
vendored
109
node_modules/path-to-regexp/index.js
generated
vendored
@@ -1,13 +1,13 @@
|
||||
/**
|
||||
* Expose `pathtoRegexp`.
|
||||
* Expose `pathToRegexp`.
|
||||
*/
|
||||
|
||||
module.exports = pathtoRegexp;
|
||||
module.exports = pathToRegexp;
|
||||
|
||||
/**
|
||||
* Match matching groups in a regular expression.
|
||||
*/
|
||||
var MATCHING_GROUP_REGEXP = /\((?!\?)/g;
|
||||
var MATCHING_GROUP_REGEXP = /\\.|\((?:\?<(.*?)>)?(?!\?)/g;
|
||||
|
||||
/**
|
||||
* Normalize the given path string,
|
||||
@@ -25,22 +25,27 @@ var MATCHING_GROUP_REGEXP = /\((?!\?)/g;
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function pathtoRegexp(path, keys, options) {
|
||||
function pathToRegexp(path, keys, options) {
|
||||
options = options || {};
|
||||
keys = keys || [];
|
||||
var strict = options.strict;
|
||||
var end = options.end !== false;
|
||||
var flags = options.sensitive ? '' : 'i';
|
||||
var lookahead = options.lookahead !== false;
|
||||
var extraOffset = 0;
|
||||
var keysOffset = keys.length;
|
||||
var i = 0;
|
||||
var name = 0;
|
||||
var pos = 0;
|
||||
var backtrack = '';
|
||||
var m;
|
||||
|
||||
if (path instanceof RegExp) {
|
||||
while (m = MATCHING_GROUP_REGEXP.exec(path.source)) {
|
||||
if (m[0][0] === '\\') continue;
|
||||
|
||||
keys.push({
|
||||
name: name++,
|
||||
name: m[1] || name++,
|
||||
optional: false,
|
||||
offset: m.index
|
||||
});
|
||||
@@ -54,20 +59,57 @@ function pathtoRegexp(path, keys, options) {
|
||||
// the same keys and options instance into every generation to get
|
||||
// consistent matching groups before we join the sources together.
|
||||
path = path.map(function (value) {
|
||||
return pathtoRegexp(value, keys, options).source;
|
||||
return pathToRegexp(value, keys, options).source;
|
||||
});
|
||||
|
||||
return new RegExp('(?:' + path.join('|') + ')', flags);
|
||||
return new RegExp(path.join('|'), flags);
|
||||
}
|
||||
|
||||
path = ('^' + path + (strict ? '' : path[path.length - 1] === '/' ? '?' : '/?'))
|
||||
.replace(/\/\(/g, '/(?:')
|
||||
.replace(/([\/\.])/g, '\\$1')
|
||||
.replace(/(\\\/)?(\\\.)?:(\w+)(\(.*?\))?(\*)?(\?)?/g, function (match, slash, format, key, capture, star, optional, offset) {
|
||||
if (typeof path !== 'string') {
|
||||
throw new TypeError('path must be a string, array of strings, or regular expression');
|
||||
}
|
||||
|
||||
path = path.replace(
|
||||
/\\.|(\/)?(\.)?:(\w+)(\(.*?\))?(\*)?(\?)?|[.*]|\/\(/g,
|
||||
function (match, slash, format, key, capture, star, optional, offset) {
|
||||
if (match[0] === '\\') {
|
||||
backtrack += match;
|
||||
pos += 2;
|
||||
return match;
|
||||
}
|
||||
|
||||
if (match === '.') {
|
||||
backtrack += '\\.';
|
||||
extraOffset += 1;
|
||||
pos += 1;
|
||||
return '\\.';
|
||||
}
|
||||
|
||||
if (slash || format) {
|
||||
backtrack = '';
|
||||
} else {
|
||||
backtrack += path.slice(pos, offset);
|
||||
}
|
||||
|
||||
pos = offset + match.length;
|
||||
|
||||
if (match === '*') {
|
||||
extraOffset += 3;
|
||||
return '(.*)';
|
||||
}
|
||||
|
||||
if (match === '/(') {
|
||||
backtrack += '/';
|
||||
extraOffset += 2;
|
||||
return '/(?:';
|
||||
}
|
||||
|
||||
slash = slash || '';
|
||||
format = format || '';
|
||||
capture = capture || '([^\\/' + format + ']+?)';
|
||||
format = format ? '\\.' : '';
|
||||
optional = optional || '';
|
||||
capture = capture ?
|
||||
capture.replace(/\\.|\*/, function (m) { return m === '*' ? '(.*)' : m; }) :
|
||||
(backtrack ? '((?:(?!/|' + backtrack + ').)+?)' : '([^/' + format + ']+?)');
|
||||
|
||||
keys.push({
|
||||
name: key,
|
||||
@@ -75,41 +117,20 @@ function pathtoRegexp(path, keys, options) {
|
||||
offset: offset + extraOffset
|
||||
});
|
||||
|
||||
var result = ''
|
||||
+ (optional ? '' : slash)
|
||||
+ '(?:'
|
||||
+ format + (optional ? slash : '') + capture
|
||||
+ (star ? '((?:[\\/' + format + '].+?)?)' : '')
|
||||
var result = '(?:'
|
||||
+ format + slash + capture
|
||||
+ (star ? '((?:[/' + format + '].+?)?)' : '')
|
||||
+ ')'
|
||||
+ optional;
|
||||
|
||||
extraOffset += result.length - match.length;
|
||||
|
||||
return result;
|
||||
})
|
||||
.replace(/\*/g, function (star, index) {
|
||||
var len = keys.length
|
||||
|
||||
while (len-- > keysOffset && keys[len].offset > index) {
|
||||
keys[len].offset += 3; // Replacement length minus asterisk length.
|
||||
}
|
||||
|
||||
return '(.*)';
|
||||
});
|
||||
|
||||
// This is a workaround for handling unnamed matching groups.
|
||||
while (m = MATCHING_GROUP_REGEXP.exec(path)) {
|
||||
var escapeCount = 0;
|
||||
var index = m.index;
|
||||
|
||||
while (path.charAt(--index) === '\\') {
|
||||
escapeCount++;
|
||||
}
|
||||
|
||||
// It's possible to escape the bracket.
|
||||
if (escapeCount % 2 === 1) {
|
||||
continue;
|
||||
}
|
||||
if (m[0][0] === '\\') continue;
|
||||
|
||||
if (keysOffset + i === keys.length || keys[keysOffset + i].offset > m.index) {
|
||||
keys.splice(keysOffset + i, 0, {
|
||||
@@ -122,8 +143,14 @@ function pathtoRegexp(path, keys, options) {
|
||||
i++;
|
||||
}
|
||||
|
||||
// If the path is non-ending, match until the end or a slash.
|
||||
path += (end ? '$' : (path[path.length - 1] === '/' ? '' : '(?=\\/|$)'));
|
||||
path += strict ? '' : path[path.length - 1] === '/' ? '?' : '/?';
|
||||
|
||||
return new RegExp(path, flags);
|
||||
// If the path is non-ending, match until the end or a slash.
|
||||
if (end) {
|
||||
path += '$';
|
||||
} else if (path[path.length - 1] !== '/') {
|
||||
path += lookahead ? '(?=/|$)' : '(?:/|$)';
|
||||
}
|
||||
|
||||
return new RegExp('^' + path, flags);
|
||||
};
|
||||
|
||||
4
node_modules/path-to-regexp/package.json
generated
vendored
4
node_modules/path-to-regexp/package.json
generated
vendored
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "path-to-regexp",
|
||||
"description": "Express style path to RegExp utility",
|
||||
"version": "0.1.7",
|
||||
"version": "0.1.12",
|
||||
"files": [
|
||||
"index.js",
|
||||
"LICENSE"
|
||||
@@ -21,7 +21,7 @@
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/component/path-to-regexp.git"
|
||||
"url": "https://github.com/pillarjs/path-to-regexp.git"
|
||||
},
|
||||
"devDependencies": {
|
||||
"mocha": "^1.17.1",
|
||||
|
||||
Reference in New Issue
Block a user