@genai-fi/nanogpt 0.20.6 → 0.21.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/{BaseTokeniser-DSg9zcYq.js → BaseTokeniser-C9TSv4th.js} +1 -1
- package/dist/{DatasetBuilder-DgURD85T.js → DatasetBuilder-B9UGNQT5.js} +82 -88
- package/dist/Generator.js +1 -1
- package/dist/{RealDiv-DBu0FQqT.js → RealDiv-CNsvC4AU.js} +6 -6
- package/dist/{Reshape-DqO3r8BC.js → Reshape-CwxdaU8n.js} +1 -1
- package/dist/{Reshape-CABOPB9d.js → Reshape-dnm9bO3B.js} +2 -2
- package/dist/TeachableLLM.js +1 -1
- package/dist/Trainer.js +1 -1
- package/dist/backend.js +2 -2
- package/dist/{backend_util-Cg-roD1p.js → backend_util-DAV0I34P.js} +5 -5
- package/dist/checks/appendCache.js +1 -1
- package/dist/checks/attentionMask.js +1 -1
- package/dist/checks/gelu.js +1 -1
- package/dist/checks/matMulGelu.js +1 -1
- package/dist/checks/normRMS.js +1 -1
- package/dist/checks/normRMSGrad.js +1 -1
- package/dist/checks/packUnpack.js +1 -1
- package/dist/checks/qkv.js +1 -1
- package/dist/checks/rope.js +6 -6
- package/dist/{chunk-BPntVaq0.js → chunk-CWhphoD1.js} +5 -5
- package/dist/{concat_util-CWDZCBlA.js → concat_util-CWzvQQlK.js} +1 -1
- package/dist/data/docx.js +58 -59
- package/dist/data/pdf.js +1 -1
- package/dist/data/textLoader.js +1 -1
- package/dist/{dist-DVmq73nz.js → dist-9wGF4ci9.js} +10 -10
- package/dist/{dist-VEU5mfO0.js → dist-BqAU9-yi.js} +4 -4
- package/dist/{dist-BewPQWjc.js → dist-Da20xy8E.js} +1874 -3071
- package/dist/{gelu-Bf1HW1RY.js → gelu-B6637MKa.js} +1 -1
- package/dist/{gpgpu_math-DvLcCH6u.js → gpgpu_math-DBYEAAdI.js} +2 -2
- package/dist/{kernel_funcs_utils-HiXOOx3f.js → kernel_funcs_utils-D-mATnGR.js} +3 -3
- package/dist/layers/BaseLayer.js +1 -1
- package/dist/layers/CausalSelfAttention.js +4 -4
- package/dist/layers/LoRA.js +3 -3
- package/dist/layers/MLP.js +2 -2
- package/dist/layers/PositionEmbedding.js +2 -2
- package/dist/layers/RMSNorm.js +1 -1
- package/dist/layers/RoPECache.js +1 -1
- package/dist/layers/TiedEmbedding.js +3 -3
- package/dist/layers/TransformerBlock.js +1 -1
- package/dist/layers/WeightStore.js +3 -3
- package/dist/loader/load.js +1 -1
- package/dist/loader/loadHF.js +1 -1
- package/dist/loader/loadTransformers.js +1 -1
- package/dist/loader/loadZipMeta.js +1 -1
- package/dist/loader/newZipLoad.js +1 -1
- package/dist/loader/oldZipLoad.js +1 -1
- package/dist/loader/save.d.ts +1 -0
- package/dist/loader/save.js +1 -1
- package/dist/{main-C0YUnw98.js → main-DdsoTJAW.js} +2012 -2015
- package/dist/main.js +1 -1
- package/dist/{matMul16-BNfZSnNM.js → matMul16-DGtlziMn.js} +3 -3
- package/dist/{matMulGelu-CPTntosE.js → matMulGelu-BAIgQaRx.js} +3 -3
- package/dist/models/NanoGPTV1.js +1 -1
- package/dist/models/NanoGPTV2.js +1 -1
- package/dist/models/factory.js +1 -1
- package/dist/models/model.js +1 -1
- package/dist/ops/adamAdjust.js +1 -1
- package/dist/ops/adamMoments.js +1 -1
- package/dist/ops/add16.js +1 -1
- package/dist/ops/appendCache.js +1 -1
- package/dist/ops/attentionMask.js +1 -1
- package/dist/ops/concat16.js +1 -1
- package/dist/ops/cpu/adamAdjust.js +1 -1
- package/dist/ops/cpu/adamMoments.js +1 -1
- package/dist/ops/cpu/appendCache.js +1 -1
- package/dist/ops/cpu/attentionMask.js +1 -1
- package/dist/ops/cpu/fusedSoftmax.js +1 -1
- package/dist/ops/cpu/gatherSub.js +1 -1
- package/dist/ops/cpu/gelu.js +1 -1
- package/dist/ops/cpu/matMul16.js +1 -1
- package/dist/ops/cpu/matMulGelu.js +2 -2
- package/dist/ops/cpu/matMulMul.js +1 -1
- package/dist/ops/cpu/mulDropout.js +1 -1
- package/dist/ops/cpu/normRMS.js +1 -1
- package/dist/ops/cpu/qkv.js +1 -1
- package/dist/ops/cpu/rope.js +1 -1
- package/dist/ops/cpu/scatterSub.js +1 -1
- package/dist/ops/dot16.js +2 -2
- package/dist/ops/dropout.js +1 -1
- package/dist/ops/dropout16.js +1 -1
- package/dist/ops/gatherSub.js +1 -1
- package/dist/ops/gelu.js +1 -1
- package/dist/ops/globalNorm.js +1 -1
- package/dist/ops/grads/add16.js +1 -1
- package/dist/ops/grads/attentionMask.js +2 -2
- package/dist/ops/grads/gelu.js +1 -1
- package/dist/ops/grads/matMul16.js +1 -1
- package/dist/ops/grads/matMulGelu.js +1 -1
- package/dist/ops/grads/normRMS.js +1 -1
- package/dist/ops/grads/pack16.js +1 -1
- package/dist/ops/grads/qkv.js +2 -2
- package/dist/ops/grads/rope.js +1 -1
- package/dist/ops/grads/softmax16.js +1 -1
- package/dist/ops/grads/unpack16.js +1 -1
- package/dist/ops/matMul16.js +1 -1
- package/dist/ops/matMulGelu.js +2 -2
- package/dist/ops/matMulMul.js +1 -1
- package/dist/ops/mul16.js +1 -1
- package/dist/ops/mulDrop.js +1 -1
- package/dist/ops/normRMS.js +1 -1
- package/dist/ops/pack16.js +1 -1
- package/dist/ops/qkv.js +1 -1
- package/dist/ops/reshape16.js +1 -1
- package/dist/ops/rope.js +1 -1
- package/dist/ops/scatterSub.js +1 -1
- package/dist/ops/slice16.js +1 -1
- package/dist/ops/softmax16.js +1 -1
- package/dist/ops/sub16.js +1 -1
- package/dist/ops/sum16.js +1 -1
- package/dist/ops/transpose16.js +1 -1
- package/dist/ops/unpack16.js +1 -1
- package/dist/ops/webgl/adamAdjust.js +2 -2
- package/dist/ops/webgl/adamMoments.js +3 -3
- package/dist/ops/webgl/appendCache.js +1 -1
- package/dist/ops/webgl/attentionMask.js +1 -1
- package/dist/ops/webgl/dropout16.js +1 -1
- package/dist/ops/webgl/fusedSoftmax.js +3 -3
- package/dist/ops/webgl/gatherSub.js +1 -1
- package/dist/ops/webgl/gelu.js +2 -2
- package/dist/ops/webgl/log.js +3 -3
- package/dist/ops/webgl/matMul16.js +8 -4
- package/dist/ops/webgl/matMulGelu.js +1 -1
- package/dist/ops/webgl/matMulMul.js +2 -2
- package/dist/ops/webgl/mulDropout.js +1 -1
- package/dist/ops/webgl/normRMS.js +1 -1
- package/dist/ops/webgl/qkv.js +1 -1
- package/dist/ops/webgl/rope.js +1 -1
- package/dist/ops/webgl/scatterSub.js +1 -1
- package/dist/ops/webgpu/adamAdjust.js +3 -3
- package/dist/ops/webgpu/adamMoments.js +3 -3
- package/dist/ops/webgpu/add16.js +1 -1
- package/dist/ops/webgpu/appendCache.js +3 -3
- package/dist/ops/webgpu/attentionMask.js +2 -2
- package/dist/ops/webgpu/attentionMask32_program.js +2 -2
- package/dist/ops/webgpu/clipScale.js +1 -1
- package/dist/ops/webgpu/concat16.js +5 -5
- package/dist/ops/webgpu/dropout16.js +3 -3
- package/dist/ops/webgpu/gatherSub.js +3 -3
- package/dist/ops/webgpu/gelu.js +3 -3
- package/dist/ops/webgpu/matMul16.js +8 -4
- package/dist/ops/webgpu/matMul16_program.js +7 -7
- package/dist/ops/webgpu/mul16.js +1 -1
- package/dist/ops/webgpu/norm2.js +1 -1
- package/dist/ops/webgpu/normRMS.js +3 -3
- package/dist/ops/webgpu/normRMSGrad.js +4 -4
- package/dist/ops/webgpu/pack16.js +1 -1
- package/dist/ops/webgpu/pack16_program.js +2 -2
- package/dist/ops/webgpu/qkv.js +2 -2
- package/dist/ops/webgpu/rope.js +3 -3
- package/dist/ops/webgpu/scatterSub.js +3 -3
- package/dist/ops/webgpu/slice16.js +4 -4
- package/dist/ops/webgpu/softmax16.js +1 -1
- package/dist/ops/webgpu/softmax16_program.js +2 -2
- package/dist/ops/webgpu/softmax16_subgroup_program.js +2 -2
- package/dist/ops/webgpu/softmax16grad.js +1 -1
- package/dist/ops/webgpu/sub16.js +1 -1
- package/dist/ops/webgpu/sum16.js +15 -15
- package/dist/ops/webgpu/transpose16.js +1 -1
- package/dist/ops/webgpu/transpose16_program.js +2 -2
- package/dist/ops/webgpu/transpose16_shared_program.js +3 -3
- package/dist/ops/webgpu/unpack16.js +3 -3
- package/dist/ops/webgpu/utils/binary_op.js +3 -3
- package/dist/ops/webgpu/utils/reductions.js +3 -3
- package/dist/{pack16-Ck-spx_F.js → pack16-BhuXNUS7.js} +1 -1
- package/dist/patches/webgpu_backend.js +3 -3
- package/dist/patches/webgpu_base.js +1 -1
- package/dist/patches/webgpu_program.js +4 -4
- package/dist/{pdf-UoDqCYzz.js → pdf-CdmW8ikl.js} +1159 -1160
- package/dist/{picomatch-3tUnMMbd.js → picomatch-BO4HbNfo.js} +125 -127
- package/dist/{rope-CbeGlsV8.js → rope-C8EAiSGY.js} +1 -1
- package/dist/{selu_util-zkAx5doH.js → selu_util-B_AFEfoz.js} +1 -1
- package/dist/{shared-D1coEFea.js → shared-24EoeHJl.js} +4 -4
- package/dist/{shared-DOgWaqvL.js → shared-CfTzpULd.js} +1 -1
- package/dist/{slice_util-Dgb3ANWI.js → slice_util-Dve4TkDn.js} +2 -2
- package/dist/{tfjs_backend-BjuQ5FqB.js → tfjs_backend-CydPRQTc.js} +2 -2
- package/dist/tokeniser/BaseTokeniser.js +1 -1
- package/dist/tokeniser/CharTokeniser.js +1 -1
- package/dist/tokeniser/bpe.js +1 -1
- package/dist/training/AdamW.js +1 -1
- package/dist/training/BasicTrainer.js +2 -2
- package/dist/training/DatasetBuilder.d.ts +0 -1
- package/dist/training/DatasetBuilder.js +2 -2
- package/dist/training/Evaluator.js +1 -1
- package/dist/training/PreTrainer.js +1 -1
- package/dist/training/SFTTrainer.js +1 -1
- package/dist/training/loss.js +2 -2
- package/dist/training/orthoGrad.js +1 -1
- package/dist/training/sparseCrossEntropy.js +1 -1
- package/dist/training/tasks/ConversationTask.js +1 -1
- package/dist/training/validation.js +1 -1
- package/dist/utilities/arrayClose.d.ts +1 -0
- package/dist/utilities/arrayClose.js +13 -1
- package/dist/utilities/dummy.js +1 -1
- package/dist/utilities/float16.d.ts +3 -0
- package/dist/utilities/float16.js +46 -0
- package/dist/utilities/multinomialCPU.js +1 -1
- package/dist/utilities/packed.js +1 -1
- package/dist/utilities/performance.js +1 -1
- package/dist/utilities/profile.js +1 -1
- package/dist/utilities/safetensors.d.ts +3 -1
- package/dist/utilities/safetensors.js +46 -36
- package/dist/utilities/sentences.js +1 -1
- package/dist/utilities/weights.js +1 -1
- package/dist/{webgpu-Dt7BMzWz.js → webgpu-B19Tw8Nd.js} +3 -3
- package/dist/{webgpu_program-WOyIVMlZ.js → webgpu_program-B0PokuRJ.js} +1 -1
- package/dist/{webgpu_util-B_F3SShA.js → webgpu_util-DfODg6XI.js} +1 -1
- package/package.json +5 -5
- package/dist/dist-DXwIvKxl.js +0 -896
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { t as e } from "./chunk-
|
|
2
|
-
import { i as t, r as n } from "./dist-DXwIvKxl.js";
|
|
1
|
+
import { t as e } from "./chunk-CWhphoD1.js";
|
|
3
2
|
//#region node_modules/picomatch/lib/constants.js
|
|
4
|
-
var
|
|
3
|
+
var t = /* @__PURE__ */ e(((e, t) => {
|
|
5
4
|
var n = "\\\\/", r = `[^${n}]`, i = 0, a = "\\.", o = "\\+", s = "\\?", c = "\\/", l = "(?=.)", u = "[^/]", d = `(?:${c}|$)`, f = `(?:^|${c})`, p = `${a}{1,2}${d}`, m = {
|
|
6
5
|
DOT_LITERAL: a,
|
|
7
6
|
PLUS_LITERAL: o,
|
|
@@ -142,16 +141,15 @@ var r = /* @__PURE__ */ e(((e, t) => {
|
|
|
142
141
|
return e === !0 ? h : m;
|
|
143
142
|
}
|
|
144
143
|
};
|
|
145
|
-
})),
|
|
146
|
-
n();
|
|
147
|
-
|
|
148
|
-
e.isObject = (e) => typeof e == "object" && !!e && !Array.isArray(e), e.hasRegexChars = (e) => o.test(e), e.isRegexChar = (t) => t.length === 1 && e.hasRegexChars(t), e.escapeRegex = (e) => e.replace(s, "\\$1"), e.toPosixSlashes = (e) => e.replace(i, "/"), e.isWindows = () => {
|
|
144
|
+
})), n = /* @__PURE__ */ e(((e) => {
|
|
145
|
+
var { REGEX_BACKSLASH: n, REGEX_REMOVE_BACKSLASH: r, REGEX_SPECIAL_CHARS: i, REGEX_SPECIAL_CHARS_GLOBAL: a } = t();
|
|
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(n, "/"), e.isWindows = () => {
|
|
149
147
|
if (typeof navigator < "u" && navigator.platform) {
|
|
150
148
|
let e = navigator.platform.toLowerCase();
|
|
151
149
|
return e === "win32" || e === "windows";
|
|
152
150
|
}
|
|
153
|
-
return
|
|
154
|
-
}, e.removeBackslashes = (e) => e.replace(
|
|
151
|
+
return typeof process < "u" && process.platform ? process.platform === "win32" : !1;
|
|
152
|
+
}, e.removeBackslashes = (e) => e.replace(r, (e) => e === "\\" ? "" : e), e.escapeLast = (t, n, r) => {
|
|
155
153
|
let i = t.lastIndexOf(n, r);
|
|
156
154
|
return i === -1 ? t : t[i - 1] === "\\" ? e.escapeLast(t, n, i - 1) : `${t.slice(0, i)}\\${t.slice(i)}`;
|
|
157
155
|
}, e.removePrefix = (e, t = {}) => {
|
|
@@ -164,17 +162,17 @@ var r = /* @__PURE__ */ e(((e, t) => {
|
|
|
164
162
|
let n = e.split(t ? /[\\/]/ : "/"), r = n[n.length - 1];
|
|
165
163
|
return r === "" ? n[n.length - 2] : r;
|
|
166
164
|
};
|
|
167
|
-
})),
|
|
168
|
-
var
|
|
165
|
+
})), r = /* @__PURE__ */ e(((e, r) => {
|
|
166
|
+
var i = n(), { 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 } = t(), b = (e) => e === d || e === s, x = (e) => {
|
|
169
167
|
e.isPrefix !== !0 && (e.depth = e.isGlobstar ? Infinity : 1);
|
|
170
168
|
};
|
|
171
|
-
|
|
172
|
-
let
|
|
169
|
+
r.exports = (e, t) => {
|
|
170
|
+
let n = t || {}, r = e.length - 1, S = n.parts === !0 || n.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 = {
|
|
173
171
|
value: "",
|
|
174
172
|
depth: 0,
|
|
175
173
|
isGlob: !1
|
|
176
|
-
}, W = () => D >=
|
|
177
|
-
for (; D <
|
|
174
|
+
}, W = () => D >= r, G = () => E.charCodeAt(D + 1), K = () => (V = H, E.charCodeAt(++D));
|
|
175
|
+
for (; D < r;) {
|
|
178
176
|
H = K();
|
|
179
177
|
let e;
|
|
180
178
|
if (H === s) {
|
|
@@ -220,7 +218,7 @@ var r = /* @__PURE__ */ e(((e, t) => {
|
|
|
220
218
|
k = D + 1;
|
|
221
219
|
continue;
|
|
222
220
|
}
|
|
223
|
-
if (
|
|
221
|
+
if (n.noext !== !0 && (H === h || H === o || H === a || H === g || H === u) && G() === p) {
|
|
224
222
|
if (M = U.isGlob = !0, N = U.isExtglob = !0, z = !0, H === u && D === O && (R = !0), S === !0) {
|
|
225
223
|
for (; W() !== !0 && (H = K());) {
|
|
226
224
|
if (H === s) {
|
|
@@ -258,11 +256,11 @@ var r = /* @__PURE__ */ e(((e, t) => {
|
|
|
258
256
|
if (S === !0) continue;
|
|
259
257
|
break;
|
|
260
258
|
}
|
|
261
|
-
if (
|
|
259
|
+
if (n.nonegate !== !0 && H === u && D === O) {
|
|
262
260
|
L = U.negated = !0, O++;
|
|
263
261
|
continue;
|
|
264
262
|
}
|
|
265
|
-
if (
|
|
263
|
+
if (n.noparen !== !0 && H === p) {
|
|
266
264
|
if (M = U.isGlob = !0, S === !0) {
|
|
267
265
|
for (; W() !== !0 && (H = K());) {
|
|
268
266
|
if (H === p) {
|
|
@@ -283,9 +281,9 @@ var r = /* @__PURE__ */ e(((e, t) => {
|
|
|
283
281
|
break;
|
|
284
282
|
}
|
|
285
283
|
}
|
|
286
|
-
|
|
284
|
+
n.noext === !0 && (N = !1, M = !1);
|
|
287
285
|
let q = E, J = "", Y = "";
|
|
288
|
-
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)),
|
|
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)), n.unescape === !0 && (Y &&= i.removeBackslashes(Y), q && I === !0 && (q = i.removeBackslashes(q)));
|
|
289
287
|
let X = {
|
|
290
288
|
prefix: J,
|
|
291
289
|
input: e,
|
|
@@ -300,22 +298,22 @@ var r = /* @__PURE__ */ e(((e, t) => {
|
|
|
300
298
|
negated: L,
|
|
301
299
|
negatedExtglob: R
|
|
302
300
|
};
|
|
303
|
-
if (
|
|
301
|
+
if (n.tokens === !0 && (X.maxDepth = 0, b(H) || w.push(U), X.tokens = w), n.parts === !0 || n.tokens === !0) {
|
|
304
302
|
let t;
|
|
305
|
-
for (let
|
|
306
|
-
let i = t ? t + 1 : O, a = C[
|
|
307
|
-
|
|
303
|
+
for (let r = 0; r < C.length; r++) {
|
|
304
|
+
let i = t ? t + 1 : O, a = C[r], o = e.slice(i, a);
|
|
305
|
+
n.tokens && (r === 0 && O !== 0 ? (w[r].isPrefix = !0, w[r].value = J) : w[r].value = o, x(w[r]), X.maxDepth += w[r].depth), (r !== 0 || o !== "") && T.push(o), t = a;
|
|
308
306
|
}
|
|
309
307
|
if (t && t + 1 < e.length) {
|
|
310
|
-
let
|
|
311
|
-
T.push(
|
|
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);
|
|
312
310
|
}
|
|
313
311
|
X.slashes = C, X.parts = T;
|
|
314
312
|
}
|
|
315
313
|
return X;
|
|
316
314
|
};
|
|
317
|
-
})),
|
|
318
|
-
var
|
|
315
|
+
})), i = /* @__PURE__ */ e(((e, r) => {
|
|
316
|
+
var i = t(), a = n(), { MAX_LENGTH: o, POSIX_REGEX_SOURCE: s, REGEX_NON_SPECIAL_CHARS: c, REGEX_SPECIAL_CHARS_BACKREF: l, REPLACEMENTS: u } = i, d = (e, t) => {
|
|
319
317
|
if (typeof t.expandRange == "function") return t.expandRange(...e, t);
|
|
320
318
|
e.sort();
|
|
321
319
|
let n = `[${e.join("-")}]`;
|
|
@@ -437,33 +435,33 @@ var r = /* @__PURE__ */ e(((e, t) => {
|
|
|
437
435
|
return t;
|
|
438
436
|
}, b = (e, t) => {
|
|
439
437
|
if (t.maxExtglobRecursion === !1) return { risky: !1 };
|
|
440
|
-
let
|
|
441
|
-
if (
|
|
442
|
-
for (let e of
|
|
438
|
+
let n = typeof t.maxExtglobRecursion == "number" ? t.maxExtglobRecursion : i.DEFAULT_MAX_EXTGLOB_RECURSION, r = p(e).map((e) => e.trim());
|
|
439
|
+
if (r.length > 1 && (r.some((e) => e === "") || r.some((e) => /^[*?]+$/.test(e)) || g(r))) return { risky: !0 };
|
|
440
|
+
for (let e of r) {
|
|
443
441
|
let t = v(e);
|
|
444
442
|
if (t) return {
|
|
445
443
|
risky: !0,
|
|
446
444
|
safeOutput: t
|
|
447
445
|
};
|
|
448
|
-
if (y(e) >
|
|
446
|
+
if (y(e) > n) return { risky: !0 };
|
|
449
447
|
}
|
|
450
448
|
return { risky: !1 };
|
|
451
449
|
}, x = (e, t) => {
|
|
452
450
|
if (typeof e != "string") throw TypeError("Expected a string");
|
|
453
451
|
e = u[e] || e;
|
|
454
|
-
let
|
|
455
|
-
if (p >
|
|
452
|
+
let n = { ...t }, r = typeof n.maxLength == "number" ? Math.min(o, n.maxLength) : o, p = e.length;
|
|
453
|
+
if (p > r) throw SyntaxError(`Input length: ${p}, exceeds maximum allowed length: ${r}`);
|
|
456
454
|
let m = {
|
|
457
455
|
type: "bos",
|
|
458
456
|
value: "",
|
|
459
|
-
output:
|
|
460
|
-
}, h = [m], g =
|
|
461
|
-
|
|
457
|
+
output: n.prepend || ""
|
|
458
|
+
}, h = [m], g = n.capture ? "" : "?:", _ = i.globChars(n.windows), v = i.extglobChars(_), { DOT_LITERAL: y, PLUS_LITERAL: S, 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 = n.dot ? "" : E, F = n.dot ? k : A, I = n.bash === !0 ? N(n) : j;
|
|
459
|
+
n.capture && (I = `(${I})`), typeof n.noext == "boolean" && (n.noextglob = n.noext);
|
|
462
460
|
let L = {
|
|
463
461
|
input: e,
|
|
464
462
|
index: -1,
|
|
465
463
|
start: 0,
|
|
466
|
-
dot:
|
|
464
|
+
dot: n.dot === !0,
|
|
467
465
|
consumed: "",
|
|
468
466
|
output: "",
|
|
469
467
|
prefix: "",
|
|
@@ -500,13 +498,13 @@ var r = /* @__PURE__ */ e(((e, t) => {
|
|
|
500
498
|
}
|
|
501
499
|
e.prev = V, h.push(e), V = e;
|
|
502
500
|
}, $ = (e, t) => {
|
|
503
|
-
let
|
|
501
|
+
let r = {
|
|
504
502
|
...v[t],
|
|
505
503
|
conditions: 1,
|
|
506
504
|
inner: ""
|
|
507
505
|
};
|
|
508
|
-
|
|
509
|
-
let i = (
|
|
506
|
+
r.prev = V, r.parens = L.parens, r.output = L.output, r.startIndex = L.index, r.tokensIndex = h.length;
|
|
507
|
+
let i = (n.capture ? "(" : "") + r.open;
|
|
510
508
|
X("parens"), Q({
|
|
511
509
|
type: e,
|
|
512
510
|
value: t,
|
|
@@ -516,14 +514,14 @@ var r = /* @__PURE__ */ e(((e, t) => {
|
|
|
516
514
|
extglob: !0,
|
|
517
515
|
value: G(),
|
|
518
516
|
output: i
|
|
519
|
-
}), R.push(
|
|
520
|
-
}, ee = (
|
|
521
|
-
let i = e.slice(
|
|
522
|
-
if ((
|
|
523
|
-
let e = o.safeOutput ? (
|
|
517
|
+
}), R.push(r);
|
|
518
|
+
}, ee = (r) => {
|
|
519
|
+
let i = e.slice(r.startIndex, L.index + 1), o = b(e.slice(r.startIndex + 2, L.index), n);
|
|
520
|
+
if ((r.type === "plus" || r.type === "star") && o.risky) {
|
|
521
|
+
let e = o.safeOutput ? (r.output ? "" : w) + (n.capture ? `(${o.safeOutput})` : o.safeOutput) : void 0, t = h[r.tokensIndex];
|
|
524
522
|
t.type = "text", t.value = i, t.output = e || a.escapeRegex(i);
|
|
525
|
-
for (let e =
|
|
526
|
-
L.output =
|
|
523
|
+
for (let e = r.tokensIndex + 1; e < h.length; e++) h[e].value = "", h[e].output = "", delete h[e].suffix;
|
|
524
|
+
L.output = r.output + t.output, L.backtrack = !0, Q({
|
|
527
525
|
type: "paren",
|
|
528
526
|
extglob: !0,
|
|
529
527
|
value: H,
|
|
@@ -531,13 +529,13 @@ var r = /* @__PURE__ */ e(((e, t) => {
|
|
|
531
529
|
}), Z("parens");
|
|
532
530
|
return;
|
|
533
531
|
}
|
|
534
|
-
let s =
|
|
535
|
-
if (
|
|
532
|
+
let s = r.close + (n.capture ? ")" : ""), c;
|
|
533
|
+
if (r.type === "negate") {
|
|
536
534
|
let e = I;
|
|
537
|
-
|
|
535
|
+
r.inner && r.inner.length > 1 && r.inner.includes("/") && (e = N(n)), (e !== I || U() || /^\)+$/.test(K())) && (s = r.close = `)$))${e}`), r.inner.includes("*") && (c = K()) && /^\.[^\\/.]+$/.test(c) && (s = r.close = `)${x(c, {
|
|
538
536
|
...t,
|
|
539
537
|
fastpaths: !1
|
|
540
|
-
}).output})${e})`),
|
|
538
|
+
}).output})${e})`), r.prev.type === "bos" && (L.negatedExtglob = !0);
|
|
541
539
|
}
|
|
542
540
|
Q({
|
|
543
541
|
type: "paren",
|
|
@@ -546,15 +544,15 @@ var r = /* @__PURE__ */ e(((e, t) => {
|
|
|
546
544
|
output: s
|
|
547
545
|
}), Z("parens");
|
|
548
546
|
};
|
|
549
|
-
if (
|
|
550
|
-
let
|
|
551
|
-
return
|
|
547
|
+
if (n.fastpaths !== !1 && !/(^[*!]|[/()[\]{}"])/.test(e)) {
|
|
548
|
+
let r = !1, i = e.replace(l, (e, t, n, i, a, o) => i === "\\" ? (r = !0, e) : i === "?" ? t ? t + i + (a ? k.repeat(a.length) : "") : o === 0 ? F + (a ? k.repeat(a.length) : "") : k.repeat(n.length) : i === "." ? y.repeat(n.length) : i === "*" ? t ? t + i + (a ? I : "") : I : t ? e : `\\${e}`);
|
|
549
|
+
return r === !0 && (i = n.unescape === !0 ? i.replace(/\\/g, "") : i.replace(/\\+/g, (e) => e.length % 2 == 0 ? "\\\\" : e ? "\\" : "")), i === e && n.contains === !0 ? (L.output = e, L) : (L.output = a.wrapOutput(i, L, t), L);
|
|
552
550
|
}
|
|
553
551
|
for (; !U();) {
|
|
554
552
|
if (H = G(), H === "\0") continue;
|
|
555
553
|
if (H === "\\") {
|
|
556
554
|
let e = W();
|
|
557
|
-
if (e === "/" &&
|
|
555
|
+
if (e === "/" && n.bash !== !0 || e === "." || e === ";") continue;
|
|
558
556
|
if (!e) {
|
|
559
557
|
H += "\\", Q({
|
|
560
558
|
type: "text",
|
|
@@ -562,8 +560,8 @@ var r = /* @__PURE__ */ e(((e, t) => {
|
|
|
562
560
|
});
|
|
563
561
|
continue;
|
|
564
562
|
}
|
|
565
|
-
let t = /^\\+/.exec(K()),
|
|
566
|
-
if (t && t[0].length > 2 && (
|
|
563
|
+
let t = /^\\+/.exec(K()), r = 0;
|
|
564
|
+
if (t && t[0].length > 2 && (r = t[0].length, L.index += r, r % 2 != 0 && (H += "\\")), n.unescape === !0 ? H = G() : H += G(), L.brackets === 0) {
|
|
567
565
|
Q({
|
|
568
566
|
type: "text",
|
|
569
567
|
value: H
|
|
@@ -572,7 +570,7 @@ var r = /* @__PURE__ */ e(((e, t) => {
|
|
|
572
570
|
}
|
|
573
571
|
}
|
|
574
572
|
if (L.brackets > 0 && (H !== "]" || V.value === "[" || V.value === "[^")) {
|
|
575
|
-
if (
|
|
573
|
+
if (n.posix !== !1 && H === ":") {
|
|
576
574
|
let e = V.value.slice(1);
|
|
577
575
|
if (e.includes("[") && (V.posix = !0, e.includes(":"))) {
|
|
578
576
|
let e = V.value.lastIndexOf("["), t = V.value.slice(0, e), n = s[V.value.slice(e + 2)];
|
|
@@ -582,7 +580,7 @@ var r = /* @__PURE__ */ e(((e, t) => {
|
|
|
582
580
|
}
|
|
583
581
|
}
|
|
584
582
|
}
|
|
585
|
-
(H === "[" && W() !== ":" || H === "-" && W() === "]") && (H = `\\${H}`), H === "]" && (V.value === "[" || V.value === "[^") && (H = `\\${H}`),
|
|
583
|
+
(H === "[" && W() !== ":" || H === "-" && W() === "]") && (H = `\\${H}`), H === "]" && (V.value === "[" || V.value === "[^") && (H = `\\${H}`), n.posix === !0 && H === "!" && V.value === "[" && (H = "^"), V.value += H, J({ value: H });
|
|
586
584
|
continue;
|
|
587
585
|
}
|
|
588
586
|
if (L.quotes === 1 && H !== "\"") {
|
|
@@ -590,7 +588,7 @@ var r = /* @__PURE__ */ e(((e, t) => {
|
|
|
590
588
|
continue;
|
|
591
589
|
}
|
|
592
590
|
if (H === "\"") {
|
|
593
|
-
L.quotes = L.quotes === 1 ? 0 : 1,
|
|
591
|
+
L.quotes = L.quotes === 1 ? 0 : 1, n.keepQuotes === !0 && Q({
|
|
594
592
|
type: "text",
|
|
595
593
|
value: H
|
|
596
594
|
});
|
|
@@ -604,7 +602,7 @@ var r = /* @__PURE__ */ e(((e, t) => {
|
|
|
604
602
|
continue;
|
|
605
603
|
}
|
|
606
604
|
if (H === ")") {
|
|
607
|
-
if (L.parens === 0 &&
|
|
605
|
+
if (L.parens === 0 && n.strictBrackets === !0) throw SyntaxError(f("opening", "("));
|
|
608
606
|
let e = R[R.length - 1];
|
|
609
607
|
if (e && L.parens === e.parens + 1) {
|
|
610
608
|
ee(R.pop());
|
|
@@ -618,8 +616,8 @@ var r = /* @__PURE__ */ e(((e, t) => {
|
|
|
618
616
|
continue;
|
|
619
617
|
}
|
|
620
618
|
if (H === "[") {
|
|
621
|
-
if (
|
|
622
|
-
if (
|
|
619
|
+
if (n.nobracket === !0 || !K().includes("]")) {
|
|
620
|
+
if (n.nobracket !== !0 && n.strictBrackets === !0) throw SyntaxError(f("closing", "]"));
|
|
623
621
|
H = `\\${H}`;
|
|
624
622
|
} else X("brackets");
|
|
625
623
|
Q({
|
|
@@ -629,7 +627,7 @@ var r = /* @__PURE__ */ e(((e, t) => {
|
|
|
629
627
|
continue;
|
|
630
628
|
}
|
|
631
629
|
if (H === "]") {
|
|
632
|
-
if (
|
|
630
|
+
if (n.nobracket === !0 || V && V.type === "bracket" && V.value.length === 1) {
|
|
633
631
|
Q({
|
|
634
632
|
type: "text",
|
|
635
633
|
value: H,
|
|
@@ -638,7 +636,7 @@ var r = /* @__PURE__ */ e(((e, t) => {
|
|
|
638
636
|
continue;
|
|
639
637
|
}
|
|
640
638
|
if (L.brackets === 0) {
|
|
641
|
-
if (
|
|
639
|
+
if (n.strictBrackets === !0) throw SyntaxError(f("opening", "["));
|
|
642
640
|
Q({
|
|
643
641
|
type: "text",
|
|
644
642
|
value: H,
|
|
@@ -648,16 +646,16 @@ var r = /* @__PURE__ */ e(((e, t) => {
|
|
|
648
646
|
}
|
|
649
647
|
Z("brackets");
|
|
650
648
|
let e = V.value.slice(1);
|
|
651
|
-
if (V.posix !== !0 && e[0] === "^" && !e.includes("/") && (H = `/${H}`), V.value += H, J({ value: H }),
|
|
649
|
+
if (V.posix !== !0 && e[0] === "^" && !e.includes("/") && (H = `/${H}`), V.value += H, J({ value: H }), n.literalBrackets === !1 || a.hasRegexChars(e)) continue;
|
|
652
650
|
let t = a.escapeRegex(V.value);
|
|
653
|
-
if (L.output = L.output.slice(0, -V.value.length),
|
|
651
|
+
if (L.output = L.output.slice(0, -V.value.length), n.literalBrackets === !0) {
|
|
654
652
|
L.output += t, V.value = t;
|
|
655
653
|
continue;
|
|
656
654
|
}
|
|
657
655
|
V.value = `(${g}${t}|${V.value})`, L.output += V.value;
|
|
658
656
|
continue;
|
|
659
657
|
}
|
|
660
|
-
if (H === "{" &&
|
|
658
|
+
if (H === "{" && n.nobrace !== !0) {
|
|
661
659
|
X("braces");
|
|
662
660
|
let e = {
|
|
663
661
|
type: "brace",
|
|
@@ -671,7 +669,7 @@ var r = /* @__PURE__ */ e(((e, t) => {
|
|
|
671
669
|
}
|
|
672
670
|
if (H === "}") {
|
|
673
671
|
let e = z[z.length - 1];
|
|
674
|
-
if (
|
|
672
|
+
if (n.nobrace === !0 || !e) {
|
|
675
673
|
Q({
|
|
676
674
|
type: "text",
|
|
677
675
|
value: H,
|
|
@@ -681,9 +679,9 @@ var r = /* @__PURE__ */ e(((e, t) => {
|
|
|
681
679
|
}
|
|
682
680
|
let t = ")";
|
|
683
681
|
if (e.dots === !0) {
|
|
684
|
-
let e = h.slice(),
|
|
685
|
-
for (let t = e.length - 1; t >= 0 && (h.pop(), e[t].type !== "brace"); t--) e[t].type !== "dots" &&
|
|
686
|
-
t = d(
|
|
682
|
+
let e = h.slice(), r = [];
|
|
683
|
+
for (let t = e.length - 1; t >= 0 && (h.pop(), e[t].type !== "brace"); t--) e[t].type !== "dots" && r.unshift(e[t].value);
|
|
684
|
+
t = d(r, n), L.backtrack = !0;
|
|
687
685
|
}
|
|
688
686
|
if (e.comma !== !0 && e.dots !== !0) {
|
|
689
687
|
let n = L.output.slice(0, e.outputIndex), r = L.tokens.slice(e.tokensIndex);
|
|
@@ -748,7 +746,7 @@ var r = /* @__PURE__ */ e(((e, t) => {
|
|
|
748
746
|
continue;
|
|
749
747
|
}
|
|
750
748
|
if (H === "?") {
|
|
751
|
-
if (!(V && V.value === "(") &&
|
|
749
|
+
if (!(V && V.value === "(") && n.noextglob !== !0 && W() === "(" && W(2) !== "?") {
|
|
752
750
|
$("qmark", H);
|
|
753
751
|
continue;
|
|
754
752
|
}
|
|
@@ -761,7 +759,7 @@ var r = /* @__PURE__ */ e(((e, t) => {
|
|
|
761
759
|
});
|
|
762
760
|
continue;
|
|
763
761
|
}
|
|
764
|
-
if (
|
|
762
|
+
if (n.dot !== !0 && (V.type === "slash" || V.type === "bos")) {
|
|
765
763
|
Q({
|
|
766
764
|
type: "qmark",
|
|
767
765
|
value: H,
|
|
@@ -777,21 +775,21 @@ var r = /* @__PURE__ */ e(((e, t) => {
|
|
|
777
775
|
continue;
|
|
778
776
|
}
|
|
779
777
|
if (H === "!") {
|
|
780
|
-
if (
|
|
778
|
+
if (n.noextglob !== !0 && W() === "(" && (W(2) !== "?" || !/[!=<:]/.test(W(3)))) {
|
|
781
779
|
$("negate", H);
|
|
782
780
|
continue;
|
|
783
781
|
}
|
|
784
|
-
if (
|
|
782
|
+
if (n.nonegate !== !0 && L.index === 0) {
|
|
785
783
|
Y();
|
|
786
784
|
continue;
|
|
787
785
|
}
|
|
788
786
|
}
|
|
789
787
|
if (H === "+") {
|
|
790
|
-
if (
|
|
788
|
+
if (n.noextglob !== !0 && W() === "(" && W(2) !== "?") {
|
|
791
789
|
$("plus", H);
|
|
792
790
|
continue;
|
|
793
791
|
}
|
|
794
|
-
if (V && V.value === "(" ||
|
|
792
|
+
if (V && V.value === "(" || n.regex === !1) {
|
|
795
793
|
Q({
|
|
796
794
|
type: "plus",
|
|
797
795
|
value: H,
|
|
@@ -813,7 +811,7 @@ var r = /* @__PURE__ */ e(((e, t) => {
|
|
|
813
811
|
continue;
|
|
814
812
|
}
|
|
815
813
|
if (H === "@") {
|
|
816
|
-
if (
|
|
814
|
+
if (n.noextglob !== !0 && W() === "(" && W(2) !== "?") {
|
|
817
815
|
Q({
|
|
818
816
|
type: "at",
|
|
819
817
|
extglob: !0,
|
|
@@ -842,17 +840,17 @@ var r = /* @__PURE__ */ e(((e, t) => {
|
|
|
842
840
|
continue;
|
|
843
841
|
}
|
|
844
842
|
let t = K();
|
|
845
|
-
if (
|
|
843
|
+
if (n.noextglob !== !0 && /^\([^?]/.test(t)) {
|
|
846
844
|
$("star", H);
|
|
847
845
|
continue;
|
|
848
846
|
}
|
|
849
847
|
if (V.type === "star") {
|
|
850
|
-
if (
|
|
848
|
+
if (n.noglobstar === !0) {
|
|
851
849
|
q(H);
|
|
852
850
|
continue;
|
|
853
851
|
}
|
|
854
|
-
let
|
|
855
|
-
if (
|
|
852
|
+
let r = V.prev, i = r.prev, a = r.type === "slash" || r.type === "bos", o = i && (i.type === "star" || i.type === "globstar");
|
|
853
|
+
if (n.bash === !0 && (!a || t[0] && t[0] !== "/")) {
|
|
856
854
|
Q({
|
|
857
855
|
type: "star",
|
|
858
856
|
value: H,
|
|
@@ -860,8 +858,8 @@ var r = /* @__PURE__ */ e(((e, t) => {
|
|
|
860
858
|
});
|
|
861
859
|
continue;
|
|
862
860
|
}
|
|
863
|
-
let s = L.braces > 0 && (
|
|
864
|
-
if (!a &&
|
|
861
|
+
let s = L.braces > 0 && (r.type === "comma" || r.type === "brace"), c = R.length && (r.type === "pipe" || r.type === "paren");
|
|
862
|
+
if (!a && r.type !== "paren" && !s && !c) {
|
|
865
863
|
Q({
|
|
866
864
|
type: "star",
|
|
867
865
|
value: H,
|
|
@@ -874,62 +872,62 @@ var r = /* @__PURE__ */ e(((e, t) => {
|
|
|
874
872
|
if (n && n !== "/") break;
|
|
875
873
|
t = t.slice(3), q("/**", 3);
|
|
876
874
|
}
|
|
877
|
-
if (
|
|
878
|
-
V.type = "globstar", V.value += H, V.output = N(
|
|
875
|
+
if (r.type === "bos" && U()) {
|
|
876
|
+
V.type = "globstar", V.value += H, V.output = N(n), L.output = V.output, L.globstar = !0, q(H);
|
|
879
877
|
continue;
|
|
880
878
|
}
|
|
881
|
-
if (
|
|
882
|
-
L.output = L.output.slice(0, -(
|
|
879
|
+
if (r.type === "slash" && r.prev.type !== "bos" && !o && U()) {
|
|
880
|
+
L.output = L.output.slice(0, -(r.output + V.output).length), r.output = `(?:${r.output}`, V.type = "globstar", V.output = N(n) + (n.strictSlashes ? ")" : "|$)"), V.value += H, L.globstar = !0, L.output += r.output + V.output, q(H);
|
|
883
881
|
continue;
|
|
884
882
|
}
|
|
885
|
-
if (
|
|
883
|
+
if (r.type === "slash" && r.prev.type !== "bos" && t[0] === "/") {
|
|
886
884
|
let e = t[1] === void 0 ? "" : "|$";
|
|
887
|
-
L.output = L.output.slice(0, -(
|
|
885
|
+
L.output = L.output.slice(0, -(r.output + V.output).length), r.output = `(?:${r.output}`, V.type = "globstar", V.output = `${N(n)}${C}|${C}${e})`, V.value += H, L.output += r.output + V.output, L.globstar = !0, q(H + G()), Q({
|
|
888
886
|
type: "slash",
|
|
889
887
|
value: "/",
|
|
890
888
|
output: ""
|
|
891
889
|
});
|
|
892
890
|
continue;
|
|
893
891
|
}
|
|
894
|
-
if (
|
|
895
|
-
V.type = "globstar", V.value += H, V.output = `(?:^|${C}|${N(
|
|
892
|
+
if (r.type === "bos" && t[0] === "/") {
|
|
893
|
+
V.type = "globstar", V.value += H, V.output = `(?:^|${C}|${N(n)}${C})`, L.output = V.output, L.globstar = !0, q(H + G()), Q({
|
|
896
894
|
type: "slash",
|
|
897
895
|
value: "/",
|
|
898
896
|
output: ""
|
|
899
897
|
});
|
|
900
898
|
continue;
|
|
901
899
|
}
|
|
902
|
-
L.output = L.output.slice(0, -V.output.length), V.type = "globstar", V.output = N(
|
|
900
|
+
L.output = L.output.slice(0, -V.output.length), V.type = "globstar", V.output = N(n), V.value += H, L.output += V.output, L.globstar = !0, q(H);
|
|
903
901
|
continue;
|
|
904
902
|
}
|
|
905
|
-
let
|
|
903
|
+
let r = {
|
|
906
904
|
type: "star",
|
|
907
905
|
value: H,
|
|
908
906
|
output: I
|
|
909
907
|
};
|
|
910
|
-
if (
|
|
911
|
-
|
|
908
|
+
if (n.bash === !0) {
|
|
909
|
+
r.output = ".*?", (V.type === "bos" || V.type === "slash") && (r.output = P + r.output), Q(r);
|
|
912
910
|
continue;
|
|
913
911
|
}
|
|
914
|
-
if (V && (V.type === "bracket" || V.type === "paren") &&
|
|
915
|
-
|
|
912
|
+
if (V && (V.type === "bracket" || V.type === "paren") && n.regex === !0) {
|
|
913
|
+
r.output = H, Q(r);
|
|
916
914
|
continue;
|
|
917
915
|
}
|
|
918
|
-
(L.index === L.start || V.type === "slash" || V.type === "dot") && (V.type === "dot" ? (L.output += D, V.output += D) :
|
|
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);
|
|
919
917
|
}
|
|
920
918
|
for (; L.brackets > 0;) {
|
|
921
|
-
if (
|
|
919
|
+
if (n.strictBrackets === !0) throw SyntaxError(f("closing", "]"));
|
|
922
920
|
L.output = a.escapeLast(L.output, "["), Z("brackets");
|
|
923
921
|
}
|
|
924
922
|
for (; L.parens > 0;) {
|
|
925
|
-
if (
|
|
923
|
+
if (n.strictBrackets === !0) throw SyntaxError(f("closing", ")"));
|
|
926
924
|
L.output = a.escapeLast(L.output, "("), Z("parens");
|
|
927
925
|
}
|
|
928
926
|
for (; L.braces > 0;) {
|
|
929
|
-
if (
|
|
927
|
+
if (n.strictBrackets === !0) throw SyntaxError(f("closing", "}"));
|
|
930
928
|
L.output = a.escapeLast(L.output, "{"), Z("braces");
|
|
931
929
|
}
|
|
932
|
-
if (
|
|
930
|
+
if (n.strictSlashes !== !0 && (V.type === "star" || V.type === "bracket") && Q({
|
|
933
931
|
type: "maybe_slash",
|
|
934
932
|
value: "",
|
|
935
933
|
output: `${C}?`
|
|
@@ -940,24 +938,24 @@ var r = /* @__PURE__ */ e(((e, t) => {
|
|
|
940
938
|
return L;
|
|
941
939
|
};
|
|
942
940
|
x.fastpaths = (e, t) => {
|
|
943
|
-
let
|
|
944
|
-
if (s >
|
|
941
|
+
let n = { ...t }, r = typeof n.maxLength == "number" ? Math.min(o, n.maxLength) : o, s = e.length;
|
|
942
|
+
if (s > r) throw SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${r}`);
|
|
945
943
|
e = u[e] || e;
|
|
946
|
-
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: _ } =
|
|
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: _ } = i.globChars(n.windows), v = n.dot ? m : p, y = n.dot ? h : p, b = n.capture ? "" : "?:", x = {
|
|
947
945
|
negated: !1,
|
|
948
946
|
prefix: ""
|
|
949
|
-
}, S =
|
|
950
|
-
|
|
947
|
+
}, S = n.bash === !0 ? ".*?" : g;
|
|
948
|
+
n.capture && (S = `(${S})`);
|
|
951
949
|
let C = (e) => e.noglobstar === !0 ? S : `(${b}(?:(?!${_}${e.dot ? f : c}).)*?)`, w = (e) => {
|
|
952
950
|
switch (e) {
|
|
953
951
|
case "*": return `${v}${d}${S}`;
|
|
954
952
|
case ".*": return `${c}${d}${S}`;
|
|
955
953
|
case "*.*": return `${v}${S}${c}${d}${S}`;
|
|
956
954
|
case "*/*": return `${v}${S}${l}${d}${y}${S}`;
|
|
957
|
-
case "**": return v + C(
|
|
958
|
-
case "**/*": return `(?:${v}${C(
|
|
959
|
-
case "**/*.*": return `(?:${v}${C(
|
|
960
|
-
case "**/.*": return `(?:${v}${C(
|
|
955
|
+
case "**": return v + C(n);
|
|
956
|
+
case "**/*": return `(?:${v}${C(n)}${l})?${y}${d}${S}`;
|
|
957
|
+
case "**/*.*": return `(?:${v}${C(n)}${l})?${y}${S}${c}${d}${S}`;
|
|
958
|
+
case "**/.*": return `(?:${v}${C(n)}${l})?${c}${d}${S}`;
|
|
961
959
|
default: {
|
|
962
960
|
let t = /^(.*?)\.(\w+)$/.exec(e);
|
|
963
961
|
if (!t) return;
|
|
@@ -966,10 +964,10 @@ var r = /* @__PURE__ */ e(((e, t) => {
|
|
|
966
964
|
}
|
|
967
965
|
}
|
|
968
966
|
}, T = w(a.removePrefix(e, x));
|
|
969
|
-
return T &&
|
|
970
|
-
},
|
|
971
|
-
})),
|
|
972
|
-
var
|
|
967
|
+
return T && n.strictSlashes !== !0 && (T += `${l}?`), T;
|
|
968
|
+
}, r.exports = x;
|
|
969
|
+
})), a = /* @__PURE__ */ e(((e, a) => {
|
|
970
|
+
var o = r(), s = i(), c = n(), l = t(), u = (e) => e && typeof e == "object" && !Array.isArray(e), d = (e, t, n = !1) => {
|
|
973
971
|
if (Array.isArray(e)) {
|
|
974
972
|
let r = e.map((e) => d(e, t, n));
|
|
975
973
|
return (e) => {
|
|
@@ -1027,7 +1025,7 @@ var r = /* @__PURE__ */ e(((e, t) => {
|
|
|
1027
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, {
|
|
1028
1026
|
...t,
|
|
1029
1027
|
fastpaths: !1
|
|
1030
|
-
}), d.scan = (e, t) =>
|
|
1028
|
+
}), d.scan = (e, t) => o(e, t), d.compileRe = (e, t, n = !1, r = !1) => {
|
|
1031
1029
|
if (n === !0) return e.output;
|
|
1032
1030
|
let i = t || {}, a = i.contains ? "" : "^", o = i.contains ? "" : "$", s = `${a}(?:${e.output})${o}`;
|
|
1033
1031
|
e && e.negated === !0 && (s = `^(?!${s}).*$`);
|
|
@@ -1048,16 +1046,16 @@ var r = /* @__PURE__ */ e(((e, t) => {
|
|
|
1048
1046
|
if (t && t.debug === !0) throw e;
|
|
1049
1047
|
return /$^/;
|
|
1050
1048
|
}
|
|
1051
|
-
}, d.constants = l,
|
|
1052
|
-
})),
|
|
1053
|
-
var
|
|
1054
|
-
function
|
|
1049
|
+
}, d.constants = l, a.exports = d;
|
|
1050
|
+
})), o = /* @__PURE__ */ e(((e, t) => {
|
|
1051
|
+
var r = a(), i = n();
|
|
1052
|
+
function o(e, t, n = !1) {
|
|
1055
1053
|
return t && (t.windows === null || t.windows === void 0) && (t = {
|
|
1056
1054
|
...t,
|
|
1057
|
-
windows:
|
|
1058
|
-
}),
|
|
1055
|
+
windows: i.isWindows()
|
|
1056
|
+
}), r(e, t, n);
|
|
1059
1057
|
}
|
|
1060
|
-
Object.assign(
|
|
1058
|
+
Object.assign(o, r), t.exports = o;
|
|
1061
1059
|
}));
|
|
1062
1060
|
//#endregion
|
|
1063
|
-
export {
|
|
1061
|
+
export { o as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $t as e, An as t, B as n, Rn as r, Wr as i, br as a, ct as o, gt as s, hr as c, lt as l, mn as u } from "./dist-
|
|
1
|
+
import { $t as e, An as t, B as n, Rn as r, Wr as i, br as a, ct as o, gt as s, hr as c, lt as l, mn as u } from "./dist-Da20xy8E.js";
|
|
2
2
|
//#region node_modules/@tensorflow/tfjs-core/dist/ops/fused_util.js
|
|
3
3
|
function d(e, t, r) {
|
|
4
4
|
if (r == null || r === "linear") return e;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { $o as t, $s as n, Ao as r, Bs as i, Ci as a, Di as o, Dn as s, En as c, Es as l, Fa as u, Fo as d, Hs as f, In as p, Jo as m, Ka as h, Ln as g, Na as _, Ni as v, Pi as y, Ps as b, Ra as x, Rs as S, Ti as C, Tn as ee, Us as w, Vs as T, Xr as E, Xs as D, Ya as te, _o as ne, aa as re, bo as ie, br as ae, ca as oe, di as se, fs as ce, ho as le, hs as ue, ki as O, ms as de, na as fe, nc as pe, no as me, ns as he, oa as ge, oc as k, qa as _e, ro as ve, sr as ye, uc as A, wn as be, wo as j, za as M } from "./dist-
|
|
3
|
-
import { B as xe, H as Se, R as Ce, V as we, _ as Te, c as N, d as Ee, f as De, g as Oe, h as ke, l as Ae, m as je, n as Me, p as Ne, r as P, s as Pe, u as Fe, v as Ie, z as Le } from "./backend_util-
|
|
4
|
-
import { a as Re, i as ze, n as Be, t as Ve } from "./slice_util-
|
|
1
|
+
import { n as e } from "./chunk-CWhphoD1.js";
|
|
2
|
+
import { $o as t, $s as n, Ao as r, Bs as i, Ci as a, Di as o, Dn as s, En as c, Es as l, Fa as u, Fo as d, Hs as f, In as p, Jo as m, Ka as h, Ln as g, Na as _, Ni as v, Pi as y, Ps as b, Ra as x, Rs as S, Ti as C, Tn as ee, Us as w, Vs as T, Xr as E, Xs as D, Ya as te, _o as ne, aa as re, bo as ie, br as ae, ca as oe, di as se, fs as ce, ho as le, hs as ue, ki as O, ms as de, na as fe, nc as pe, no as me, ns as he, oa as ge, oc as k, qa as _e, ro as ve, sr as ye, uc as A, wn as be, wo as j, za as M } from "./dist-Da20xy8E.js";
|
|
3
|
+
import { B as xe, H as Se, R as Ce, V as we, _ as Te, c as N, d as Ee, f as De, g as Oe, h as ke, l as Ae, m as je, n as Me, p as Ne, r as P, s as Pe, u as Fe, v as Ie, z as Le } from "./backend_util-DAV0I34P.js";
|
|
4
|
+
import { a as Re, i as ze, n as Be, t as Ve } from "./slice_util-Dve4TkDn.js";
|
|
5
5
|
import { s as F } from "./complex_util-CkazZsaH.js";
|
|
6
6
|
//#region node_modules/@tensorflow/tfjs-backend-cpu/dist/cpu_util.js
|
|
7
7
|
function I(e, t) {
|