Sha256: 4c52110a7053ca74d659226519e2d977d10ccbba0305d514d2aeffa78e1583f5

Contents?: true

Size: 847 Bytes

Versions: 154

Compression:

Stored size: 847 Bytes

Contents

/**
 * 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.
 */
export const unescape = (s, { windowsPathsNoEscape = false, } = {}) => {
    return windowsPathsNoEscape
        ? s.replace(/\[([^\/\\])\]/g, '$1')
        : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, '$1$2').replace(/\\([^\/])/g, '$1');
};
//# sourceMappingURL=unescape.js.map

Version data entries

154 entries across 41 versions & 2 rubygems

Version Path
immosquare-cleaner-0.1.49 node_modules/ignore-walk/node_modules/minimatch/dist/mjs/unescape.js
immosquare-cleaner-0.1.49 node_modules/eslint-plugin-sonarjs/node_modules/minimatch/dist/esm/unescape.js
immosquare-cleaner-0.1.49 node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/unescape.js
immosquare-cleaner-0.1.49 node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/unescape.js
immosquare-cleaner-0.1.49 node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/unescape.js
immosquare-cleaner-0.1.48 node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/unescape.js
immosquare-cleaner-0.1.48 node_modules/ignore-walk/node_modules/minimatch/dist/mjs/unescape.js
immosquare-cleaner-0.1.48 node_modules/eslint-plugin-sonarjs/node_modules/minimatch/dist/esm/unescape.js
immosquare-cleaner-0.1.48 node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/unescape.js
immosquare-cleaner-0.1.48 node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/unescape.js
immosquare-cleaner-0.1.48 node_modules/@tufjs/models/node_modules/minimatch/dist/mjs/unescape.js
immosquare-cleaner-0.1.47 node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/unescape.js
immosquare-cleaner-0.1.47 node_modules/ignore-walk/node_modules/minimatch/dist/mjs/unescape.js
immosquare-cleaner-0.1.47 node_modules/eslint-plugin-sonarjs/node_modules/minimatch/dist/esm/unescape.js
immosquare-cleaner-0.1.47 node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/unescape.js
immosquare-cleaner-0.1.47 node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/unescape.js
immosquare-cleaner-0.1.47 node_modules/@tufjs/models/node_modules/minimatch/dist/mjs/unescape.js
immosquare-cleaner-0.1.46 node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/unescape.js
immosquare-cleaner-0.1.46 node_modules/ignore-walk/node_modules/minimatch/dist/mjs/unescape.js
immosquare-cleaner-0.1.46 node_modules/eslint-plugin-sonarjs/node_modules/minimatch/dist/esm/unescape.js