Sha256: 875f1dc7229d850e9adac1786cf1f0fea3a718f4e91242049be0e409c19a8e02

Contents?: true

Size: 917 Bytes

Versions: 31

Compression:

Stored size: 917 Bytes

Contents

import { Minimatch } from '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.
 */
export const hasMagic = (pattern, options = {}) => {
    if (!Array.isArray(pattern)) {
        pattern = [pattern];
    }
    for (const p of pattern) {
        if (new Minimatch(p, options).hasMagic())
            return true;
    }
    return false;
};
//# sourceMappingURL=has-magic.js.map

Version data entries

31 entries across 23 versions & 3 rubygems

Version Path
rapid_stack-0.1.1 templates/FrontEnd/node_modules/@capacitor/cli/node_modules/glob/dist/mjs/has-magic.js
rapid_stack-0.1.1 templates/FrontEnd/node_modules/node-gyp/node_modules/glob/dist/esm/has-magic.js
rapid_stack-0.1.1 templates/FrontEnd/node_modules/minizlib/node_modules/glob/dist/esm/has-magic.js
rapid_stack-0.1.1 templates/FrontEnd/node_modules/cacache/node_modules/glob/dist/esm/has-magic.js
rapid_stack-0.1.1 templates/FrontEnd/node_modules/@npmcli/package-json/node_modules/glob/dist/esm/has-magic.js
rapid_stack-0.1.0 templates/FrontEnd/node_modules/@capacitor/cli/node_modules/glob/dist/mjs/has-magic.js
rapid_stack-0.1.0 templates/FrontEnd/node_modules/node-gyp/node_modules/glob/dist/esm/has-magic.js
rapid_stack-0.1.0 templates/FrontEnd/node_modules/minizlib/node_modules/glob/dist/esm/has-magic.js
rapid_stack-0.1.0 templates/FrontEnd/node_modules/cacache/node_modules/glob/dist/esm/has-magic.js
rapid_stack-0.1.0 templates/FrontEnd/node_modules/@npmcli/package-json/node_modules/glob/dist/esm/has-magic.js
immosquare-cleaner-0.1.42 node_modules/glob/dist/esm/has-magic.js
immosquare-cleaner-0.1.41 node_modules/glob/dist/esm/has-magic.js
immosquare-cleaner-0.1.40 node_modules/glob/dist/esm/has-magic.js
immosquare-cleaner-0.1.39 node_modules/glob/dist/esm/has-magic.js
immosquare-cleaner-0.1.38 node_modules/glob/dist/esm/has-magic.js
decidim-0.26.10 packages/webpacker/node_modules/glob/dist/mjs/has-magic.js
immosquare-cleaner-0.1.32 node_modules/glob/dist/esm/has-magic.js
immosquare-cleaner-0.1.31 node_modules/glob/dist/esm/has-magic.js
immosquare-cleaner-0.1.30 node_modules/glob/dist/esm/has-magic.js
immosquare-cleaner-0.1.29 node_modules/glob/dist/esm/has-magic.js