@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
package/build/esnext/node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/parse.esnext
CHANGED
|
@@ -1,772 +1,778 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import './utils.esnext';
|
|
3
|
-
import { __exports as utils$1 } from '../../../../../../_virtual/utils.esnext';
|
|
1
|
+
import { __require as requireConstants } from './constants.esnext';
|
|
2
|
+
import { __require as requireUtils } from './utils.esnext';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
REPLACEMENTS
|
|
13
|
-
} = constants;
|
|
14
|
-
const expandRange = (args, options) => {
|
|
15
|
-
if (typeof options.expandRange === "function") {
|
|
16
|
-
return options.expandRange(...args, options);
|
|
17
|
-
}
|
|
18
|
-
args.sort();
|
|
19
|
-
const value = `[${args.join("-")}]`;
|
|
20
|
-
try {
|
|
21
|
-
new RegExp(value);
|
|
22
|
-
} catch (ex) {
|
|
23
|
-
return args.map((v) => utils.escapeRegex(v)).join("..");
|
|
24
|
-
}
|
|
25
|
-
return value;
|
|
26
|
-
};
|
|
27
|
-
const syntaxError = (type, char) => {
|
|
28
|
-
return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
|
|
29
|
-
};
|
|
30
|
-
const parse = (input, options) => {
|
|
31
|
-
if (typeof input !== "string") {
|
|
32
|
-
throw new TypeError("Expected a string");
|
|
33
|
-
}
|
|
34
|
-
input = REPLACEMENTS[input] || input;
|
|
35
|
-
const opts = { ...options };
|
|
36
|
-
const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
37
|
-
let len = input.length;
|
|
38
|
-
if (len > max) {
|
|
39
|
-
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
40
|
-
}
|
|
41
|
-
const bos = { type: "bos", value: "", output: opts.prepend || "" };
|
|
42
|
-
const tokens = [bos];
|
|
43
|
-
const capture = opts.capture ? "" : "?:";
|
|
44
|
-
const win32 = utils.isWindows(options);
|
|
45
|
-
const PLATFORM_CHARS = constants.globChars(win32);
|
|
46
|
-
const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
|
|
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();
|
|
47
11
|
const {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
12
|
+
MAX_LENGTH,
|
|
13
|
+
POSIX_REGEX_SOURCE,
|
|
14
|
+
REGEX_NON_SPECIAL_CHARS,
|
|
15
|
+
REGEX_SPECIAL_CHARS_BACKREF,
|
|
16
|
+
REPLACEMENTS
|
|
17
|
+
} = constants;
|
|
18
|
+
const expandRange = (args, options) => {
|
|
19
|
+
if (typeof options.expandRange === "function") {
|
|
20
|
+
return options.expandRange(...args, options);
|
|
21
|
+
}
|
|
22
|
+
args.sort();
|
|
23
|
+
const value = `[${args.join("-")}]`;
|
|
24
|
+
try {
|
|
25
|
+
new RegExp(value);
|
|
26
|
+
} catch (ex) {
|
|
27
|
+
return args.map((v) => utils.escapeRegex(v)).join("..");
|
|
28
|
+
}
|
|
29
|
+
return value;
|
|
63
30
|
};
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
let star = opts.bash === true ? globstar(opts) : STAR;
|
|
67
|
-
if (opts.capture) {
|
|
68
|
-
star = `(${star})`;
|
|
69
|
-
}
|
|
70
|
-
if (typeof opts.noext === "boolean") {
|
|
71
|
-
opts.noextglob = opts.noext;
|
|
72
|
-
}
|
|
73
|
-
const state = {
|
|
74
|
-
input,
|
|
75
|
-
index: -1,
|
|
76
|
-
start: 0,
|
|
77
|
-
dot: opts.dot === true,
|
|
78
|
-
consumed: "",
|
|
79
|
-
output: "",
|
|
80
|
-
prefix: "",
|
|
81
|
-
backtrack: false,
|
|
82
|
-
negated: false,
|
|
83
|
-
brackets: 0,
|
|
84
|
-
braces: 0,
|
|
85
|
-
parens: 0,
|
|
86
|
-
quotes: 0,
|
|
87
|
-
globstar: false,
|
|
88
|
-
tokens
|
|
31
|
+
const syntaxError = (type, char) => {
|
|
32
|
+
return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
|
|
89
33
|
};
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
34
|
+
const parse = (input, options) => {
|
|
35
|
+
if (typeof input !== "string") {
|
|
36
|
+
throw new TypeError("Expected a string");
|
|
37
|
+
}
|
|
38
|
+
input = REPLACEMENTS[input] || input;
|
|
39
|
+
const opts = { ...options };
|
|
40
|
+
const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
41
|
+
let len = input.length;
|
|
42
|
+
if (len > max) {
|
|
43
|
+
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
44
|
+
}
|
|
45
|
+
const bos = { type: "bos", value: "", output: opts.prepend || "" };
|
|
46
|
+
const tokens = [bos];
|
|
47
|
+
const capture = opts.capture ? "" : "?:";
|
|
48
|
+
const win32 = utils.isWindows(options);
|
|
49
|
+
const PLATFORM_CHARS = constants.globChars(win32);
|
|
50
|
+
const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
|
|
51
|
+
const {
|
|
52
|
+
DOT_LITERAL,
|
|
53
|
+
PLUS_LITERAL,
|
|
54
|
+
SLASH_LITERAL,
|
|
55
|
+
ONE_CHAR,
|
|
56
|
+
DOTS_SLASH,
|
|
57
|
+
NO_DOT,
|
|
58
|
+
NO_DOT_SLASH,
|
|
59
|
+
NO_DOTS_SLASH,
|
|
60
|
+
QMARK,
|
|
61
|
+
QMARK_NO_DOT,
|
|
62
|
+
STAR,
|
|
63
|
+
START_ANCHOR
|
|
64
|
+
} = PLATFORM_CHARS;
|
|
65
|
+
const globstar = (opts2) => {
|
|
66
|
+
return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
|
67
|
+
};
|
|
68
|
+
const nodot = opts.dot ? "" : NO_DOT;
|
|
69
|
+
const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
|
|
70
|
+
let star = opts.bash === true ? globstar(opts) : STAR;
|
|
71
|
+
if (opts.capture) {
|
|
72
|
+
star = `(${star})`;
|
|
73
|
+
}
|
|
74
|
+
if (typeof opts.noext === "boolean") {
|
|
75
|
+
opts.noextglob = opts.noext;
|
|
76
|
+
}
|
|
77
|
+
const state = {
|
|
78
|
+
input,
|
|
79
|
+
index: -1,
|
|
80
|
+
start: 0,
|
|
81
|
+
dot: opts.dot === true,
|
|
82
|
+
consumed: "",
|
|
83
|
+
output: "",
|
|
84
|
+
prefix: "",
|
|
85
|
+
backtrack: false,
|
|
86
|
+
negated: false,
|
|
87
|
+
brackets: 0,
|
|
88
|
+
braces: 0,
|
|
89
|
+
parens: 0,
|
|
90
|
+
quotes: 0,
|
|
91
|
+
globstar: false,
|
|
92
|
+
tokens
|
|
93
|
+
};
|
|
94
|
+
input = utils.removePrefix(input, state);
|
|
95
|
+
len = input.length;
|
|
96
|
+
const extglobs = [];
|
|
97
|
+
const braces = [];
|
|
98
|
+
const stack = [];
|
|
99
|
+
let prev = bos;
|
|
100
|
+
let value;
|
|
101
|
+
const eos = () => state.index === len - 1;
|
|
102
|
+
const peek = state.peek = (n = 1) => input[state.index + n];
|
|
103
|
+
const advance = state.advance = () => input[++state.index] || "";
|
|
104
|
+
const remaining = () => input.slice(state.index + 1);
|
|
105
|
+
const consume = (value2 = "", num = 0) => {
|
|
106
|
+
state.consumed += value2;
|
|
107
|
+
state.index += num;
|
|
108
|
+
};
|
|
109
|
+
const append = (token) => {
|
|
110
|
+
state.output += token.output != null ? token.output : token.value;
|
|
111
|
+
consume(token.value);
|
|
112
|
+
};
|
|
113
|
+
const negate = () => {
|
|
114
|
+
let count = 1;
|
|
115
|
+
while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) {
|
|
116
|
+
advance();
|
|
117
|
+
state.start++;
|
|
118
|
+
count++;
|
|
119
|
+
}
|
|
120
|
+
if (count % 2 === 0) {
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
state.negated = true;
|
|
113
124
|
state.start++;
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) {
|
|
136
|
-
state.output = state.output.slice(0, -prev.output.length);
|
|
137
|
-
prev.type = "star";
|
|
138
|
-
prev.value = "*";
|
|
139
|
-
prev.output = star;
|
|
140
|
-
state.output += prev.output;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
if (extglobs.length && tok.type !== "paren") {
|
|
144
|
-
extglobs[extglobs.length - 1].inner += tok.value;
|
|
145
|
-
}
|
|
146
|
-
if (tok.value || tok.output) append(tok);
|
|
147
|
-
if (prev && prev.type === "text" && tok.type === "text") {
|
|
148
|
-
prev.value += tok.value;
|
|
149
|
-
prev.output = (prev.output || "") + tok.value;
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
tok.prev = prev;
|
|
153
|
-
tokens.push(tok);
|
|
154
|
-
prev = tok;
|
|
155
|
-
};
|
|
156
|
-
const extglobOpen = (type, value2) => {
|
|
157
|
-
const token = { ...EXTGLOB_CHARS[value2], conditions: 1, inner: "" };
|
|
158
|
-
token.prev = prev;
|
|
159
|
-
token.parens = state.parens;
|
|
160
|
-
token.output = state.output;
|
|
161
|
-
const output = (opts.capture ? "(" : "") + token.open;
|
|
162
|
-
increment("parens");
|
|
163
|
-
push({ type, value: value2, output: state.output ? "" : ONE_CHAR });
|
|
164
|
-
push({ type: "paren", extglob: true, value: advance(), output });
|
|
165
|
-
extglobs.push(token);
|
|
166
|
-
};
|
|
167
|
-
const extglobClose = (token) => {
|
|
168
|
-
let output = token.close + (opts.capture ? ")" : "");
|
|
169
|
-
let rest;
|
|
170
|
-
if (token.type === "negate") {
|
|
171
|
-
let extglobStar = star;
|
|
172
|
-
if (token.inner && token.inner.length > 1 && token.inner.includes("/")) {
|
|
173
|
-
extglobStar = globstar(opts);
|
|
174
|
-
}
|
|
175
|
-
if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
|
|
176
|
-
output = token.close = `)$))${extglobStar}`;
|
|
177
|
-
}
|
|
178
|
-
if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
|
|
179
|
-
const expression = parse(rest, { ...options, fastpaths: false }).output;
|
|
180
|
-
output = token.close = `)${expression})${extglobStar})`;
|
|
181
|
-
}
|
|
182
|
-
if (token.prev.type === "bos") {
|
|
183
|
-
state.negatedExtglob = true;
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
push({ type: "paren", extglob: true, value, output });
|
|
187
|
-
decrement("parens");
|
|
188
|
-
};
|
|
189
|
-
if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
|
|
190
|
-
let backslashes = false;
|
|
191
|
-
let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
|
|
192
|
-
if (first === "\\") {
|
|
193
|
-
backslashes = true;
|
|
194
|
-
return m;
|
|
125
|
+
return true;
|
|
126
|
+
};
|
|
127
|
+
const increment = (type) => {
|
|
128
|
+
state[type]++;
|
|
129
|
+
stack.push(type);
|
|
130
|
+
};
|
|
131
|
+
const decrement = (type) => {
|
|
132
|
+
state[type]--;
|
|
133
|
+
stack.pop();
|
|
134
|
+
};
|
|
135
|
+
const push = (tok) => {
|
|
136
|
+
if (prev.type === "globstar") {
|
|
137
|
+
const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace");
|
|
138
|
+
const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
|
|
139
|
+
if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) {
|
|
140
|
+
state.output = state.output.slice(0, -prev.output.length);
|
|
141
|
+
prev.type = "star";
|
|
142
|
+
prev.value = "*";
|
|
143
|
+
prev.output = star;
|
|
144
|
+
state.output += prev.output;
|
|
145
|
+
}
|
|
195
146
|
}
|
|
196
|
-
if (
|
|
197
|
-
|
|
198
|
-
|
|
147
|
+
if (extglobs.length && tok.type !== "paren") {
|
|
148
|
+
extglobs[extglobs.length - 1].inner += tok.value;
|
|
149
|
+
}
|
|
150
|
+
if (tok.value || tok.output) append(tok);
|
|
151
|
+
if (prev && prev.type === "text" && tok.type === "text") {
|
|
152
|
+
prev.value += tok.value;
|
|
153
|
+
prev.output = (prev.output || "") + tok.value;
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
tok.prev = prev;
|
|
157
|
+
tokens.push(tok);
|
|
158
|
+
prev = tok;
|
|
159
|
+
};
|
|
160
|
+
const extglobOpen = (type, value2) => {
|
|
161
|
+
const token = { ...EXTGLOB_CHARS[value2], conditions: 1, inner: "" };
|
|
162
|
+
token.prev = prev;
|
|
163
|
+
token.parens = state.parens;
|
|
164
|
+
token.output = state.output;
|
|
165
|
+
const output = (opts.capture ? "(" : "") + token.open;
|
|
166
|
+
increment("parens");
|
|
167
|
+
push({ type, value: value2, output: state.output ? "" : ONE_CHAR });
|
|
168
|
+
push({ type: "paren", extglob: true, value: advance(), output });
|
|
169
|
+
extglobs.push(token);
|
|
170
|
+
};
|
|
171
|
+
const extglobClose = (token) => {
|
|
172
|
+
let output = token.close + (opts.capture ? ")" : "");
|
|
173
|
+
let rest;
|
|
174
|
+
if (token.type === "negate") {
|
|
175
|
+
let extglobStar = star;
|
|
176
|
+
if (token.inner && token.inner.length > 1 && token.inner.includes("/")) {
|
|
177
|
+
extglobStar = globstar(opts);
|
|
199
178
|
}
|
|
200
|
-
if (
|
|
201
|
-
|
|
179
|
+
if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
|
|
180
|
+
output = token.close = `)$))${extglobStar}`;
|
|
181
|
+
}
|
|
182
|
+
if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
|
|
183
|
+
const expression = parse(rest, { ...options, fastpaths: false }).output;
|
|
184
|
+
output = token.close = `)${expression})${extglobStar})`;
|
|
185
|
+
}
|
|
186
|
+
if (token.prev.type === "bos") {
|
|
187
|
+
state.negatedExtglob = true;
|
|
202
188
|
}
|
|
203
|
-
return QMARK.repeat(chars.length);
|
|
204
|
-
}
|
|
205
|
-
if (first === ".") {
|
|
206
|
-
return DOT_LITERAL.repeat(chars.length);
|
|
207
189
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
190
|
+
push({ type: "paren", extglob: true, value, output });
|
|
191
|
+
decrement("parens");
|
|
192
|
+
};
|
|
193
|
+
if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
|
|
194
|
+
let backslashes = false;
|
|
195
|
+
let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
|
|
196
|
+
if (first === "\\") {
|
|
197
|
+
backslashes = true;
|
|
198
|
+
return m;
|
|
199
|
+
}
|
|
200
|
+
if (first === "?") {
|
|
201
|
+
if (esc) {
|
|
202
|
+
return esc + first + (rest ? QMARK.repeat(rest.length) : "");
|
|
203
|
+
}
|
|
204
|
+
if (index === 0) {
|
|
205
|
+
return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
|
|
206
|
+
}
|
|
207
|
+
return QMARK.repeat(chars.length);
|
|
208
|
+
}
|
|
209
|
+
if (first === ".") {
|
|
210
|
+
return DOT_LITERAL.repeat(chars.length);
|
|
211
|
+
}
|
|
212
|
+
if (first === "*") {
|
|
213
|
+
if (esc) {
|
|
214
|
+
return esc + first + (rest ? star : "");
|
|
215
|
+
}
|
|
216
|
+
return star;
|
|
217
|
+
}
|
|
218
|
+
return esc ? m : `\\${m}`;
|
|
219
|
+
});
|
|
220
|
+
if (backslashes === true) {
|
|
221
|
+
if (opts.unescape === true) {
|
|
222
|
+
output = output.replace(/\\/g, "");
|
|
223
|
+
} else {
|
|
224
|
+
output = output.replace(/\\+/g, (m) => {
|
|
225
|
+
return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
|
|
226
|
+
});
|
|
211
227
|
}
|
|
212
|
-
return star;
|
|
213
228
|
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
if (opts.unescape === true) {
|
|
218
|
-
output = output.replace(/\\/g, "");
|
|
219
|
-
} else {
|
|
220
|
-
output = output.replace(/\\+/g, (m) => {
|
|
221
|
-
return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
|
|
222
|
-
});
|
|
229
|
+
if (output === input && opts.contains === true) {
|
|
230
|
+
state.output = input;
|
|
231
|
+
return state;
|
|
223
232
|
}
|
|
224
|
-
|
|
225
|
-
if (output === input && opts.contains === true) {
|
|
226
|
-
state.output = input;
|
|
233
|
+
state.output = utils.wrapOutput(output, state, options);
|
|
227
234
|
return state;
|
|
228
235
|
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
while (!eos()) {
|
|
233
|
-
value = advance();
|
|
234
|
-
if (value === "\0") {
|
|
235
|
-
continue;
|
|
236
|
-
}
|
|
237
|
-
if (value === "\\") {
|
|
238
|
-
const next = peek();
|
|
239
|
-
if (next === "/" && opts.bash !== true) {
|
|
240
|
-
continue;
|
|
241
|
-
}
|
|
242
|
-
if (next === "." || next === ";") {
|
|
236
|
+
while (!eos()) {
|
|
237
|
+
value = advance();
|
|
238
|
+
if (value === "\0") {
|
|
243
239
|
continue;
|
|
244
240
|
}
|
|
245
|
-
if (
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
state.index += slashes;
|
|
255
|
-
if (slashes % 2 !== 0) {
|
|
241
|
+
if (value === "\\") {
|
|
242
|
+
const next = peek();
|
|
243
|
+
if (next === "/" && opts.bash !== true) {
|
|
244
|
+
continue;
|
|
245
|
+
}
|
|
246
|
+
if (next === "." || next === ";") {
|
|
247
|
+
continue;
|
|
248
|
+
}
|
|
249
|
+
if (!next) {
|
|
256
250
|
value += "\\";
|
|
251
|
+
push({ type: "text", value });
|
|
252
|
+
continue;
|
|
253
|
+
}
|
|
254
|
+
const match = /^\\+/.exec(remaining());
|
|
255
|
+
let slashes = 0;
|
|
256
|
+
if (match && match[0].length > 2) {
|
|
257
|
+
slashes = match[0].length;
|
|
258
|
+
state.index += slashes;
|
|
259
|
+
if (slashes % 2 !== 0) {
|
|
260
|
+
value += "\\";
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
if (opts.unescape === true) {
|
|
264
|
+
value = advance();
|
|
265
|
+
} else {
|
|
266
|
+
value += advance();
|
|
267
|
+
}
|
|
268
|
+
if (state.brackets === 0) {
|
|
269
|
+
push({ type: "text", value });
|
|
270
|
+
continue;
|
|
257
271
|
}
|
|
258
272
|
}
|
|
259
|
-
if (
|
|
260
|
-
value
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
const rest2 = prev.value.slice(idx + 2);
|
|
278
|
-
const posix = POSIX_REGEX_SOURCE[rest2];
|
|
279
|
-
if (posix) {
|
|
280
|
-
prev.value = pre + posix;
|
|
281
|
-
state.backtrack = true;
|
|
282
|
-
advance();
|
|
283
|
-
if (!bos.output && tokens.indexOf(prev) === 1) {
|
|
284
|
-
bos.output = ONE_CHAR;
|
|
273
|
+
if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
|
|
274
|
+
if (opts.posix !== false && value === ":") {
|
|
275
|
+
const inner = prev.value.slice(1);
|
|
276
|
+
if (inner.includes("[")) {
|
|
277
|
+
prev.posix = true;
|
|
278
|
+
if (inner.includes(":")) {
|
|
279
|
+
const idx = prev.value.lastIndexOf("[");
|
|
280
|
+
const pre = prev.value.slice(0, idx);
|
|
281
|
+
const rest2 = prev.value.slice(idx + 2);
|
|
282
|
+
const posix = POSIX_REGEX_SOURCE[rest2];
|
|
283
|
+
if (posix) {
|
|
284
|
+
prev.value = pre + posix;
|
|
285
|
+
state.backtrack = true;
|
|
286
|
+
advance();
|
|
287
|
+
if (!bos.output && tokens.indexOf(prev) === 1) {
|
|
288
|
+
bos.output = ONE_CHAR;
|
|
289
|
+
}
|
|
290
|
+
continue;
|
|
285
291
|
}
|
|
286
|
-
continue;
|
|
287
292
|
}
|
|
288
293
|
}
|
|
289
294
|
}
|
|
295
|
+
if (value === "[" && peek() !== ":" || value === "-" && peek() === "]") {
|
|
296
|
+
value = `\\${value}`;
|
|
297
|
+
}
|
|
298
|
+
if (value === "]" && (prev.value === "[" || prev.value === "[^")) {
|
|
299
|
+
value = `\\${value}`;
|
|
300
|
+
}
|
|
301
|
+
if (opts.posix === true && value === "!" && prev.value === "[") {
|
|
302
|
+
value = "^";
|
|
303
|
+
}
|
|
304
|
+
prev.value += value;
|
|
305
|
+
append({ value });
|
|
306
|
+
continue;
|
|
290
307
|
}
|
|
291
|
-
if (
|
|
292
|
-
value =
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
value = `\\${value}`;
|
|
296
|
-
}
|
|
297
|
-
if (opts.posix === true && value === "!" && prev.value === "[") {
|
|
298
|
-
value = "^";
|
|
299
|
-
}
|
|
300
|
-
prev.value += value;
|
|
301
|
-
append({ value });
|
|
302
|
-
continue;
|
|
303
|
-
}
|
|
304
|
-
if (state.quotes === 1 && value !== '"') {
|
|
305
|
-
value = utils.escapeRegex(value);
|
|
306
|
-
prev.value += value;
|
|
307
|
-
append({ value });
|
|
308
|
-
continue;
|
|
309
|
-
}
|
|
310
|
-
if (value === '"') {
|
|
311
|
-
state.quotes = state.quotes === 1 ? 0 : 1;
|
|
312
|
-
if (opts.keepQuotes === true) {
|
|
313
|
-
push({ type: "text", value });
|
|
314
|
-
}
|
|
315
|
-
continue;
|
|
316
|
-
}
|
|
317
|
-
if (value === "(") {
|
|
318
|
-
increment("parens");
|
|
319
|
-
push({ type: "paren", value });
|
|
320
|
-
continue;
|
|
321
|
-
}
|
|
322
|
-
if (value === ")") {
|
|
323
|
-
if (state.parens === 0 && opts.strictBrackets === true) {
|
|
324
|
-
throw new SyntaxError(syntaxError("opening", "("));
|
|
325
|
-
}
|
|
326
|
-
const extglob = extglobs[extglobs.length - 1];
|
|
327
|
-
if (extglob && state.parens === extglob.parens + 1) {
|
|
328
|
-
extglobClose(extglobs.pop());
|
|
308
|
+
if (state.quotes === 1 && value !== '"') {
|
|
309
|
+
value = utils.escapeRegex(value);
|
|
310
|
+
prev.value += value;
|
|
311
|
+
append({ value });
|
|
329
312
|
continue;
|
|
330
313
|
}
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
if (value === "[") {
|
|
336
|
-
if (opts.nobracket === true || !remaining().includes("]")) {
|
|
337
|
-
if (opts.nobracket !== true && opts.strictBrackets === true) {
|
|
338
|
-
throw new SyntaxError(syntaxError("closing", "]"));
|
|
314
|
+
if (value === '"') {
|
|
315
|
+
state.quotes = state.quotes === 1 ? 0 : 1;
|
|
316
|
+
if (opts.keepQuotes === true) {
|
|
317
|
+
push({ type: "text", value });
|
|
339
318
|
}
|
|
340
|
-
|
|
341
|
-
} else {
|
|
342
|
-
increment("brackets");
|
|
319
|
+
continue;
|
|
343
320
|
}
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
if (value === "]") {
|
|
348
|
-
if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) {
|
|
349
|
-
push({ type: "text", value, output: `\\${value}` });
|
|
321
|
+
if (value === "(") {
|
|
322
|
+
increment("parens");
|
|
323
|
+
push({ type: "paren", value });
|
|
350
324
|
continue;
|
|
351
325
|
}
|
|
352
|
-
if (
|
|
353
|
-
if (opts.strictBrackets === true) {
|
|
354
|
-
throw new SyntaxError(syntaxError("opening", "
|
|
326
|
+
if (value === ")") {
|
|
327
|
+
if (state.parens === 0 && opts.strictBrackets === true) {
|
|
328
|
+
throw new SyntaxError(syntaxError("opening", "("));
|
|
329
|
+
}
|
|
330
|
+
const extglob = extglobs[extglobs.length - 1];
|
|
331
|
+
if (extglob && state.parens === extglob.parens + 1) {
|
|
332
|
+
extglobClose(extglobs.pop());
|
|
333
|
+
continue;
|
|
355
334
|
}
|
|
356
|
-
push({ type: "
|
|
335
|
+
push({ type: "paren", value, output: state.parens ? ")" : "\\)" });
|
|
336
|
+
decrement("parens");
|
|
357
337
|
continue;
|
|
358
338
|
}
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
339
|
+
if (value === "[") {
|
|
340
|
+
if (opts.nobracket === true || !remaining().includes("]")) {
|
|
341
|
+
if (opts.nobracket !== true && opts.strictBrackets === true) {
|
|
342
|
+
throw new SyntaxError(syntaxError("closing", "]"));
|
|
343
|
+
}
|
|
344
|
+
value = `\\${value}`;
|
|
345
|
+
} else {
|
|
346
|
+
increment("brackets");
|
|
347
|
+
}
|
|
348
|
+
push({ type: "bracket", value });
|
|
367
349
|
continue;
|
|
368
350
|
}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
351
|
+
if (value === "]") {
|
|
352
|
+
if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) {
|
|
353
|
+
push({ type: "text", value, output: `\\${value}` });
|
|
354
|
+
continue;
|
|
355
|
+
}
|
|
356
|
+
if (state.brackets === 0) {
|
|
357
|
+
if (opts.strictBrackets === true) {
|
|
358
|
+
throw new SyntaxError(syntaxError("opening", "["));
|
|
359
|
+
}
|
|
360
|
+
push({ type: "text", value, output: `\\${value}` });
|
|
361
|
+
continue;
|
|
362
|
+
}
|
|
363
|
+
decrement("brackets");
|
|
364
|
+
const prevValue = prev.value.slice(1);
|
|
365
|
+
if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) {
|
|
366
|
+
value = `/${value}`;
|
|
367
|
+
}
|
|
368
|
+
prev.value += value;
|
|
369
|
+
append({ value });
|
|
370
|
+
if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
|
|
371
|
+
continue;
|
|
372
|
+
}
|
|
373
|
+
const escaped = utils.escapeRegex(prev.value);
|
|
374
|
+
state.output = state.output.slice(0, -prev.value.length);
|
|
375
|
+
if (opts.literalBrackets === true) {
|
|
376
|
+
state.output += escaped;
|
|
377
|
+
prev.value = escaped;
|
|
378
|
+
continue;
|
|
379
|
+
}
|
|
380
|
+
prev.value = `(${capture}${escaped}|${prev.value})`;
|
|
381
|
+
state.output += prev.value;
|
|
374
382
|
continue;
|
|
375
383
|
}
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
tokensIndex: state.tokens.length
|
|
388
|
-
};
|
|
389
|
-
braces.push(open);
|
|
390
|
-
push(open);
|
|
391
|
-
continue;
|
|
392
|
-
}
|
|
393
|
-
if (value === "}") {
|
|
394
|
-
const brace = braces[braces.length - 1];
|
|
395
|
-
if (opts.nobrace === true || !brace) {
|
|
396
|
-
push({ type: "text", value, output: value });
|
|
384
|
+
if (value === "{" && opts.nobrace !== true) {
|
|
385
|
+
increment("braces");
|
|
386
|
+
const open = {
|
|
387
|
+
type: "brace",
|
|
388
|
+
value,
|
|
389
|
+
output: "(",
|
|
390
|
+
outputIndex: state.output.length,
|
|
391
|
+
tokensIndex: state.tokens.length
|
|
392
|
+
};
|
|
393
|
+
braces.push(open);
|
|
394
|
+
push(open);
|
|
397
395
|
continue;
|
|
398
396
|
}
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
397
|
+
if (value === "}") {
|
|
398
|
+
const brace = braces[braces.length - 1];
|
|
399
|
+
if (opts.nobrace === true || !brace) {
|
|
400
|
+
push({ type: "text", value, output: value });
|
|
401
|
+
continue;
|
|
402
|
+
}
|
|
403
|
+
let output = ")";
|
|
404
|
+
if (brace.dots === true) {
|
|
405
|
+
const arr = tokens.slice();
|
|
406
|
+
const range = [];
|
|
407
|
+
for (let i = arr.length - 1; i >= 0; i--) {
|
|
408
|
+
tokens.pop();
|
|
409
|
+
if (arr[i].type === "brace") {
|
|
410
|
+
break;
|
|
411
|
+
}
|
|
412
|
+
if (arr[i].type !== "dots") {
|
|
413
|
+
range.unshift(arr[i].value);
|
|
414
|
+
}
|
|
407
415
|
}
|
|
408
|
-
|
|
409
|
-
|
|
416
|
+
output = expandRange(range, opts);
|
|
417
|
+
state.backtrack = true;
|
|
418
|
+
}
|
|
419
|
+
if (brace.comma !== true && brace.dots !== true) {
|
|
420
|
+
const out = state.output.slice(0, brace.outputIndex);
|
|
421
|
+
const toks = state.tokens.slice(brace.tokensIndex);
|
|
422
|
+
brace.value = brace.output = "\\{";
|
|
423
|
+
value = output = "\\}";
|
|
424
|
+
state.output = out;
|
|
425
|
+
for (const t of toks) {
|
|
426
|
+
state.output += t.output || t.value;
|
|
410
427
|
}
|
|
411
428
|
}
|
|
412
|
-
|
|
413
|
-
|
|
429
|
+
push({ type: "brace", value, output });
|
|
430
|
+
decrement("braces");
|
|
431
|
+
braces.pop();
|
|
432
|
+
continue;
|
|
414
433
|
}
|
|
415
|
-
if (
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
brace.value = brace.output = "\\{";
|
|
419
|
-
value = output = "\\}";
|
|
420
|
-
state.output = out;
|
|
421
|
-
for (const t of toks) {
|
|
422
|
-
state.output += t.output || t.value;
|
|
434
|
+
if (value === "|") {
|
|
435
|
+
if (extglobs.length > 0) {
|
|
436
|
+
extglobs[extglobs.length - 1].conditions++;
|
|
423
437
|
}
|
|
424
|
-
|
|
425
|
-
push({ type: "brace", value, output });
|
|
426
|
-
decrement("braces");
|
|
427
|
-
braces.pop();
|
|
428
|
-
continue;
|
|
429
|
-
}
|
|
430
|
-
if (value === "|") {
|
|
431
|
-
if (extglobs.length > 0) {
|
|
432
|
-
extglobs[extglobs.length - 1].conditions++;
|
|
433
|
-
}
|
|
434
|
-
push({ type: "text", value });
|
|
435
|
-
continue;
|
|
436
|
-
}
|
|
437
|
-
if (value === ",") {
|
|
438
|
-
let output = value;
|
|
439
|
-
const brace = braces[braces.length - 1];
|
|
440
|
-
if (brace && stack[stack.length - 1] === "braces") {
|
|
441
|
-
brace.comma = true;
|
|
442
|
-
output = "|";
|
|
443
|
-
}
|
|
444
|
-
push({ type: "comma", value, output });
|
|
445
|
-
continue;
|
|
446
|
-
}
|
|
447
|
-
if (value === "/") {
|
|
448
|
-
if (prev.type === "dot" && state.index === state.start + 1) {
|
|
449
|
-
state.start = state.index + 1;
|
|
450
|
-
state.consumed = "";
|
|
451
|
-
state.output = "";
|
|
452
|
-
tokens.pop();
|
|
453
|
-
prev = bos;
|
|
438
|
+
push({ type: "text", value });
|
|
454
439
|
continue;
|
|
455
440
|
}
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
}
|
|
459
|
-
if (value === ".") {
|
|
460
|
-
if (state.braces > 0 && prev.type === "dot") {
|
|
461
|
-
if (prev.value === ".") prev.output = DOT_LITERAL;
|
|
441
|
+
if (value === ",") {
|
|
442
|
+
let output = value;
|
|
462
443
|
const brace = braces[braces.length - 1];
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
}
|
|
469
|
-
if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
|
|
470
|
-
push({ type: "text", value, output: DOT_LITERAL });
|
|
444
|
+
if (brace && stack[stack.length - 1] === "braces") {
|
|
445
|
+
brace.comma = true;
|
|
446
|
+
output = "|";
|
|
447
|
+
}
|
|
448
|
+
push({ type: "comma", value, output });
|
|
471
449
|
continue;
|
|
472
450
|
}
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
451
|
+
if (value === "/") {
|
|
452
|
+
if (prev.type === "dot" && state.index === state.start + 1) {
|
|
453
|
+
state.start = state.index + 1;
|
|
454
|
+
state.consumed = "";
|
|
455
|
+
state.output = "";
|
|
456
|
+
tokens.pop();
|
|
457
|
+
prev = bos;
|
|
458
|
+
continue;
|
|
459
|
+
}
|
|
460
|
+
push({ type: "slash", value, output: SLASH_LITERAL });
|
|
480
461
|
continue;
|
|
481
462
|
}
|
|
482
|
-
if (
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
463
|
+
if (value === ".") {
|
|
464
|
+
if (state.braces > 0 && prev.type === "dot") {
|
|
465
|
+
if (prev.value === ".") prev.output = DOT_LITERAL;
|
|
466
|
+
const brace = braces[braces.length - 1];
|
|
467
|
+
prev.type = "dots";
|
|
468
|
+
prev.output += value;
|
|
469
|
+
prev.value += value;
|
|
470
|
+
brace.dots = true;
|
|
471
|
+
continue;
|
|
487
472
|
}
|
|
488
|
-
if (
|
|
489
|
-
output
|
|
473
|
+
if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
|
|
474
|
+
push({ type: "text", value, output: DOT_LITERAL });
|
|
475
|
+
continue;
|
|
490
476
|
}
|
|
491
|
-
push({ type: "
|
|
477
|
+
push({ type: "dot", value, output: DOT_LITERAL });
|
|
492
478
|
continue;
|
|
493
479
|
}
|
|
494
|
-
if (
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
push({ type: "qmark", value, output: QMARK });
|
|
499
|
-
continue;
|
|
500
|
-
}
|
|
501
|
-
if (value === "!") {
|
|
502
|
-
if (opts.noextglob !== true && peek() === "(") {
|
|
503
|
-
if (peek(2) !== "?" || !/[!=<:]/.test(peek(3))) {
|
|
504
|
-
extglobOpen("negate", value);
|
|
480
|
+
if (value === "?") {
|
|
481
|
+
const isGroup = prev && prev.value === "(";
|
|
482
|
+
if (!isGroup && opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
|
|
483
|
+
extglobOpen("qmark", value);
|
|
505
484
|
continue;
|
|
506
485
|
}
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
486
|
+
if (prev && prev.type === "paren") {
|
|
487
|
+
const next = peek();
|
|
488
|
+
let output = value;
|
|
489
|
+
if (next === "<" && !utils.supportsLookbehinds()) {
|
|
490
|
+
throw new Error("Node.js v10 or higher is required for regex lookbehinds");
|
|
491
|
+
}
|
|
492
|
+
if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) {
|
|
493
|
+
output = `\\${value}`;
|
|
494
|
+
}
|
|
495
|
+
push({ type: "text", value, output });
|
|
496
|
+
continue;
|
|
497
|
+
}
|
|
498
|
+
if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) {
|
|
499
|
+
push({ type: "qmark", value, output: QMARK_NO_DOT });
|
|
500
|
+
continue;
|
|
501
|
+
}
|
|
502
|
+
push({ type: "qmark", value, output: QMARK });
|
|
510
503
|
continue;
|
|
511
504
|
}
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
505
|
+
if (value === "!") {
|
|
506
|
+
if (opts.noextglob !== true && peek() === "(") {
|
|
507
|
+
if (peek(2) !== "?" || !/[!=<:]/.test(peek(3))) {
|
|
508
|
+
extglobOpen("negate", value);
|
|
509
|
+
continue;
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
if (opts.nonegate !== true && state.index === 0) {
|
|
513
|
+
negate();
|
|
514
|
+
continue;
|
|
515
|
+
}
|
|
517
516
|
}
|
|
518
|
-
if (
|
|
519
|
-
|
|
517
|
+
if (value === "+") {
|
|
518
|
+
if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
|
|
519
|
+
extglobOpen("plus", value);
|
|
520
|
+
continue;
|
|
521
|
+
}
|
|
522
|
+
if (prev && prev.value === "(" || opts.regex === false) {
|
|
523
|
+
push({ type: "plus", value, output: PLUS_LITERAL });
|
|
524
|
+
continue;
|
|
525
|
+
}
|
|
526
|
+
if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
|
|
527
|
+
push({ type: "plus", value });
|
|
528
|
+
continue;
|
|
529
|
+
}
|
|
530
|
+
push({ type: "plus", value: PLUS_LITERAL });
|
|
520
531
|
continue;
|
|
521
532
|
}
|
|
522
|
-
if (
|
|
523
|
-
|
|
533
|
+
if (value === "@") {
|
|
534
|
+
if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
|
|
535
|
+
push({ type: "at", extglob: true, value, output: "" });
|
|
536
|
+
continue;
|
|
537
|
+
}
|
|
538
|
+
push({ type: "text", value });
|
|
524
539
|
continue;
|
|
525
540
|
}
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
541
|
+
if (value !== "*") {
|
|
542
|
+
if (value === "$" || value === "^") {
|
|
543
|
+
value = `\\${value}`;
|
|
544
|
+
}
|
|
545
|
+
const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
|
|
546
|
+
if (match) {
|
|
547
|
+
value += match[0];
|
|
548
|
+
state.index += match[0].length;
|
|
549
|
+
}
|
|
550
|
+
push({ type: "text", value });
|
|
532
551
|
continue;
|
|
533
552
|
}
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
|
|
542
|
-
if (match) {
|
|
543
|
-
value += match[0];
|
|
544
|
-
state.index += match[0].length;
|
|
545
|
-
}
|
|
546
|
-
push({ type: "text", value });
|
|
547
|
-
continue;
|
|
548
|
-
}
|
|
549
|
-
if (prev && (prev.type === "globstar" || prev.star === true)) {
|
|
550
|
-
prev.type = "star";
|
|
551
|
-
prev.star = true;
|
|
552
|
-
prev.value += value;
|
|
553
|
-
prev.output = star;
|
|
554
|
-
state.backtrack = true;
|
|
555
|
-
state.globstar = true;
|
|
556
|
-
consume(value);
|
|
557
|
-
continue;
|
|
558
|
-
}
|
|
559
|
-
let rest = remaining();
|
|
560
|
-
if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
|
|
561
|
-
extglobOpen("star", value);
|
|
562
|
-
continue;
|
|
563
|
-
}
|
|
564
|
-
if (prev.type === "star") {
|
|
565
|
-
if (opts.noglobstar === true) {
|
|
553
|
+
if (prev && (prev.type === "globstar" || prev.star === true)) {
|
|
554
|
+
prev.type = "star";
|
|
555
|
+
prev.star = true;
|
|
556
|
+
prev.value += value;
|
|
557
|
+
prev.output = star;
|
|
558
|
+
state.backtrack = true;
|
|
559
|
+
state.globstar = true;
|
|
566
560
|
consume(value);
|
|
567
561
|
continue;
|
|
568
562
|
}
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
const afterStar = before && (before.type === "star" || before.type === "globstar");
|
|
573
|
-
if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) {
|
|
574
|
-
push({ type: "star", value, output: "" });
|
|
575
|
-
continue;
|
|
576
|
-
}
|
|
577
|
-
const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace");
|
|
578
|
-
const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
|
|
579
|
-
if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
|
|
580
|
-
push({ type: "star", value, output: "" });
|
|
563
|
+
let rest = remaining();
|
|
564
|
+
if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
|
|
565
|
+
extglobOpen("star", value);
|
|
581
566
|
continue;
|
|
582
567
|
}
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
568
|
+
if (prev.type === "star") {
|
|
569
|
+
if (opts.noglobstar === true) {
|
|
570
|
+
consume(value);
|
|
571
|
+
continue;
|
|
587
572
|
}
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
573
|
+
const prior = prev.prev;
|
|
574
|
+
const before = prior.prev;
|
|
575
|
+
const isStart = prior.type === "slash" || prior.type === "bos";
|
|
576
|
+
const afterStar = before && (before.type === "star" || before.type === "globstar");
|
|
577
|
+
if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) {
|
|
578
|
+
push({ type: "star", value, output: "" });
|
|
579
|
+
continue;
|
|
580
|
+
}
|
|
581
|
+
const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace");
|
|
582
|
+
const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
|
|
583
|
+
if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
|
|
584
|
+
push({ type: "star", value, output: "" });
|
|
585
|
+
continue;
|
|
586
|
+
}
|
|
587
|
+
while (rest.slice(0, 3) === "/**") {
|
|
588
|
+
const after = input[state.index + 4];
|
|
589
|
+
if (after && after !== "/") {
|
|
590
|
+
break;
|
|
591
|
+
}
|
|
592
|
+
rest = rest.slice(3);
|
|
593
|
+
consume("/**", 3);
|
|
594
|
+
}
|
|
595
|
+
if (prior.type === "bos" && eos()) {
|
|
596
|
+
prev.type = "globstar";
|
|
597
|
+
prev.value += value;
|
|
598
|
+
prev.output = globstar(opts);
|
|
599
|
+
state.output = prev.output;
|
|
600
|
+
state.globstar = true;
|
|
601
|
+
consume(value);
|
|
602
|
+
continue;
|
|
603
|
+
}
|
|
604
|
+
if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
|
|
605
|
+
state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
|
606
|
+
prior.output = `(?:${prior.output}`;
|
|
607
|
+
prev.type = "globstar";
|
|
608
|
+
prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)");
|
|
609
|
+
prev.value += value;
|
|
610
|
+
state.globstar = true;
|
|
611
|
+
state.output += prior.output + prev.output;
|
|
612
|
+
consume(value);
|
|
613
|
+
continue;
|
|
614
|
+
}
|
|
615
|
+
if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
|
|
616
|
+
const end = rest[1] !== void 0 ? "|$" : "";
|
|
617
|
+
state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
|
618
|
+
prior.output = `(?:${prior.output}`;
|
|
619
|
+
prev.type = "globstar";
|
|
620
|
+
prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
|
|
621
|
+
prev.value += value;
|
|
622
|
+
state.output += prior.output + prev.output;
|
|
623
|
+
state.globstar = true;
|
|
624
|
+
consume(value + advance());
|
|
625
|
+
push({ type: "slash", value: "/", output: "" });
|
|
626
|
+
continue;
|
|
627
|
+
}
|
|
628
|
+
if (prior.type === "bos" && rest[0] === "/") {
|
|
629
|
+
prev.type = "globstar";
|
|
630
|
+
prev.value += value;
|
|
631
|
+
prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
|
|
632
|
+
state.output = prev.output;
|
|
633
|
+
state.globstar = true;
|
|
634
|
+
consume(value + advance());
|
|
635
|
+
push({ type: "slash", value: "/", output: "" });
|
|
636
|
+
continue;
|
|
637
|
+
}
|
|
638
|
+
state.output = state.output.slice(0, -prev.output.length);
|
|
592
639
|
prev.type = "globstar";
|
|
593
|
-
prev.value += value;
|
|
594
640
|
prev.output = globstar(opts);
|
|
595
|
-
state.output = prev.output;
|
|
596
|
-
state.globstar = true;
|
|
597
|
-
consume(value);
|
|
598
|
-
continue;
|
|
599
|
-
}
|
|
600
|
-
if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
|
|
601
|
-
state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
|
602
|
-
prior.output = `(?:${prior.output}`;
|
|
603
|
-
prev.type = "globstar";
|
|
604
|
-
prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)");
|
|
605
641
|
prev.value += value;
|
|
642
|
+
state.output += prev.output;
|
|
606
643
|
state.globstar = true;
|
|
607
|
-
state.output += prior.output + prev.output;
|
|
608
644
|
consume(value);
|
|
609
645
|
continue;
|
|
610
646
|
}
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
state.output += prior.output + prev.output;
|
|
619
|
-
state.globstar = true;
|
|
620
|
-
consume(value + advance());
|
|
621
|
-
push({ type: "slash", value: "/", output: "" });
|
|
647
|
+
const token = { type: "star", value, output: star };
|
|
648
|
+
if (opts.bash === true) {
|
|
649
|
+
token.output = ".*?";
|
|
650
|
+
if (prev.type === "bos" || prev.type === "slash") {
|
|
651
|
+
token.output = nodot + token.output;
|
|
652
|
+
}
|
|
653
|
+
push(token);
|
|
622
654
|
continue;
|
|
623
655
|
}
|
|
624
|
-
if (
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
|
|
628
|
-
state.output = prev.output;
|
|
629
|
-
state.globstar = true;
|
|
630
|
-
consume(value + advance());
|
|
631
|
-
push({ type: "slash", value: "/", output: "" });
|
|
656
|
+
if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) {
|
|
657
|
+
token.output = value;
|
|
658
|
+
push(token);
|
|
632
659
|
continue;
|
|
633
660
|
}
|
|
634
|
-
state.
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
661
|
+
if (state.index === state.start || prev.type === "slash" || prev.type === "dot") {
|
|
662
|
+
if (prev.type === "dot") {
|
|
663
|
+
state.output += NO_DOT_SLASH;
|
|
664
|
+
prev.output += NO_DOT_SLASH;
|
|
665
|
+
} else if (opts.dot === true) {
|
|
666
|
+
state.output += NO_DOTS_SLASH;
|
|
667
|
+
prev.output += NO_DOTS_SLASH;
|
|
668
|
+
} else {
|
|
669
|
+
state.output += nodot;
|
|
670
|
+
prev.output += nodot;
|
|
671
|
+
}
|
|
672
|
+
if (peek() !== "*") {
|
|
673
|
+
state.output += ONE_CHAR;
|
|
674
|
+
prev.output += ONE_CHAR;
|
|
675
|
+
}
|
|
648
676
|
}
|
|
649
677
|
push(token);
|
|
650
|
-
continue;
|
|
651
678
|
}
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
679
|
+
while (state.brackets > 0) {
|
|
680
|
+
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "]"));
|
|
681
|
+
state.output = utils.escapeLast(state.output, "[");
|
|
682
|
+
decrement("brackets");
|
|
656
683
|
}
|
|
657
|
-
|
|
658
|
-
if (
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
} else if (opts.dot === true) {
|
|
662
|
-
state.output += NO_DOTS_SLASH;
|
|
663
|
-
prev.output += NO_DOTS_SLASH;
|
|
664
|
-
} else {
|
|
665
|
-
state.output += nodot;
|
|
666
|
-
prev.output += nodot;
|
|
667
|
-
}
|
|
668
|
-
if (peek() !== "*") {
|
|
669
|
-
state.output += ONE_CHAR;
|
|
670
|
-
prev.output += ONE_CHAR;
|
|
671
|
-
}
|
|
684
|
+
while (state.parens > 0) {
|
|
685
|
+
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", ")"));
|
|
686
|
+
state.output = utils.escapeLast(state.output, "(");
|
|
687
|
+
decrement("parens");
|
|
672
688
|
}
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
if (
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
decrement("braces");
|
|
689
|
-
}
|
|
690
|
-
if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) {
|
|
691
|
-
push({ type: "maybe_slash", value: "", output: `${SLASH_LITERAL}?` });
|
|
692
|
-
}
|
|
693
|
-
if (state.backtrack === true) {
|
|
694
|
-
state.output = "";
|
|
695
|
-
for (const token of state.tokens) {
|
|
696
|
-
state.output += token.output != null ? token.output : token.value;
|
|
697
|
-
if (token.suffix) {
|
|
698
|
-
state.output += token.suffix;
|
|
689
|
+
while (state.braces > 0) {
|
|
690
|
+
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "}"));
|
|
691
|
+
state.output = utils.escapeLast(state.output, "{");
|
|
692
|
+
decrement("braces");
|
|
693
|
+
}
|
|
694
|
+
if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) {
|
|
695
|
+
push({ type: "maybe_slash", value: "", output: `${SLASH_LITERAL}?` });
|
|
696
|
+
}
|
|
697
|
+
if (state.backtrack === true) {
|
|
698
|
+
state.output = "";
|
|
699
|
+
for (const token of state.tokens) {
|
|
700
|
+
state.output += token.output != null ? token.output : token.value;
|
|
701
|
+
if (token.suffix) {
|
|
702
|
+
state.output += token.suffix;
|
|
703
|
+
}
|
|
699
704
|
}
|
|
700
705
|
}
|
|
701
|
-
|
|
702
|
-
return state;
|
|
703
|
-
};
|
|
704
|
-
parse.fastpaths = (input, options) => {
|
|
705
|
-
const opts = { ...options };
|
|
706
|
-
const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
707
|
-
const len = input.length;
|
|
708
|
-
if (len > max) {
|
|
709
|
-
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
710
|
-
}
|
|
711
|
-
input = REPLACEMENTS[input] || input;
|
|
712
|
-
const win32 = utils.isWindows(options);
|
|
713
|
-
const {
|
|
714
|
-
DOT_LITERAL,
|
|
715
|
-
SLASH_LITERAL,
|
|
716
|
-
ONE_CHAR,
|
|
717
|
-
DOTS_SLASH,
|
|
718
|
-
NO_DOT,
|
|
719
|
-
NO_DOTS,
|
|
720
|
-
NO_DOTS_SLASH,
|
|
721
|
-
STAR,
|
|
722
|
-
START_ANCHOR
|
|
723
|
-
} = constants.globChars(win32);
|
|
724
|
-
const nodot = opts.dot ? NO_DOTS : NO_DOT;
|
|
725
|
-
const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
|
|
726
|
-
const capture = opts.capture ? "" : "?:";
|
|
727
|
-
const state = { negated: false, prefix: "" };
|
|
728
|
-
let star = opts.bash === true ? ".*?" : STAR;
|
|
729
|
-
if (opts.capture) {
|
|
730
|
-
star = `(${star})`;
|
|
731
|
-
}
|
|
732
|
-
const globstar = (opts2) => {
|
|
733
|
-
if (opts2.noglobstar === true) return star;
|
|
734
|
-
return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
|
706
|
+
return state;
|
|
735
707
|
};
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
708
|
+
parse.fastpaths = (input, options) => {
|
|
709
|
+
const opts = { ...options };
|
|
710
|
+
const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
711
|
+
const len = input.length;
|
|
712
|
+
if (len > max) {
|
|
713
|
+
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
714
|
+
}
|
|
715
|
+
input = REPLACEMENTS[input] || input;
|
|
716
|
+
const win32 = utils.isWindows(options);
|
|
717
|
+
const {
|
|
718
|
+
DOT_LITERAL,
|
|
719
|
+
SLASH_LITERAL,
|
|
720
|
+
ONE_CHAR,
|
|
721
|
+
DOTS_SLASH,
|
|
722
|
+
NO_DOT,
|
|
723
|
+
NO_DOTS,
|
|
724
|
+
NO_DOTS_SLASH,
|
|
725
|
+
STAR,
|
|
726
|
+
START_ANCHOR
|
|
727
|
+
} = constants.globChars(win32);
|
|
728
|
+
const nodot = opts.dot ? NO_DOTS : NO_DOT;
|
|
729
|
+
const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
|
|
730
|
+
const capture = opts.capture ? "" : "?:";
|
|
731
|
+
const state = { negated: false, prefix: "" };
|
|
732
|
+
let star = opts.bash === true ? ".*?" : STAR;
|
|
733
|
+
if (opts.capture) {
|
|
734
|
+
star = `(${star})`;
|
|
735
|
+
}
|
|
736
|
+
const globstar = (opts2) => {
|
|
737
|
+
if (opts2.noglobstar === true) return star;
|
|
738
|
+
return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
|
739
|
+
};
|
|
740
|
+
const create = (str) => {
|
|
741
|
+
switch (str) {
|
|
742
|
+
case "*":
|
|
743
|
+
return `${nodot}${ONE_CHAR}${star}`;
|
|
744
|
+
case ".*":
|
|
745
|
+
return `${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
746
|
+
case "*.*":
|
|
747
|
+
return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
748
|
+
case "*/*":
|
|
749
|
+
return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
|
|
750
|
+
case "**":
|
|
751
|
+
return nodot + globstar(opts);
|
|
752
|
+
case "**/*":
|
|
753
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
|
|
754
|
+
case "**/*.*":
|
|
755
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
756
|
+
case "**/.*":
|
|
757
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
758
|
+
default: {
|
|
759
|
+
const match = /^(.*?)\.(\w+)$/.exec(str);
|
|
760
|
+
if (!match) return;
|
|
761
|
+
const source2 = create(match[1]);
|
|
762
|
+
if (!source2) return;
|
|
763
|
+
return source2 + DOT_LITERAL + match[2];
|
|
764
|
+
}
|
|
760
765
|
}
|
|
766
|
+
};
|
|
767
|
+
const output = utils.removePrefix(input, state);
|
|
768
|
+
let source = create(output);
|
|
769
|
+
if (source && opts.strictSlashes !== true) {
|
|
770
|
+
source += `${SLASH_LITERAL}?`;
|
|
761
771
|
}
|
|
772
|
+
return source;
|
|
762
773
|
};
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
source += `${SLASH_LITERAL}?`;
|
|
767
|
-
}
|
|
768
|
-
return source;
|
|
769
|
-
};
|
|
770
|
-
var parse_1 = parse;
|
|
774
|
+
parse_1 = parse;
|
|
775
|
+
return parse_1;
|
|
776
|
+
}
|
|
771
777
|
|
|
772
|
-
export {
|
|
778
|
+
export { requireParse as __require };
|