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.62 node_modules/eslint-plugin-sonarjs/node_modules/minimatch/dist/commonjs/unescape.js
immosquare-cleaner-0.1.61 node_modules/eslint-plugin-sonarjs/node_modules/minimatch/dist/commonjs/unescape.js
immosquare-cleaner-0.1.60 node_modules/@tufjs/models/node_modules/minimatch/dist/cjs/unescape.js
immosquare-cleaner-0.1.60 node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/unescape.js
immosquare-cleaner-0.1.60 node_modules/ignore-walk/node_modules/minimatch/dist/cjs/unescape.js
immosquare-cleaner-0.1.60 node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/unescape.js
immosquare-cleaner-0.1.60 node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/unescape.js
immosquare-cleaner-0.1.60 node_modules/eslint-plugin-sonarjs/node_modules/minimatch/dist/commonjs/unescape.js
immosquare-cleaner-0.1.60 node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/unescape.js
immosquare-cleaner-0.1.59 node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/unescape.js
immosquare-cleaner-0.1.59 node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/unescape.js
immosquare-cleaner-0.1.59 node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/unescape.js
immosquare-cleaner-0.1.59 node_modules/@tufjs/models/node_modules/minimatch/dist/cjs/unescape.js
immosquare-cleaner-0.1.59 node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/unescape.js
immosquare-cleaner-0.1.59 node_modules/eslint-plugin-sonarjs/node_modules/minimatch/dist/commonjs/unescape.js
immosquare-cleaner-0.1.59 node_modules/ignore-walk/node_modules/minimatch/dist/cjs/unescape.js
immosquare-cleaner-0.1.58 node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/unescape.js
immosquare-cleaner-0.1.58 node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/unescape.js
immosquare-cleaner-0.1.58 node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/unescape.js
immosquare-cleaner-0.1.58 node_modules/eslint-plugin-sonarjs/node_modules/minimatch/dist/commonjs/unescape.js