@powerlines/plugin-automd 0.1.128 → 0.1.129

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.
Files changed (80) hide show
  1. package/dist/_virtual/rolldown_runtime.cjs +2 -0
  2. package/dist/_virtual/rolldown_runtime.mjs +32 -0
  3. package/dist/index.cjs +5 -5
  4. package/dist/index.d.mts +1 -1
  5. package/dist/index.mjs +7 -7
  6. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.cjs +78 -0
  7. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +77 -0
  8. package/dist/node_modules/.pnpm/acorn@8.15.0/node_modules/acorn/dist/acorn.cjs +5032 -0
  9. package/dist/node_modules/.pnpm/acorn@8.15.0/node_modules/acorn/dist/acorn.mjs +5031 -0
  10. package/dist/node_modules/.pnpm/automd@0.4.2_patch_hash_0fe864a2d6fa1461e144747e5f0fbc0a5fb51435ec6b3217ffb18ff2d7058778_magicast@0.5.1/node_modules/automd/dist/shared/automd.CjwUz8DJ.cjs +593 -0
  11. package/dist/node_modules/.pnpm/automd@0.4.2_patch_hash_0fe864a2d6fa1461e144747e5f0fbc0a5fb51435ec6b3217ffb18ff2d7058778_magicast@0.5.1/node_modules/automd/dist/shared/automd.CjwUz8DJ.mjs +590 -0
  12. package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DA7CpUDY.cjs +23 -0
  13. package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DA7CpUDY.mjs +22 -0
  14. package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DnMsyigM.cjs +405 -0
  15. package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DnMsyigM.mjs +404 -0
  16. package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.cjs +46 -0
  17. package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs +45 -0
  18. package/dist/node_modules/.pnpm/didyoumean2@7.0.4/node_modules/didyoumean2/dist/index.cjs +204 -0
  19. package/dist/node_modules/.pnpm/didyoumean2@7.0.4/node_modules/didyoumean2/dist/index.mjs +202 -0
  20. package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.cjs +1013 -0
  21. package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.mjs +1007 -0
  22. package/dist/node_modules/.pnpm/fastest-levenshtein@1.0.16/node_modules/fastest-levenshtein/mod.cjs +128 -0
  23. package/dist/node_modules/.pnpm/fastest-levenshtein@1.0.16/node_modules/fastest-levenshtein/mod.mjs +123 -0
  24. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/babel.cjs +41464 -0
  25. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/babel.mjs +41461 -0
  26. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/jiti.cjs +4387 -0
  27. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/jiti.mjs +4384 -0
  28. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/lib/jiti.cjs +26 -0
  29. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/lib/jiti.mjs +26 -0
  30. package/dist/node_modules/.pnpm/lodash.deburr@4.1.0/node_modules/lodash.deburr/index.cjs +370 -0
  31. package/dist/node_modules/.pnpm/lodash.deburr@4.1.0/node_modules/lodash.deburr/index.mjs +367 -0
  32. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.cjs +939 -0
  33. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs +939 -0
  34. package/dist/node_modules/.pnpm/mdbox@0.1.1/node_modules/mdbox/dist/index.cjs +67 -0
  35. package/dist/node_modules/.pnpm/mdbox@0.1.1/node_modules/mdbox/dist/index.mjs +64 -0
  36. package/dist/node_modules/.pnpm/mlly@1.8.0/node_modules/mlly/dist/index.cjs +1292 -0
  37. package/dist/node_modules/.pnpm/mlly@1.8.0/node_modules/mlly/dist/index.mjs +1284 -0
  38. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.cjs +179 -0
  39. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs +179 -0
  40. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.cjs +20 -0
  41. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.mjs +18 -0
  42. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.cjs +3975 -0
  43. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.mjs +3961 -0
  44. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DfbY2q-x.cjs +16 -0
  45. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DfbY2q-x.mjs +14 -0
  46. package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.cjs +36 -0
  47. package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.mjs +33 -0
  48. package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.cjs +227 -0
  49. package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs +225 -0
  50. package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.cjs +139 -0
  51. package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs +133 -0
  52. package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.cjs +77 -0
  53. package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs +76 -0
  54. package/dist/node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.cjs +72 -0
  55. package/dist/node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.mjs +69 -0
  56. package/dist/node_modules/.pnpm/ufo@1.6.2/node_modules/ufo/dist/index.cjs +178 -0
  57. package/dist/node_modules/.pnpm/ufo@1.6.2/node_modules/ufo/dist/index.mjs +175 -0
  58. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/babel.cjs +12337 -0
  59. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/babel.mjs +12337 -0
  60. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/loader.cjs +19 -0
  61. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/loader.mjs +18 -0
  62. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.BTwOq8Jl.cjs +71 -0
  63. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.BTwOq8Jl.mjs +71 -0
  64. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.Br_uXjZG.cjs +110 -0
  65. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.Br_uXjZG.mjs +100 -0
  66. package/dist/types/plugin.d.mts +3 -3
  67. package/package.json +4 -5
  68. /package/dist/{powerlines → packages/powerlines}/src/internal/helpers/hooks.d.mts +0 -0
  69. /package/dist/{powerlines → packages/powerlines}/src/types/api.d.mts +0 -0
  70. /package/dist/{powerlines → packages/powerlines}/src/types/babel.d.mts +0 -0
  71. /package/dist/{powerlines → packages/powerlines}/src/types/build.d.mts +0 -0
  72. /package/dist/{powerlines → packages/powerlines}/src/types/commands.d.mts +0 -0
  73. /package/dist/{powerlines → packages/powerlines}/src/types/config.d.mts +0 -0
  74. /package/dist/{powerlines → packages/powerlines}/src/types/context.d.mts +0 -0
  75. /package/dist/{powerlines → packages/powerlines}/src/types/fs.d.mts +0 -0
  76. /package/dist/{powerlines → packages/powerlines}/src/types/hooks.d.mts +0 -0
  77. /package/dist/{powerlines → packages/powerlines}/src/types/plugin.d.mts +0 -0
  78. /package/dist/{powerlines → packages/powerlines}/src/types/resolved.d.mts +0 -0
  79. /package/dist/{powerlines → packages/powerlines}/src/types/tsconfig.d.mts +0 -0
  80. /package/dist/{powerlines → packages/powerlines}/src/types/unplugin.d.mts +0 -0
@@ -0,0 +1,404 @@
1
+ import { N } from "./confbox.DA7CpUDY.mjs";
2
+
3
+ //#region ../../node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DnMsyigM.mjs
4
+ function $(n, l = !1) {
5
+ const g = n.length;
6
+ let e = 0, u = "", p = 0, k = 16, A = 0, o = 0, O = 0, B = 0, b = 0;
7
+ function I(i, T) {
8
+ let s = 0, c = 0;
9
+ for (; s < i;) {
10
+ let t = n.charCodeAt(e);
11
+ if (t >= 48 && t <= 57) c = c * 16 + t - 48;
12
+ else if (t >= 65 && t <= 70) c = c * 16 + t - 65 + 10;
13
+ else if (t >= 97 && t <= 102) c = c * 16 + t - 97 + 10;
14
+ else break;
15
+ e++, s++;
16
+ }
17
+ return s < i && (c = -1), c;
18
+ }
19
+ function V(i) {
20
+ e = i, u = "", p = 0, k = 16, b = 0;
21
+ }
22
+ function F() {
23
+ let i = e;
24
+ if (n.charCodeAt(e) === 48) e++;
25
+ else for (e++; e < n.length && L(n.charCodeAt(e));) e++;
26
+ if (e < n.length && n.charCodeAt(e) === 46) if (e++, e < n.length && L(n.charCodeAt(e))) for (e++; e < n.length && L(n.charCodeAt(e));) e++;
27
+ else return b = 3, n.substring(i, e);
28
+ let T = e;
29
+ if (e < n.length && (n.charCodeAt(e) === 69 || n.charCodeAt(e) === 101)) if (e++, (e < n.length && n.charCodeAt(e) === 43 || n.charCodeAt(e) === 45) && e++, e < n.length && L(n.charCodeAt(e))) {
30
+ for (e++; e < n.length && L(n.charCodeAt(e));) e++;
31
+ T = e;
32
+ } else b = 3;
33
+ return n.substring(i, T);
34
+ }
35
+ function a() {
36
+ let i = "", T = e;
37
+ for (;;) {
38
+ if (e >= g) {
39
+ i += n.substring(T, e), b = 2;
40
+ break;
41
+ }
42
+ const s = n.charCodeAt(e);
43
+ if (s === 34) {
44
+ i += n.substring(T, e), e++;
45
+ break;
46
+ }
47
+ if (s === 92) {
48
+ if (i += n.substring(T, e), e++, e >= g) {
49
+ b = 2;
50
+ break;
51
+ }
52
+ switch (n.charCodeAt(e++)) {
53
+ case 34:
54
+ i += "\"";
55
+ break;
56
+ case 92:
57
+ i += "\\";
58
+ break;
59
+ case 47:
60
+ i += "/";
61
+ break;
62
+ case 98:
63
+ i += "\b";
64
+ break;
65
+ case 102:
66
+ i += "\f";
67
+ break;
68
+ case 110:
69
+ i += `
70
+ `;
71
+ break;
72
+ case 114:
73
+ i += "\r";
74
+ break;
75
+ case 116:
76
+ i += " ";
77
+ break;
78
+ case 117:
79
+ const t = I(4);
80
+ t >= 0 ? i += String.fromCharCode(t) : b = 4;
81
+ break;
82
+ default: b = 5;
83
+ }
84
+ T = e;
85
+ continue;
86
+ }
87
+ if (s >= 0 && s <= 31) if (r(s)) {
88
+ i += n.substring(T, e), b = 2;
89
+ break;
90
+ } else b = 6;
91
+ e++;
92
+ }
93
+ return i;
94
+ }
95
+ function w() {
96
+ if (u = "", b = 0, p = e, o = A, B = O, e >= g) return p = g, k = 17;
97
+ let i = n.charCodeAt(e);
98
+ if (J(i)) {
99
+ do
100
+ e++, u += String.fromCharCode(i), i = n.charCodeAt(e);
101
+ while (J(i));
102
+ return k = 15;
103
+ }
104
+ if (r(i)) return e++, u += String.fromCharCode(i), i === 13 && n.charCodeAt(e) === 10 && (e++, u += `
105
+ `), A++, O = e, k = 14;
106
+ switch (i) {
107
+ case 123: return e++, k = 1;
108
+ case 125: return e++, k = 2;
109
+ case 91: return e++, k = 3;
110
+ case 93: return e++, k = 4;
111
+ case 58: return e++, k = 6;
112
+ case 44: return e++, k = 5;
113
+ case 34: return e++, u = a(), k = 10;
114
+ case 47:
115
+ const T = e - 1;
116
+ if (n.charCodeAt(e + 1) === 47) {
117
+ for (e += 2; e < g && !r(n.charCodeAt(e));) e++;
118
+ return u = n.substring(T, e), k = 12;
119
+ }
120
+ if (n.charCodeAt(e + 1) === 42) {
121
+ e += 2;
122
+ const s = g - 1;
123
+ let c = !1;
124
+ for (; e < s;) {
125
+ const t = n.charCodeAt(e);
126
+ if (t === 42 && n.charCodeAt(e + 1) === 47) {
127
+ e += 2, c = !0;
128
+ break;
129
+ }
130
+ e++, r(t) && (t === 13 && n.charCodeAt(e) === 10 && e++, A++, O = e);
131
+ }
132
+ return c || (e++, b = 1), u = n.substring(T, e), k = 13;
133
+ }
134
+ return u += String.fromCharCode(i), e++, k = 16;
135
+ case 45: if (u += String.fromCharCode(i), e++, e === g || !L(n.charCodeAt(e))) return k = 16;
136
+ case 48:
137
+ case 49:
138
+ case 50:
139
+ case 51:
140
+ case 52:
141
+ case 53:
142
+ case 54:
143
+ case 55:
144
+ case 56:
145
+ case 57: return u += F(), k = 11;
146
+ default:
147
+ for (; e < g && v(i);) e++, i = n.charCodeAt(e);
148
+ if (p !== e) {
149
+ switch (u = n.substring(p, e), u) {
150
+ case "true": return k = 8;
151
+ case "false": return k = 9;
152
+ case "null": return k = 7;
153
+ }
154
+ return k = 16;
155
+ }
156
+ return u += String.fromCharCode(i), e++, k = 16;
157
+ }
158
+ }
159
+ function v(i) {
160
+ if (J(i) || r(i)) return !1;
161
+ switch (i) {
162
+ case 125:
163
+ case 93:
164
+ case 123:
165
+ case 91:
166
+ case 34:
167
+ case 58:
168
+ case 44:
169
+ case 47: return !1;
170
+ }
171
+ return !0;
172
+ }
173
+ function j() {
174
+ let i;
175
+ do
176
+ i = w();
177
+ while (i >= 12 && i <= 15);
178
+ return i;
179
+ }
180
+ return {
181
+ setPosition: V,
182
+ getPosition: () => e,
183
+ scan: l ? j : w,
184
+ getToken: () => k,
185
+ getTokenValue: () => u,
186
+ getTokenOffset: () => p,
187
+ getTokenLength: () => e - p,
188
+ getTokenStartLine: () => o,
189
+ getTokenStartCharacter: () => p - B,
190
+ getTokenError: () => b
191
+ };
192
+ }
193
+ function J(n) {
194
+ return n === 32 || n === 9;
195
+ }
196
+ function r(n) {
197
+ return n === 10 || n === 13;
198
+ }
199
+ function L(n) {
200
+ return n >= 48 && n <= 57;
201
+ }
202
+ var Q;
203
+ (function(n) {
204
+ n[n.lineFeed = 10] = "lineFeed", n[n.carriageReturn = 13] = "carriageReturn", n[n.space = 32] = "space", n[n._0 = 48] = "_0", n[n._1 = 49] = "_1", n[n._2 = 50] = "_2", n[n._3 = 51] = "_3", n[n._4 = 52] = "_4", n[n._5 = 53] = "_5", n[n._6 = 54] = "_6", n[n._7 = 55] = "_7", n[n._8 = 56] = "_8", n[n._9 = 57] = "_9", n[n.a = 97] = "a", n[n.b = 98] = "b", n[n.c = 99] = "c", n[n.d = 100] = "d", n[n.e = 101] = "e", n[n.f = 102] = "f", n[n.g = 103] = "g", n[n.h = 104] = "h", n[n.i = 105] = "i", n[n.j = 106] = "j", n[n.k = 107] = "k", n[n.l = 108] = "l", n[n.m = 109] = "m", n[n.n = 110] = "n", n[n.o = 111] = "o", n[n.p = 112] = "p", n[n.q = 113] = "q", n[n.r = 114] = "r", n[n.s = 115] = "s", n[n.t = 116] = "t", n[n.u = 117] = "u", n[n.v = 118] = "v", n[n.w = 119] = "w", n[n.x = 120] = "x", n[n.y = 121] = "y", n[n.z = 122] = "z", n[n.A = 65] = "A", n[n.B = 66] = "B", n[n.C = 67] = "C", n[n.D = 68] = "D", n[n.E = 69] = "E", n[n.F = 70] = "F", n[n.G = 71] = "G", n[n.H = 72] = "H", n[n.I = 73] = "I", n[n.J = 74] = "J", n[n.K = 75] = "K", n[n.L = 76] = "L", n[n.M = 77] = "M", n[n.N = 78] = "N", n[n.O = 79] = "O", n[n.P = 80] = "P", n[n.Q = 81] = "Q", n[n.R = 82] = "R", n[n.S = 83] = "S", n[n.T = 84] = "T", n[n.U = 85] = "U", n[n.V = 86] = "V", n[n.W = 87] = "W", n[n.X = 88] = "X", n[n.Y = 89] = "Y", n[n.Z = 90] = "Z", n[n.asterisk = 42] = "asterisk", n[n.backslash = 92] = "backslash", n[n.closeBrace = 125] = "closeBrace", n[n.closeBracket = 93] = "closeBracket", n[n.colon = 58] = "colon", n[n.comma = 44] = "comma", n[n.dot = 46] = "dot", n[n.doubleQuote = 34] = "doubleQuote", n[n.minus = 45] = "minus", n[n.openBrace = 123] = "openBrace", n[n.openBracket = 91] = "openBracket", n[n.plus = 43] = "plus", n[n.slash = 47] = "slash", n[n.formFeed = 12] = "formFeed", n[n.tab = 9] = "tab";
205
+ })(Q || (Q = {})), new Array(20).fill(0).map((n, l) => " ".repeat(l));
206
+ const N$1 = 200;
207
+ new Array(N$1).fill(0).map((n, l) => `
208
+ ` + " ".repeat(l)), new Array(N$1).fill(0).map((n, l) => "\r" + " ".repeat(l)), new Array(N$1).fill(0).map((n, l) => `\r
209
+ ` + " ".repeat(l)), new Array(N$1).fill(0).map((n, l) => `
210
+ ` + " ".repeat(l)), new Array(N$1).fill(0).map((n, l) => "\r" + " ".repeat(l)), new Array(N$1).fill(0).map((n, l) => `\r
211
+ ` + " ".repeat(l));
212
+ var U;
213
+ (function(n) {
214
+ n.DEFAULT = { allowTrailingComma: !1 };
215
+ })(U || (U = {}));
216
+ function S(n, l = [], g = U.DEFAULT) {
217
+ let e = null, u = [];
218
+ const p = [];
219
+ function k(o) {
220
+ Array.isArray(u) ? u.push(o) : e !== null && (u[e] = o);
221
+ }
222
+ return P(n, {
223
+ onObjectBegin: () => {
224
+ const o = {};
225
+ k(o), p.push(u), u = o, e = null;
226
+ },
227
+ onObjectProperty: (o) => {
228
+ e = o;
229
+ },
230
+ onObjectEnd: () => {
231
+ u = p.pop();
232
+ },
233
+ onArrayBegin: () => {
234
+ const o = [];
235
+ k(o), p.push(u), u = o, e = null;
236
+ },
237
+ onArrayEnd: () => {
238
+ u = p.pop();
239
+ },
240
+ onLiteralValue: k,
241
+ onError: (o, O, B) => {
242
+ l.push({
243
+ error: o,
244
+ offset: O,
245
+ length: B
246
+ });
247
+ }
248
+ }, g), u[0];
249
+ }
250
+ function P(n, l, g = U.DEFAULT) {
251
+ const e = $(n, !1), u = [];
252
+ let p = 0;
253
+ function k(f) {
254
+ return f ? () => p === 0 && f(e.getTokenOffset(), e.getTokenLength(), e.getTokenStartLine(), e.getTokenStartCharacter()) : () => !0;
255
+ }
256
+ function A(f) {
257
+ return f ? (m) => p === 0 && f(m, e.getTokenOffset(), e.getTokenLength(), e.getTokenStartLine(), e.getTokenStartCharacter()) : () => !0;
258
+ }
259
+ function o(f) {
260
+ return f ? (m) => p === 0 && f(m, e.getTokenOffset(), e.getTokenLength(), e.getTokenStartLine(), e.getTokenStartCharacter(), () => u.slice()) : () => !0;
261
+ }
262
+ function O(f) {
263
+ return f ? () => {
264
+ p > 0 ? p++ : f(e.getTokenOffset(), e.getTokenLength(), e.getTokenStartLine(), e.getTokenStartCharacter(), () => u.slice()) === !1 && (p = 1);
265
+ } : () => !0;
266
+ }
267
+ function B(f) {
268
+ return f ? () => {
269
+ p > 0 && p--, p === 0 && f(e.getTokenOffset(), e.getTokenLength(), e.getTokenStartLine(), e.getTokenStartCharacter());
270
+ } : () => !0;
271
+ }
272
+ const b = O(l.onObjectBegin), I = o(l.onObjectProperty), V = B(l.onObjectEnd), F = O(l.onArrayBegin), a = B(l.onArrayEnd), w = o(l.onLiteralValue), v = A(l.onSeparator), j = k(l.onComment), i = A(l.onError), T = g && g.disallowComments, s = g && g.allowTrailingComma;
273
+ function c() {
274
+ for (;;) {
275
+ const f = e.scan();
276
+ switch (e.getTokenError()) {
277
+ case 4:
278
+ t(14);
279
+ break;
280
+ case 5:
281
+ t(15);
282
+ break;
283
+ case 3:
284
+ t(13);
285
+ break;
286
+ case 1:
287
+ T || t(11);
288
+ break;
289
+ case 2:
290
+ t(12);
291
+ break;
292
+ case 6:
293
+ t(16);
294
+ break;
295
+ }
296
+ switch (f) {
297
+ case 12:
298
+ case 13:
299
+ T ? t(10) : j();
300
+ break;
301
+ case 16:
302
+ t(1);
303
+ break;
304
+ case 15:
305
+ case 14: break;
306
+ default: return f;
307
+ }
308
+ }
309
+ }
310
+ function t(f, m = [], y = []) {
311
+ if (i(f), m.length + y.length > 0) {
312
+ let _ = e.getToken();
313
+ for (; _ !== 17;) {
314
+ if (m.indexOf(_) !== -1) {
315
+ c();
316
+ break;
317
+ } else if (y.indexOf(_) !== -1) break;
318
+ _ = c();
319
+ }
320
+ }
321
+ }
322
+ function D(f) {
323
+ const m = e.getTokenValue();
324
+ return f ? w(m) : (I(m), u.push(m)), c(), !0;
325
+ }
326
+ function G() {
327
+ switch (e.getToken()) {
328
+ case 11:
329
+ const f = e.getTokenValue();
330
+ let m = Number(f);
331
+ isNaN(m) && (t(2), m = 0), w(m);
332
+ break;
333
+ case 7:
334
+ w(null);
335
+ break;
336
+ case 8:
337
+ w(!0);
338
+ break;
339
+ case 9:
340
+ w(!1);
341
+ break;
342
+ default: return !1;
343
+ }
344
+ return c(), !0;
345
+ }
346
+ function M() {
347
+ return e.getToken() !== 10 ? (t(3, [], [2, 5]), !1) : (D(!1), e.getToken() === 6 ? (v(":"), c(), E() || t(4, [], [2, 5])) : t(5, [], [2, 5]), u.pop(), !0);
348
+ }
349
+ function X() {
350
+ b(), c();
351
+ let f = !1;
352
+ for (; e.getToken() !== 2 && e.getToken() !== 17;) {
353
+ if (e.getToken() === 5) {
354
+ if (f || t(4, [], []), v(","), c(), e.getToken() === 2 && s) break;
355
+ } else f && t(6, [], []);
356
+ M() || t(4, [], [2, 5]), f = !0;
357
+ }
358
+ return V(), e.getToken() !== 2 ? t(7, [2], []) : c(), !0;
359
+ }
360
+ function Y() {
361
+ F(), c();
362
+ let f = !0, m = !1;
363
+ for (; e.getToken() !== 4 && e.getToken() !== 17;) {
364
+ if (e.getToken() === 5) {
365
+ if (m || t(4, [], []), v(","), c(), e.getToken() === 4 && s) break;
366
+ } else m && t(6, [], []);
367
+ f ? (u.push(0), f = !1) : u[u.length - 1]++, E() || t(4, [], [4, 5]), m = !0;
368
+ }
369
+ return a(), f || u.pop(), e.getToken() !== 4 ? t(8, [4], []) : c(), !0;
370
+ }
371
+ function E() {
372
+ switch (e.getToken()) {
373
+ case 3: return Y();
374
+ case 1: return X();
375
+ case 10: return D(!0);
376
+ default: return G();
377
+ }
378
+ }
379
+ return c(), e.getToken() === 17 ? g.allowEmptyContent ? !0 : (t(4, [], []), !1) : E() ? (e.getToken() !== 17 && t(9, [], []), !0) : (t(4, [], []), !1);
380
+ }
381
+ var W;
382
+ (function(n) {
383
+ n[n.None = 0] = "None", n[n.UnexpectedEndOfComment = 1] = "UnexpectedEndOfComment", n[n.UnexpectedEndOfString = 2] = "UnexpectedEndOfString", n[n.UnexpectedEndOfNumber = 3] = "UnexpectedEndOfNumber", n[n.InvalidUnicode = 4] = "InvalidUnicode", n[n.InvalidEscapeCharacter = 5] = "InvalidEscapeCharacter", n[n.InvalidCharacter = 6] = "InvalidCharacter";
384
+ })(W || (W = {}));
385
+ var H;
386
+ (function(n) {
387
+ n[n.OpenBraceToken = 1] = "OpenBraceToken", n[n.CloseBraceToken = 2] = "CloseBraceToken", n[n.OpenBracketToken = 3] = "OpenBracketToken", n[n.CloseBracketToken = 4] = "CloseBracketToken", n[n.CommaToken = 5] = "CommaToken", n[n.ColonToken = 6] = "ColonToken", n[n.NullKeyword = 7] = "NullKeyword", n[n.TrueKeyword = 8] = "TrueKeyword", n[n.FalseKeyword = 9] = "FalseKeyword", n[n.StringLiteral = 10] = "StringLiteral", n[n.NumericLiteral = 11] = "NumericLiteral", n[n.LineCommentTrivia = 12] = "LineCommentTrivia", n[n.BlockCommentTrivia = 13] = "BlockCommentTrivia", n[n.LineBreakTrivia = 14] = "LineBreakTrivia", n[n.Trivia = 15] = "Trivia", n[n.Unknown = 16] = "Unknown", n[n.EOF = 17] = "EOF";
388
+ })(H || (H = {}));
389
+ const K = S;
390
+ var q;
391
+ (function(n) {
392
+ n[n.InvalidSymbol = 1] = "InvalidSymbol", n[n.InvalidNumberFormat = 2] = "InvalidNumberFormat", n[n.PropertyNameExpected = 3] = "PropertyNameExpected", n[n.ValueExpected = 4] = "ValueExpected", n[n.ColonExpected = 5] = "ColonExpected", n[n.CommaExpected = 6] = "CommaExpected", n[n.CloseBraceExpected = 7] = "CloseBraceExpected", n[n.CloseBracketExpected = 8] = "CloseBracketExpected", n[n.EndOfFileExpected = 9] = "EndOfFileExpected", n[n.InvalidCommentToken = 10] = "InvalidCommentToken", n[n.UnexpectedEndOfComment = 11] = "UnexpectedEndOfComment", n[n.UnexpectedEndOfString = 12] = "UnexpectedEndOfString", n[n.UnexpectedEndOfNumber = 13] = "UnexpectedEndOfNumber", n[n.InvalidUnicode = 14] = "InvalidUnicode", n[n.InvalidEscapeCharacter = 15] = "InvalidEscapeCharacter", n[n.InvalidCharacter = 16] = "InvalidCharacter";
393
+ })(q || (q = {}));
394
+ function x(n, l) {
395
+ const g = JSON.parse(n, l?.reviver);
396
+ return N(n, g, l), g;
397
+ }
398
+ function h(n, l) {
399
+ const g = K(n, l?.errors, l);
400
+ return N(n, g, l), g;
401
+ }
402
+
403
+ //#endregion
404
+ export { h, x };
@@ -0,0 +1,46 @@
1
+
2
+ //#region ../../node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs
3
+ const suspectProtoRx = /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/;
4
+ const suspectConstructorRx = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
5
+ const JsonSigRx = /^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;
6
+ function jsonParseTransform(key, value) {
7
+ if (key === "__proto__" || key === "constructor" && value && typeof value === "object" && "prototype" in value) {
8
+ warnKeyDropped(key);
9
+ return;
10
+ }
11
+ return value;
12
+ }
13
+ function warnKeyDropped(key) {
14
+ console.warn(`[destr] Dropping "${key}" key to prevent prototype pollution.`);
15
+ }
16
+ function destr(value, options = {}) {
17
+ if (typeof value !== "string") return value;
18
+ if (value[0] === "\"" && value[value.length - 1] === "\"" && value.indexOf("\\") === -1) return value.slice(1, -1);
19
+ const _value = value.trim();
20
+ if (_value.length <= 9) switch (_value.toLowerCase()) {
21
+ case "true": return true;
22
+ case "false": return false;
23
+ case "undefined": return;
24
+ case "null": return null;
25
+ case "nan": return NaN;
26
+ case "infinity": return Number.POSITIVE_INFINITY;
27
+ case "-infinity": return Number.NEGATIVE_INFINITY;
28
+ }
29
+ if (!JsonSigRx.test(value)) {
30
+ if (options.strict) throw new SyntaxError("[destr] Invalid JSON");
31
+ return value;
32
+ }
33
+ try {
34
+ if (suspectProtoRx.test(value) || suspectConstructorRx.test(value)) {
35
+ if (options.strict) throw new Error("[destr] Possible prototype pollution");
36
+ return JSON.parse(value, jsonParseTransform);
37
+ }
38
+ return JSON.parse(value);
39
+ } catch (error) {
40
+ if (options.strict) throw error;
41
+ return value;
42
+ }
43
+ }
44
+
45
+ //#endregion
46
+ exports.destr = destr;
@@ -0,0 +1,45 @@
1
+ //#region ../../node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs
2
+ const suspectProtoRx = /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/;
3
+ const suspectConstructorRx = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
4
+ const JsonSigRx = /^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;
5
+ function jsonParseTransform(key, value) {
6
+ if (key === "__proto__" || key === "constructor" && value && typeof value === "object" && "prototype" in value) {
7
+ warnKeyDropped(key);
8
+ return;
9
+ }
10
+ return value;
11
+ }
12
+ function warnKeyDropped(key) {
13
+ console.warn(`[destr] Dropping "${key}" key to prevent prototype pollution.`);
14
+ }
15
+ function destr(value, options = {}) {
16
+ if (typeof value !== "string") return value;
17
+ if (value[0] === "\"" && value[value.length - 1] === "\"" && value.indexOf("\\") === -1) return value.slice(1, -1);
18
+ const _value = value.trim();
19
+ if (_value.length <= 9) switch (_value.toLowerCase()) {
20
+ case "true": return true;
21
+ case "false": return false;
22
+ case "undefined": return;
23
+ case "null": return null;
24
+ case "nan": return NaN;
25
+ case "infinity": return Number.POSITIVE_INFINITY;
26
+ case "-infinity": return Number.NEGATIVE_INFINITY;
27
+ }
28
+ if (!JsonSigRx.test(value)) {
29
+ if (options.strict) throw new SyntaxError("[destr] Invalid JSON");
30
+ return value;
31
+ }
32
+ try {
33
+ if (suspectProtoRx.test(value) || suspectConstructorRx.test(value)) {
34
+ if (options.strict) throw new Error("[destr] Possible prototype pollution");
35
+ return JSON.parse(value, jsonParseTransform);
36
+ }
37
+ return JSON.parse(value);
38
+ } catch (error) {
39
+ if (options.strict) throw error;
40
+ return value;
41
+ }
42
+ }
43
+
44
+ //#endregion
45
+ export { destr };
@@ -0,0 +1,204 @@
1
+ const require_rolldown_runtime = require('../../../../../../_virtual/rolldown_runtime.cjs');
2
+ const require_mod = require('../../../../fastest-levenshtein@1.0.16/node_modules/fastest-levenshtein/mod.cjs');
3
+ const require_index = require('../../../../lodash.deburr@4.1.0/node_modules/lodash.deburr/index.cjs');
4
+
5
+ //#region ../../node_modules/.pnpm/didyoumean2@7.0.4/node_modules/didyoumean2/dist/index.mjs
6
+ var import_fastest_levenshtein = require_mod.default;
7
+ var import_lodash = /* @__PURE__ */ require_rolldown_runtime.__toESM(require_index.default, 1);
8
+ let ReturnTypeEnums = /* @__PURE__ */ function(ReturnTypeEnums$1) {
9
+ ReturnTypeEnums$1["ALL_CLOSEST_MATCHES"] = "all-closest-matches";
10
+ ReturnTypeEnums$1["ALL_MATCHES"] = "all-matches";
11
+ ReturnTypeEnums$1["ALL_SORTED_MATCHES"] = "all-sorted-matches";
12
+ ReturnTypeEnums$1["FIRST_CLOSEST_MATCH"] = "first-closest-match";
13
+ ReturnTypeEnums$1["FIRST_MATCH"] = "first-match";
14
+ return ReturnTypeEnums$1;
15
+ }({});
16
+ let ThresholdTypeEnums = /* @__PURE__ */ function(ThresholdTypeEnums$1) {
17
+ ThresholdTypeEnums$1["EDIT_DISTANCE"] = "edit-distance";
18
+ ThresholdTypeEnums$1["SIMILARITY"] = "similarity";
19
+ return ThresholdTypeEnums$1;
20
+ }({});
21
+ const fillDefaultOptions = (options) => {
22
+ const optionsWithDefaultValues = {
23
+ caseSensitive: false,
24
+ deburr: true,
25
+ matchPath: [],
26
+ returnType: ReturnTypeEnums.FIRST_CLOSEST_MATCH,
27
+ thresholdType: ThresholdTypeEnums.SIMILARITY,
28
+ trimSpaces: true,
29
+ ...options
30
+ };
31
+ if (!Object.values(ReturnTypeEnums).includes(optionsWithDefaultValues.returnType)) throw new TypeError("unknown returnType");
32
+ if (!Object.values(ThresholdTypeEnums).includes(optionsWithDefaultValues.thresholdType)) throw new TypeError("unknown thresholdType");
33
+ switch (optionsWithDefaultValues.thresholdType) {
34
+ case ThresholdTypeEnums.EDIT_DISTANCE: return {
35
+ threshold: 20,
36
+ ...optionsWithDefaultValues
37
+ };
38
+ case ThresholdTypeEnums.SIMILARITY: return {
39
+ threshold: .4,
40
+ ...optionsWithDefaultValues
41
+ };
42
+ }
43
+ };
44
+ /**
45
+ * Using edit distance between `a` and `b` to calculate similarity
46
+ *
47
+ * @param {string} a - `input`
48
+ * @param {string} b - String from `matchList`
49
+ * @returns {number} similarity between `a` and `b`
50
+ */
51
+ const getSimilarity = (a, b) => {
52
+ if (!a || !b) return 0;
53
+ if (a === b) return 1;
54
+ const editDistance = (0, import_fastest_levenshtein.distance)(a, b);
55
+ const longestLength = Math.max(a.length, b.length);
56
+ return (longestLength - editDistance) / longestLength;
57
+ };
58
+ /**
59
+ * Normalize a string
60
+ *
61
+ * @param {string} str - any string
62
+ * @param {object} options - options that allows you to modify the behavior
63
+ * @returns {string} - normalized string
64
+ */
65
+ const normalizeString = (str, options) => {
66
+ let s = str;
67
+ if (options.trimSpaces) s = s.trim().replaceAll(/\s+/gu, " ");
68
+ if (options.deburr) s = (0, import_lodash.default)(s);
69
+ if (!options.caseSensitive) s = s.toLowerCase();
70
+ return s;
71
+ };
72
+ const getMatchItemStr = (matchItem, matchPath) => {
73
+ const matchItemStr = matchPath.length > 0 ? matchPath.reduce((acc, prop) => {
74
+ return acc?.[prop];
75
+ }, matchItem) : matchItem;
76
+ if (typeof matchItemStr !== "string") return "";
77
+ return matchItemStr;
78
+ };
79
+ /**
80
+ * Process matchItem according to options
81
+ *
82
+ * @param {object | string} matchItem - Item for matching with `input`
83
+ * @param {object} options - options that allows you to modify the behavior
84
+ * @returns {string} - processed matchItem
85
+ */
86
+ const matchItemProcessor = (matchItem, options) => {
87
+ const { matchPath } = options;
88
+ return normalizeString(getMatchItemStr(matchItem, matchPath), options);
89
+ };
90
+ /**
91
+ * Generate result
92
+ *
93
+ * @param {object[] | string[]} matchList - List for matching with `input`
94
+ * @param {number[]} matchedIndexes - indexes of matchList that need to be returned as result
95
+ * @param {ReturnTypeEnums} returnType - how the result will response to user
96
+ * @returns {Array | null | object | string} - matched result(s), return object if `match` is `{Object[]}`
97
+ */
98
+ const resultProcessor = (matchList, matchedIndexes, returnType) => {
99
+ switch (returnType) {
100
+ case ReturnTypeEnums.ALL_CLOSEST_MATCHES:
101
+ case ReturnTypeEnums.ALL_MATCHES:
102
+ case ReturnTypeEnums.ALL_SORTED_MATCHES: return matchedIndexes.map((matchedIndex) => matchList[matchedIndex]);
103
+ case ReturnTypeEnums.FIRST_CLOSEST_MATCH:
104
+ case ReturnTypeEnums.FIRST_MATCH: {
105
+ const matchedIndex = matchedIndexes[0];
106
+ if (matchedIndex === void 0) return null;
107
+ return matchList[matchedIndex];
108
+ }
109
+ }
110
+ };
111
+ /**
112
+ * Main function for didyoumean2
113
+ *
114
+ * @param {string} input - string that you are not sure and want to match with `matchList`
115
+ * @param {object[] | string[]} matchList - List for matching with `input`
116
+ * @param {null | object | undefined} options - options that allows you to modify the behavior
117
+ * @returns {Array | null | object | string} - matched result(s), return object if `match` is `{Object[]}`
118
+ */
119
+ function didYouMean(input, matchList, options) {
120
+ const optionsWithDefaults = fillDefaultOptions(options);
121
+ const { returnType, threshold, thresholdType } = optionsWithDefaults;
122
+ const normalizedInput = normalizeString(input, optionsWithDefaults);
123
+ let checkIfMatched;
124
+ let scoreProcessor;
125
+ switch (thresholdType) {
126
+ case ThresholdTypeEnums.EDIT_DISTANCE:
127
+ checkIfMatched = (score) => score <= threshold;
128
+ scoreProcessor = (matchItem) => (0, import_fastest_levenshtein.distance)(normalizedInput, matchItemProcessor(matchItem, optionsWithDefaults));
129
+ break;
130
+ case ThresholdTypeEnums.SIMILARITY:
131
+ checkIfMatched = (score) => score >= threshold;
132
+ scoreProcessor = (matchItem) => getSimilarity(normalizedInput, matchItemProcessor(matchItem, optionsWithDefaults));
133
+ break;
134
+ }
135
+ const matchedIndexes = [];
136
+ switch (returnType) {
137
+ case ReturnTypeEnums.ALL_CLOSEST_MATCHES:
138
+ case ReturnTypeEnums.FIRST_CLOSEST_MATCH: {
139
+ const scores = [];
140
+ let marginValue;
141
+ switch (thresholdType) {
142
+ case ThresholdTypeEnums.EDIT_DISTANCE:
143
+ marginValue = Number.POSITIVE_INFINITY;
144
+ for (const matchItem of matchList) {
145
+ const score = scoreProcessor(matchItem);
146
+ if (marginValue > score) marginValue = score;
147
+ scores.push(score);
148
+ }
149
+ break;
150
+ case ThresholdTypeEnums.SIMILARITY:
151
+ marginValue = 0;
152
+ for (const matchItem of matchList) {
153
+ const score = scoreProcessor(matchItem);
154
+ if (marginValue < score) marginValue = score;
155
+ scores.push(score);
156
+ }
157
+ break;
158
+ }
159
+ for (const [i, score] of scores.entries()) if (checkIfMatched(score) && score === marginValue) matchedIndexes.push(i);
160
+ break;
161
+ }
162
+ case ReturnTypeEnums.ALL_MATCHES:
163
+ for (const [i, matchItem] of matchList.entries()) {
164
+ const score = scoreProcessor(matchItem);
165
+ if (checkIfMatched(score)) matchedIndexes.push(i);
166
+ }
167
+ break;
168
+ case ReturnTypeEnums.ALL_SORTED_MATCHES: {
169
+ const unsortedResults = [];
170
+ for (const [i, matchItem] of matchList.entries()) {
171
+ const score = scoreProcessor(matchItem);
172
+ if (checkIfMatched(score)) unsortedResults.push({
173
+ score,
174
+ index: i
175
+ });
176
+ }
177
+ switch (thresholdType) {
178
+ case ThresholdTypeEnums.EDIT_DISTANCE:
179
+ unsortedResults.sort((a, b) => a.score - b.score);
180
+ break;
181
+ case ThresholdTypeEnums.SIMILARITY:
182
+ unsortedResults.sort((a, b) => b.score - a.score);
183
+ break;
184
+ }
185
+ for (const unsortedResult of unsortedResults) matchedIndexes.push(unsortedResult.index);
186
+ break;
187
+ }
188
+ case ReturnTypeEnums.FIRST_MATCH:
189
+ for (const [i, matchItem] of matchList.entries()) {
190
+ const score = scoreProcessor(matchItem);
191
+ if (checkIfMatched(score)) {
192
+ matchedIndexes.push(i);
193
+ break;
194
+ }
195
+ }
196
+ break;
197
+ }
198
+ return resultProcessor(matchList, matchedIndexes, returnType);
199
+ }
200
+
201
+ //#endregion
202
+ exports.ReturnTypeEnums = ReturnTypeEnums;
203
+ exports.ThresholdTypeEnums = ThresholdTypeEnums;
204
+ exports.default = didYouMean;