Sha256: ff3e0dd4664576cfe078c3b494724d7cf2f691cdf960304e354e7c34fa6b5a30

Contents?: true

Size: 973 Bytes

Versions: 154

Compression:

Stored size: 973 Bytes

Contents

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.unescape = void 0;
/**
 * Un-escape a string that has been escaped with {@link escape}.
 *
 * If the {@link windowsPathsNoEscape} option is used, then square-brace
 * escapes are removed, but not backslash escapes.  For example, it will turn
 * the string `'[*]'` into `*`, but it will not turn `'\\*'` into `'*'`,
 * becuase `\` is a path separator in `windowsPathsNoEscape` mode.
 *
 * When `windowsPathsNoEscape` is not set, then both brace escapes and
 * backslash escapes are removed.
 *
 * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
 * or unescaped.
 */
const unescape = (s, { windowsPathsNoEscape = false, } = {}) => {
    return windowsPathsNoEscape
        ? s.replace(/\[([^\/\\])\]/g, '$1')
        : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, '$1$2').replace(/\\([^\/])/g, '$1');
};
exports.unescape = unescape;
//# sourceMappingURL=unescape.js.map

Version data entries

154 entries across 41 versions & 2 rubygems

Version Path
immosquare-cleaner-0.1.31 node_modules/minimatch/dist/cjs/unescape.js
immosquare-cleaner-0.1.30 node_modules/minimatch/dist/cjs/unescape.js
immosquare-cleaner-0.1.29 node_modules/minimatch/dist/cjs/unescape.js
immosquare-cleaner-0.1.28 node_modules/minimatch/dist/cjs/unescape.js
immosquare-cleaner-0.1.27 node_modules/minimatch/dist/cjs/unescape.js
immosquare-cleaner-0.1.26 node_modules/minimatch/dist/cjs/unescape.js
immosquare-cleaner-0.1.25 node_modules/minimatch/dist/cjs/unescape.js
immosquare-cleaner-0.1.24 node_modules/minimatch/dist/cjs/unescape.js
immosquare-cleaner-0.1.23 node_modules/minimatch/dist/cjs/unescape.js
decidim-0.26.9 packages/webpacker/node_modules/minimatch/dist/cjs/unescape.js
decidim-0.28.0.rc5 packages/webpacker/node_modules/minimatch/dist/cjs/unescape.js
decidim-0.28.0.rc4 packages/webpacker/node_modules/minimatch/dist/cjs/unescape.js
decidim-0.26.8 packages/webpacker/node_modules/minimatch/dist/cjs/unescape.js
decidim-0.27.4 packages/webpacker/node_modules/minimatch/dist/cjs/unescape.js