feat: refactoring project
This commit is contained in:
11
node_modules/micromatch/index.js
generated
vendored
11
node_modules/micromatch/index.js
generated
vendored
@ -4,7 +4,12 @@ const util = require('util');
|
||||
const braces = require('braces');
|
||||
const picomatch = require('picomatch');
|
||||
const utils = require('picomatch/lib/utils');
|
||||
const isEmptyString = val => val === '' || val === './';
|
||||
|
||||
const isEmptyString = v => v === '' || v === './';
|
||||
const hasBraces = v => {
|
||||
const index = v.indexOf('{');
|
||||
return index > -1 && v.indexOf('}', index) > -1;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns an array of strings that match one or more glob patterns.
|
||||
@ -445,7 +450,7 @@ micromatch.parse = (patterns, options) => {
|
||||
|
||||
micromatch.braces = (pattern, options) => {
|
||||
if (typeof pattern !== 'string') throw new TypeError('Expected a string');
|
||||
if ((options && options.nobrace === true) || !/\{.*\}/.test(pattern)) {
|
||||
if ((options && options.nobrace === true) || !hasBraces(pattern)) {
|
||||
return [pattern];
|
||||
}
|
||||
return braces(pattern, options);
|
||||
@ -464,4 +469,6 @@ micromatch.braceExpand = (pattern, options) => {
|
||||
* Expose micromatch
|
||||
*/
|
||||
|
||||
// exposed for tests
|
||||
micromatch.hasBraces = hasBraces;
|
||||
module.exports = micromatch;
|
||||
|
Reference in New Issue
Block a user