@quilted/create 0.2.42 → 0.2.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/build/esm/_virtual/index.mjs +6 -2
- package/build/esm/_virtual/index10.mjs +3 -0
- package/build/esm/_virtual/index11.mjs +3 -0
- package/build/esm/_virtual/index12.mjs +3 -0
- package/build/esm/_virtual/index13.mjs +3 -0
- package/build/esm/_virtual/index2.mjs +2 -2
- package/build/esm/_virtual/index3.mjs +6 -2
- package/build/esm/_virtual/index4.mjs +6 -2
- package/build/esm/_virtual/index5.mjs +6 -2
- package/build/esm/_virtual/index6.mjs +6 -2
- package/build/esm/_virtual/index8.mjs +3 -0
- package/build/esm/_virtual/index9.mjs +3 -0
- package/build/esm/_virtual/minimatch.mjs +12 -0
- package/build/esm/app.mjs +2 -2
- package/build/esm/cli.mjs +1 -1
- package/build/esm/module.mjs +2 -2
- package/build/esm/node_modules/.pnpm/@nodelib_fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/adapters/fs.mjs +29 -21
- package/build/esm/node_modules/.pnpm/@nodelib_fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/constants.mjs +24 -18
- package/build/esm/node_modules/.pnpm/@nodelib_fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/index.mjs +35 -32
- package/build/esm/node_modules/.pnpm/@nodelib_fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/async.mjs +103 -101
- package/build/esm/node_modules/.pnpm/@nodelib_fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/common.mjs +19 -13
- package/build/esm/node_modules/.pnpm/@nodelib_fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/sync.mjs +63 -61
- package/build/esm/node_modules/.pnpm/@nodelib_fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/settings.mjs +33 -27
- package/build/esm/node_modules/.pnpm/@nodelib_fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/utils/fs.mjs +25 -19
- package/build/esm/node_modules/.pnpm/@nodelib_fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/utils/index.mjs +15 -10
- package/build/esm/node_modules/.pnpm/@nodelib_fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/adapters/fs.mjs +27 -19
- package/build/esm/node_modules/.pnpm/@nodelib_fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/index.mjs +35 -32
- package/build/esm/node_modules/.pnpm/@nodelib_fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/async.mjs +39 -33
- package/build/esm/node_modules/.pnpm/@nodelib_fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/sync.mjs +26 -20
- package/build/esm/node_modules/.pnpm/@nodelib_fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/settings.mjs +24 -17
- package/build/esm/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/index.mjs +44 -42
- package/build/esm/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/async.mjs +37 -30
- package/build/esm/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/stream.mjs +41 -34
- package/build/esm/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/sync.mjs +22 -15
- package/build/esm/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/async.mjs +103 -98
- package/build/esm/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/common.mjs +35 -29
- package/build/esm/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/reader.mjs +19 -12
- package/build/esm/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/sync.mjs +64 -59
- package/build/esm/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/settings.mjs +34 -27
- package/build/esm/node_modules/.pnpm/arg@5.0.2/node_modules/arg/index.mjs +116 -112
- package/build/esm/node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.mjs +54 -47
- package/build/esm/node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.mjs +144 -137
- package/build/esm/node_modules/.pnpm/braces@3.0.2/node_modules/braces/index.mjs +173 -166
- package/build/esm/node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/compile.mjs +57 -51
- package/build/esm/node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/constants.mjs +102 -94
- package/build/esm/node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/expand.mjs +89 -83
- package/build/esm/node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/parse.mjs +312 -305
- package/build/esm/node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/stringify.mjs +30 -24
- package/build/esm/node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/utils.mjs +116 -108
- package/build/esm/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/splitStringTransformer/splitStringTransformer.mjs +1 -3
- package/build/esm/node_modules/.pnpm/dir-glob@3.0.1/node_modules/dir-glob/index.mjs +63 -61
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/index.mjs +75 -77
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/managers/patterns.mjs +28 -22
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/managers/tasks.mjs +83 -78
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/async.mjs +31 -25
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/filters/deep.mjs +66 -60
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/filters/entry.mjs +66 -59
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/filters/error.mjs +23 -16
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/matchers/matcher.mjs +55 -48
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/matchers/partial.mjs +40 -33
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/provider.mjs +59 -55
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/stream.mjs +38 -32
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/sync.mjs +31 -25
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/transformers/entry.mjs +33 -26
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/readers/async.mjs +43 -38
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/readers/reader.mjs +41 -35
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/readers/stream.mjs +60 -55
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/readers/sync.mjs +48 -43
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/settings.mjs +65 -57
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/utils/array.mjs +26 -20
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/utils/errno.mjs +14 -8
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/utils/fs.mjs +25 -19
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/utils/index.mjs +33 -34
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/utils/path.mjs +39 -33
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/utils/pattern.mjs +170 -164
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/utils/stream.mjs +24 -18
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/utils/string.mjs +18 -12
- package/build/esm/node_modules/.pnpm/fastq@1.13.0/node_modules/fastq/queue.mjs +227 -221
- package/build/esm/node_modules/.pnpm/fill-range@7.0.1/node_modules/fill-range/index.mjs +207 -200
- package/build/esm/node_modules/.pnpm/find-up@6.3.0/node_modules/find-up/index.mjs +1 -6
- package/build/esm/node_modules/.pnpm/glob-parent@5.1.2/node_modules/glob-parent/index.mjs +51 -44
- package/build/esm/node_modules/.pnpm/globby@13.1.1/node_modules/globby/ignore.mjs +2 -2
- package/build/esm/node_modules/.pnpm/globby@13.1.1/node_modules/globby/index.mjs +3 -3
- package/build/esm/node_modules/.pnpm/ignore@5.2.4/node_modules/ignore/index.mjs +443 -439
- package/build/esm/node_modules/.pnpm/is-extglob@2.1.1/node_modules/is-extglob/index.mjs +18 -11
- package/build/esm/node_modules/.pnpm/is-glob@4.0.3/node_modules/is-glob/index.mjs +116 -109
- package/build/esm/node_modules/.pnpm/is-number@7.0.0/node_modules/is-number/index.mjs +17 -10
- package/build/esm/node_modules/.pnpm/merge2@1.4.1/node_modules/merge2/index.mjs +117 -110
- package/build/esm/node_modules/.pnpm/micromatch@4.0.5/node_modules/micromatch/index.mjs +457 -451
- package/build/esm/node_modules/.pnpm/minimatch@5.1.0/node_modules/minimatch/lib/path.mjs +14 -7
- package/build/esm/node_modules/.pnpm/minimatch@5.1.0/node_modules/minimatch/minimatch.mjs +770 -770
- package/build/esm/node_modules/.pnpm/path-type@4.0.0/node_modules/path-type/index.mjs +40 -34
- package/build/esm/node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/index.mjs +10 -3
- package/build/esm/node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/constants.mjs +227 -220
- package/build/esm/node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/parse.mjs +941 -935
- package/build/esm/node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/picomatch.mjs +331 -325
- package/build/esm/node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/scan.mjs +303 -297
- package/build/esm/node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/utils.mjs +65 -57
- package/build/esm/node_modules/.pnpm/prettier@3.0.0/node_modules/prettier/plugins/babel.mjs +605 -605
- package/build/esm/node_modules/.pnpm/prettier@3.0.0/node_modules/prettier/plugins/estree.mjs +378 -394
- package/build/esm/node_modules/.pnpm/prettier@3.0.0/node_modules/prettier/plugins/typescript.mjs +15 -15
- package/build/esm/node_modules/.pnpm/prettier@3.0.0/node_modules/prettier/plugins/yaml.mjs +281 -294
- package/build/esm/node_modules/.pnpm/prettier@3.0.0/node_modules/prettier/standalone.mjs +155 -155
- package/build/esm/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/index.mjs +1 -1
- package/build/esm/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/prompts.mjs +1 -1
- package/build/esm/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/clear.mjs +1 -1
- package/build/esm/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/index.mjs +17 -12
- package/build/esm/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/prompts.mjs +1 -1
- package/build/esm/node_modules/.pnpm/queue-microtask@1.2.3/node_modules/queue-microtask/index.mjs +14 -7
- package/build/esm/node_modules/.pnpm/reusify@1.0.4/node_modules/reusify/reusify.mjs +29 -22
- package/build/esm/node_modules/.pnpm/run-parallel@1.2.0/node_modules/run-parallel/index.mjs +49 -42
- package/build/esm/node_modules/.pnpm/to-regex-range@5.0.1/node_modules/to-regex-range/index.mjs +231 -224
- package/build/esm/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/nodes/YAMLMap.mjs +1 -1
- package/build/esm/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/nodes/addPairToJSMap.mjs +1 -1
- package/build/esm/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/schema/tags.mjs +3 -3
- package/build/esm/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.mjs +2 -2
- package/build/esm/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.mjs +1 -1
- package/build/esm/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/schema/yaml-1.1/set.mjs +2 -2
- package/build/esm/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/stringify/stringifyString.mjs +1 -1
- package/build/esm/package.mjs +2 -2
- package/build/esm/packages/cli-kit/build/esnext/prompt.esnext.mjs +1 -1
- package/build/esm/server.mjs +5 -9
- package/build/esm/shared/package-manager.mjs +1 -1
- package/build/esm/shared/prompts.mjs +1 -1
- package/build/esnext/_virtual/index.esnext +6 -2
- package/build/esnext/_virtual/index10.esnext +3 -0
- package/build/esnext/_virtual/index11.esnext +3 -0
- package/build/esnext/_virtual/index12.esnext +3 -0
- package/build/esnext/_virtual/index13.esnext +3 -0
- package/build/esnext/_virtual/index2.esnext +2 -2
- package/build/esnext/_virtual/index3.esnext +6 -2
- package/build/esnext/_virtual/index4.esnext +6 -2
- package/build/esnext/_virtual/index5.esnext +6 -2
- package/build/esnext/_virtual/index6.esnext +6 -2
- package/build/esnext/_virtual/index8.esnext +3 -0
- package/build/esnext/_virtual/index9.esnext +3 -0
- package/build/esnext/_virtual/minimatch.esnext +12 -0
- package/build/esnext/app.esnext +2 -2
- package/build/esnext/module.esnext +2 -2
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/adapters/fs.esnext +27 -19
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/constants.esnext +19 -13
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/index.esnext +33 -30
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/async.esnext +99 -97
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/common.esnext +14 -8
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/sync.esnext +59 -57
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/settings.esnext +31 -25
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/utils/fs.esnext +23 -17
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/utils/index.esnext +13 -8
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/adapters/fs.esnext +25 -17
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/index.esnext +33 -30
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/async.esnext +38 -32
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/sync.esnext +25 -19
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/settings.esnext +23 -16
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/index.esnext +42 -40
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/async.esnext +36 -29
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/stream.esnext +40 -33
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/sync.esnext +21 -14
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/async.esnext +98 -93
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/common.esnext +30 -24
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/reader.esnext +17 -10
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/sync.esnext +59 -54
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/settings.esnext +33 -26
- package/build/esnext/node_modules/.pnpm/arg@5.0.2/node_modules/arg/index.esnext +132 -128
- package/build/esnext/node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.esnext +54 -47
- package/build/esnext/node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.esnext +137 -130
- package/build/esnext/node_modules/.pnpm/braces@3.0.2/node_modules/braces/index.esnext +66 -59
- package/build/esnext/node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/compile.esnext +53 -47
- package/build/esnext/node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/constants.esnext +102 -95
- package/build/esnext/node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/expand.esnext +89 -83
- package/build/esnext/node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/parse.esnext +217 -210
- package/build/esnext/node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/stringify.esnext +30 -24
- package/build/esnext/node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/utils.esnext +75 -67
- package/build/esnext/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/splitStringTransformer/splitStringTransformer.esnext +1 -3
- package/build/esnext/node_modules/.pnpm/dir-glob@3.0.1/node_modules/dir-glob/index.esnext +63 -61
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/index.esnext +68 -70
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/managers/patterns.esnext +17 -11
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/managers/tasks.esnext +81 -76
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/async.esnext +29 -23
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/filters/deep.esnext +61 -55
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/filters/entry.esnext +61 -54
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/filters/error.esnext +21 -14
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/matchers/matcher.esnext +49 -42
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/matchers/partial.esnext +31 -24
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/provider.esnext +57 -53
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/stream.esnext +34 -28
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/sync.esnext +29 -23
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/transformers/entry.esnext +29 -22
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/readers/async.esnext +40 -35
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/readers/reader.esnext +39 -33
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/readers/stream.esnext +56 -51
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/readers/sync.esnext +46 -41
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/settings.esnext +59 -51
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/utils/array.esnext +24 -18
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/utils/errno.esnext +12 -6
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/utils/fs.esnext +23 -17
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/utils/index.esnext +31 -32
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/utils/path.esnext +32 -26
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/utils/pattern.esnext +135 -129
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/utils/stream.esnext +23 -17
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/utils/string.esnext +16 -10
- package/build/esnext/node_modules/.pnpm/fastq@1.13.0/node_modules/fastq/queue.esnext +220 -215
- package/build/esnext/node_modules/.pnpm/fill-range@7.0.1/node_modules/fill-range/index.esnext +193 -186
- package/build/esnext/node_modules/.pnpm/find-up@6.3.0/node_modules/find-up/index.esnext +1 -6
- package/build/esnext/node_modules/.pnpm/glob-parent@5.1.2/node_modules/glob-parent/index.esnext +31 -24
- package/build/esnext/node_modules/.pnpm/globby@13.1.1/node_modules/globby/ignore.esnext +2 -2
- package/build/esnext/node_modules/.pnpm/globby@13.1.1/node_modules/globby/index.esnext +3 -3
- package/build/esnext/node_modules/.pnpm/ignore@5.2.4/node_modules/ignore/index.esnext +357 -353
- package/build/esnext/node_modules/.pnpm/is-extglob@2.1.1/node_modules/is-extglob/index.esnext +18 -11
- package/build/esnext/node_modules/.pnpm/is-glob@4.0.3/node_modules/is-glob/index.esnext +111 -104
- package/build/esnext/node_modules/.pnpm/is-number@7.0.0/node_modules/is-number/index.esnext +17 -10
- package/build/esnext/node_modules/.pnpm/merge2@1.4.1/node_modules/merge2/index.esnext +103 -96
- package/build/esnext/node_modules/.pnpm/micromatch@4.0.5/node_modules/micromatch/index.esnext +147 -141
- package/build/esnext/node_modules/.pnpm/minimatch@5.1.0/node_modules/minimatch/lib/path.esnext +10 -3
- package/build/esnext/node_modules/.pnpm/minimatch@5.1.0/node_modules/minimatch/minimatch.esnext +495 -491
- package/build/esnext/node_modules/.pnpm/path-type@4.0.0/node_modules/path-type/index.esnext +38 -32
- package/build/esnext/node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/index.esnext +10 -3
- package/build/esnext/node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/constants.esnext +198 -191
- package/build/esnext/node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/parse.esnext +683 -677
- package/build/esnext/node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/picomatch.esnext +137 -131
- package/build/esnext/node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/scan.esnext +279 -273
- package/build/esnext/node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/utils.esnext +65 -57
- package/build/esnext/node_modules/.pnpm/prettier@3.0.0/node_modules/prettier/plugins/babel.esnext +9 -9
- package/build/esnext/node_modules/.pnpm/prettier@3.0.0/node_modules/prettier/plugins/estree.esnext +20 -20
- package/build/esnext/node_modules/.pnpm/prettier@3.0.0/node_modules/prettier/plugins/typescript.esnext +15 -15
- package/build/esnext/node_modules/.pnpm/prettier@3.0.0/node_modules/prettier/plugins/yaml.esnext +64 -64
- package/build/esnext/node_modules/.pnpm/prettier@3.0.0/node_modules/prettier/standalone.esnext +19 -19
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/index.esnext +1 -1
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/clear.esnext +1 -1
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/index.esnext +16 -11
- package/build/esnext/node_modules/.pnpm/queue-microtask@1.2.3/node_modules/queue-microtask/index.esnext +12 -5
- package/build/esnext/node_modules/.pnpm/reusify@1.0.4/node_modules/reusify/reusify.esnext +29 -22
- package/build/esnext/node_modules/.pnpm/run-parallel@1.2.0/node_modules/run-parallel/index.esnext +47 -40
- package/build/esnext/node_modules/.pnpm/to-regex-range@5.0.1/node_modules/to-regex-range/index.esnext +196 -189
- package/build/esnext/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/compose/resolve-block-scalar.esnext +2 -0
- package/build/esnext/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.esnext +2 -0
- package/build/esnext/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/compose/resolve-props.esnext +1 -0
- package/build/esnext/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/nodes/YAMLMap.esnext +1 -1
- package/build/esnext/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/nodes/addPairToJSMap.esnext +1 -1
- package/build/esnext/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/parse/lexer.esnext +5 -0
- package/build/esnext/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/parse/parser.esnext +4 -0
- package/build/esnext/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/schema/tags.esnext +3 -3
- package/build/esnext/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.esnext +2 -2
- package/build/esnext/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.esnext +1 -1
- package/build/esnext/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/schema/yaml-1.1/set.esnext +2 -2
- package/build/esnext/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/stringify/stringifyString.esnext +1 -1
- package/build/esnext/package.esnext +2 -2
- package/build/esnext/packages/cli-kit/build/esnext/prompt.esnext.esnext +1 -1
- package/build/esnext/server.esnext +5 -9
- package/build/esnext/shared/package-manager.esnext +1 -1
- package/build/esnext/shared/prompts.esnext +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/source/shared/prompts.ts +1 -1
- package/templates/app-basic/App.tsx +3 -4
- package/templates/app-basic/browser.tsx +5 -1
- package/templates/app-basic/foundation/html/Head.test.tsx +42 -0
- package/templates/app-basic/foundation/html/Head.tsx +34 -0
- package/templates/app-basic/foundation/html.ts +1 -1
- package/templates/app-basic/package.json +4 -4
- package/templates/app-basic/server.tsx +89 -3
- package/templates/app-empty/package.json +3 -3
- package/templates/app-empty/server.tsx +4 -3
- package/templates/app-graphql/App.tsx +3 -4
- package/templates/app-graphql/browser.tsx +5 -1
- package/templates/app-graphql/foundation/html/Head.test.tsx +42 -0
- package/templates/app-graphql/foundation/html/Head.tsx +34 -0
- package/templates/app-graphql/foundation/html.ts +1 -1
- package/templates/app-graphql/package.json +4 -4
- package/templates/app-graphql/server.tsx +93 -9
- package/templates/app-trpc/App.tsx +3 -4
- package/templates/app-trpc/browser.tsx +5 -1
- package/templates/app-trpc/foundation/html/Head.test.tsx +42 -0
- package/templates/app-trpc/foundation/html/Head.tsx +34 -0
- package/templates/app-trpc/foundation/html.ts +1 -1
- package/templates/app-trpc/package.json +4 -4
- package/templates/app-trpc/server.tsx +93 -8
- package/templates/package/package.json +3 -3
- package/templates/workspace/package.json +4 -4
- package/templates/app-basic/foundation/html/HTML.test.tsx +0 -46
- package/templates/app-basic/foundation/html/HTML.tsx +0 -159
- package/templates/app-graphql/foundation/html/HTML.test.tsx +0 -46
- package/templates/app-graphql/foundation/html/HTML.tsx +0 -159
- package/templates/app-trpc/foundation/html/HTML.test.tsx +0 -46
- package/templates/app-trpc/foundation/html/HTML.tsx +0 -159
|
@@ -1,1099 +1,1105 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import './utils.mjs';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
REGEX_NON_SPECIAL_CHARS,
|
|
16
|
-
REGEX_SPECIAL_CHARS_BACKREF,
|
|
17
|
-
REPLACEMENTS
|
|
18
|
-
} = constants;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Helpers
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
const expandRange = (args, options) => {
|
|
25
|
-
if (typeof options.expandRange === 'function') {
|
|
26
|
-
return options.expandRange(...args, options);
|
|
27
|
-
}
|
|
28
|
-
args.sort();
|
|
29
|
-
const value = `[${args.join('-')}]`;
|
|
30
|
-
try {
|
|
31
|
-
/* eslint-disable-next-line no-new */
|
|
32
|
-
new RegExp(value);
|
|
33
|
-
} catch (ex) {
|
|
34
|
-
return args.map(v => utils.escapeRegex(v)).join('..');
|
|
35
|
-
}
|
|
36
|
-
return value;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Create the message for a syntax error
|
|
41
|
-
*/
|
|
42
|
-
|
|
43
|
-
const syntaxError = (type, char) => {
|
|
44
|
-
return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Parse the given input string.
|
|
49
|
-
* @param {String} input
|
|
50
|
-
* @param {Object} options
|
|
51
|
-
* @return {Object}
|
|
52
|
-
*/
|
|
53
|
-
|
|
54
|
-
const parse = (input, options) => {
|
|
55
|
-
if (typeof input !== 'string') {
|
|
56
|
-
throw new TypeError('Expected a string');
|
|
57
|
-
}
|
|
58
|
-
input = REPLACEMENTS[input] || input;
|
|
59
|
-
const opts = {
|
|
60
|
-
...options
|
|
61
|
-
};
|
|
62
|
-
const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
63
|
-
let len = input.length;
|
|
64
|
-
if (len > max) {
|
|
65
|
-
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
66
|
-
}
|
|
67
|
-
const bos = {
|
|
68
|
-
type: 'bos',
|
|
69
|
-
value: '',
|
|
70
|
-
output: opts.prepend || ''
|
|
71
|
-
};
|
|
72
|
-
const tokens = [bos];
|
|
73
|
-
const capture = opts.capture ? '' : '?:';
|
|
74
|
-
const win32 = utils.isWindows(options);
|
|
1
|
+
import { __require as requireConstants } from './constants.mjs';
|
|
2
|
+
import { __require as requireUtils } from './utils.mjs';
|
|
3
|
+
|
|
4
|
+
var parse_1;
|
|
5
|
+
var hasRequiredParse;
|
|
6
|
+
function requireParse() {
|
|
7
|
+
if (hasRequiredParse) return parse_1;
|
|
8
|
+
hasRequiredParse = 1;
|
|
9
|
+
const constants = requireConstants();
|
|
10
|
+
const utils = requireUtils();
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Constants
|
|
14
|
+
*/
|
|
75
15
|
|
|
76
|
-
// create constants based on platform, for windows or posix
|
|
77
|
-
const PLATFORM_CHARS = constants.globChars(win32);
|
|
78
|
-
const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
|
|
79
16
|
const {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
NO_DOT_SLASH,
|
|
87
|
-
NO_DOTS_SLASH,
|
|
88
|
-
QMARK,
|
|
89
|
-
QMARK_NO_DOT,
|
|
90
|
-
STAR,
|
|
91
|
-
START_ANCHOR
|
|
92
|
-
} = PLATFORM_CHARS;
|
|
93
|
-
const globstar = opts => {
|
|
94
|
-
return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
|
95
|
-
};
|
|
96
|
-
const nodot = opts.dot ? '' : NO_DOT;
|
|
97
|
-
const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
|
|
98
|
-
let star = opts.bash === true ? globstar(opts) : STAR;
|
|
99
|
-
if (opts.capture) {
|
|
100
|
-
star = `(${star})`;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// minimatch options support
|
|
104
|
-
if (typeof opts.noext === 'boolean') {
|
|
105
|
-
opts.noextglob = opts.noext;
|
|
106
|
-
}
|
|
107
|
-
const state = {
|
|
108
|
-
input,
|
|
109
|
-
index: -1,
|
|
110
|
-
start: 0,
|
|
111
|
-
dot: opts.dot === true,
|
|
112
|
-
consumed: '',
|
|
113
|
-
output: '',
|
|
114
|
-
prefix: '',
|
|
115
|
-
backtrack: false,
|
|
116
|
-
negated: false,
|
|
117
|
-
brackets: 0,
|
|
118
|
-
braces: 0,
|
|
119
|
-
parens: 0,
|
|
120
|
-
quotes: 0,
|
|
121
|
-
globstar: false,
|
|
122
|
-
tokens
|
|
123
|
-
};
|
|
124
|
-
input = utils.removePrefix(input, state);
|
|
125
|
-
len = input.length;
|
|
126
|
-
const extglobs = [];
|
|
127
|
-
const braces = [];
|
|
128
|
-
const stack = [];
|
|
129
|
-
let prev = bos;
|
|
130
|
-
let value;
|
|
17
|
+
MAX_LENGTH,
|
|
18
|
+
POSIX_REGEX_SOURCE,
|
|
19
|
+
REGEX_NON_SPECIAL_CHARS,
|
|
20
|
+
REGEX_SPECIAL_CHARS_BACKREF,
|
|
21
|
+
REPLACEMENTS
|
|
22
|
+
} = constants;
|
|
131
23
|
|
|
132
24
|
/**
|
|
133
|
-
*
|
|
25
|
+
* Helpers
|
|
134
26
|
*/
|
|
135
27
|
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
const remaining = () => input.slice(state.index + 1);
|
|
140
|
-
const consume = (value = '', num = 0) => {
|
|
141
|
-
state.consumed += value;
|
|
142
|
-
state.index += num;
|
|
143
|
-
};
|
|
144
|
-
const append = token => {
|
|
145
|
-
state.output += token.output != null ? token.output : token.value;
|
|
146
|
-
consume(token.value);
|
|
147
|
-
};
|
|
148
|
-
const negate = () => {
|
|
149
|
-
let count = 1;
|
|
150
|
-
while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) {
|
|
151
|
-
advance();
|
|
152
|
-
state.start++;
|
|
153
|
-
count++;
|
|
28
|
+
const expandRange = (args, options) => {
|
|
29
|
+
if (typeof options.expandRange === 'function') {
|
|
30
|
+
return options.expandRange(...args, options);
|
|
154
31
|
}
|
|
155
|
-
|
|
156
|
-
|
|
32
|
+
args.sort();
|
|
33
|
+
const value = `[${args.join('-')}]`;
|
|
34
|
+
try {
|
|
35
|
+
/* eslint-disable-next-line no-new */
|
|
36
|
+
new RegExp(value);
|
|
37
|
+
} catch (ex) {
|
|
38
|
+
return args.map(v => utils.escapeRegex(v)).join('..');
|
|
157
39
|
}
|
|
158
|
-
|
|
159
|
-
state.start++;
|
|
160
|
-
return true;
|
|
161
|
-
};
|
|
162
|
-
const increment = type => {
|
|
163
|
-
state[type]++;
|
|
164
|
-
stack.push(type);
|
|
165
|
-
};
|
|
166
|
-
const decrement = type => {
|
|
167
|
-
state[type]--;
|
|
168
|
-
stack.pop();
|
|
40
|
+
return value;
|
|
169
41
|
};
|
|
170
42
|
|
|
171
43
|
/**
|
|
172
|
-
*
|
|
173
|
-
* tokenizing by 1) helping us avoid backtracking as much as possible,
|
|
174
|
-
* and 2) helping us avoid creating extra tokens when consecutive
|
|
175
|
-
* characters are plain text. This improves performance and simplifies
|
|
176
|
-
* lookbehinds.
|
|
44
|
+
* Create the message for a syntax error
|
|
177
45
|
*/
|
|
178
46
|
|
|
179
|
-
const
|
|
180
|
-
|
|
181
|
-
const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace');
|
|
182
|
-
const isExtglob = tok.extglob === true || extglobs.length && (tok.type === 'pipe' || tok.type === 'paren');
|
|
183
|
-
if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) {
|
|
184
|
-
state.output = state.output.slice(0, -prev.output.length);
|
|
185
|
-
prev.type = 'star';
|
|
186
|
-
prev.value = '*';
|
|
187
|
-
prev.output = star;
|
|
188
|
-
state.output += prev.output;
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
if (extglobs.length && tok.type !== 'paren') {
|
|
192
|
-
extglobs[extglobs.length - 1].inner += tok.value;
|
|
193
|
-
}
|
|
194
|
-
if (tok.value || tok.output) append(tok);
|
|
195
|
-
if (prev && prev.type === 'text' && tok.type === 'text') {
|
|
196
|
-
prev.value += tok.value;
|
|
197
|
-
prev.output = (prev.output || '') + tok.value;
|
|
198
|
-
return;
|
|
199
|
-
}
|
|
200
|
-
tok.prev = prev;
|
|
201
|
-
tokens.push(tok);
|
|
202
|
-
prev = tok;
|
|
203
|
-
};
|
|
204
|
-
const extglobOpen = (type, value) => {
|
|
205
|
-
const token = {
|
|
206
|
-
...EXTGLOB_CHARS[value],
|
|
207
|
-
conditions: 1,
|
|
208
|
-
inner: ''
|
|
209
|
-
};
|
|
210
|
-
token.prev = prev;
|
|
211
|
-
token.parens = state.parens;
|
|
212
|
-
token.output = state.output;
|
|
213
|
-
const output = (opts.capture ? '(' : '') + token.open;
|
|
214
|
-
increment('parens');
|
|
215
|
-
push({
|
|
216
|
-
type,
|
|
217
|
-
value,
|
|
218
|
-
output: state.output ? '' : ONE_CHAR
|
|
219
|
-
});
|
|
220
|
-
push({
|
|
221
|
-
type: 'paren',
|
|
222
|
-
extglob: true,
|
|
223
|
-
value: advance(),
|
|
224
|
-
output
|
|
225
|
-
});
|
|
226
|
-
extglobs.push(token);
|
|
227
|
-
};
|
|
228
|
-
const extglobClose = token => {
|
|
229
|
-
let output = token.close + (opts.capture ? ')' : '');
|
|
230
|
-
let rest;
|
|
231
|
-
if (token.type === 'negate') {
|
|
232
|
-
let extglobStar = star;
|
|
233
|
-
if (token.inner && token.inner.length > 1 && token.inner.includes('/')) {
|
|
234
|
-
extglobStar = globstar(opts);
|
|
235
|
-
}
|
|
236
|
-
if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
|
|
237
|
-
output = token.close = `)$))${extglobStar}`;
|
|
238
|
-
}
|
|
239
|
-
if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
|
|
240
|
-
// Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis.
|
|
241
|
-
// In this case, we need to parse the string and use it in the output of the original pattern.
|
|
242
|
-
// Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`.
|
|
243
|
-
//
|
|
244
|
-
// Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`.
|
|
245
|
-
const expression = parse(rest, {
|
|
246
|
-
...options,
|
|
247
|
-
fastpaths: false
|
|
248
|
-
}).output;
|
|
249
|
-
output = token.close = `)${expression})${extglobStar})`;
|
|
250
|
-
}
|
|
251
|
-
if (token.prev.type === 'bos') {
|
|
252
|
-
state.negatedExtglob = true;
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
push({
|
|
256
|
-
type: 'paren',
|
|
257
|
-
extglob: true,
|
|
258
|
-
value,
|
|
259
|
-
output
|
|
260
|
-
});
|
|
261
|
-
decrement('parens');
|
|
47
|
+
const syntaxError = (type, char) => {
|
|
48
|
+
return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
|
|
262
49
|
};
|
|
263
50
|
|
|
264
51
|
/**
|
|
265
|
-
*
|
|
52
|
+
* Parse the given input string.
|
|
53
|
+
* @param {String} input
|
|
54
|
+
* @param {Object} options
|
|
55
|
+
* @return {Object}
|
|
266
56
|
*/
|
|
267
57
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
if (first === '\\') {
|
|
272
|
-
backslashes = true;
|
|
273
|
-
return m;
|
|
274
|
-
}
|
|
275
|
-
if (first === '?') {
|
|
276
|
-
if (esc) {
|
|
277
|
-
return esc + first + (rest ? QMARK.repeat(rest.length) : '');
|
|
278
|
-
}
|
|
279
|
-
if (index === 0) {
|
|
280
|
-
return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : '');
|
|
281
|
-
}
|
|
282
|
-
return QMARK.repeat(chars.length);
|
|
283
|
-
}
|
|
284
|
-
if (first === '.') {
|
|
285
|
-
return DOT_LITERAL.repeat(chars.length);
|
|
286
|
-
}
|
|
287
|
-
if (first === '*') {
|
|
288
|
-
if (esc) {
|
|
289
|
-
return esc + first + (rest ? star : '');
|
|
290
|
-
}
|
|
291
|
-
return star;
|
|
292
|
-
}
|
|
293
|
-
return esc ? m : `\\${m}`;
|
|
294
|
-
});
|
|
295
|
-
if (backslashes === true) {
|
|
296
|
-
if (opts.unescape === true) {
|
|
297
|
-
output = output.replace(/\\/g, '');
|
|
298
|
-
} else {
|
|
299
|
-
output = output.replace(/\\+/g, m => {
|
|
300
|
-
return m.length % 2 === 0 ? '\\\\' : m ? '\\' : '';
|
|
301
|
-
});
|
|
302
|
-
}
|
|
58
|
+
const parse = (input, options) => {
|
|
59
|
+
if (typeof input !== 'string') {
|
|
60
|
+
throw new TypeError('Expected a string');
|
|
303
61
|
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
62
|
+
input = REPLACEMENTS[input] || input;
|
|
63
|
+
const opts = {
|
|
64
|
+
...options
|
|
65
|
+
};
|
|
66
|
+
const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
67
|
+
let len = input.length;
|
|
68
|
+
if (len > max) {
|
|
69
|
+
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
70
|
+
}
|
|
71
|
+
const bos = {
|
|
72
|
+
type: 'bos',
|
|
73
|
+
value: '',
|
|
74
|
+
output: opts.prepend || ''
|
|
75
|
+
};
|
|
76
|
+
const tokens = [bos];
|
|
77
|
+
const capture = opts.capture ? '' : '?:';
|
|
78
|
+
const win32 = utils.isWindows(options);
|
|
79
|
+
|
|
80
|
+
// create constants based on platform, for windows or posix
|
|
81
|
+
const PLATFORM_CHARS = constants.globChars(win32);
|
|
82
|
+
const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
|
|
83
|
+
const {
|
|
84
|
+
DOT_LITERAL,
|
|
85
|
+
PLUS_LITERAL,
|
|
86
|
+
SLASH_LITERAL,
|
|
87
|
+
ONE_CHAR,
|
|
88
|
+
DOTS_SLASH,
|
|
89
|
+
NO_DOT,
|
|
90
|
+
NO_DOT_SLASH,
|
|
91
|
+
NO_DOTS_SLASH,
|
|
92
|
+
QMARK,
|
|
93
|
+
QMARK_NO_DOT,
|
|
94
|
+
STAR,
|
|
95
|
+
START_ANCHOR
|
|
96
|
+
} = PLATFORM_CHARS;
|
|
97
|
+
const globstar = opts => {
|
|
98
|
+
return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
|
99
|
+
};
|
|
100
|
+
const nodot = opts.dot ? '' : NO_DOT;
|
|
101
|
+
const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
|
|
102
|
+
let star = opts.bash === true ? globstar(opts) : STAR;
|
|
103
|
+
if (opts.capture) {
|
|
104
|
+
star = `(${star})`;
|
|
307
105
|
}
|
|
308
|
-
state.output = utils.wrapOutput(output, state, options);
|
|
309
|
-
return state;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
/**
|
|
313
|
-
* Tokenize input until we reach end-of-string
|
|
314
|
-
*/
|
|
315
106
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
continue;
|
|
107
|
+
// minimatch options support
|
|
108
|
+
if (typeof opts.noext === 'boolean') {
|
|
109
|
+
opts.noextglob = opts.noext;
|
|
320
110
|
}
|
|
111
|
+
const state = {
|
|
112
|
+
input,
|
|
113
|
+
index: -1,
|
|
114
|
+
start: 0,
|
|
115
|
+
dot: opts.dot === true,
|
|
116
|
+
consumed: '',
|
|
117
|
+
output: '',
|
|
118
|
+
prefix: '',
|
|
119
|
+
backtrack: false,
|
|
120
|
+
negated: false,
|
|
121
|
+
brackets: 0,
|
|
122
|
+
braces: 0,
|
|
123
|
+
parens: 0,
|
|
124
|
+
quotes: 0,
|
|
125
|
+
globstar: false,
|
|
126
|
+
tokens
|
|
127
|
+
};
|
|
128
|
+
input = utils.removePrefix(input, state);
|
|
129
|
+
len = input.length;
|
|
130
|
+
const extglobs = [];
|
|
131
|
+
const braces = [];
|
|
132
|
+
const stack = [];
|
|
133
|
+
let prev = bos;
|
|
134
|
+
let value;
|
|
321
135
|
|
|
322
136
|
/**
|
|
323
|
-
*
|
|
137
|
+
* Tokenizing helpers
|
|
324
138
|
*/
|
|
325
139
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
const match = /^\\+/.exec(remaining());
|
|
345
|
-
let slashes = 0;
|
|
346
|
-
if (match && match[0].length > 2) {
|
|
347
|
-
slashes = match[0].length;
|
|
348
|
-
state.index += slashes;
|
|
349
|
-
if (slashes % 2 !== 0) {
|
|
350
|
-
value += '\\';
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
if (opts.unescape === true) {
|
|
354
|
-
value = advance();
|
|
355
|
-
} else {
|
|
356
|
-
value += advance();
|
|
140
|
+
const eos = () => state.index === len - 1;
|
|
141
|
+
const peek = state.peek = (n = 1) => input[state.index + n];
|
|
142
|
+
const advance = state.advance = () => input[++state.index] || '';
|
|
143
|
+
const remaining = () => input.slice(state.index + 1);
|
|
144
|
+
const consume = (value = '', num = 0) => {
|
|
145
|
+
state.consumed += value;
|
|
146
|
+
state.index += num;
|
|
147
|
+
};
|
|
148
|
+
const append = token => {
|
|
149
|
+
state.output += token.output != null ? token.output : token.value;
|
|
150
|
+
consume(token.value);
|
|
151
|
+
};
|
|
152
|
+
const negate = () => {
|
|
153
|
+
let count = 1;
|
|
154
|
+
while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) {
|
|
155
|
+
advance();
|
|
156
|
+
state.start++;
|
|
157
|
+
count++;
|
|
357
158
|
}
|
|
358
|
-
if (
|
|
359
|
-
|
|
360
|
-
type: 'text',
|
|
361
|
-
value
|
|
362
|
-
});
|
|
363
|
-
continue;
|
|
159
|
+
if (count % 2 === 0) {
|
|
160
|
+
return false;
|
|
364
161
|
}
|
|
365
|
-
|
|
162
|
+
state.negated = true;
|
|
163
|
+
state.start++;
|
|
164
|
+
return true;
|
|
165
|
+
};
|
|
166
|
+
const increment = type => {
|
|
167
|
+
state[type]++;
|
|
168
|
+
stack.push(type);
|
|
169
|
+
};
|
|
170
|
+
const decrement = type => {
|
|
171
|
+
state[type]--;
|
|
172
|
+
stack.pop();
|
|
173
|
+
};
|
|
366
174
|
|
|
367
175
|
/**
|
|
368
|
-
*
|
|
369
|
-
*
|
|
176
|
+
* Push tokens onto the tokens array. This helper speeds up
|
|
177
|
+
* tokenizing by 1) helping us avoid backtracking as much as possible,
|
|
178
|
+
* and 2) helping us avoid creating extra tokens when consecutive
|
|
179
|
+
* characters are plain text. This improves performance and simplifies
|
|
180
|
+
* lookbehinds.
|
|
370
181
|
*/
|
|
371
182
|
|
|
372
|
-
|
|
373
|
-
if (
|
|
374
|
-
const
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
if (posix) {
|
|
383
|
-
prev.value = pre + posix;
|
|
384
|
-
state.backtrack = true;
|
|
385
|
-
advance();
|
|
386
|
-
if (!bos.output && tokens.indexOf(prev) === 1) {
|
|
387
|
-
bos.output = ONE_CHAR;
|
|
388
|
-
}
|
|
389
|
-
continue;
|
|
390
|
-
}
|
|
391
|
-
}
|
|
183
|
+
const push = tok => {
|
|
184
|
+
if (prev.type === 'globstar') {
|
|
185
|
+
const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace');
|
|
186
|
+
const isExtglob = tok.extglob === true || extglobs.length && (tok.type === 'pipe' || tok.type === 'paren');
|
|
187
|
+
if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) {
|
|
188
|
+
state.output = state.output.slice(0, -prev.output.length);
|
|
189
|
+
prev.type = 'star';
|
|
190
|
+
prev.value = '*';
|
|
191
|
+
prev.output = star;
|
|
192
|
+
state.output += prev.output;
|
|
392
193
|
}
|
|
393
194
|
}
|
|
394
|
-
if (
|
|
395
|
-
|
|
195
|
+
if (extglobs.length && tok.type !== 'paren') {
|
|
196
|
+
extglobs[extglobs.length - 1].inner += tok.value;
|
|
396
197
|
}
|
|
397
|
-
if (
|
|
398
|
-
|
|
198
|
+
if (tok.value || tok.output) append(tok);
|
|
199
|
+
if (prev && prev.type === 'text' && tok.type === 'text') {
|
|
200
|
+
prev.value += tok.value;
|
|
201
|
+
prev.output = (prev.output || '') + tok.value;
|
|
202
|
+
return;
|
|
399
203
|
}
|
|
400
|
-
|
|
401
|
-
|
|
204
|
+
tok.prev = prev;
|
|
205
|
+
tokens.push(tok);
|
|
206
|
+
prev = tok;
|
|
207
|
+
};
|
|
208
|
+
const extglobOpen = (type, value) => {
|
|
209
|
+
const token = {
|
|
210
|
+
...EXTGLOB_CHARS[value],
|
|
211
|
+
conditions: 1,
|
|
212
|
+
inner: ''
|
|
213
|
+
};
|
|
214
|
+
token.prev = prev;
|
|
215
|
+
token.parens = state.parens;
|
|
216
|
+
token.output = state.output;
|
|
217
|
+
const output = (opts.capture ? '(' : '') + token.open;
|
|
218
|
+
increment('parens');
|
|
219
|
+
push({
|
|
220
|
+
type,
|
|
221
|
+
value,
|
|
222
|
+
output: state.output ? '' : ONE_CHAR
|
|
223
|
+
});
|
|
224
|
+
push({
|
|
225
|
+
type: 'paren',
|
|
226
|
+
extglob: true,
|
|
227
|
+
value: advance(),
|
|
228
|
+
output
|
|
229
|
+
});
|
|
230
|
+
extglobs.push(token);
|
|
231
|
+
};
|
|
232
|
+
const extglobClose = token => {
|
|
233
|
+
let output = token.close + (opts.capture ? ')' : '');
|
|
234
|
+
let rest;
|
|
235
|
+
if (token.type === 'negate') {
|
|
236
|
+
let extglobStar = star;
|
|
237
|
+
if (token.inner && token.inner.length > 1 && token.inner.includes('/')) {
|
|
238
|
+
extglobStar = globstar(opts);
|
|
239
|
+
}
|
|
240
|
+
if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
|
|
241
|
+
output = token.close = `)$))${extglobStar}`;
|
|
242
|
+
}
|
|
243
|
+
if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
|
|
244
|
+
// Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis.
|
|
245
|
+
// In this case, we need to parse the string and use it in the output of the original pattern.
|
|
246
|
+
// Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`.
|
|
247
|
+
//
|
|
248
|
+
// Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`.
|
|
249
|
+
const expression = parse(rest, {
|
|
250
|
+
...options,
|
|
251
|
+
fastpaths: false
|
|
252
|
+
}).output;
|
|
253
|
+
output = token.close = `)${expression})${extglobStar})`;
|
|
254
|
+
}
|
|
255
|
+
if (token.prev.type === 'bos') {
|
|
256
|
+
state.negatedExtglob = true;
|
|
257
|
+
}
|
|
402
258
|
}
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
259
|
+
push({
|
|
260
|
+
type: 'paren',
|
|
261
|
+
extglob: true,
|
|
262
|
+
value,
|
|
263
|
+
output
|
|
406
264
|
});
|
|
407
|
-
|
|
408
|
-
}
|
|
265
|
+
decrement('parens');
|
|
266
|
+
};
|
|
409
267
|
|
|
410
268
|
/**
|
|
411
|
-
*
|
|
412
|
-
* until we reach the closing double quote.
|
|
269
|
+
* Fast paths
|
|
413
270
|
*/
|
|
414
271
|
|
|
415
|
-
if (
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
272
|
+
if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
|
|
273
|
+
let backslashes = false;
|
|
274
|
+
let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
|
|
275
|
+
if (first === '\\') {
|
|
276
|
+
backslashes = true;
|
|
277
|
+
return m;
|
|
278
|
+
}
|
|
279
|
+
if (first === '?') {
|
|
280
|
+
if (esc) {
|
|
281
|
+
return esc + first + (rest ? QMARK.repeat(rest.length) : '');
|
|
282
|
+
}
|
|
283
|
+
if (index === 0) {
|
|
284
|
+
return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : '');
|
|
285
|
+
}
|
|
286
|
+
return QMARK.repeat(chars.length);
|
|
287
|
+
}
|
|
288
|
+
if (first === '.') {
|
|
289
|
+
return DOT_LITERAL.repeat(chars.length);
|
|
290
|
+
}
|
|
291
|
+
if (first === '*') {
|
|
292
|
+
if (esc) {
|
|
293
|
+
return esc + first + (rest ? star : '');
|
|
294
|
+
}
|
|
295
|
+
return star;
|
|
296
|
+
}
|
|
297
|
+
return esc ? m : `\\${m}`;
|
|
420
298
|
});
|
|
421
|
-
|
|
299
|
+
if (backslashes === true) {
|
|
300
|
+
if (opts.unescape === true) {
|
|
301
|
+
output = output.replace(/\\/g, '');
|
|
302
|
+
} else {
|
|
303
|
+
output = output.replace(/\\+/g, m => {
|
|
304
|
+
return m.length % 2 === 0 ? '\\\\' : m ? '\\' : '';
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
if (output === input && opts.contains === true) {
|
|
309
|
+
state.output = input;
|
|
310
|
+
return state;
|
|
311
|
+
}
|
|
312
|
+
state.output = utils.wrapOutput(output, state, options);
|
|
313
|
+
return state;
|
|
422
314
|
}
|
|
423
315
|
|
|
424
316
|
/**
|
|
425
|
-
*
|
|
317
|
+
* Tokenize input until we reach end-of-string
|
|
426
318
|
*/
|
|
427
319
|
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
if (
|
|
431
|
-
|
|
432
|
-
type: 'text',
|
|
433
|
-
value
|
|
434
|
-
});
|
|
320
|
+
while (!eos()) {
|
|
321
|
+
value = advance();
|
|
322
|
+
if (value === '\u0000') {
|
|
323
|
+
continue;
|
|
435
324
|
}
|
|
436
|
-
continue;
|
|
437
|
-
}
|
|
438
325
|
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
326
|
+
/**
|
|
327
|
+
* Escaped characters
|
|
328
|
+
*/
|
|
442
329
|
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
330
|
+
if (value === '\\') {
|
|
331
|
+
const next = peek();
|
|
332
|
+
if (next === '/' && opts.bash !== true) {
|
|
333
|
+
continue;
|
|
334
|
+
}
|
|
335
|
+
if (next === '.' || next === ';') {
|
|
336
|
+
continue;
|
|
337
|
+
}
|
|
338
|
+
if (!next) {
|
|
339
|
+
value += '\\';
|
|
340
|
+
push({
|
|
341
|
+
type: 'text',
|
|
342
|
+
value
|
|
343
|
+
});
|
|
344
|
+
continue;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
// collapse slashes to reduce potential for exploits
|
|
348
|
+
const match = /^\\+/.exec(remaining());
|
|
349
|
+
let slashes = 0;
|
|
350
|
+
if (match && match[0].length > 2) {
|
|
351
|
+
slashes = match[0].length;
|
|
352
|
+
state.index += slashes;
|
|
353
|
+
if (slashes % 2 !== 0) {
|
|
354
|
+
value += '\\';
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
if (opts.unescape === true) {
|
|
358
|
+
value = advance();
|
|
359
|
+
} else {
|
|
360
|
+
value += advance();
|
|
361
|
+
}
|
|
362
|
+
if (state.brackets === 0) {
|
|
363
|
+
push({
|
|
364
|
+
type: 'text',
|
|
365
|
+
value
|
|
366
|
+
});
|
|
367
|
+
continue;
|
|
368
|
+
}
|
|
454
369
|
}
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* If we're inside a regex character class, continue
|
|
373
|
+
* until we reach the closing bracket.
|
|
374
|
+
*/
|
|
375
|
+
|
|
376
|
+
if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) {
|
|
377
|
+
if (opts.posix !== false && value === ':') {
|
|
378
|
+
const inner = prev.value.slice(1);
|
|
379
|
+
if (inner.includes('[')) {
|
|
380
|
+
prev.posix = true;
|
|
381
|
+
if (inner.includes(':')) {
|
|
382
|
+
const idx = prev.value.lastIndexOf('[');
|
|
383
|
+
const pre = prev.value.slice(0, idx);
|
|
384
|
+
const rest = prev.value.slice(idx + 2);
|
|
385
|
+
const posix = POSIX_REGEX_SOURCE[rest];
|
|
386
|
+
if (posix) {
|
|
387
|
+
prev.value = pre + posix;
|
|
388
|
+
state.backtrack = true;
|
|
389
|
+
advance();
|
|
390
|
+
if (!bos.output && tokens.indexOf(prev) === 1) {
|
|
391
|
+
bos.output = ONE_CHAR;
|
|
392
|
+
}
|
|
393
|
+
continue;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
if (value === '[' && peek() !== ':' || value === '-' && peek() === ']') {
|
|
399
|
+
value = `\\${value}`;
|
|
400
|
+
}
|
|
401
|
+
if (value === ']' && (prev.value === '[' || prev.value === '[^')) {
|
|
402
|
+
value = `\\${value}`;
|
|
403
|
+
}
|
|
404
|
+
if (opts.posix === true && value === '!' && prev.value === '[') {
|
|
405
|
+
value = '^';
|
|
406
|
+
}
|
|
407
|
+
prev.value += value;
|
|
408
|
+
append({
|
|
409
|
+
value
|
|
410
|
+
});
|
|
458
411
|
continue;
|
|
459
412
|
}
|
|
460
|
-
push({
|
|
461
|
-
type: 'paren',
|
|
462
|
-
value,
|
|
463
|
-
output: state.parens ? ')' : '\\)'
|
|
464
|
-
});
|
|
465
|
-
decrement('parens');
|
|
466
|
-
continue;
|
|
467
|
-
}
|
|
468
413
|
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
414
|
+
/**
|
|
415
|
+
* If we're inside a quoted string, continue
|
|
416
|
+
* until we reach the closing double quote.
|
|
417
|
+
*/
|
|
418
|
+
|
|
419
|
+
if (state.quotes === 1 && value !== '"') {
|
|
420
|
+
value = utils.escapeRegex(value);
|
|
421
|
+
prev.value += value;
|
|
422
|
+
append({
|
|
423
|
+
value
|
|
424
|
+
});
|
|
425
|
+
continue;
|
|
426
|
+
}
|
|
472
427
|
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
428
|
+
/**
|
|
429
|
+
* Double quotes
|
|
430
|
+
*/
|
|
431
|
+
|
|
432
|
+
if (value === '"') {
|
|
433
|
+
state.quotes = state.quotes === 1 ? 0 : 1;
|
|
434
|
+
if (opts.keepQuotes === true) {
|
|
435
|
+
push({
|
|
436
|
+
type: 'text',
|
|
437
|
+
value
|
|
438
|
+
});
|
|
477
439
|
}
|
|
478
|
-
|
|
479
|
-
} else {
|
|
480
|
-
increment('brackets');
|
|
440
|
+
continue;
|
|
481
441
|
}
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
if (opts.nobracket === true || prev && prev.type === 'bracket' && prev.value.length === 1) {
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* Parentheses
|
|
445
|
+
*/
|
|
446
|
+
|
|
447
|
+
if (value === '(') {
|
|
448
|
+
increment('parens');
|
|
490
449
|
push({
|
|
491
|
-
type: '
|
|
492
|
-
value
|
|
493
|
-
output: `\\${value}`
|
|
450
|
+
type: 'paren',
|
|
451
|
+
value
|
|
494
452
|
});
|
|
495
453
|
continue;
|
|
496
454
|
}
|
|
497
|
-
if (
|
|
498
|
-
if (opts.strictBrackets === true) {
|
|
499
|
-
throw new SyntaxError(syntaxError('opening', '
|
|
455
|
+
if (value === ')') {
|
|
456
|
+
if (state.parens === 0 && opts.strictBrackets === true) {
|
|
457
|
+
throw new SyntaxError(syntaxError('opening', '('));
|
|
458
|
+
}
|
|
459
|
+
const extglob = extglobs[extglobs.length - 1];
|
|
460
|
+
if (extglob && state.parens === extglob.parens + 1) {
|
|
461
|
+
extglobClose(extglobs.pop());
|
|
462
|
+
continue;
|
|
500
463
|
}
|
|
501
464
|
push({
|
|
502
|
-
type: '
|
|
465
|
+
type: 'paren',
|
|
503
466
|
value,
|
|
504
|
-
output:
|
|
467
|
+
output: state.parens ? ')' : '\\)'
|
|
505
468
|
});
|
|
506
|
-
|
|
507
|
-
}
|
|
508
|
-
decrement('brackets');
|
|
509
|
-
const prevValue = prev.value.slice(1);
|
|
510
|
-
if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) {
|
|
511
|
-
value = `/${value}`;
|
|
512
|
-
}
|
|
513
|
-
prev.value += value;
|
|
514
|
-
append({
|
|
515
|
-
value
|
|
516
|
-
});
|
|
517
|
-
|
|
518
|
-
// when literal brackets are explicitly disabled
|
|
519
|
-
// assume we should match with a regex character class
|
|
520
|
-
if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
|
|
521
|
-
continue;
|
|
522
|
-
}
|
|
523
|
-
const escaped = utils.escapeRegex(prev.value);
|
|
524
|
-
state.output = state.output.slice(0, -prev.value.length);
|
|
525
|
-
|
|
526
|
-
// when literal brackets are explicitly enabled
|
|
527
|
-
// assume we should escape the brackets to match literal characters
|
|
528
|
-
if (opts.literalBrackets === true) {
|
|
529
|
-
state.output += escaped;
|
|
530
|
-
prev.value = escaped;
|
|
469
|
+
decrement('parens');
|
|
531
470
|
continue;
|
|
532
471
|
}
|
|
533
472
|
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
continue;
|
|
538
|
-
}
|
|
473
|
+
/**
|
|
474
|
+
* Square brackets
|
|
475
|
+
*/
|
|
539
476
|
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
output: '(',
|
|
550
|
-
outputIndex: state.output.length,
|
|
551
|
-
tokensIndex: state.tokens.length
|
|
552
|
-
};
|
|
553
|
-
braces.push(open);
|
|
554
|
-
push(open);
|
|
555
|
-
continue;
|
|
556
|
-
}
|
|
557
|
-
if (value === '}') {
|
|
558
|
-
const brace = braces[braces.length - 1];
|
|
559
|
-
if (opts.nobrace === true || !brace) {
|
|
477
|
+
if (value === '[') {
|
|
478
|
+
if (opts.nobracket === true || !remaining().includes(']')) {
|
|
479
|
+
if (opts.nobracket !== true && opts.strictBrackets === true) {
|
|
480
|
+
throw new SyntaxError(syntaxError('closing', ']'));
|
|
481
|
+
}
|
|
482
|
+
value = `\\${value}`;
|
|
483
|
+
} else {
|
|
484
|
+
increment('brackets');
|
|
485
|
+
}
|
|
560
486
|
push({
|
|
561
|
-
type: '
|
|
562
|
-
value
|
|
563
|
-
output: value
|
|
487
|
+
type: 'bracket',
|
|
488
|
+
value
|
|
564
489
|
});
|
|
565
490
|
continue;
|
|
566
491
|
}
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
492
|
+
if (value === ']') {
|
|
493
|
+
if (opts.nobracket === true || prev && prev.type === 'bracket' && prev.value.length === 1) {
|
|
494
|
+
push({
|
|
495
|
+
type: 'text',
|
|
496
|
+
value,
|
|
497
|
+
output: `\\${value}`
|
|
498
|
+
});
|
|
499
|
+
continue;
|
|
500
|
+
}
|
|
501
|
+
if (state.brackets === 0) {
|
|
502
|
+
if (opts.strictBrackets === true) {
|
|
503
|
+
throw new SyntaxError(syntaxError('opening', '['));
|
|
578
504
|
}
|
|
505
|
+
push({
|
|
506
|
+
type: 'text',
|
|
507
|
+
value,
|
|
508
|
+
output: `\\${value}`
|
|
509
|
+
});
|
|
510
|
+
continue;
|
|
579
511
|
}
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
const out = state.output.slice(0, brace.outputIndex);
|
|
585
|
-
const toks = state.tokens.slice(brace.tokensIndex);
|
|
586
|
-
brace.value = brace.output = '\\{';
|
|
587
|
-
value = output = '\\}';
|
|
588
|
-
state.output = out;
|
|
589
|
-
for (const t of toks) {
|
|
590
|
-
state.output += t.output || t.value;
|
|
512
|
+
decrement('brackets');
|
|
513
|
+
const prevValue = prev.value.slice(1);
|
|
514
|
+
if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) {
|
|
515
|
+
value = `/${value}`;
|
|
591
516
|
}
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
output
|
|
597
|
-
});
|
|
598
|
-
decrement('braces');
|
|
599
|
-
braces.pop();
|
|
600
|
-
continue;
|
|
601
|
-
}
|
|
517
|
+
prev.value += value;
|
|
518
|
+
append({
|
|
519
|
+
value
|
|
520
|
+
});
|
|
602
521
|
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
522
|
+
// when literal brackets are explicitly disabled
|
|
523
|
+
// assume we should match with a regex character class
|
|
524
|
+
if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
|
|
525
|
+
continue;
|
|
526
|
+
}
|
|
527
|
+
const escaped = utils.escapeRegex(prev.value);
|
|
528
|
+
state.output = state.output.slice(0, -prev.value.length);
|
|
529
|
+
|
|
530
|
+
// when literal brackets are explicitly enabled
|
|
531
|
+
// assume we should escape the brackets to match literal characters
|
|
532
|
+
if (opts.literalBrackets === true) {
|
|
533
|
+
state.output += escaped;
|
|
534
|
+
prev.value = escaped;
|
|
535
|
+
continue;
|
|
536
|
+
}
|
|
606
537
|
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
538
|
+
// when the user specifies nothing, try to match both
|
|
539
|
+
prev.value = `(${capture}${escaped}|${prev.value})`;
|
|
540
|
+
state.output += prev.value;
|
|
541
|
+
continue;
|
|
610
542
|
}
|
|
611
|
-
push({
|
|
612
|
-
type: 'text',
|
|
613
|
-
value
|
|
614
|
-
});
|
|
615
|
-
continue;
|
|
616
|
-
}
|
|
617
543
|
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
544
|
+
/**
|
|
545
|
+
* Braces
|
|
546
|
+
*/
|
|
621
547
|
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
548
|
+
if (value === '{' && opts.nobrace !== true) {
|
|
549
|
+
increment('braces');
|
|
550
|
+
const open = {
|
|
551
|
+
type: 'brace',
|
|
552
|
+
value,
|
|
553
|
+
output: '(',
|
|
554
|
+
outputIndex: state.output.length,
|
|
555
|
+
tokensIndex: state.tokens.length
|
|
556
|
+
};
|
|
557
|
+
braces.push(open);
|
|
558
|
+
push(open);
|
|
559
|
+
continue;
|
|
560
|
+
}
|
|
561
|
+
if (value === '}') {
|
|
562
|
+
const brace = braces[braces.length - 1];
|
|
563
|
+
if (opts.nobrace === true || !brace) {
|
|
564
|
+
push({
|
|
565
|
+
type: 'text',
|
|
566
|
+
value,
|
|
567
|
+
output: value
|
|
568
|
+
});
|
|
569
|
+
continue;
|
|
570
|
+
}
|
|
571
|
+
let output = ')';
|
|
572
|
+
if (brace.dots === true) {
|
|
573
|
+
const arr = tokens.slice();
|
|
574
|
+
const range = [];
|
|
575
|
+
for (let i = arr.length - 1; i >= 0; i--) {
|
|
576
|
+
tokens.pop();
|
|
577
|
+
if (arr[i].type === 'brace') {
|
|
578
|
+
break;
|
|
579
|
+
}
|
|
580
|
+
if (arr[i].type !== 'dots') {
|
|
581
|
+
range.unshift(arr[i].value);
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
output = expandRange(range, opts);
|
|
585
|
+
state.backtrack = true;
|
|
586
|
+
}
|
|
587
|
+
if (brace.comma !== true && brace.dots !== true) {
|
|
588
|
+
const out = state.output.slice(0, brace.outputIndex);
|
|
589
|
+
const toks = state.tokens.slice(brace.tokensIndex);
|
|
590
|
+
brace.value = brace.output = '\\{';
|
|
591
|
+
value = output = '\\}';
|
|
592
|
+
state.output = out;
|
|
593
|
+
for (const t of toks) {
|
|
594
|
+
state.output += t.output || t.value;
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
push({
|
|
598
|
+
type: 'brace',
|
|
599
|
+
value,
|
|
600
|
+
output
|
|
601
|
+
});
|
|
602
|
+
decrement('braces');
|
|
603
|
+
braces.pop();
|
|
604
|
+
continue;
|
|
628
605
|
}
|
|
629
|
-
push({
|
|
630
|
-
type: 'comma',
|
|
631
|
-
value,
|
|
632
|
-
output
|
|
633
|
-
});
|
|
634
|
-
continue;
|
|
635
|
-
}
|
|
636
606
|
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
607
|
+
/**
|
|
608
|
+
* Pipes
|
|
609
|
+
*/
|
|
640
610
|
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
state.output = '';
|
|
650
|
-
tokens.pop();
|
|
651
|
-
prev = bos; // reset "prev" to the first token
|
|
611
|
+
if (value === '|') {
|
|
612
|
+
if (extglobs.length > 0) {
|
|
613
|
+
extglobs[extglobs.length - 1].conditions++;
|
|
614
|
+
}
|
|
615
|
+
push({
|
|
616
|
+
type: 'text',
|
|
617
|
+
value
|
|
618
|
+
});
|
|
652
619
|
continue;
|
|
653
620
|
}
|
|
654
|
-
push({
|
|
655
|
-
type: 'slash',
|
|
656
|
-
value,
|
|
657
|
-
output: SLASH_LITERAL
|
|
658
|
-
});
|
|
659
|
-
continue;
|
|
660
|
-
}
|
|
661
621
|
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
622
|
+
/**
|
|
623
|
+
* Commas
|
|
624
|
+
*/
|
|
665
625
|
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
if (prev.value === '.') prev.output = DOT_LITERAL;
|
|
626
|
+
if (value === ',') {
|
|
627
|
+
let output = value;
|
|
669
628
|
const brace = braces[braces.length - 1];
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
continue;
|
|
675
|
-
}
|
|
676
|
-
if (state.braces + state.parens === 0 && prev.type !== 'bos' && prev.type !== 'slash') {
|
|
629
|
+
if (brace && stack[stack.length - 1] === 'braces') {
|
|
630
|
+
brace.comma = true;
|
|
631
|
+
output = '|';
|
|
632
|
+
}
|
|
677
633
|
push({
|
|
678
|
-
type: '
|
|
634
|
+
type: 'comma',
|
|
679
635
|
value,
|
|
680
|
-
output
|
|
636
|
+
output
|
|
681
637
|
});
|
|
682
638
|
continue;
|
|
683
639
|
}
|
|
684
|
-
push({
|
|
685
|
-
type: 'dot',
|
|
686
|
-
value,
|
|
687
|
-
output: DOT_LITERAL
|
|
688
|
-
});
|
|
689
|
-
continue;
|
|
690
|
-
}
|
|
691
|
-
|
|
692
|
-
/**
|
|
693
|
-
* Question marks
|
|
694
|
-
*/
|
|
695
640
|
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
641
|
+
/**
|
|
642
|
+
* Slashes
|
|
643
|
+
*/
|
|
644
|
+
|
|
645
|
+
if (value === '/') {
|
|
646
|
+
// if the beginning of the glob is "./", advance the start
|
|
647
|
+
// to the current index, and don't add the "./" characters
|
|
648
|
+
// to the state. This greatly simplifies lookbehinds when
|
|
649
|
+
// checking for BOS characters like "!" and "." (not "./")
|
|
650
|
+
if (prev.type === 'dot' && state.index === state.start + 1) {
|
|
651
|
+
state.start = state.index + 1;
|
|
652
|
+
state.consumed = '';
|
|
653
|
+
state.output = '';
|
|
654
|
+
tokens.pop();
|
|
655
|
+
prev = bos; // reset "prev" to the first token
|
|
656
|
+
continue;
|
|
657
|
+
}
|
|
658
|
+
push({
|
|
659
|
+
type: 'slash',
|
|
660
|
+
value,
|
|
661
|
+
output: SLASH_LITERAL
|
|
662
|
+
});
|
|
700
663
|
continue;
|
|
701
664
|
}
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
665
|
+
|
|
666
|
+
/**
|
|
667
|
+
* Dots
|
|
668
|
+
*/
|
|
669
|
+
|
|
670
|
+
if (value === '.') {
|
|
671
|
+
if (state.braces > 0 && prev.type === 'dot') {
|
|
672
|
+
if (prev.value === '.') prev.output = DOT_LITERAL;
|
|
673
|
+
const brace = braces[braces.length - 1];
|
|
674
|
+
prev.type = 'dots';
|
|
675
|
+
prev.output += value;
|
|
676
|
+
prev.value += value;
|
|
677
|
+
brace.dots = true;
|
|
678
|
+
continue;
|
|
707
679
|
}
|
|
708
|
-
if (
|
|
709
|
-
|
|
680
|
+
if (state.braces + state.parens === 0 && prev.type !== 'bos' && prev.type !== 'slash') {
|
|
681
|
+
push({
|
|
682
|
+
type: 'text',
|
|
683
|
+
value,
|
|
684
|
+
output: DOT_LITERAL
|
|
685
|
+
});
|
|
686
|
+
continue;
|
|
710
687
|
}
|
|
711
688
|
push({
|
|
712
|
-
type: '
|
|
689
|
+
type: 'dot',
|
|
713
690
|
value,
|
|
714
|
-
output
|
|
691
|
+
output: DOT_LITERAL
|
|
715
692
|
});
|
|
716
693
|
continue;
|
|
717
694
|
}
|
|
718
|
-
|
|
695
|
+
|
|
696
|
+
/**
|
|
697
|
+
* Question marks
|
|
698
|
+
*/
|
|
699
|
+
|
|
700
|
+
if (value === '?') {
|
|
701
|
+
const isGroup = prev && prev.value === '(';
|
|
702
|
+
if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
|
|
703
|
+
extglobOpen('qmark', value);
|
|
704
|
+
continue;
|
|
705
|
+
}
|
|
706
|
+
if (prev && prev.type === 'paren') {
|
|
707
|
+
const next = peek();
|
|
708
|
+
let output = value;
|
|
709
|
+
if (next === '<' && !utils.supportsLookbehinds()) {
|
|
710
|
+
throw new Error('Node.js v10 or higher is required for regex lookbehinds');
|
|
711
|
+
}
|
|
712
|
+
if (prev.value === '(' && !/[!=<:]/.test(next) || next === '<' && !/<([!=]|\w+>)/.test(remaining())) {
|
|
713
|
+
output = `\\${value}`;
|
|
714
|
+
}
|
|
715
|
+
push({
|
|
716
|
+
type: 'text',
|
|
717
|
+
value,
|
|
718
|
+
output
|
|
719
|
+
});
|
|
720
|
+
continue;
|
|
721
|
+
}
|
|
722
|
+
if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) {
|
|
723
|
+
push({
|
|
724
|
+
type: 'qmark',
|
|
725
|
+
value,
|
|
726
|
+
output: QMARK_NO_DOT
|
|
727
|
+
});
|
|
728
|
+
continue;
|
|
729
|
+
}
|
|
719
730
|
push({
|
|
720
731
|
type: 'qmark',
|
|
721
732
|
value,
|
|
722
|
-
output:
|
|
733
|
+
output: QMARK
|
|
723
734
|
});
|
|
724
735
|
continue;
|
|
725
736
|
}
|
|
726
|
-
push({
|
|
727
|
-
type: 'qmark',
|
|
728
|
-
value,
|
|
729
|
-
output: QMARK
|
|
730
|
-
});
|
|
731
|
-
continue;
|
|
732
|
-
}
|
|
733
737
|
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
738
|
+
/**
|
|
739
|
+
* Exclamation
|
|
740
|
+
*/
|
|
737
741
|
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
+
if (value === '!') {
|
|
743
|
+
if (opts.noextglob !== true && peek() === '(') {
|
|
744
|
+
if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) {
|
|
745
|
+
extglobOpen('negate', value);
|
|
746
|
+
continue;
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
if (opts.nonegate !== true && state.index === 0) {
|
|
750
|
+
negate();
|
|
742
751
|
continue;
|
|
743
752
|
}
|
|
744
753
|
}
|
|
745
|
-
if (opts.nonegate !== true && state.index === 0) {
|
|
746
|
-
negate();
|
|
747
|
-
continue;
|
|
748
|
-
}
|
|
749
|
-
}
|
|
750
754
|
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
755
|
+
/**
|
|
756
|
+
* Plus
|
|
757
|
+
*/
|
|
754
758
|
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
759
|
+
if (value === '+') {
|
|
760
|
+
if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
|
|
761
|
+
extglobOpen('plus', value);
|
|
762
|
+
continue;
|
|
763
|
+
}
|
|
764
|
+
if (prev && prev.value === '(' || opts.regex === false) {
|
|
765
|
+
push({
|
|
766
|
+
type: 'plus',
|
|
767
|
+
value,
|
|
768
|
+
output: PLUS_LITERAL
|
|
769
|
+
});
|
|
770
|
+
continue;
|
|
771
|
+
}
|
|
772
|
+
if (prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace') || state.parens > 0) {
|
|
773
|
+
push({
|
|
774
|
+
type: 'plus',
|
|
775
|
+
value
|
|
776
|
+
});
|
|
777
|
+
continue;
|
|
778
|
+
}
|
|
761
779
|
push({
|
|
762
780
|
type: 'plus',
|
|
763
|
-
value
|
|
764
|
-
output: PLUS_LITERAL
|
|
781
|
+
value: PLUS_LITERAL
|
|
765
782
|
});
|
|
766
783
|
continue;
|
|
767
784
|
}
|
|
768
|
-
|
|
785
|
+
|
|
786
|
+
/**
|
|
787
|
+
* Plain text
|
|
788
|
+
*/
|
|
789
|
+
|
|
790
|
+
if (value === '@') {
|
|
791
|
+
if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
|
|
792
|
+
push({
|
|
793
|
+
type: 'at',
|
|
794
|
+
extglob: true,
|
|
795
|
+
value,
|
|
796
|
+
output: ''
|
|
797
|
+
});
|
|
798
|
+
continue;
|
|
799
|
+
}
|
|
769
800
|
push({
|
|
770
|
-
type: '
|
|
801
|
+
type: 'text',
|
|
771
802
|
value
|
|
772
803
|
});
|
|
773
804
|
continue;
|
|
774
805
|
}
|
|
775
|
-
push({
|
|
776
|
-
type: 'plus',
|
|
777
|
-
value: PLUS_LITERAL
|
|
778
|
-
});
|
|
779
|
-
continue;
|
|
780
|
-
}
|
|
781
806
|
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
807
|
+
/**
|
|
808
|
+
* Plain text
|
|
809
|
+
*/
|
|
785
810
|
|
|
786
|
-
|
|
787
|
-
|
|
811
|
+
if (value !== '*') {
|
|
812
|
+
if (value === '$' || value === '^') {
|
|
813
|
+
value = `\\${value}`;
|
|
814
|
+
}
|
|
815
|
+
const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
|
|
816
|
+
if (match) {
|
|
817
|
+
value += match[0];
|
|
818
|
+
state.index += match[0].length;
|
|
819
|
+
}
|
|
788
820
|
push({
|
|
789
|
-
type: '
|
|
790
|
-
|
|
791
|
-
value,
|
|
792
|
-
output: ''
|
|
821
|
+
type: 'text',
|
|
822
|
+
value
|
|
793
823
|
});
|
|
794
824
|
continue;
|
|
795
825
|
}
|
|
796
|
-
push({
|
|
797
|
-
type: 'text',
|
|
798
|
-
value
|
|
799
|
-
});
|
|
800
|
-
continue;
|
|
801
|
-
}
|
|
802
|
-
|
|
803
|
-
/**
|
|
804
|
-
* Plain text
|
|
805
|
-
*/
|
|
806
|
-
|
|
807
|
-
if (value !== '*') {
|
|
808
|
-
if (value === '$' || value === '^') {
|
|
809
|
-
value = `\\${value}`;
|
|
810
|
-
}
|
|
811
|
-
const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
|
|
812
|
-
if (match) {
|
|
813
|
-
value += match[0];
|
|
814
|
-
state.index += match[0].length;
|
|
815
|
-
}
|
|
816
|
-
push({
|
|
817
|
-
type: 'text',
|
|
818
|
-
value
|
|
819
|
-
});
|
|
820
|
-
continue;
|
|
821
|
-
}
|
|
822
826
|
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
827
|
+
/**
|
|
828
|
+
* Stars
|
|
829
|
+
*/
|
|
826
830
|
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
consume(value);
|
|
835
|
-
continue;
|
|
836
|
-
}
|
|
837
|
-
let rest = remaining();
|
|
838
|
-
if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
|
|
839
|
-
extglobOpen('star', value);
|
|
840
|
-
continue;
|
|
841
|
-
}
|
|
842
|
-
if (prev.type === 'star') {
|
|
843
|
-
if (opts.noglobstar === true) {
|
|
831
|
+
if (prev && (prev.type === 'globstar' || prev.star === true)) {
|
|
832
|
+
prev.type = 'star';
|
|
833
|
+
prev.star = true;
|
|
834
|
+
prev.value += value;
|
|
835
|
+
prev.output = star;
|
|
836
|
+
state.backtrack = true;
|
|
837
|
+
state.globstar = true;
|
|
844
838
|
consume(value);
|
|
845
839
|
continue;
|
|
846
840
|
}
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
const afterStar = before && (before.type === 'star' || before.type === 'globstar');
|
|
851
|
-
if (opts.bash === true && (!isStart || rest[0] && rest[0] !== '/')) {
|
|
852
|
-
push({
|
|
853
|
-
type: 'star',
|
|
854
|
-
value,
|
|
855
|
-
output: ''
|
|
856
|
-
});
|
|
857
|
-
continue;
|
|
858
|
-
}
|
|
859
|
-
const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace');
|
|
860
|
-
const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren');
|
|
861
|
-
if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) {
|
|
862
|
-
push({
|
|
863
|
-
type: 'star',
|
|
864
|
-
value,
|
|
865
|
-
output: ''
|
|
866
|
-
});
|
|
841
|
+
let rest = remaining();
|
|
842
|
+
if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
|
|
843
|
+
extglobOpen('star', value);
|
|
867
844
|
continue;
|
|
868
845
|
}
|
|
846
|
+
if (prev.type === 'star') {
|
|
847
|
+
if (opts.noglobstar === true) {
|
|
848
|
+
consume(value);
|
|
849
|
+
continue;
|
|
850
|
+
}
|
|
851
|
+
const prior = prev.prev;
|
|
852
|
+
const before = prior.prev;
|
|
853
|
+
const isStart = prior.type === 'slash' || prior.type === 'bos';
|
|
854
|
+
const afterStar = before && (before.type === 'star' || before.type === 'globstar');
|
|
855
|
+
if (opts.bash === true && (!isStart || rest[0] && rest[0] !== '/')) {
|
|
856
|
+
push({
|
|
857
|
+
type: 'star',
|
|
858
|
+
value,
|
|
859
|
+
output: ''
|
|
860
|
+
});
|
|
861
|
+
continue;
|
|
862
|
+
}
|
|
863
|
+
const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace');
|
|
864
|
+
const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren');
|
|
865
|
+
if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) {
|
|
866
|
+
push({
|
|
867
|
+
type: 'star',
|
|
868
|
+
value,
|
|
869
|
+
output: ''
|
|
870
|
+
});
|
|
871
|
+
continue;
|
|
872
|
+
}
|
|
869
873
|
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
874
|
+
// strip consecutive `/**/`
|
|
875
|
+
while (rest.slice(0, 3) === '/**') {
|
|
876
|
+
const after = input[state.index + 4];
|
|
877
|
+
if (after && after !== '/') {
|
|
878
|
+
break;
|
|
879
|
+
}
|
|
880
|
+
rest = rest.slice(3);
|
|
881
|
+
consume('/**', 3);
|
|
875
882
|
}
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
883
|
+
if (prior.type === 'bos' && eos()) {
|
|
884
|
+
prev.type = 'globstar';
|
|
885
|
+
prev.value += value;
|
|
886
|
+
prev.output = globstar(opts);
|
|
887
|
+
state.output = prev.output;
|
|
888
|
+
state.globstar = true;
|
|
889
|
+
consume(value);
|
|
890
|
+
continue;
|
|
891
|
+
}
|
|
892
|
+
if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) {
|
|
893
|
+
state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
|
894
|
+
prior.output = `(?:${prior.output}`;
|
|
895
|
+
prev.type = 'globstar';
|
|
896
|
+
prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)');
|
|
897
|
+
prev.value += value;
|
|
898
|
+
state.globstar = true;
|
|
899
|
+
state.output += prior.output + prev.output;
|
|
900
|
+
consume(value);
|
|
901
|
+
continue;
|
|
902
|
+
}
|
|
903
|
+
if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') {
|
|
904
|
+
const end = rest[1] !== void 0 ? '|$' : '';
|
|
905
|
+
state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
|
906
|
+
prior.output = `(?:${prior.output}`;
|
|
907
|
+
prev.type = 'globstar';
|
|
908
|
+
prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
|
|
909
|
+
prev.value += value;
|
|
910
|
+
state.output += prior.output + prev.output;
|
|
911
|
+
state.globstar = true;
|
|
912
|
+
consume(value + advance());
|
|
913
|
+
push({
|
|
914
|
+
type: 'slash',
|
|
915
|
+
value: '/',
|
|
916
|
+
output: ''
|
|
917
|
+
});
|
|
918
|
+
continue;
|
|
919
|
+
}
|
|
920
|
+
if (prior.type === 'bos' && rest[0] === '/') {
|
|
921
|
+
prev.type = 'globstar';
|
|
922
|
+
prev.value += value;
|
|
923
|
+
prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
|
|
924
|
+
state.output = prev.output;
|
|
925
|
+
state.globstar = true;
|
|
926
|
+
consume(value + advance());
|
|
927
|
+
push({
|
|
928
|
+
type: 'slash',
|
|
929
|
+
value: '/',
|
|
930
|
+
output: ''
|
|
931
|
+
});
|
|
932
|
+
continue;
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
// remove single star from output
|
|
936
|
+
state.output = state.output.slice(0, -prev.output.length);
|
|
937
|
+
|
|
938
|
+
// reset previous token to globstar
|
|
880
939
|
prev.type = 'globstar';
|
|
881
|
-
prev.value += value;
|
|
882
940
|
prev.output = globstar(opts);
|
|
883
|
-
state.output = prev.output;
|
|
884
|
-
state.globstar = true;
|
|
885
|
-
consume(value);
|
|
886
|
-
continue;
|
|
887
|
-
}
|
|
888
|
-
if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) {
|
|
889
|
-
state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
|
890
|
-
prior.output = `(?:${prior.output}`;
|
|
891
|
-
prev.type = 'globstar';
|
|
892
|
-
prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)');
|
|
893
941
|
prev.value += value;
|
|
942
|
+
|
|
943
|
+
// reset output with globstar
|
|
944
|
+
state.output += prev.output;
|
|
894
945
|
state.globstar = true;
|
|
895
|
-
state.output += prior.output + prev.output;
|
|
896
946
|
consume(value);
|
|
897
947
|
continue;
|
|
898
948
|
}
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
push(
|
|
910
|
-
type: 'slash',
|
|
911
|
-
value: '/',
|
|
912
|
-
output: ''
|
|
913
|
-
});
|
|
949
|
+
const token = {
|
|
950
|
+
type: 'star',
|
|
951
|
+
value,
|
|
952
|
+
output: star
|
|
953
|
+
};
|
|
954
|
+
if (opts.bash === true) {
|
|
955
|
+
token.output = '.*?';
|
|
956
|
+
if (prev.type === 'bos' || prev.type === 'slash') {
|
|
957
|
+
token.output = nodot + token.output;
|
|
958
|
+
}
|
|
959
|
+
push(token);
|
|
914
960
|
continue;
|
|
915
961
|
}
|
|
916
|
-
if (
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
|
|
920
|
-
state.output = prev.output;
|
|
921
|
-
state.globstar = true;
|
|
922
|
-
consume(value + advance());
|
|
923
|
-
push({
|
|
924
|
-
type: 'slash',
|
|
925
|
-
value: '/',
|
|
926
|
-
output: ''
|
|
927
|
-
});
|
|
962
|
+
if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) {
|
|
963
|
+
token.output = value;
|
|
964
|
+
push(token);
|
|
928
965
|
continue;
|
|
929
966
|
}
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
const token = {
|
|
946
|
-
type: 'star',
|
|
947
|
-
value,
|
|
948
|
-
output: star
|
|
949
|
-
};
|
|
950
|
-
if (opts.bash === true) {
|
|
951
|
-
token.output = '.*?';
|
|
952
|
-
if (prev.type === 'bos' || prev.type === 'slash') {
|
|
953
|
-
token.output = nodot + token.output;
|
|
967
|
+
if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') {
|
|
968
|
+
if (prev.type === 'dot') {
|
|
969
|
+
state.output += NO_DOT_SLASH;
|
|
970
|
+
prev.output += NO_DOT_SLASH;
|
|
971
|
+
} else if (opts.dot === true) {
|
|
972
|
+
state.output += NO_DOTS_SLASH;
|
|
973
|
+
prev.output += NO_DOTS_SLASH;
|
|
974
|
+
} else {
|
|
975
|
+
state.output += nodot;
|
|
976
|
+
prev.output += nodot;
|
|
977
|
+
}
|
|
978
|
+
if (peek() !== '*') {
|
|
979
|
+
state.output += ONE_CHAR;
|
|
980
|
+
prev.output += ONE_CHAR;
|
|
981
|
+
}
|
|
954
982
|
}
|
|
955
983
|
push(token);
|
|
956
|
-
continue;
|
|
957
984
|
}
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
985
|
+
while (state.brackets > 0) {
|
|
986
|
+
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']'));
|
|
987
|
+
state.output = utils.escapeLast(state.output, '[');
|
|
988
|
+
decrement('brackets');
|
|
962
989
|
}
|
|
963
|
-
|
|
964
|
-
if (
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
} else if (opts.dot === true) {
|
|
968
|
-
state.output += NO_DOTS_SLASH;
|
|
969
|
-
prev.output += NO_DOTS_SLASH;
|
|
970
|
-
} else {
|
|
971
|
-
state.output += nodot;
|
|
972
|
-
prev.output += nodot;
|
|
973
|
-
}
|
|
974
|
-
if (peek() !== '*') {
|
|
975
|
-
state.output += ONE_CHAR;
|
|
976
|
-
prev.output += ONE_CHAR;
|
|
977
|
-
}
|
|
990
|
+
while (state.parens > 0) {
|
|
991
|
+
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')'));
|
|
992
|
+
state.output = utils.escapeLast(state.output, '(');
|
|
993
|
+
decrement('parens');
|
|
978
994
|
}
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
if
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
output: `${SLASH_LITERAL}?`
|
|
1001
|
-
});
|
|
1002
|
-
}
|
|
1003
|
-
|
|
1004
|
-
// rebuild the output if we had to backtrack at any point
|
|
1005
|
-
if (state.backtrack === true) {
|
|
1006
|
-
state.output = '';
|
|
1007
|
-
for (const token of state.tokens) {
|
|
1008
|
-
state.output += token.output != null ? token.output : token.value;
|
|
1009
|
-
if (token.suffix) {
|
|
1010
|
-
state.output += token.suffix;
|
|
995
|
+
while (state.braces > 0) {
|
|
996
|
+
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}'));
|
|
997
|
+
state.output = utils.escapeLast(state.output, '{');
|
|
998
|
+
decrement('braces');
|
|
999
|
+
}
|
|
1000
|
+
if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) {
|
|
1001
|
+
push({
|
|
1002
|
+
type: 'maybe_slash',
|
|
1003
|
+
value: '',
|
|
1004
|
+
output: `${SLASH_LITERAL}?`
|
|
1005
|
+
});
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
// rebuild the output if we had to backtrack at any point
|
|
1009
|
+
if (state.backtrack === true) {
|
|
1010
|
+
state.output = '';
|
|
1011
|
+
for (const token of state.tokens) {
|
|
1012
|
+
state.output += token.output != null ? token.output : token.value;
|
|
1013
|
+
if (token.suffix) {
|
|
1014
|
+
state.output += token.suffix;
|
|
1015
|
+
}
|
|
1011
1016
|
}
|
|
1012
1017
|
}
|
|
1013
|
-
|
|
1014
|
-
return state;
|
|
1015
|
-
};
|
|
1016
|
-
|
|
1017
|
-
/**
|
|
1018
|
-
* Fast paths for creating regular expressions for common glob patterns.
|
|
1019
|
-
* This can significantly speed up processing and has very little downside
|
|
1020
|
-
* impact when none of the fast paths match.
|
|
1021
|
-
*/
|
|
1022
|
-
|
|
1023
|
-
parse.fastpaths = (input, options) => {
|
|
1024
|
-
const opts = {
|
|
1025
|
-
...options
|
|
1026
|
-
};
|
|
1027
|
-
const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
1028
|
-
const len = input.length;
|
|
1029
|
-
if (len > max) {
|
|
1030
|
-
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
1031
|
-
}
|
|
1032
|
-
input = REPLACEMENTS[input] || input;
|
|
1033
|
-
const win32 = utils.isWindows(options);
|
|
1034
|
-
|
|
1035
|
-
// create constants based on platform, for windows or posix
|
|
1036
|
-
const {
|
|
1037
|
-
DOT_LITERAL,
|
|
1038
|
-
SLASH_LITERAL,
|
|
1039
|
-
ONE_CHAR,
|
|
1040
|
-
DOTS_SLASH,
|
|
1041
|
-
NO_DOT,
|
|
1042
|
-
NO_DOTS,
|
|
1043
|
-
NO_DOTS_SLASH,
|
|
1044
|
-
STAR,
|
|
1045
|
-
START_ANCHOR
|
|
1046
|
-
} = constants.globChars(win32);
|
|
1047
|
-
const nodot = opts.dot ? NO_DOTS : NO_DOT;
|
|
1048
|
-
const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
|
|
1049
|
-
const capture = opts.capture ? '' : '?:';
|
|
1050
|
-
const state = {
|
|
1051
|
-
negated: false,
|
|
1052
|
-
prefix: ''
|
|
1053
|
-
};
|
|
1054
|
-
let star = opts.bash === true ? '.*?' : STAR;
|
|
1055
|
-
if (opts.capture) {
|
|
1056
|
-
star = `(${star})`;
|
|
1057
|
-
}
|
|
1058
|
-
const globstar = opts => {
|
|
1059
|
-
if (opts.noglobstar === true) return star;
|
|
1060
|
-
return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
|
1018
|
+
return state;
|
|
1061
1019
|
};
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1020
|
+
|
|
1021
|
+
/**
|
|
1022
|
+
* Fast paths for creating regular expressions for common glob patterns.
|
|
1023
|
+
* This can significantly speed up processing and has very little downside
|
|
1024
|
+
* impact when none of the fast paths match.
|
|
1025
|
+
*/
|
|
1026
|
+
|
|
1027
|
+
parse.fastpaths = (input, options) => {
|
|
1028
|
+
const opts = {
|
|
1029
|
+
...options
|
|
1030
|
+
};
|
|
1031
|
+
const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
1032
|
+
const len = input.length;
|
|
1033
|
+
if (len > max) {
|
|
1034
|
+
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
1035
|
+
}
|
|
1036
|
+
input = REPLACEMENTS[input] || input;
|
|
1037
|
+
const win32 = utils.isWindows(options);
|
|
1038
|
+
|
|
1039
|
+
// create constants based on platform, for windows or posix
|
|
1040
|
+
const {
|
|
1041
|
+
DOT_LITERAL,
|
|
1042
|
+
SLASH_LITERAL,
|
|
1043
|
+
ONE_CHAR,
|
|
1044
|
+
DOTS_SLASH,
|
|
1045
|
+
NO_DOT,
|
|
1046
|
+
NO_DOTS,
|
|
1047
|
+
NO_DOTS_SLASH,
|
|
1048
|
+
STAR,
|
|
1049
|
+
START_ANCHOR
|
|
1050
|
+
} = constants.globChars(win32);
|
|
1051
|
+
const nodot = opts.dot ? NO_DOTS : NO_DOT;
|
|
1052
|
+
const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
|
|
1053
|
+
const capture = opts.capture ? '' : '?:';
|
|
1054
|
+
const state = {
|
|
1055
|
+
negated: false,
|
|
1056
|
+
prefix: ''
|
|
1057
|
+
};
|
|
1058
|
+
let star = opts.bash === true ? '.*?' : STAR;
|
|
1059
|
+
if (opts.capture) {
|
|
1060
|
+
star = `(${star})`;
|
|
1088
1061
|
}
|
|
1062
|
+
const globstar = opts => {
|
|
1063
|
+
if (opts.noglobstar === true) return star;
|
|
1064
|
+
return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
|
1065
|
+
};
|
|
1066
|
+
const create = str => {
|
|
1067
|
+
switch (str) {
|
|
1068
|
+
case '*':
|
|
1069
|
+
return `${nodot}${ONE_CHAR}${star}`;
|
|
1070
|
+
case '.*':
|
|
1071
|
+
return `${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
1072
|
+
case '*.*':
|
|
1073
|
+
return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
1074
|
+
case '*/*':
|
|
1075
|
+
return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
|
|
1076
|
+
case '**':
|
|
1077
|
+
return nodot + globstar(opts);
|
|
1078
|
+
case '**/*':
|
|
1079
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
|
|
1080
|
+
case '**/*.*':
|
|
1081
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
1082
|
+
case '**/.*':
|
|
1083
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
1084
|
+
default:
|
|
1085
|
+
{
|
|
1086
|
+
const match = /^(.*?)\.(\w+)$/.exec(str);
|
|
1087
|
+
if (!match) return;
|
|
1088
|
+
const source = create(match[1]);
|
|
1089
|
+
if (!source) return;
|
|
1090
|
+
return source + DOT_LITERAL + match[2];
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
};
|
|
1094
|
+
const output = utils.removePrefix(input, state);
|
|
1095
|
+
let source = create(output);
|
|
1096
|
+
if (source && opts.strictSlashes !== true) {
|
|
1097
|
+
source += `${SLASH_LITERAL}?`;
|
|
1098
|
+
}
|
|
1099
|
+
return source;
|
|
1089
1100
|
};
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
return source;
|
|
1096
|
-
};
|
|
1097
|
-
var parse_1 = parse;
|
|
1098
|
-
|
|
1099
|
-
export { parse_1 };
|
|
1101
|
+
parse_1 = parse;
|
|
1102
|
+
return parse_1;
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
export { requireParse as __require };
|