Sha256: 1e4a9acafa68903d5331e17635339ca59c52b71152e82e195438adc46ef7381a

Contents?: true

Size: 1.03 KB

Versions: 21

Compression:

Stored size: 1.03 KB

Contents

"use strict";
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

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
immosquare-cleaner-0.1.42 node_modules/glob/dist/commonjs/has-magic.js
immosquare-cleaner-0.1.41 node_modules/glob/dist/commonjs/has-magic.js
immosquare-cleaner-0.1.40 node_modules/glob/dist/commonjs/has-magic.js
immosquare-cleaner-0.1.39 node_modules/glob/dist/commonjs/has-magic.js
immosquare-cleaner-0.1.38 node_modules/glob/dist/commonjs/has-magic.js
decidim-0.26.10 packages/webpacker/node_modules/glob/dist/cjs/src/has-magic.js
immosquare-cleaner-0.1.32 node_modules/glob/dist/commonjs/has-magic.js
immosquare-cleaner-0.1.31 node_modules/glob/dist/commonjs/has-magic.js
immosquare-cleaner-0.1.30 node_modules/glob/dist/commonjs/has-magic.js
immosquare-cleaner-0.1.29 node_modules/glob/dist/commonjs/has-magic.js
immosquare-cleaner-0.1.28 node_modules/glob/dist/commonjs/has-magic.js
immosquare-cleaner-0.1.27 node_modules/glob/dist/commonjs/has-magic.js
immosquare-cleaner-0.1.26 node_modules/glob/dist/commonjs/has-magic.js
immosquare-cleaner-0.1.25 node_modules/glob/dist/commonjs/has-magic.js
immosquare-cleaner-0.1.24 node_modules/glob/dist/commonjs/has-magic.js
immosquare-cleaner-0.1.23 node_modules/glob/dist/commonjs/has-magic.js
decidim-0.26.9 packages/webpacker/node_modules/glob/dist/cjs/src/has-magic.js
decidim-0.28.0.rc5 packages/webpacker/node_modules/glob/dist/cjs/src/has-magic.js
decidim-0.28.0.rc4 packages/webpacker/node_modules/glob/dist/cjs/src/has-magic.js
decidim-0.26.8 packages/webpacker/node_modules/glob/dist/cjs/src/has-magic.js