Sha256: 877adbdc76d2706bf0cc8efb03953d3c200dcf9665a9c725172b914012bb2206

Contents?: true

Size: 1.35 KB

Versions: 154

Compression:

Stored size: 1.35 KB

Contents

{"version":3,"file":"escape.js","sourceRoot":"","sources":["../../src/escape.ts"],"names":[],"mappings":";;;AACA;;;;;;;;GAQG;AACI,MAAM,MAAM,GAAG,CACpB,CAAS,EACT,EACE,oBAAoB,GAAG,KAAK,MACsB,EAAE,EACtD,EAAE;IACF,wDAAwD;IACxD,4DAA4D;IAC5D,sDAAsD;IACtD,OAAO,oBAAoB;QACzB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC;QACjC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA;AACvC,CAAC,CAAA;AAZY,QAAA,MAAM,UAYlB","sourcesContent":["import { MinimatchOptions } from './index.js'\n/**\n * Escape all magic characters in a glob pattern.\n *\n * If the {@link windowsPathsNoEscape | GlobOptions.windowsPathsNoEscape}\n * option is used, then characters are escaped by wrapping in `[]`, because\n * a magic character wrapped in a character class can only be satisfied by\n * that exact character.  In this mode, `\\` is _not_ escaped, because it is\n * not interpreted as a magic character, but instead as a path separator.\n */\nexport const escape = (\n  s: string,\n  {\n    windowsPathsNoEscape = false,\n  }: Pick<MinimatchOptions, 'windowsPathsNoEscape'> = {}\n) => {\n  // don't need to escape +@! because we escape the parens\n  // that make those magic, and escaping ! as [!] isn't valid,\n  // because [!]] is a valid glob class meaning not ']'.\n  return windowsPathsNoEscape\n    ? s.replace(/[?*()[\\]]/g, '[$&]')\n    : s.replace(/[?*()[\\]\\\\]/g, '\\\\$&')\n}\n"]}

Version data entries

154 entries across 41 versions & 2 rubygems

Version Path
immosquare-cleaner-0.1.52 node_modules/eslint-plugin-sonarjs/node_modules/minimatch/dist/commonjs/escape.js.map
immosquare-cleaner-0.1.52 node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/escape.js.map
immosquare-cleaner-0.1.52 node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/escape.js.map
immosquare-cleaner-0.1.52 node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/escape.js.map
immosquare-cleaner-0.1.52 node_modules/@tufjs/models/node_modules/minimatch/dist/cjs/escape.js.map
immosquare-cleaner-0.1.51 node_modules/@tufjs/models/node_modules/minimatch/dist/cjs/escape.js.map
immosquare-cleaner-0.1.51 node_modules/ignore-walk/node_modules/minimatch/dist/cjs/escape.js.map
immosquare-cleaner-0.1.51 node_modules/eslint-plugin-sonarjs/node_modules/minimatch/dist/commonjs/escape.js.map
immosquare-cleaner-0.1.51 node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/escape.js.map
immosquare-cleaner-0.1.51 node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/escape.js.map
immosquare-cleaner-0.1.51 node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/escape.js.map
immosquare-cleaner-0.1.51 node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/escape.js.map
immosquare-cleaner-0.1.50 node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/escape.js.map
immosquare-cleaner-0.1.50 node_modules/@tufjs/models/node_modules/minimatch/dist/cjs/escape.js.map
immosquare-cleaner-0.1.50 node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/escape.js.map
immosquare-cleaner-0.1.50 node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/escape.js.map
immosquare-cleaner-0.1.50 node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/escape.js.map
immosquare-cleaner-0.1.50 node_modules/eslint-plugin-sonarjs/node_modules/minimatch/dist/commonjs/escape.js.map
immosquare-cleaner-0.1.50 node_modules/ignore-walk/node_modules/minimatch/dist/cjs/escape.js.map
immosquare-cleaner-0.1.49 node_modules/@tufjs/models/node_modules/minimatch/dist/cjs/escape.js.map