NUEVA BUSQUEDA DE DATOS SRI
This commit is contained in:
BIN
node_modules/picomatch/lib/.DS_Store
generated
vendored
BIN
node_modules/picomatch/lib/.DS_Store
generated
vendored
Binary file not shown.
31
node_modules/picomatch/lib/parse.js
generated
vendored
31
node_modules/picomatch/lib/parse.js
generated
vendored
@@ -92,7 +92,7 @@ const parse = (input, options) => {
|
||||
START_ANCHOR
|
||||
} = PLATFORM_CHARS;
|
||||
|
||||
const globstar = (opts) => {
|
||||
const globstar = opts => {
|
||||
return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
||||
};
|
||||
|
||||
@@ -142,12 +142,13 @@ const parse = (input, options) => {
|
||||
|
||||
const eos = () => state.index === len - 1;
|
||||
const peek = state.peek = (n = 1) => input[state.index + n];
|
||||
const advance = state.advance = () => input[++state.index];
|
||||
const advance = state.advance = () => input[++state.index] || '';
|
||||
const remaining = () => input.slice(state.index + 1);
|
||||
const consume = (value = '', num = 0) => {
|
||||
state.consumed += value;
|
||||
state.index += num;
|
||||
};
|
||||
|
||||
const append = token => {
|
||||
state.output += token.output != null ? token.output : token.value;
|
||||
consume(token.value);
|
||||
@@ -203,7 +204,7 @@ const parse = (input, options) => {
|
||||
}
|
||||
}
|
||||
|
||||
if (extglobs.length && tok.type !== 'paren' && !EXTGLOB_CHARS[tok.value]) {
|
||||
if (extglobs.length && tok.type !== 'paren') {
|
||||
extglobs[extglobs.length - 1].inner += tok.value;
|
||||
}
|
||||
|
||||
@@ -228,8 +229,6 @@ const parse = (input, options) => {
|
||||
const output = (opts.capture ? '(' : '') + token.open;
|
||||
|
||||
increment('parens');
|
||||
|
||||
|
||||
push({ type, value, output: state.output ? '' : ONE_CHAR });
|
||||
push({ type: 'paren', extglob: true, value: advance(), output });
|
||||
extglobs.push(token);
|
||||
@@ -237,6 +236,7 @@ const parse = (input, options) => {
|
||||
|
||||
const extglobClose = token => {
|
||||
let output = token.close + (opts.capture ? ')' : '');
|
||||
let rest;
|
||||
|
||||
if (token.type === 'negate') {
|
||||
let extglobStar = star;
|
||||
@@ -249,7 +249,18 @@ const parse = (input, options) => {
|
||||
output = token.close = `)$))${extglobStar}`;
|
||||
}
|
||||
|
||||
if (token.prev.type === 'bos' && eos()) {
|
||||
if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
|
||||
// Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis.
|
||||
// In this case, we need to parse the string and use it in the output of the original pattern.
|
||||
// Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`.
|
||||
//
|
||||
// Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`.
|
||||
const expression = parse(rest, { ...options, fastpaths: false }).output;
|
||||
|
||||
output = token.close = `)${expression})${extglobStar})`;
|
||||
}
|
||||
|
||||
if (token.prev.type === 'bos') {
|
||||
state.negatedExtglob = true;
|
||||
}
|
||||
}
|
||||
@@ -358,9 +369,9 @@ const parse = (input, options) => {
|
||||
}
|
||||
|
||||
if (opts.unescape === true) {
|
||||
value = advance() || '';
|
||||
value = advance();
|
||||
} else {
|
||||
value += advance() || '';
|
||||
value += advance();
|
||||
}
|
||||
|
||||
if (state.brackets === 0) {
|
||||
@@ -585,7 +596,7 @@ const parse = (input, options) => {
|
||||
const out = state.output.slice(0, brace.outputIndex);
|
||||
const toks = state.tokens.slice(brace.tokensIndex);
|
||||
brace.value = brace.output = '\\{';
|
||||
value = output = `\\}`;
|
||||
value = output = '\\}';
|
||||
state.output = out;
|
||||
for (const t of toks) {
|
||||
state.output += (t.output || t.value);
|
||||
@@ -1024,7 +1035,7 @@ parse.fastpaths = (input, options) => {
|
||||
star = `(${star})`;
|
||||
}
|
||||
|
||||
const globstar = (opts) => {
|
||||
const globstar = opts => {
|
||||
if (opts.noglobstar === true) return star;
|
||||
return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
||||
};
|
||||
|
||||
64
node_modules/picomatch/lib/picomatch.js
generated
vendored
64
node_modules/picomatch/lib/picomatch.js
generated
vendored
@@ -231,67 +231,71 @@ picomatch.parse = (pattern, options) => {
|
||||
picomatch.scan = (input, options) => scan(input, options);
|
||||
|
||||
/**
|
||||
* Create a regular expression from a glob pattern.
|
||||
* Compile a regular expression from the `state` object returned by the
|
||||
* [parse()](#parse) method.
|
||||
*
|
||||
* ```js
|
||||
* const picomatch = require('picomatch');
|
||||
* // picomatch.makeRe(input[, options]);
|
||||
*
|
||||
* console.log(picomatch.makeRe('*.js'));
|
||||
* //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
|
||||
* ```
|
||||
* @param {String} `input` A glob pattern to convert to regex.
|
||||
* @param {Object} `state`
|
||||
* @param {Object} `options`
|
||||
* @return {RegExp} Returns a regex created from the given pattern.
|
||||
* @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser.
|
||||
* @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.
|
||||
* @return {RegExp}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
picomatch.compileRe = (parsed, options, returnOutput = false, returnState = false) => {
|
||||
picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
|
||||
if (returnOutput === true) {
|
||||
return parsed.output;
|
||||
return state.output;
|
||||
}
|
||||
|
||||
const opts = options || {};
|
||||
const prepend = opts.contains ? '' : '^';
|
||||
const append = opts.contains ? '' : '$';
|
||||
|
||||
let source = `${prepend}(?:${parsed.output})${append}`;
|
||||
if (parsed && parsed.negated === true) {
|
||||
let source = `${prepend}(?:${state.output})${append}`;
|
||||
if (state && state.negated === true) {
|
||||
source = `^(?!${source}).*$`;
|
||||
}
|
||||
|
||||
const regex = picomatch.toRegex(source, options);
|
||||
if (returnState === true) {
|
||||
regex.state = parsed;
|
||||
regex.state = state;
|
||||
}
|
||||
|
||||
return regex;
|
||||
};
|
||||
|
||||
picomatch.makeRe = (input, options, returnOutput = false, returnState = false) => {
|
||||
/**
|
||||
* Create a regular expression from a parsed glob pattern.
|
||||
*
|
||||
* ```js
|
||||
* const picomatch = require('picomatch');
|
||||
* const state = picomatch.parse('*.js');
|
||||
* // picomatch.compileRe(state[, options]);
|
||||
*
|
||||
* console.log(picomatch.compileRe(state));
|
||||
* //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
|
||||
* ```
|
||||
* @param {String} `state` The object returned from the `.parse` method.
|
||||
* @param {Object} `options`
|
||||
* @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result.
|
||||
* @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression.
|
||||
* @return {RegExp} Returns a regex created from the given pattern.
|
||||
* @api public
|
||||
*/
|
||||
|
||||
picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
|
||||
if (!input || typeof input !== 'string') {
|
||||
throw new TypeError('Expected a non-empty string');
|
||||
}
|
||||
|
||||
const opts = options || {};
|
||||
let parsed = { negated: false, fastpaths: true };
|
||||
let prefix = '';
|
||||
let output;
|
||||
|
||||
if (input.startsWith('./')) {
|
||||
input = input.slice(2);
|
||||
prefix = parsed.prefix = './';
|
||||
if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) {
|
||||
parsed.output = parse.fastpaths(input, options);
|
||||
}
|
||||
|
||||
if (opts.fastpaths !== false && (input[0] === '.' || input[0] === '*')) {
|
||||
output = parse.fastpaths(input, options);
|
||||
}
|
||||
|
||||
if (output === undefined) {
|
||||
if (!parsed.output) {
|
||||
parsed = parse(input, options);
|
||||
parsed.prefix = prefix + (parsed.prefix || '');
|
||||
} else {
|
||||
parsed.output = output;
|
||||
}
|
||||
|
||||
return picomatch.compileRe(parsed, options, returnOutput, returnState);
|
||||
|
||||
45
node_modules/picomatch/lib/scan.js
generated
vendored
45
node_modules/picomatch/lib/scan.js
generated
vendored
@@ -32,7 +32,8 @@ const depth = token => {
|
||||
/**
|
||||
* Quickly scans a glob pattern and returns an object with a handful of
|
||||
* useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),
|
||||
* `glob` (the actual pattern), and `negated` (true if the path starts with `!`).
|
||||
* `glob` (the actual pattern), `negated` (true if the path starts with `!` but not
|
||||
* with `!(`) and `negatedExtglob` (true if the path starts with `!(`).
|
||||
*
|
||||
* ```js
|
||||
* const pm = require('picomatch');
|
||||
@@ -66,6 +67,7 @@ const scan = (input, options) => {
|
||||
let braceEscaped = false;
|
||||
let backslashes = false;
|
||||
let negated = false;
|
||||
let negatedExtglob = false;
|
||||
let finished = false;
|
||||
let braces = 0;
|
||||
let prev;
|
||||
@@ -177,6 +179,9 @@ const scan = (input, options) => {
|
||||
isGlob = token.isGlob = true;
|
||||
isExtglob = token.isExtglob = true;
|
||||
finished = true;
|
||||
if (code === CHAR_EXCLAMATION_MARK && index === start) {
|
||||
negatedExtglob = true;
|
||||
}
|
||||
|
||||
if (scanToEnd === true) {
|
||||
while (eos() !== true && (code = advance())) {
|
||||
@@ -231,13 +236,15 @@ const scan = (input, options) => {
|
||||
isBracket = token.isBracket = true;
|
||||
isGlob = token.isGlob = true;
|
||||
finished = true;
|
||||
|
||||
if (scanToEnd === true) {
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (scanToEnd === true) {
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
|
||||
@@ -247,23 +254,24 @@ const scan = (input, options) => {
|
||||
}
|
||||
|
||||
if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
|
||||
while (eos() !== true && (code = advance())) {
|
||||
if (code === CHAR_BACKWARD_SLASH) {
|
||||
backslashes = token.backslashes = true;
|
||||
code = advance();
|
||||
continue;
|
||||
}
|
||||
isGlob = token.isGlob = true;
|
||||
|
||||
if (code === CHAR_RIGHT_PARENTHESES) {
|
||||
isGlob = token.isGlob = true;
|
||||
finished = true;
|
||||
|
||||
if (scanToEnd === true) {
|
||||
if (scanToEnd === true) {
|
||||
while (eos() !== true && (code = advance())) {
|
||||
if (code === CHAR_LEFT_PARENTHESES) {
|
||||
backslashes = token.backslashes = true;
|
||||
code = advance();
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
|
||||
if (code === CHAR_RIGHT_PARENTHESES) {
|
||||
finished = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (isGlob === true) {
|
||||
@@ -327,7 +335,8 @@ const scan = (input, options) => {
|
||||
isGlob,
|
||||
isExtglob,
|
||||
isGlobstar,
|
||||
negated
|
||||
negated,
|
||||
negatedExtglob
|
||||
};
|
||||
|
||||
if (opts.tokens === true) {
|
||||
|
||||
Reference in New Issue
Block a user