@genai-fi/nanogpt 1.4.1 → 1.6.0
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/dist/{DatasetBuilder-DU1G1OKX.js → DatasetBuilder-DRDW8tcM.js} +85 -86
- package/dist/Generator-BcR_14Cj.js +316 -0
- package/dist/{RealDiv-CSnvtN2E.js → RealDiv-Cl8k3YTx.js} +54 -62
- package/dist/{Reshape-BlylqwWy.js → Reshape-CKxKPKqi.js} +9 -12
- package/dist/Reshape-H5zZRgr9.js +16 -0
- package/dist/RoPECache-dYscFINl.js +722 -0
- package/dist/TeachableLLM.js +29 -34
- package/dist/api/beamer.d.ts +1 -0
- package/dist/api/beamer.js +19 -10
- package/dist/api/responses.js +11 -12
- package/dist/api/training.js +12 -14
- package/dist/axis_util-rF9RnwKE.js +37 -0
- package/dist/backend.js +5 -6
- package/dist/{backend_util-DAV0I34P.js → backend_util-Cpp0Gwlp.js} +180 -185
- package/dist/{binary_op_util-CrYk9LXL.js → binary_op_util-WY9YIl0q.js} +3 -7
- package/dist/broadcast_to-CGvLNiQ0.js +20 -0
- package/dist/checks/appendCache.js +7 -7
- package/dist/checks/attentionMask.js +9 -8
- package/dist/checks/check.js +1 -2
- package/dist/checks/gelu.js +6 -6
- package/dist/checks/index.js +24 -25
- package/dist/checks/matMulGelu.js +7 -7
- package/dist/checks/normRMS.js +14 -12
- package/dist/checks/normRMSGrad.js +9 -8
- package/dist/checks/packUnpack.js +7 -7
- package/dist/checks/qkv.js +1 -34
- package/dist/checks/rope.js +6 -6
- package/dist/checks/weights.js +1 -2
- package/dist/clip_by_value-D-UX9am5.js +13 -0
- package/dist/complex-Cl904TqN.js +13 -0
- package/dist/{complex_util-CkazZsaH.js → complex_util-BBlPAm-s.js} +1 -2
- package/dist/concat-Oip5acVY.js +14 -0
- package/dist/{concat_util-CWzvQQlK.js → concat_util-CY45Hf4F.js} +2 -3
- package/dist/data/docx.js +3 -4
- package/dist/data/pdf.js +11 -14
- package/dist/data/stream.js +1 -2
- package/dist/data/textLoader.js +16 -15
- package/dist/data-CV_i_H6B.js +11 -0
- package/dist/data.js +5 -12
- package/dist/dist-CMMLi-qO.js +2675 -0
- package/dist/{dist-BGVm64AY.js → dist-DeVH1nGn.js} +1465 -1573
- package/dist/{dist-CwK5S7Ls.js → dist-DyL7qSLJ.js} +2664 -2400
- package/dist/dropout16-CA31Ud5a.js +20 -0
- package/dist/dropout_util-SiFMbFXz.js +22 -0
- package/dist/{eventemitter3-D_qV3Lof.js → eventemitter3-wmfmOP_f.js} +2 -3
- package/dist/expand_dims-Dh3Fulyn.js +10 -0
- package/dist/floor-BwjmUb7X.js +8 -0
- package/dist/gather-B5Z1RFt5.js +14 -0
- package/dist/gatherSub-CRUfUzBa.js +22 -0
- package/dist/gelu-Xx9-ohH9.js +25 -0
- package/dist/{gpgpu_math-20tPK8LM.js → gpgpu_math-48m8q3jI.js} +265 -286
- package/dist/inference/Beamer.d.ts +14 -2
- package/dist/inference/Beamer.js +170 -105
- package/dist/inference/Generator.js +1 -259
- package/dist/inference/tokenisePrompt.d.ts +2 -1
- package/dist/inference/tokenisePrompt.js +15 -11
- package/dist/inference/types.d.ts +7 -0
- package/dist/inference/utilities.js +1 -2
- package/dist/{jszip.min-DKa1Rjyn.js → jszip.min-Btv48m44.js} +68 -64
- package/dist/{kernel_funcs_utils-ql8Y8qPn.js → kernel_funcs_utils-BYRpSfV_.js} +39 -42
- package/dist/layers/BaseLayer.js +9 -10
- package/dist/layers/{CausalSelfAttention.d.ts → GQA.d.ts} +8 -3
- package/dist/layers/GQA.js +102 -0
- package/dist/layers/HeadLayer.d.ts +12 -0
- package/dist/layers/HeadLayer.js +28 -0
- package/dist/layers/LoRA.js +17 -20
- package/dist/layers/MHA.d.ts +43 -0
- package/dist/layers/MHA.js +102 -0
- package/dist/layers/MLP.d.ts +5 -1
- package/dist/layers/MLP.js +33 -20
- package/dist/layers/PositionEmbedding.js +14 -13
- package/dist/layers/RMSNorm.d.ts +2 -0
- package/dist/layers/RMSNorm.js +16 -11
- package/dist/layers/RoPECache.js +1 -337
- package/dist/layers/TiedEmbedding.js +15 -14
- package/dist/layers/TransformerBlock.d.ts +4 -10
- package/dist/layers/TransformerBlock.js +29 -30
- package/dist/layers/WeightStore.js +4 -5
- package/dist/layers-CFqEip3s.js +13 -0
- package/dist/layers.d.ts +1 -1
- package/dist/layers.js +4 -12
- package/dist/loader/load.js +27 -24
- package/dist/loader/loadHF.js +3 -3
- package/dist/loader/loadTransformers.js +22 -7
- package/dist/loader/loadZipMeta.js +1 -2
- package/dist/loader/newZipLoad.js +1 -2
- package/dist/loader/oldZipLoad.js +8 -9
- package/dist/loader/save.js +31 -17
- package/dist/loader/types.d.ts +8 -2
- package/dist/main.js +3281 -3463
- package/dist/matMul16-tE26fnhf.js +87 -0
- package/dist/{matMulGelu-CBoqTZM7.js → matMulGelu-ASUWlKqu.js} +33 -33
- package/dist/mat_mul-R9_DWmIT.js +16 -0
- package/dist/models/Llama.d.ts +16 -0
- package/dist/models/Llama.js +88 -0
- package/dist/models/NanoGPTV1.js +53 -54
- package/dist/models/NanoGPTV2.js +48 -49
- package/dist/models/Qwen3.d.ts +16 -0
- package/dist/models/Qwen3.js +88 -0
- package/dist/models/config.d.ts +18 -1
- package/dist/models/config.js +3 -8
- package/dist/models/factory.js +14 -11
- package/dist/models/model.d.ts +5 -7
- package/dist/models/model.js +1 -2
- package/dist/models-DyBpJJwM.js +13 -0
- package/dist/models.js +6 -14
- package/dist/mul16-C7sqgqik.js +41 -0
- package/dist/non_max_suppression_impl-B0H318rb.js +72 -0
- package/dist/not_equal-Bu3O8rh_.js +67 -0
- package/dist/one_hot-TEMPumJj.js +14 -0
- package/dist/ones-DpPXWa6A.js +13 -0
- package/dist/ops/adamAdjust.js +2 -3
- package/dist/ops/adamMoments.js +2 -3
- package/dist/ops/add16.js +2 -3
- package/dist/ops/appendCache.js +9 -8
- package/dist/ops/attentionMask.d.ts +1 -1
- package/dist/ops/attentionMask.js +8 -5
- package/dist/ops/concat16.js +5 -5
- package/dist/ops/cpu/adamAdjust.js +7 -8
- package/dist/ops/cpu/adamMoments.js +5 -5
- package/dist/ops/cpu/appendCache.js +3 -3
- package/dist/ops/cpu/attentionMask.js +12 -8
- package/dist/ops/cpu/fusedSoftmax.js +3 -3
- package/dist/ops/cpu/gatherSub.js +1 -12
- package/dist/ops/cpu/gelu.js +12 -13
- package/dist/ops/cpu/matMul16.js +7 -7
- package/dist/ops/cpu/matMulGelu.js +21 -18
- package/dist/ops/cpu/matMulMul.js +8 -9
- package/dist/ops/cpu/mulDropout.js +8 -9
- package/dist/ops/cpu/normRMS.js +12 -13
- package/dist/ops/cpu/qkv.js +14 -13
- package/dist/ops/cpu/rope.js +11 -8
- package/dist/ops/cpu/scatterSub.js +1 -12
- package/dist/ops/dot16.js +16 -17
- package/dist/ops/dropout.js +9 -8
- package/dist/ops/dropout16.js +1 -22
- package/dist/ops/gatherSub.js +3 -4
- package/dist/ops/gelu.js +1 -2
- package/dist/ops/globalNorm.js +14 -14
- package/dist/ops/grads/add16.js +16 -17
- package/dist/ops/grads/attentionMask.js +6 -7
- package/dist/ops/grads/dropout16.js +1 -1
- package/dist/ops/grads/gelu.js +1 -2
- package/dist/ops/grads/matMul16.js +1 -2
- package/dist/ops/grads/matMulGelu.js +6 -7
- package/dist/ops/grads/mul16.js +1 -1
- package/dist/ops/grads/normRMS.js +8 -9
- package/dist/ops/grads/pack16.js +1 -2
- package/dist/ops/grads/qkv.js +10 -10
- package/dist/ops/grads/rope.js +1 -2
- package/dist/ops/grads/silu.d.ts +2 -0
- package/dist/ops/grads/silu.js +1 -0
- package/dist/ops/grads/softmax16.js +6 -7
- package/dist/ops/grads/unpack16.js +1 -2
- package/dist/ops/grads/utils.js +1 -2
- package/dist/ops/matMul16.d.ts +2 -2
- package/dist/ops/matMul16.js +1 -2
- package/dist/ops/matMulGelu.js +3 -4
- package/dist/ops/matMulMul.js +2 -3
- package/dist/ops/mul16.js +1 -43
- package/dist/ops/mulDrop.js +2 -3
- package/dist/ops/normRMS.d.ts +1 -1
- package/dist/ops/normRMS.js +10 -11
- package/dist/ops/pack16.js +1 -2
- package/dist/ops/qkv.js +2 -3
- package/dist/ops/reshape16.js +11 -11
- package/dist/ops/rope.d.ts +1 -1
- package/dist/ops/rope.js +1 -2
- package/dist/ops/scatterSub.js +3 -4
- package/dist/ops/silu.d.ts +3 -0
- package/dist/ops/silu.js +1 -0
- package/dist/ops/slice16.js +5 -5
- package/dist/ops/softmax16.js +3 -4
- package/dist/ops/sub16.js +3 -4
- package/dist/ops/sum16.js +3 -3
- package/dist/ops/transpose16.js +16 -15
- package/dist/ops/unpack16.js +1 -2
- package/dist/ops/webgl/adamAdjust.js +8 -9
- package/dist/ops/webgl/adamMoments.js +2 -3
- package/dist/ops/webgl/appendCache.js +2 -3
- package/dist/ops/webgl/attentionMask.js +2 -3
- package/dist/ops/webgl/dropout16.js +2 -3
- package/dist/ops/webgl/fusedSoftmax.js +13 -13
- package/dist/ops/webgl/gatherSub.js +2 -3
- package/dist/ops/webgl/gelu.js +11 -12
- package/dist/ops/webgl/log.js +10 -10
- package/dist/ops/webgl/matMul16.js +31 -24
- package/dist/ops/webgl/matMulGelu.js +1 -2
- package/dist/ops/webgl/matMulMul.js +3 -4
- package/dist/ops/webgl/mulDropout.js +2 -3
- package/dist/ops/webgl/normRMS.js +11 -10
- package/dist/ops/webgl/qkv.js +2 -3
- package/dist/ops/webgl/rope.js +10 -9
- package/dist/ops/webgl/scatterSub.js +2 -3
- package/dist/ops/webgpu/adamAdjust.js +13 -14
- package/dist/ops/webgpu/adamMoments.js +13 -14
- package/dist/ops/webgpu/add16.js +3 -4
- package/dist/ops/webgpu/appendCache.js +20 -21
- package/dist/ops/webgpu/attentionMask.js +18 -19
- package/dist/ops/webgpu/attentionMask32_program.js +7 -8
- package/dist/ops/webgpu/clipScale.js +11 -12
- package/dist/ops/webgpu/concat16.js +17 -18
- package/dist/ops/webgpu/dropout16.js +6 -7
- package/dist/ops/webgpu/gatherSub.js +11 -12
- package/dist/ops/webgpu/gelu.js +10 -11
- package/dist/ops/webgpu/index.js +17 -16
- package/dist/ops/webgpu/matMul16.js +74 -57
- package/dist/ops/webgpu/matMul16_program.d.ts +4 -3
- package/dist/ops/webgpu/matMul16_program.js +30 -22
- package/dist/ops/webgpu/mul16.js +3 -4
- package/dist/ops/webgpu/norm2.js +9 -10
- package/dist/ops/webgpu/normRMS.js +13 -14
- package/dist/ops/webgpu/normRMS16_program.d.ts +2 -1
- package/dist/ops/webgpu/normRMS16_program.js +5 -5
- package/dist/ops/webgpu/normRMS32_program.d.ts +2 -1
- package/dist/ops/webgpu/normRMS32_program.js +5 -5
- package/dist/ops/webgpu/normRMSGrad.js +30 -30
- package/dist/ops/webgpu/pack16.js +2 -3
- package/dist/ops/webgpu/pack16_program.js +3 -4
- package/dist/ops/webgpu/qkv.js +10 -11
- package/dist/ops/webgpu/rope.js +113 -49
- package/dist/ops/webgpu/scatterSub.js +12 -13
- package/dist/ops/webgpu/silu.d.ts +14 -0
- package/dist/ops/webgpu/silu.js +117 -0
- package/dist/ops/webgpu/slice16.js +17 -18
- package/dist/ops/webgpu/softmax16.js +9 -9
- package/dist/ops/webgpu/softmax16_program.js +9 -10
- package/dist/ops/webgpu/softmax16_subgroup_program.js +11 -12
- package/dist/ops/webgpu/softmax16grad.js +8 -9
- package/dist/ops/webgpu/sub16.js +3 -4
- package/dist/ops/webgpu/sum16.js +16 -15
- package/dist/ops/webgpu/transpose16.js +13 -12
- package/dist/ops/webgpu/transpose16_program.js +3 -4
- package/dist/ops/webgpu/transpose16_shared_program.js +17 -18
- package/dist/ops/webgpu/unpack16.js +8 -9
- package/dist/ops/webgpu/utils/binary_op.js +20 -21
- package/dist/ops/webgpu/utils/deviceInfo.js +1 -2
- package/dist/ops/webgpu/utils/reductions.js +21 -20
- package/dist/ops-Be5ACU5R.js +13 -0
- package/dist/ops-C1UpdEYM.js +509 -0
- package/dist/{pack16-BhuXNUS7.js → pack16-BHO4t1-M.js} +14 -17
- package/dist/pad-Dy-1IP3A.js +13 -0
- package/dist/patches/webgpu_backend.js +18 -19
- package/dist/patches/webgpu_base.js +2 -3
- package/dist/patches/webgpu_program.js +21 -22
- package/dist/{pdf-Bzuk68Vy.js → pdf-CbnQ75VG.js} +380 -701
- package/dist/{picomatch-BO4HbNfo.js → picomatch--TW6gyBJ.js} +229 -291
- package/dist/qkv-BQfNPucX.js +42 -0
- package/dist/rand_util-_vCY93Uw.js +44 -0
- package/dist/random_normal-DUIT8kyC.js +11 -0
- package/dist/range-CYvQC3fW.js +13 -0
- package/dist/relu-C4XULT8A.js +8 -0
- package/dist/reshape-DJb1jgMt.js +8 -0
- package/dist/resize_nearest_neighbor-DAqcTYUe.js +188 -0
- package/dist/{chunk-CWhphoD1.js → rolldown-runtime-CwxnZyOB.js} +4 -5
- package/dist/rope-JjBVufF_.js +24 -0
- package/dist/scatterSub-BOnqk-uY.js +27 -0
- package/dist/scatter_nd_util-BepMCpLY.js +34 -0
- package/dist/seedrandom-SHEGFK6H.js +282 -0
- package/dist/selu_util-DeOTf-sc.js +27 -0
- package/dist/shared-BIDMUBCs.js +1864 -0
- package/dist/{shared-CfTzpULd.js → shared-CX_iPI5K.js} +2 -3
- package/dist/silu-DsAE2cJ5.js +23 -0
- package/dist/slice-Dlb1FlzG.js +13 -0
- package/dist/{slice_util-Dve4TkDn.js → slice_util-BVgPRoij.js} +3 -4
- package/dist/softmax-Dpav_dWw.js +10 -0
- package/dist/split-DYnT8chz.js +11 -0
- package/dist/squeeze-B3XYGAlg.js +9 -0
- package/dist/stack-Dbbt9mIk.js +10 -0
- package/dist/step-DA-5DNu9.js +348 -0
- package/dist/{stream-BpAwcvHz.js → stream-BBe2apn4.js} +68 -88
- package/dist/sum-C8qNbFNp.js +13 -0
- package/dist/tensor-ALxWZfmz.js +7 -0
- package/dist/tensor1d-BHgkkhTE.js +9 -0
- package/dist/tensor2d-ARItvqVn.js +10 -0
- package/dist/tensor4d-D1zRBipJ.js +10 -0
- package/dist/tfjs_backend-CsXOum0h.js +685 -0
- package/dist/tile-DfyQ0KX-.js +10 -0
- package/dist/tokenise-DbS2Ea-T.js +14 -0
- package/dist/tokenise.js +6 -15
- package/dist/tokeniser/BaseTokeniser.js +5 -9
- package/dist/tokeniser/CharTokeniser.js +1 -2
- package/dist/tokeniser/bpe.js +19 -20
- package/dist/topk-BrU2pkrR.js +19 -0
- package/dist/training/AdamW.js +35 -31
- package/dist/training/BasicTrainer.js +56 -56
- package/dist/training/DatasetBuilder.js +1 -2
- package/dist/training/Evaluator.js +8 -5
- package/dist/training/LRScheduler.js +1 -2
- package/dist/training/PreTrainer.js +7 -8
- package/dist/training/SFTTrainer.js +7 -8
- package/dist/training/configure.js +16 -15
- package/dist/training/factory.js +1 -2
- package/dist/training/loss.js +1 -2
- package/dist/training/orthoGrad.js +2 -3
- package/dist/training/prepareData.js +18 -17
- package/dist/training/sparseCrossEntropy.js +38 -32
- package/dist/training/tasks/TokenStore.js +21 -22
- package/dist/training/tasks/tokenStream.js +1 -2
- package/dist/training/validateOptions.js +1 -2
- package/dist/training/validation.js +1 -2
- package/dist/transpose-BC-M_OoT.js +34 -0
- package/dist/unsorted_segment_sum-BelC7R-q.js +408 -0
- package/dist/utilities/arrayClose.js +5 -4
- package/dist/utilities/arrayShape.js +1 -2
- package/dist/utilities/datasetID.js +1 -2
- package/dist/utilities/dummy.js +15 -15
- package/dist/utilities/float16.js +10 -10
- package/dist/utilities/maxHeap.d.ts +16 -0
- package/dist/utilities/maxHeap.js +54 -0
- package/dist/utilities/multinomialCPU.d.ts +1 -2
- package/dist/utilities/multinomialCPU.js +6 -8
- package/dist/utilities/packed.js +2 -3
- package/dist/utilities/parameters.js +34 -19
- package/dist/utilities/performance.js +2 -3
- package/dist/utilities/profile.js +3 -4
- package/dist/utilities/random.js +1 -2
- package/dist/utilities/safetensors.js +14 -14
- package/dist/utilities/sentences.js +16 -13
- package/dist/utilities/tokenParse.js +1 -2
- package/dist/utilities/tokens.js +5 -6
- package/dist/utilities/topP.d.ts +1 -0
- package/dist/utilities/topP.js +20 -13
- package/dist/utilities/waitForModel.js +1 -2
- package/dist/utilities/weights.js +4 -4
- package/dist/utilities/yielder.js +1 -2
- package/dist/{v4-BK7K-jy_.js → v4-YCkfo8OR.js} +4 -7
- package/dist/{webgpu-IAn9VotJ.js → webgpu-BHX-uBym.js} +156 -163
- package/dist/{webgpu_program-B0PokuRJ.js → webgpu_program-DvkFqRlR.js} +28 -29
- package/dist/{webgpu_util-DfODg6XI.js → webgpu_util-5QTyovaf.js} +2 -3
- package/dist/zeros-hxKGkRfl.js +12 -0
- package/package.json +3 -3
- package/dist/Reshape-CwxdaU8n.js +0 -17
- package/dist/dist-Da20xy8E.js +0 -6375
- package/dist/gelu-B6637MKa.js +0 -27
- package/dist/layers/CausalSelfAttention.js +0 -99
- package/dist/matMul16-DGtlziMn.js +0 -81
- package/dist/rope-C8EAiSGY.js +0 -25
- package/dist/selu_util-B_AFEfoz.js +0 -24
- package/dist/shared-24EoeHJl.js +0 -1314
- package/dist/tfjs_backend-h5weiy1O.js +0 -614
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import { t as e } from "./
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { t as e } from "./rolldown-runtime-CwxnZyOB.js";
|
|
2
|
+
import { rt as t } from "./dist-CMMLi-qO.js";
|
|
3
|
+
// node_modules/@tensorflow/tfjs-core/dist/ops/variable.js
|
|
4
|
+
function n(e, n = !0, r, i) {
|
|
5
|
+
return t.makeVariable(e, n, r, i);
|
|
6
|
+
}
|
|
7
|
+
// node_modules/picomatch/lib/constants.js
|
|
8
|
+
var r = /* @__PURE__ */ e(((e, t) => {
|
|
4
9
|
var n = "\\\\/", r = `[^${n}]`, i = 0, a = "\\.", o = "\\+", s = "\\?", c = "\\/", l = "(?=.)", u = "[^/]", d = `(?:${c}|$)`, f = `(?:^|${c})`, p = `${a}{1,2}${d}`, m = {
|
|
5
10
|
DOT_LITERAL: a,
|
|
6
11
|
PLUS_LITERAL: o,
|
|
@@ -35,7 +40,7 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
35
40
|
};
|
|
36
41
|
t.exports = {
|
|
37
42
|
DEFAULT_MAX_EXTGLOB_RECURSION: i,
|
|
38
|
-
MAX_LENGTH:
|
|
43
|
+
MAX_LENGTH: 65536,
|
|
39
44
|
POSIX_REGEX_SOURCE: {
|
|
40
45
|
__proto__: null,
|
|
41
46
|
alnum: "a-zA-Z0-9",
|
|
@@ -141,15 +146,15 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
141
146
|
return e === !0 ? h : m;
|
|
142
147
|
}
|
|
143
148
|
};
|
|
144
|
-
})),
|
|
145
|
-
var { REGEX_BACKSLASH:
|
|
146
|
-
e.isObject = (e) => typeof e == "object" && !!e && !Array.isArray(e), e.hasRegexChars = (e) => i.test(e), e.isRegexChar = (t) => t.length === 1 && e.hasRegexChars(t), e.escapeRegex = (e) => e.replace(a, "\\$1"), e.toPosixSlashes = (e) => e.replace(
|
|
149
|
+
})), i = /* @__PURE__ */ e(((e) => {
|
|
150
|
+
var { REGEX_BACKSLASH: t, REGEX_REMOVE_BACKSLASH: n, REGEX_SPECIAL_CHARS: i, REGEX_SPECIAL_CHARS_GLOBAL: a } = r();
|
|
151
|
+
e.isObject = (e) => typeof e == "object" && !!e && !Array.isArray(e), e.hasRegexChars = (e) => i.test(e), e.isRegexChar = (t) => t.length === 1 && e.hasRegexChars(t), e.escapeRegex = (e) => e.replace(a, "\\$1"), e.toPosixSlashes = (e) => e.replace(t, "/"), e.isWindows = () => {
|
|
147
152
|
if (typeof navigator < "u" && navigator.platform) {
|
|
148
153
|
let e = navigator.platform.toLowerCase();
|
|
149
154
|
return e === "win32" || e === "windows";
|
|
150
155
|
}
|
|
151
156
|
return typeof process < "u" && process.platform ? process.platform === "win32" : !1;
|
|
152
|
-
}, e.removeBackslashes = (e) => e.replace(
|
|
157
|
+
}, e.removeBackslashes = (e) => e.replace(n, (e) => e === "\\" ? "" : e), e.escapeLast = (t, n, r) => {
|
|
153
158
|
let i = t.lastIndexOf(n, r);
|
|
154
159
|
return i === -1 ? t : t[i - 1] === "\\" ? e.escapeLast(t, n, i - 1) : `${t.slice(0, i)}\\${t.slice(i)}`;
|
|
155
160
|
}, e.removePrefix = (e, t = {}) => {
|
|
@@ -162,128 +167,105 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
162
167
|
let n = e.split(t ? /[\\/]/ : "/"), r = n[n.length - 1];
|
|
163
168
|
return r === "" ? n[n.length - 2] : r;
|
|
164
169
|
};
|
|
165
|
-
})),
|
|
166
|
-
var
|
|
170
|
+
})), a = /* @__PURE__ */ e(((e, t) => {
|
|
171
|
+
var n = i(), { CHAR_ASTERISK: a, CHAR_AT: o, CHAR_BACKWARD_SLASH: s, CHAR_COMMA: c, CHAR_DOT: l, CHAR_EXCLAMATION_MARK: u, CHAR_FORWARD_SLASH: d, CHAR_LEFT_CURLY_BRACE: f, CHAR_LEFT_PARENTHESES: p, CHAR_LEFT_SQUARE_BRACKET: m, CHAR_PLUS: h, CHAR_QUESTION_MARK: g, CHAR_RIGHT_CURLY_BRACE: _, CHAR_RIGHT_PARENTHESES: v, CHAR_RIGHT_SQUARE_BRACKET: y } = r(), b = (e) => e === d || e === s, x = (e) => {
|
|
167
172
|
e.isPrefix !== !0 && (e.depth = e.isGlobstar ? Infinity : 1);
|
|
168
173
|
};
|
|
169
|
-
|
|
170
|
-
let
|
|
174
|
+
t.exports = (e, t) => {
|
|
175
|
+
let r = t || {}, i = e.length - 1, S = r.parts === !0 || r.tokens === !0 || r.scanToEnd === !0, C = [], w = [], T = [], E = e, D = -1, O = 0, k = 0, A = !1, j = !1, M = !1, N = !1, P = !1, F = !1, I = !1, L = !1, R = !1, z = !1, B = 0, V, H, U = {
|
|
171
176
|
value: "",
|
|
172
177
|
depth: 0,
|
|
173
178
|
isGlob: !1
|
|
174
|
-
}, W = () => D >=
|
|
175
|
-
for (; D <
|
|
179
|
+
}, W = () => D >= i, G = () => E.charCodeAt(D + 1), K = () => (V = H, E.charCodeAt(++D));
|
|
180
|
+
for (; D < i;) {
|
|
176
181
|
H = K();
|
|
177
182
|
let e;
|
|
178
|
-
if (H === s)
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
183
|
+
if (H === s) I = U.backslashes = !0, H = K(), H === f && (F = !0);
|
|
184
|
+
else {
|
|
185
|
+
if (F === !0 || H === f) {
|
|
186
|
+
for (B++; W() !== !0 && (H = K());) if (H === s) I = U.backslashes = !0, K();
|
|
187
|
+
else if (H === f) B++;
|
|
188
|
+
else {
|
|
189
|
+
if (F !== !0 && H === l && (H = K()) === l || F !== !0 && H === c) {
|
|
190
|
+
if (A = U.isBrace = !0, M = U.isGlob = !0, z = !0, S === !0) continue;
|
|
191
|
+
break;
|
|
192
|
+
}
|
|
193
|
+
if (H === _ && (B--, B === 0)) {
|
|
194
|
+
F = !1, A = U.isBrace = !0, z = !0;
|
|
195
|
+
break;
|
|
196
|
+
}
|
|
187
197
|
}
|
|
188
|
-
if (
|
|
189
|
-
|
|
198
|
+
if (S === !0) continue;
|
|
199
|
+
break;
|
|
200
|
+
}
|
|
201
|
+
if (H === d) {
|
|
202
|
+
if (C.push(D), w.push(U), U = {
|
|
203
|
+
value: "",
|
|
204
|
+
depth: 0,
|
|
205
|
+
isGlob: !1
|
|
206
|
+
}, z === !0) continue;
|
|
207
|
+
if (V === l && D === O + 1) {
|
|
208
|
+
O += 2;
|
|
190
209
|
continue;
|
|
191
210
|
}
|
|
192
|
-
|
|
193
|
-
|
|
211
|
+
k = D + 1;
|
|
212
|
+
} else {
|
|
213
|
+
if (r.noext !== !0 && (H === h || H === o || H === a || H === g || H === u) && G() === p) {
|
|
214
|
+
if (M = U.isGlob = !0, N = U.isExtglob = !0, z = !0, H === u && D === O && (R = !0), S === !0) {
|
|
215
|
+
let e = 0;
|
|
216
|
+
for (; W() !== !0 && (H = K());) if (H === s) I = U.backslashes = !0, K();
|
|
217
|
+
else if (H === p) e++;
|
|
218
|
+
else if (H === v && --e === 0) {
|
|
219
|
+
z = !0;
|
|
220
|
+
break;
|
|
221
|
+
}
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
194
224
|
break;
|
|
195
225
|
}
|
|
196
|
-
if (
|
|
197
|
-
if (
|
|
226
|
+
if (H === a) {
|
|
227
|
+
if (V === a && (P = U.isGlobstar = !0), M = U.isGlob = !0, z = !0, S === !0) continue;
|
|
198
228
|
break;
|
|
199
229
|
}
|
|
200
|
-
if (H ===
|
|
201
|
-
|
|
230
|
+
if (H === g) {
|
|
231
|
+
if (M = U.isGlob = !0, z = !0, S === !0) continue;
|
|
202
232
|
break;
|
|
203
233
|
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
if (H === d) {
|
|
209
|
-
if (C.push(D), w.push(U), U = {
|
|
210
|
-
value: "",
|
|
211
|
-
depth: 0,
|
|
212
|
-
isGlob: !1
|
|
213
|
-
}, z === !0) continue;
|
|
214
|
-
if (V === l && D === O + 1) {
|
|
215
|
-
O += 2;
|
|
216
|
-
continue;
|
|
217
|
-
}
|
|
218
|
-
k = D + 1;
|
|
219
|
-
continue;
|
|
220
|
-
}
|
|
221
|
-
if (n.noext !== !0 && (H === h || H === o || H === a || H === g || H === u) && G() === p) {
|
|
222
|
-
if (M = U.isGlob = !0, N = U.isExtglob = !0, z = !0, H === u && D === O && (R = !0), S === !0) {
|
|
223
|
-
for (; W() !== !0 && (H = K());) {
|
|
224
|
-
if (H === s) {
|
|
225
|
-
I = U.backslashes = !0, H = K();
|
|
226
|
-
continue;
|
|
227
|
-
}
|
|
228
|
-
if (H === v) {
|
|
229
|
-
M = U.isGlob = !0, z = !0;
|
|
234
|
+
if (H === m) {
|
|
235
|
+
for (; W() !== !0 && (e = K());) if (e === s) I = U.backslashes = !0, K();
|
|
236
|
+
else if (e === y) {
|
|
237
|
+
j = U.isBracket = !0, M = U.isGlob = !0, z = !0;
|
|
230
238
|
break;
|
|
231
239
|
}
|
|
232
|
-
|
|
233
|
-
continue;
|
|
234
|
-
}
|
|
235
|
-
break;
|
|
236
|
-
}
|
|
237
|
-
if (H === a) {
|
|
238
|
-
if (V === a && (P = U.isGlobstar = !0), M = U.isGlob = !0, z = !0, S === !0) continue;
|
|
239
|
-
break;
|
|
240
|
-
}
|
|
241
|
-
if (H === g) {
|
|
242
|
-
if (M = U.isGlob = !0, z = !0, S === !0) continue;
|
|
243
|
-
break;
|
|
244
|
-
}
|
|
245
|
-
if (H === m) {
|
|
246
|
-
for (; W() !== !0 && (e = K());) {
|
|
247
|
-
if (e === s) {
|
|
248
|
-
I = U.backslashes = !0, K();
|
|
249
|
-
continue;
|
|
250
|
-
}
|
|
251
|
-
if (e === y) {
|
|
252
|
-
j = U.isBracket = !0, M = U.isGlob = !0, z = !0;
|
|
240
|
+
if (S === !0) continue;
|
|
253
241
|
break;
|
|
254
242
|
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
243
|
+
if (r.nonegate !== !0 && H === u && D === O) L = U.negated = !0, O++;
|
|
244
|
+
else {
|
|
245
|
+
if (r.noparen !== !0 && H === p) {
|
|
246
|
+
if (M = U.isGlob = !0, S === !0) {
|
|
247
|
+
let e = 1;
|
|
248
|
+
for (; W() !== !0 && (H = K());) if (H === s) I = U.backslashes = !0, K();
|
|
249
|
+
else if (H === p) e++;
|
|
250
|
+
else if (H === v && --e === 0) {
|
|
251
|
+
z = !0;
|
|
252
|
+
break;
|
|
253
|
+
}
|
|
254
|
+
continue;
|
|
255
|
+
}
|
|
256
|
+
break;
|
|
269
257
|
}
|
|
270
|
-
if (
|
|
271
|
-
z = !0;
|
|
258
|
+
if (M === !0) {
|
|
259
|
+
if (z = !0, S === !0) continue;
|
|
272
260
|
break;
|
|
273
261
|
}
|
|
274
262
|
}
|
|
275
|
-
continue;
|
|
276
263
|
}
|
|
277
|
-
break;
|
|
278
|
-
}
|
|
279
|
-
if (M === !0) {
|
|
280
|
-
if (z = !0, S === !0) continue;
|
|
281
|
-
break;
|
|
282
264
|
}
|
|
283
265
|
}
|
|
284
|
-
|
|
266
|
+
r.noext === !0 && (N = !1, M = !1);
|
|
285
267
|
let q = E, J = "", Y = "";
|
|
286
|
-
O > 0 && (J = E.slice(0, O), E = E.slice(O), k -= O), q && M === !0 && k > 0 ? (q = E.slice(0, k), Y = E.slice(k)) : M === !0 ? (q = "", Y = E) : q = E, q && q !== "" && q !== "/" && q !== E && b(q.charCodeAt(q.length - 1)) && (q = q.slice(0, -1)),
|
|
268
|
+
O > 0 && (J = E.slice(0, O), E = E.slice(O), k -= O), q && M === !0 && k > 0 ? (q = E.slice(0, k), Y = E.slice(k)) : M === !0 ? (q = "", Y = E) : q = E, q && q !== "" && q !== "/" && q !== E && b(q.charCodeAt(q.length - 1)) && (q = q.slice(0, -1)), r.unescape === !0 && (Y &&= n.removeBackslashes(Y), q && I === !0 && (q = n.removeBackslashes(q)));
|
|
287
269
|
let X = {
|
|
288
270
|
prefix: J,
|
|
289
271
|
input: e,
|
|
@@ -298,22 +280,19 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
298
280
|
negated: L,
|
|
299
281
|
negatedExtglob: R
|
|
300
282
|
};
|
|
301
|
-
if (
|
|
283
|
+
if (r.tokens === !0 && (X.maxDepth = 0, b(H) || w.push(U), X.tokens = w), r.parts === !0 || r.tokens === !0) {
|
|
302
284
|
let t;
|
|
303
|
-
for (let
|
|
304
|
-
let i = t ? t + 1
|
|
305
|
-
|
|
306
|
-
}
|
|
307
|
-
if (t && t + 1 < e.length) {
|
|
308
|
-
let r = e.slice(t + 1);
|
|
309
|
-
T.push(r), n.tokens && (w[w.length - 1].value = r, x(w[w.length - 1]), X.maxDepth += w[w.length - 1].depth);
|
|
285
|
+
for (let n = 0; n < C.length; n++) {
|
|
286
|
+
let i = t === void 0 ? O : t + 1, a = C[n], o = e.slice(i, a);
|
|
287
|
+
r.tokens && (n === 0 && O !== 0 ? (w[n].isPrefix = !0, w[n].value = J) : w[n].value = o, x(w[n]), X.maxDepth += w[n].depth), a >= O && (T.push(o), t = a);
|
|
310
288
|
}
|
|
311
|
-
|
|
289
|
+
let n = t === void 0 ? O : t + 1, i = e.slice(n);
|
|
290
|
+
T.push(i), r.tokens && t && t + 1 < e.length && (w[w.length - 1].value = i, x(w[w.length - 1]), X.maxDepth += w[w.length - 1].depth), X.slashes = C, X.parts = T;
|
|
312
291
|
}
|
|
313
292
|
return X;
|
|
314
293
|
};
|
|
315
|
-
})),
|
|
316
|
-
var
|
|
294
|
+
})), o = /* @__PURE__ */ e(((e, t) => {
|
|
295
|
+
var n = r(), a = i(), { MAX_LENGTH: o, POSIX_REGEX_SOURCE: s, REGEX_NON_SPECIAL_CHARS: c, REGEX_SPECIAL_CHARS_BACKREF: l, REPLACEMENTS: u } = n, d = (e, t) => {
|
|
317
296
|
if (typeof t.expandRange == "function") return t.expandRange(...e, t);
|
|
318
297
|
e.sort();
|
|
319
298
|
let n = `[${e.join("-")}]`;
|
|
@@ -325,19 +304,10 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
325
304
|
return n;
|
|
326
305
|
}, f = (e, t) => `Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`, p = (e) => {
|
|
327
306
|
let t = [], n = 0, r = 0, i = 0, a = "", o = !1;
|
|
328
|
-
for (let s of e)
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
}
|
|
333
|
-
if (s === "\\") {
|
|
334
|
-
a += s, o = !0;
|
|
335
|
-
continue;
|
|
336
|
-
}
|
|
337
|
-
if (s === "\"") {
|
|
338
|
-
i = i === 1 ? 0 : 1, a += s;
|
|
339
|
-
continue;
|
|
340
|
-
}
|
|
307
|
+
for (let s of e) if (o === !0) a += s, o = !1;
|
|
308
|
+
else if (s === "\\") a += s, o = !0;
|
|
309
|
+
else if (s === "\"") i = i === 1 ? 0 : 1, a += s;
|
|
310
|
+
else {
|
|
341
311
|
if (i === 0) {
|
|
342
312
|
if (s === "[") n++;
|
|
343
313
|
else if (s === "]" && n > 0) n--;
|
|
@@ -355,17 +325,9 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
355
325
|
return t.push(a), t;
|
|
356
326
|
}, m = (e) => {
|
|
357
327
|
let t = !1;
|
|
358
|
-
for (let n of e)
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
continue;
|
|
362
|
-
}
|
|
363
|
-
if (n === "\\") {
|
|
364
|
-
t = !0;
|
|
365
|
-
continue;
|
|
366
|
-
}
|
|
367
|
-
if (/[?*+@!()[\]{}]/.test(n)) return !1;
|
|
368
|
-
}
|
|
328
|
+
for (let n of e) if (t === !0) t = !1;
|
|
329
|
+
else if (n === "\\") t = !0;
|
|
330
|
+
else if (/[?*+@!()[\]{}]/.test(n)) return !1;
|
|
369
331
|
return !0;
|
|
370
332
|
}, h = (e) => {
|
|
371
333
|
let t = e.trim(), n = !0;
|
|
@@ -375,7 +337,7 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
375
337
|
let t = e.map(h).filter(Boolean);
|
|
376
338
|
for (let e = 0; e < t.length; e++) for (let n = e + 1; n < t.length; n++) {
|
|
377
339
|
let r = t[e], i = t[n], a = r[0];
|
|
378
|
-
if (
|
|
340
|
+
if (a && r === a.repeat(r.length) && i === a.repeat(i.length) && (r === i || r.startsWith(i) || i.startsWith(r))) return !0;
|
|
379
341
|
}
|
|
380
342
|
return !1;
|
|
381
343
|
}, _ = (e, t = !0) => {
|
|
@@ -383,33 +345,15 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
383
345
|
let n = 0, r = 0, i = 0, a = !1;
|
|
384
346
|
for (let o = 1; o < e.length; o++) {
|
|
385
347
|
let s = e[o];
|
|
386
|
-
if (a === !0)
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
i = i === 1 ? 0 : 1;
|
|
396
|
-
continue;
|
|
397
|
-
}
|
|
398
|
-
if (i !== 1) {
|
|
399
|
-
if (s === "[") {
|
|
400
|
-
n++;
|
|
401
|
-
continue;
|
|
402
|
-
}
|
|
403
|
-
if (s === "]" && n > 0) {
|
|
404
|
-
n--;
|
|
405
|
-
continue;
|
|
406
|
-
}
|
|
407
|
-
if (!(n > 0)) {
|
|
408
|
-
if (s === "(") {
|
|
409
|
-
r++;
|
|
410
|
-
continue;
|
|
411
|
-
}
|
|
412
|
-
if (s === ")" && (r--, r === 0)) return t === !0 && o !== e.length - 1 ? void 0 : {
|
|
348
|
+
if (a === !0) a = !1;
|
|
349
|
+
else if (s === "\\") a = !0;
|
|
350
|
+
else if (s === "\"") i = i === 1 ? 0 : 1;
|
|
351
|
+
else if (i !== 1) {
|
|
352
|
+
if (s === "[") n++;
|
|
353
|
+
else if (s === "]" && n > 0) n--;
|
|
354
|
+
else if (!(n > 0)) {
|
|
355
|
+
if (s === "(") r++;
|
|
356
|
+
else if (s === ")" && (r--, r === 0)) return t === !0 && o !== e.length - 1 ? void 0 : {
|
|
413
357
|
type: e[0],
|
|
414
358
|
body: e.slice(2, o),
|
|
415
359
|
end: o
|
|
@@ -417,7 +361,7 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
417
361
|
}
|
|
418
362
|
}
|
|
419
363
|
}
|
|
420
|
-
}, v = (e) => {
|
|
364
|
+
}, v = (e) => `${e.length === 1 ? a.escapeRegex(e[0]) : `[${e.map((e) => a.escapeRegex(e)).join("")}]`}*`, y = (e) => {
|
|
421
365
|
let t = 0, n = [];
|
|
422
366
|
for (; t < e.length;) {
|
|
423
367
|
let r = _(e.slice(t), !1);
|
|
@@ -428,40 +372,46 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
428
372
|
if (!a || a.length !== 1) return;
|
|
429
373
|
n.push(a), t += r.end + 1;
|
|
430
374
|
}
|
|
431
|
-
if (!(n.length < 1)) return
|
|
432
|
-
},
|
|
375
|
+
if (!(n.length < 1)) return n;
|
|
376
|
+
}, b = (e) => {
|
|
433
377
|
let t = 0, n = e.trim(), r = _(n);
|
|
434
378
|
for (; r;) t++, n = r.body.trim(), r = _(n);
|
|
435
379
|
return t;
|
|
436
|
-
},
|
|
380
|
+
}, x = (e, t) => {
|
|
437
381
|
if (t.maxExtglobRecursion === !1) return { risky: !1 };
|
|
438
|
-
let
|
|
439
|
-
if (
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
382
|
+
let r = typeof t.maxExtglobRecursion == "number" ? t.maxExtglobRecursion : n.DEFAULT_MAX_EXTGLOB_RECURSION, i = p(e).map((e) => e.trim());
|
|
383
|
+
if (i.length > 1 && (i.some((e) => e === "") || i.some((e) => /^[*?]+$/.test(e)) || g(i))) return { risky: !0 };
|
|
384
|
+
let a = [], o = !1, s = !0;
|
|
385
|
+
for (let e of i) {
|
|
386
|
+
let t = y(e);
|
|
387
|
+
if (t) {
|
|
388
|
+
o = !0, a.push(...t);
|
|
389
|
+
continue;
|
|
390
|
+
}
|
|
391
|
+
let n = h(e);
|
|
392
|
+
if (n && n.length === 1) a.push(n);
|
|
393
|
+
else if (s = !1, b(e) > r) return { risky: !0 };
|
|
447
394
|
}
|
|
448
|
-
return
|
|
449
|
-
|
|
395
|
+
return o ? s ? {
|
|
396
|
+
risky: !0,
|
|
397
|
+
safeOutput: v([...new Set(a)])
|
|
398
|
+
} : { risky: !0 } : { risky: !1 };
|
|
399
|
+
}, S = (e, t) => {
|
|
450
400
|
if (typeof e != "string") throw TypeError("Expected a string");
|
|
451
401
|
e = u[e] || e;
|
|
452
|
-
let
|
|
453
|
-
if (p >
|
|
402
|
+
let r = { ...t }, i = typeof r.maxLength == "number" ? Math.min(o, r.maxLength) : o, p = e.length;
|
|
403
|
+
if (p > i) throw SyntaxError(`Input length: ${p}, exceeds maximum allowed length: ${i}`);
|
|
454
404
|
let m = {
|
|
455
405
|
type: "bos",
|
|
456
406
|
value: "",
|
|
457
|
-
output:
|
|
458
|
-
}, h = [m], g =
|
|
459
|
-
|
|
407
|
+
output: r.prepend || ""
|
|
408
|
+
}, h = [m], g = r.capture ? "" : "?:", _ = n.globChars(r.windows), v = n.extglobChars(_), { DOT_LITERAL: y, PLUS_LITERAL: b, SLASH_LITERAL: C, ONE_CHAR: w, DOTS_SLASH: T, NO_DOT: E, NO_DOT_SLASH: D, NO_DOTS_SLASH: O, QMARK: k, QMARK_NO_DOT: A, STAR: j, START_ANCHOR: M } = _, N = (e) => `(${g}(?:(?!${M}${e.dot ? T : y}).)*?)`, P = r.dot ? "" : E, F = r.dot ? k : A, I = r.bash === !0 ? N(r) : j;
|
|
409
|
+
r.capture && (I = `(${I})`), typeof r.noext == "boolean" && (r.noextglob = r.noext);
|
|
460
410
|
let L = {
|
|
461
411
|
input: e,
|
|
462
412
|
index: -1,
|
|
463
413
|
start: 0,
|
|
464
|
-
dot:
|
|
414
|
+
dot: r.dot === !0,
|
|
465
415
|
consumed: "",
|
|
466
416
|
output: "",
|
|
467
417
|
prefix: "",
|
|
@@ -482,7 +432,7 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
482
432
|
}, Y = () => {
|
|
483
433
|
let e = 1;
|
|
484
434
|
for (; W() === "!" && (W(2) !== "(" || W(3) === "?");) G(), L.start++, e++;
|
|
485
|
-
return e % 2
|
|
435
|
+
return e % 2 != 0 && (L.negated = !0, L.start++, !0);
|
|
486
436
|
}, X = (e) => {
|
|
487
437
|
L[e]++, B.push(e);
|
|
488
438
|
}, Z = (e) => {
|
|
@@ -492,19 +442,15 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
492
442
|
let t = L.braces > 0 && (e.type === "comma" || e.type === "brace"), n = e.extglob === !0 || R.length && (e.type === "pipe" || e.type === "paren");
|
|
493
443
|
e.type !== "slash" && e.type !== "paren" && !t && !n && (L.output = L.output.slice(0, -V.output.length), V.type = "star", V.value = "*", V.output = I, L.output += V.output);
|
|
494
444
|
}
|
|
495
|
-
|
|
496
|
-
V.output = (V.output || V.value) + e.value, V.value += e.value;
|
|
497
|
-
return;
|
|
498
|
-
}
|
|
499
|
-
e.prev = V, h.push(e), V = e;
|
|
445
|
+
R.length && e.type !== "paren" && (R[R.length - 1].inner += e.value), (e.value || e.output) && J(e), V && V.type === "text" && e.type === "text" ? (V.output = (V.output || V.value) + e.value, V.value += e.value) : (e.prev = V, h.push(e), V = e);
|
|
500
446
|
}, $ = (e, t) => {
|
|
501
|
-
let
|
|
447
|
+
let n = {
|
|
502
448
|
...v[t],
|
|
503
449
|
conditions: 1,
|
|
504
450
|
inner: ""
|
|
505
451
|
};
|
|
506
|
-
|
|
507
|
-
let i = (
|
|
452
|
+
n.prev = V, n.parens = L.parens, n.output = L.output, n.startIndex = L.index, n.tokensIndex = h.length;
|
|
453
|
+
let i = (r.capture ? "(" : "") + n.open;
|
|
508
454
|
X("parens"), Q({
|
|
509
455
|
type: e,
|
|
510
456
|
value: t,
|
|
@@ -514,14 +460,14 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
514
460
|
extglob: !0,
|
|
515
461
|
value: G(),
|
|
516
462
|
output: i
|
|
517
|
-
}), R.push(
|
|
518
|
-
}, ee = (
|
|
519
|
-
let i = e.slice(
|
|
520
|
-
if ((
|
|
521
|
-
let e = o.safeOutput ? (
|
|
463
|
+
}), R.push(n);
|
|
464
|
+
}, ee = (n) => {
|
|
465
|
+
let i = e.slice(n.startIndex, L.index + 1), o = x(e.slice(n.startIndex + 2, L.index), r);
|
|
466
|
+
if ((n.type === "plus" || n.type === "star") && o.risky) {
|
|
467
|
+
let e = o.safeOutput ? (n.output ? "" : w) + (r.capture ? `(${o.safeOutput})` : o.safeOutput) : void 0, t = h[n.tokensIndex];
|
|
522
468
|
t.type = "text", t.value = i, t.output = e || a.escapeRegex(i);
|
|
523
|
-
for (let e =
|
|
524
|
-
L.output =
|
|
469
|
+
for (let e = n.tokensIndex + 1; e < h.length; e++) h[e].value = "", h[e].output = "", delete h[e].suffix;
|
|
470
|
+
L.output = n.output + t.output, L.backtrack = !0, Q({
|
|
525
471
|
type: "paren",
|
|
526
472
|
extglob: !0,
|
|
527
473
|
value: H,
|
|
@@ -529,13 +475,13 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
529
475
|
}), Z("parens");
|
|
530
476
|
return;
|
|
531
477
|
}
|
|
532
|
-
let s =
|
|
533
|
-
if (
|
|
478
|
+
let s = n.close + (r.capture ? ")" : ""), c;
|
|
479
|
+
if (n.type === "negate") {
|
|
534
480
|
let e = I;
|
|
535
|
-
|
|
481
|
+
n.inner && n.inner.length > 1 && n.inner.includes("/") && (e = N(r)), (e !== I || U() || /^\)+$/.test(K())) && (s = n.close = `)$))${e}`), n.inner.includes("*") && (c = K()) && /^\.[^\\/.]+$/.test(c) && (s = n.close = `)${S(c, {
|
|
536
482
|
...t,
|
|
537
483
|
fastpaths: !1
|
|
538
|
-
}).output})${e})`),
|
|
484
|
+
}).output})${e})`), n.prev.type === "bos" && (L.negatedExtglob = !0);
|
|
539
485
|
}
|
|
540
486
|
Q({
|
|
541
487
|
type: "paren",
|
|
@@ -544,15 +490,15 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
544
490
|
output: s
|
|
545
491
|
}), Z("parens");
|
|
546
492
|
};
|
|
547
|
-
if (
|
|
548
|
-
let
|
|
549
|
-
return
|
|
493
|
+
if (r.fastpaths !== !1 && !/(^[*!]|[/()[\]{}"])/.test(e)) {
|
|
494
|
+
let n = !1, i = e.replace(l, (e, t, r, i, a, o) => i === "\\" ? (n = !0, e) : i === "?" ? t ? t + i + (a ? k.repeat(a.length) : "") : o === 0 ? F + (a ? k.repeat(a.length) : "") : k.repeat(r.length) : i === "." ? y.repeat(r.length) : i === "*" ? t ? t + i + (a ? I : "") : I : t ? e : `\\${e}`);
|
|
495
|
+
return n === !0 && (i = r.unescape === !0 ? i.replace(/\\/g, "") : i.replace(/\\+/g, (e) => e.length % 2 == 0 ? "\\\\" : e ? "\\" : "")), i === e && r.contains === !0 ? (L.output = e, L) : (L.output = a.wrapOutput(i, L, t), L);
|
|
550
496
|
}
|
|
551
497
|
for (; !U();) {
|
|
552
498
|
if (H = G(), H === "\0") continue;
|
|
553
499
|
if (H === "\\") {
|
|
554
500
|
let e = W();
|
|
555
|
-
if (e === "/" &&
|
|
501
|
+
if (e === "/" && r.bash !== !0 || e === "." || e === ";") continue;
|
|
556
502
|
if (!e) {
|
|
557
503
|
H += "\\", Q({
|
|
558
504
|
type: "text",
|
|
@@ -560,8 +506,8 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
560
506
|
});
|
|
561
507
|
continue;
|
|
562
508
|
}
|
|
563
|
-
let t = /^\\+/.exec(K()),
|
|
564
|
-
if (t && t[0].length > 2 && (
|
|
509
|
+
let t = /^\\+/.exec(K()), n = 0;
|
|
510
|
+
if (t && t[0].length > 2 && (n = t[0].length, L.index += n, n % 2 != 0 && (H += "\\")), r.unescape === !0 ? H = G() : H += G(), L.brackets === 0) {
|
|
565
511
|
Q({
|
|
566
512
|
type: "text",
|
|
567
513
|
value: H
|
|
@@ -570,7 +516,7 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
570
516
|
}
|
|
571
517
|
}
|
|
572
518
|
if (L.brackets > 0 && (H !== "]" || V.value === "[" || V.value === "[^")) {
|
|
573
|
-
if (
|
|
519
|
+
if (r.posix !== !1 && H === ":") {
|
|
574
520
|
let e = V.value.slice(1);
|
|
575
521
|
if (e.includes("[") && (V.posix = !0, e.includes(":"))) {
|
|
576
522
|
let e = V.value.lastIndexOf("["), t = V.value.slice(0, e), n = s[V.value.slice(e + 2)];
|
|
@@ -580,7 +526,7 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
580
526
|
}
|
|
581
527
|
}
|
|
582
528
|
}
|
|
583
|
-
(H === "[" && W() !== ":" || H === "-" && W() === "]") && (H = `\\${H}`), H === "]" && (V.value === "[" || V.value === "[^") && (H = `\\${H}`),
|
|
529
|
+
(H === "[" && W() !== ":" || H === "-" && W() === "]") && (H = `\\${H}`), H === "]" && (V.value === "[" || V.value === "[^") && (H = `\\${H}`), r.posix === !0 && H === "!" && V.value === "[" && (H = "^"), V.value += H, J({ value: H });
|
|
584
530
|
continue;
|
|
585
531
|
}
|
|
586
532
|
if (L.quotes === 1 && H !== "\"") {
|
|
@@ -588,7 +534,7 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
588
534
|
continue;
|
|
589
535
|
}
|
|
590
536
|
if (H === "\"") {
|
|
591
|
-
L.quotes = L.quotes === 1 ? 0 : 1,
|
|
537
|
+
L.quotes = L.quotes === 1 ? 0 : 1, r.keepQuotes === !0 && Q({
|
|
592
538
|
type: "text",
|
|
593
539
|
value: H
|
|
594
540
|
});
|
|
@@ -602,7 +548,7 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
602
548
|
continue;
|
|
603
549
|
}
|
|
604
550
|
if (H === ")") {
|
|
605
|
-
if (L.parens === 0 &&
|
|
551
|
+
if (L.parens === 0 && r.strictBrackets === !0) throw SyntaxError(f("opening", "("));
|
|
606
552
|
let e = R[R.length - 1];
|
|
607
553
|
if (e && L.parens === e.parens + 1) {
|
|
608
554
|
ee(R.pop());
|
|
@@ -616,8 +562,8 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
616
562
|
continue;
|
|
617
563
|
}
|
|
618
564
|
if (H === "[") {
|
|
619
|
-
if (
|
|
620
|
-
if (
|
|
565
|
+
if (r.nobracket === !0 || !K().includes("]")) {
|
|
566
|
+
if (r.nobracket !== !0 && r.strictBrackets === !0) throw SyntaxError(f("closing", "]"));
|
|
621
567
|
H = `\\${H}`;
|
|
622
568
|
} else X("brackets");
|
|
623
569
|
Q({
|
|
@@ -627,7 +573,7 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
627
573
|
continue;
|
|
628
574
|
}
|
|
629
575
|
if (H === "]") {
|
|
630
|
-
if (
|
|
576
|
+
if (r.nobracket === !0 || V && V.type === "bracket" && V.value.length === 1) {
|
|
631
577
|
Q({
|
|
632
578
|
type: "text",
|
|
633
579
|
value: H,
|
|
@@ -636,7 +582,7 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
636
582
|
continue;
|
|
637
583
|
}
|
|
638
584
|
if (L.brackets === 0) {
|
|
639
|
-
if (
|
|
585
|
+
if (r.strictBrackets === !0) throw SyntaxError(f("opening", "["));
|
|
640
586
|
Q({
|
|
641
587
|
type: "text",
|
|
642
588
|
value: H,
|
|
@@ -646,16 +592,16 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
646
592
|
}
|
|
647
593
|
Z("brackets");
|
|
648
594
|
let e = V.value.slice(1);
|
|
649
|
-
if (V.posix !== !0 && e[0] === "^" && !e.includes("/") && (H = `/${H}`), V.value += H, J({ value: H }),
|
|
595
|
+
if (V.posix !== !0 && e[0] === "^" && !e.includes("/") && (H = `/${H}`), V.value += H, J({ value: H }), r.literalBrackets === !1 || a.hasRegexChars(e)) continue;
|
|
650
596
|
let t = a.escapeRegex(V.value);
|
|
651
|
-
if (L.output = L.output.slice(0, -V.value.length),
|
|
597
|
+
if (L.output = L.output.slice(0, -V.value.length), r.literalBrackets === !0) {
|
|
652
598
|
L.output += t, V.value = t;
|
|
653
599
|
continue;
|
|
654
600
|
}
|
|
655
601
|
V.value = `(${g}${t}|${V.value})`, L.output += V.value;
|
|
656
602
|
continue;
|
|
657
603
|
}
|
|
658
|
-
if (H === "{" &&
|
|
604
|
+
if (H === "{" && r.nobrace !== !0) {
|
|
659
605
|
X("braces");
|
|
660
606
|
let e = {
|
|
661
607
|
type: "brace",
|
|
@@ -669,7 +615,7 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
669
615
|
}
|
|
670
616
|
if (H === "}") {
|
|
671
617
|
let e = z[z.length - 1];
|
|
672
|
-
if (
|
|
618
|
+
if (r.nobrace === !0 || !e) {
|
|
673
619
|
Q({
|
|
674
620
|
type: "text",
|
|
675
621
|
value: H,
|
|
@@ -679,9 +625,9 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
679
625
|
}
|
|
680
626
|
let t = ")";
|
|
681
627
|
if (e.dots === !0) {
|
|
682
|
-
let e = h.slice(),
|
|
683
|
-
for (let t = e.length - 1; t >= 0 && (h.pop(), e[t].type !== "brace"); t--) e[t].type !== "dots" &&
|
|
684
|
-
t = d(
|
|
628
|
+
let e = h.slice(), n = [];
|
|
629
|
+
for (let t = e.length - 1; t >= 0 && (h.pop(), e[t].type !== "brace"); t--) e[t].type !== "dots" && n.unshift(e[t].value);
|
|
630
|
+
t = d(n, r), L.backtrack = !0;
|
|
685
631
|
}
|
|
686
632
|
if (e.comma !== !0 && e.dots !== !0) {
|
|
687
633
|
let n = L.output.slice(0, e.outputIndex), r = L.tokens.slice(e.tokensIndex);
|
|
@@ -746,7 +692,7 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
746
692
|
continue;
|
|
747
693
|
}
|
|
748
694
|
if (H === "?") {
|
|
749
|
-
if (!(V && V.value === "(") &&
|
|
695
|
+
if (!(V && V.value === "(") && r.noextglob !== !0 && W() === "(" && W(2) !== "?") {
|
|
750
696
|
$("qmark", H);
|
|
751
697
|
continue;
|
|
752
698
|
}
|
|
@@ -759,7 +705,7 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
759
705
|
});
|
|
760
706
|
continue;
|
|
761
707
|
}
|
|
762
|
-
if (
|
|
708
|
+
if (r.dot !== !0 && (V.type === "slash" || V.type === "bos")) {
|
|
763
709
|
Q({
|
|
764
710
|
type: "qmark",
|
|
765
711
|
value: H,
|
|
@@ -775,25 +721,25 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
775
721
|
continue;
|
|
776
722
|
}
|
|
777
723
|
if (H === "!") {
|
|
778
|
-
if (
|
|
724
|
+
if (r.noextglob !== !0 && W() === "(" && (W(2) !== "?" || !/[!=<:]/.test(W(3)))) {
|
|
779
725
|
$("negate", H);
|
|
780
726
|
continue;
|
|
781
727
|
}
|
|
782
|
-
if (
|
|
728
|
+
if (r.nonegate !== !0 && L.index === 0) {
|
|
783
729
|
Y();
|
|
784
730
|
continue;
|
|
785
731
|
}
|
|
786
732
|
}
|
|
787
733
|
if (H === "+") {
|
|
788
|
-
if (
|
|
734
|
+
if (r.noextglob !== !0 && W() === "(" && W(2) !== "?") {
|
|
789
735
|
$("plus", H);
|
|
790
736
|
continue;
|
|
791
737
|
}
|
|
792
|
-
if (V && V.value === "(" ||
|
|
738
|
+
if (V && V.value === "(" || r.regex === !1) {
|
|
793
739
|
Q({
|
|
794
740
|
type: "plus",
|
|
795
741
|
value: H,
|
|
796
|
-
output:
|
|
742
|
+
output: b
|
|
797
743
|
});
|
|
798
744
|
continue;
|
|
799
745
|
}
|
|
@@ -806,12 +752,12 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
806
752
|
}
|
|
807
753
|
Q({
|
|
808
754
|
type: "plus",
|
|
809
|
-
value:
|
|
755
|
+
value: b
|
|
810
756
|
});
|
|
811
757
|
continue;
|
|
812
758
|
}
|
|
813
759
|
if (H === "@") {
|
|
814
|
-
if (
|
|
760
|
+
if (r.noextglob !== !0 && W() === "(" && W(2) !== "?") {
|
|
815
761
|
Q({
|
|
816
762
|
type: "at",
|
|
817
763
|
extglob: !0,
|
|
@@ -840,17 +786,17 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
840
786
|
continue;
|
|
841
787
|
}
|
|
842
788
|
let t = K();
|
|
843
|
-
if (
|
|
789
|
+
if (r.noextglob !== !0 && /^\([^?]/.test(t)) {
|
|
844
790
|
$("star", H);
|
|
845
791
|
continue;
|
|
846
792
|
}
|
|
847
793
|
if (V.type === "star") {
|
|
848
|
-
if (
|
|
794
|
+
if (r.noglobstar === !0) {
|
|
849
795
|
q(H);
|
|
850
796
|
continue;
|
|
851
797
|
}
|
|
852
|
-
let
|
|
853
|
-
if (
|
|
798
|
+
let n = V.prev, i = n.prev, a = n.type === "slash" || n.type === "bos", o = i && (i.type === "star" || i.type === "globstar");
|
|
799
|
+
if (r.bash === !0 && (!a || t[0] && t[0] !== "/")) {
|
|
854
800
|
Q({
|
|
855
801
|
type: "star",
|
|
856
802
|
value: H,
|
|
@@ -858,8 +804,8 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
858
804
|
});
|
|
859
805
|
continue;
|
|
860
806
|
}
|
|
861
|
-
let s = L.braces > 0 && (
|
|
862
|
-
if (!a &&
|
|
807
|
+
let s = L.braces > 0 && (n.type === "comma" || n.type === "brace"), c = R.length && (n.type === "pipe" || n.type === "paren");
|
|
808
|
+
if (!a && n.type !== "paren" && !s && !c) {
|
|
863
809
|
Q({
|
|
864
810
|
type: "star",
|
|
865
811
|
value: H,
|
|
@@ -872,62 +818,55 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
872
818
|
if (n && n !== "/") break;
|
|
873
819
|
t = t.slice(3), q("/**", 3);
|
|
874
820
|
}
|
|
875
|
-
|
|
876
|
-
|
|
821
|
+
let l = U() || L.parens > 0 && t === ")".repeat(L.parens) && !R.some((e) => e.type === "negate");
|
|
822
|
+
if (n.type === "bos" && U()) {
|
|
823
|
+
V.type = "globstar", V.value += H, V.output = N(r), L.output = V.output, L.globstar = !0, q(H);
|
|
877
824
|
continue;
|
|
878
825
|
}
|
|
879
|
-
if (
|
|
880
|
-
L.output = L.output.slice(0, -(
|
|
826
|
+
if (n.type === "slash" && n.prev.type !== "bos" && !o && l) {
|
|
827
|
+
L.output = L.output.slice(0, -(n.output + V.output).length), n.output = `(?:${n.output}`, V.type = "globstar", V.output = N(r) + (r.strictSlashes ? ")" : "|$)"), V.value += H, L.globstar = !0, L.output += n.output + V.output, q(H);
|
|
881
828
|
continue;
|
|
882
829
|
}
|
|
883
|
-
if (
|
|
830
|
+
if (n.type === "slash" && n.prev.type !== "bos" && t[0] === "/") {
|
|
884
831
|
let e = t[1] === void 0 ? "" : "|$";
|
|
885
|
-
L.output = L.output.slice(0, -(
|
|
832
|
+
L.output = L.output.slice(0, -(n.output + V.output).length), n.output = `(?:${n.output}`, V.type = "globstar", V.output = `${N(r)}${C}|${C}${e})`, V.value += H, L.output += n.output + V.output, L.globstar = !0, q(H + G()), Q({
|
|
886
833
|
type: "slash",
|
|
887
834
|
value: "/",
|
|
888
835
|
output: ""
|
|
889
836
|
});
|
|
890
837
|
continue;
|
|
891
838
|
}
|
|
892
|
-
if (
|
|
893
|
-
V.type = "globstar", V.value += H, V.output = `(?:^|${C}|${N(
|
|
839
|
+
if (n.type === "bos" && t[0] === "/") {
|
|
840
|
+
V.type = "globstar", V.value += H, V.output = `(?:^|${C}|${N(r)}${C})`, L.output = V.output, L.globstar = !0, q(H + G()), Q({
|
|
894
841
|
type: "slash",
|
|
895
842
|
value: "/",
|
|
896
843
|
output: ""
|
|
897
844
|
});
|
|
898
845
|
continue;
|
|
899
846
|
}
|
|
900
|
-
L.output = L.output.slice(0, -V.output.length), V.type = "globstar", V.output = N(
|
|
847
|
+
L.output = L.output.slice(0, -V.output.length), V.type = "globstar", V.output = N(r), V.value += H, L.output += V.output, L.globstar = !0, q(H);
|
|
901
848
|
continue;
|
|
902
849
|
}
|
|
903
|
-
let
|
|
850
|
+
let n = {
|
|
904
851
|
type: "star",
|
|
905
852
|
value: H,
|
|
906
853
|
output: I
|
|
907
854
|
};
|
|
908
|
-
|
|
909
|
-
r.output = ".*?", (V.type === "bos" || V.type === "slash") && (r.output = P + r.output), Q(r);
|
|
910
|
-
continue;
|
|
911
|
-
}
|
|
912
|
-
if (V && (V.type === "bracket" || V.type === "paren") && n.regex === !0) {
|
|
913
|
-
r.output = H, Q(r);
|
|
914
|
-
continue;
|
|
915
|
-
}
|
|
916
|
-
(L.index === L.start || V.type === "slash" || V.type === "dot") && (V.type === "dot" ? (L.output += D, V.output += D) : n.dot === !0 ? (L.output += O, V.output += O) : (L.output += P, V.output += P), W() !== "*" && (L.output += w, V.output += w)), Q(r);
|
|
855
|
+
r.bash === !0 ? (n.output = ".*?", (V.type === "bos" || V.type === "slash") && (n.output = P + n.output), Q(n)) : V && (V.type === "bracket" || V.type === "paren") && r.regex === !0 ? (n.output = H, Q(n)) : ((L.index === L.start || V.type === "slash" || V.type === "dot") && (V.type === "dot" ? (L.output += D, V.output += D) : r.dot === !0 ? (L.output += O, V.output += O) : (L.output += P, V.output += P), W() !== "*" && (L.output += w, V.output += w)), Q(n));
|
|
917
856
|
}
|
|
918
857
|
for (; L.brackets > 0;) {
|
|
919
|
-
if (
|
|
858
|
+
if (r.strictBrackets === !0) throw SyntaxError(f("closing", "]"));
|
|
920
859
|
L.output = a.escapeLast(L.output, "["), Z("brackets");
|
|
921
860
|
}
|
|
922
861
|
for (; L.parens > 0;) {
|
|
923
|
-
if (
|
|
862
|
+
if (r.strictBrackets === !0) throw SyntaxError(f("closing", ")"));
|
|
924
863
|
L.output = a.escapeLast(L.output, "("), Z("parens");
|
|
925
864
|
}
|
|
926
865
|
for (; L.braces > 0;) {
|
|
927
|
-
if (
|
|
866
|
+
if (r.strictBrackets === !0) throw SyntaxError(f("closing", "}"));
|
|
928
867
|
L.output = a.escapeLast(L.output, "{"), Z("braces");
|
|
929
868
|
}
|
|
930
|
-
if (
|
|
869
|
+
if (r.strictSlashes !== !0 && (V.type === "star" || V.type === "bracket") && Q({
|
|
931
870
|
type: "maybe_slash",
|
|
932
871
|
value: "",
|
|
933
872
|
output: `${C}?`
|
|
@@ -937,25 +876,25 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
937
876
|
}
|
|
938
877
|
return L;
|
|
939
878
|
};
|
|
940
|
-
|
|
941
|
-
let
|
|
942
|
-
if (s >
|
|
879
|
+
S.fastpaths = (e, t) => {
|
|
880
|
+
let r = { ...t }, i = typeof r.maxLength == "number" ? Math.min(o, r.maxLength) : o, s = e.length;
|
|
881
|
+
if (s > i) throw SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${i}`);
|
|
943
882
|
e = u[e] || e;
|
|
944
|
-
let { DOT_LITERAL: c, SLASH_LITERAL: l, ONE_CHAR: d, DOTS_SLASH: f, NO_DOT: p, NO_DOTS: m, NO_DOTS_SLASH: h, STAR: g, START_ANCHOR: _ } =
|
|
883
|
+
let { DOT_LITERAL: c, SLASH_LITERAL: l, ONE_CHAR: d, DOTS_SLASH: f, NO_DOT: p, NO_DOTS: m, NO_DOTS_SLASH: h, STAR: g, START_ANCHOR: _ } = n.globChars(r.windows), v = r.dot ? m : p, y = r.dot ? h : p, b = r.capture ? "" : "?:", x = {
|
|
945
884
|
negated: !1,
|
|
946
885
|
prefix: ""
|
|
947
|
-
}, S =
|
|
948
|
-
|
|
886
|
+
}, S = r.bash === !0 ? ".*?" : g;
|
|
887
|
+
r.capture && (S = `(${S})`);
|
|
949
888
|
let C = (e) => e.noglobstar === !0 ? S : `(${b}(?:(?!${_}${e.dot ? f : c}).)*?)`, w = (e) => {
|
|
950
889
|
switch (e) {
|
|
951
890
|
case "*": return `${v}${d}${S}`;
|
|
952
891
|
case ".*": return `${c}${d}${S}`;
|
|
953
892
|
case "*.*": return `${v}${S}${c}${d}${S}`;
|
|
954
893
|
case "*/*": return `${v}${S}${l}${d}${y}${S}`;
|
|
955
|
-
case "**": return v + C(
|
|
956
|
-
case "**/*": return `(?:${v}${C(
|
|
957
|
-
case "**/*.*": return `(?:${v}${C(
|
|
958
|
-
case "**/.*": return `(?:${v}${C(
|
|
894
|
+
case "**": return v + C(r);
|
|
895
|
+
case "**/*": return `(?:${v}${C(r)}${l})?${y}${d}${S}`;
|
|
896
|
+
case "**/*.*": return `(?:${v}${C(r)}${l})?${y}${S}${c}${d}${S}`;
|
|
897
|
+
case "**/.*": return `(?:${v}${C(r)}${l})?${c}${d}${S}`;
|
|
959
898
|
default: {
|
|
960
899
|
let t = /^(.*?)\.(\w+)$/.exec(e);
|
|
961
900
|
if (!t) return;
|
|
@@ -964,10 +903,10 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
964
903
|
}
|
|
965
904
|
}
|
|
966
905
|
}, T = w(a.removePrefix(e, x));
|
|
967
|
-
return T &&
|
|
968
|
-
},
|
|
969
|
-
})),
|
|
970
|
-
var
|
|
906
|
+
return T && r.strictSlashes !== !0 && (T += `${l}?`), T;
|
|
907
|
+
}, t.exports = S;
|
|
908
|
+
})), s = /* @__PURE__ */ e(((e, t) => {
|
|
909
|
+
var n = a(), s = o(), c = i(), l = r(), u = (e) => e && typeof e == "object" && !Array.isArray(e), d = (e, t, n = !1) => {
|
|
971
910
|
if (Array.isArray(e)) {
|
|
972
911
|
let r = e.map((e) => d(e, t, n));
|
|
973
912
|
return (e) => {
|
|
@@ -1006,7 +945,7 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
1006
945
|
match: u,
|
|
1007
946
|
isMatch: l
|
|
1008
947
|
};
|
|
1009
|
-
return typeof i.onResult == "function" && i.onResult(p), l === !1 ? (p.isMatch = !1, r ? p : !1) : c(n) ? (typeof i.onIgnore == "function" && i.onIgnore(p), p.isMatch = !1, r ? p : !1) : (typeof i.onMatch == "function" && i.onMatch(p), r
|
|
948
|
+
return typeof i.onResult == "function" && i.onResult(p), l === !1 ? (p.isMatch = !1, r ? p : !1) : c(n) ? (typeof i.onIgnore == "function" && i.onIgnore(p), p.isMatch = !1, r ? p : !1) : (typeof i.onMatch == "function" && i.onMatch(p), !r || p);
|
|
1010
949
|
};
|
|
1011
950
|
return n && (l.state = s), l;
|
|
1012
951
|
};
|
|
@@ -1022,10 +961,10 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
1022
961
|
match: s,
|
|
1023
962
|
output: l
|
|
1024
963
|
};
|
|
1025
|
-
}, d.matchBase = (e, t, n) => (t instanceof RegExp ? t : d.makeRe(t, n)).test(c.basename(e)), d.isMatch = (e, t, n) => d(t, n)(e), d.parse = (e, t) => Array.isArray(e) ? e.map((e) => d.parse(e, t)) : s(e, {
|
|
964
|
+
}, d.matchBase = (e, t, n, r = n && n.windows) => (t instanceof RegExp ? t : d.makeRe(t, n)).test(c.basename(e, { windows: r })), d.isMatch = (e, t, n) => d(t, n)(e), d.parse = (e, t) => Array.isArray(e) ? e.map((e) => d.parse(e, t)) : s(e, {
|
|
1026
965
|
...t,
|
|
1027
966
|
fastpaths: !1
|
|
1028
|
-
}), d.scan = (e, t) =>
|
|
967
|
+
}), d.scan = (e, t) => n(e, t), d.compileRe = (e, t, n = !1, r = !1) => {
|
|
1029
968
|
if (n === !0) return e.output;
|
|
1030
969
|
let i = t || {}, a = i.contains ? "" : "^", o = i.contains ? "" : "$", s = `${a}(?:${e.output})${o}`;
|
|
1031
970
|
e && e.negated === !0 && (s = `^(?!${s}).*$`);
|
|
@@ -1046,16 +985,15 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
1046
985
|
if (t && t.debug === !0) throw e;
|
|
1047
986
|
return /$^/;
|
|
1048
987
|
}
|
|
1049
|
-
}, d.constants = l,
|
|
1050
|
-
})),
|
|
1051
|
-
var
|
|
1052
|
-
function
|
|
988
|
+
}, d.constants = l, t.exports = d;
|
|
989
|
+
})), c = /* @__PURE__ */ e(((e, t) => {
|
|
990
|
+
var n = s(), r = i();
|
|
991
|
+
function a(e, t, i = !1) {
|
|
1053
992
|
return t && (t.windows === null || t.windows === void 0) && (t = {
|
|
1054
993
|
...t,
|
|
1055
|
-
windows:
|
|
1056
|
-
}),
|
|
994
|
+
windows: r.isWindows()
|
|
995
|
+
}), n(e, t, i);
|
|
1057
996
|
}
|
|
1058
|
-
Object.assign(
|
|
997
|
+
Object.assign(a, n), t.exports = a;
|
|
1059
998
|
}));
|
|
1060
|
-
|
|
1061
|
-
export { o as t };
|
|
999
|
+
export { n, c as t };
|