Buckets:
| ; | |
| Object.defineProperty(exports, "__esModule", { value: true }); | |
| exports.hasMagic = void 0; | |
| const minimatch_1 = require("minimatch"); | |
| /** | |
| * Return true if the patterns provided contain any magic glob characters, | |
| * given the options provided. | |
| * | |
| * Brace expansion is not considered "magic" unless the `magicalBraces` option | |
| * is set, as brace expansion just turns one string into an array of strings. | |
| * So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and | |
| * `'xby'` both do not contain any magic glob characters, and it's treated the | |
| * same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true` | |
| * is in the options, brace expansion _is_ treated as a pattern having magic. | |
| */ | |
| const hasMagic = (pattern, options = {}) => { | |
| if (!Array.isArray(pattern)) { | |
| pattern = [pattern]; | |
| } | |
| for (const p of pattern) { | |
| if (new minimatch_1.Minimatch(p, options).hasMagic()) | |
| return true; | |
| } | |
| return false; | |
| }; | |
| exports.hasMagic = hasMagic; | |
| //# sourceMappingURL=has-magic.js.map |
Xet Storage Details
- Size:
- 1.06 kB
- Xet hash:
- cbb2d8747aa23f51d2b57857eaf286db4f95ca49f6c59a8625c758de0e37eac1
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.