@storm-software/untyped 0.8.2 → 0.8.3
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/README.md +1 -1
- package/{dist/chunk-GWEQOXW6.mjs → bin/chunk-65NJ2BNV.js} +16 -13
- package/bin/chunk-7LNAPF6J.js +7601 -0
- package/bin/chunk-BIBA7MGH.js +84 -0
- package/bin/chunk-MVPKPUE3.js +1120 -0
- package/bin/chunk-PRGAKNNV.js +765 -0
- package/bin/chunk-Q3AKY4XY.js +4054 -0
- package/bin/chunk-Q42ZDLPG.js +510 -0
- package/bin/chunk-RNYNEYJ5.js +451 -0
- package/bin/dist-SOH4ASEU.js +17570 -0
- package/bin/esm-SQV6ELTR.js +1716 -0
- package/bin/execa-4HBUJBFQ.js +2424 -0
- package/bin/json5-WTSMELC2.js +10 -0
- package/bin/jsonc-B7SFZJW2.js +15 -0
- package/bin/multipart-parser-TFNERLJV.js +187 -0
- package/bin/toml-MTE5VHET.js +10 -0
- package/bin/untyped.cjs +83925 -0
- package/bin/untyped.js +42339 -373
- package/bin/yaml-D6PQ2AEL.js +10 -0
- package/dist/{chunk-XSW3ZXMK.mjs → chunk-B5PWE2FK.js} +8 -3
- package/dist/{chunk-6HKRKQSU.js → chunk-BFSI6OL7.cjs} +12 -7
- package/dist/{chunk-LWMIR3BQ.js → chunk-CLGOYXO6.cjs} +13 -8
- package/dist/chunk-EIXSLKJ6.js +85 -0
- package/dist/{chunk-EBIRRCGB.mjs → chunk-ELSZYSKI.js} +8 -3
- package/dist/{chunk-6OB6EGVE.js → chunk-HUCZDWTY.cjs} +206 -175
- package/dist/chunk-KQOG5R22.cjs +6 -0
- package/dist/chunk-MW6UM5LZ.js +6 -0
- package/dist/chunk-S36U2TKG.js +7218 -0
- package/dist/{chunk-MNW76QG7.mjs → chunk-SF7VZOKX.js} +39 -8
- package/dist/{chunk-HSIBHFJE.mjs → chunk-TJ5YM7SW.js} +8 -3
- package/dist/{chunk-TJLW3KPU.js → chunk-UCWWPTWV.cjs} +11 -6
- package/dist/chunk-VCSZBLKU.cjs +85 -0
- package/dist/chunk-YU5YP27Q.cjs +7221 -0
- package/dist/generate.cjs +11 -0
- package/dist/{generate.d.mts → generate.d.cts} +1 -1
- package/dist/generate.d.ts +1 -1
- package/dist/generate.js +11 -10
- package/dist/index.cjs +32 -0
- package/dist/{index.d.mts → index.d.cts} +6 -6
- package/dist/index.d.ts +1 -1
- package/dist/index.js +32 -27
- package/dist/{types-CIJRaFHD.d.mts → types-BQ21E8Xn.d.cts} +3 -3
- package/dist/{types-CIJRaFHD.d.ts → types-BQ21E8Xn.d.ts} +3 -3
- package/dist/utilities.cjs +6 -0
- package/dist/utilities.js +6 -6
- package/package.json +44 -53
- package/bin/untyped.mjs +0 -7050
- package/dist/chunk-NYKCIVTC.js +0 -46
- package/dist/chunk-U4YLQDJK.js +0 -1
- package/dist/chunk-ZHPKHX4S.mjs +0 -0
- package/dist/generate.mjs +0 -10
- package/dist/index.mjs +0 -27
- package/dist/utilities.mjs +0 -6
- /package/bin/{untyped.d.mts → untyped.d.cts} +0 -0
- /package/dist/{utilities.d.mts → utilities.d.cts} +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
d,
|
|
3
|
+
h
|
|
4
|
+
} from "./chunk-RNYNEYJ5.js";
|
|
5
|
+
import "./chunk-BIBA7MGH.js";
|
|
6
|
+
import {
|
|
7
|
+
init_esm_shims
|
|
8
|
+
} from "./chunk-65NJ2BNV.js";
|
|
9
|
+
|
|
10
|
+
// ../../node_modules/.pnpm/confbox@0.1.8/node_modules/confbox/dist/jsonc.mjs
|
|
11
|
+
init_esm_shims();
|
|
12
|
+
export {
|
|
13
|
+
h as parseJSONC,
|
|
14
|
+
d as stringifyJSONC
|
|
15
|
+
};
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import {
|
|
2
|
+
require_node,
|
|
3
|
+
require_node_fetch_native_DhEqb06g
|
|
4
|
+
} from "./chunk-Q3AKY4XY.js";
|
|
5
|
+
import {
|
|
6
|
+
__commonJS,
|
|
7
|
+
__name,
|
|
8
|
+
__require,
|
|
9
|
+
init_esm_shims
|
|
10
|
+
} from "./chunk-65NJ2BNV.js";
|
|
11
|
+
|
|
12
|
+
// ../../node_modules/.pnpm/node-fetch-native@1.6.5/node_modules/node-fetch-native/dist/chunks/multipart-parser.cjs
|
|
13
|
+
var require_multipart_parser = __commonJS({
|
|
14
|
+
"../../node_modules/.pnpm/node-fetch-native@1.6.5/node_modules/node-fetch-native/dist/chunks/multipart-parser.cjs"(exports) {
|
|
15
|
+
init_esm_shims();
|
|
16
|
+
var N = Object.defineProperty;
|
|
17
|
+
var c = /* @__PURE__ */ __name((_, a) => N(_, "name", { value: a, configurable: true }), "c");
|
|
18
|
+
__require("node:fs"), __require("node:path");
|
|
19
|
+
var node = require_node();
|
|
20
|
+
__require("node:http"), __require("node:https"), __require("node:zlib"), __require("node:stream"), __require("node:buffer"), __require("node:util"), require_node_fetch_native_DhEqb06g(), __require("node:url"), __require("node:net");
|
|
21
|
+
var s = 0;
|
|
22
|
+
var S = { START_BOUNDARY: s++, HEADER_FIELD_START: s++, HEADER_FIELD: s++, HEADER_VALUE_START: s++, HEADER_VALUE: s++, HEADER_VALUE_ALMOST_DONE: s++, HEADERS_ALMOST_DONE: s++, PART_DATA_START: s++, PART_DATA: s++, END: s++ };
|
|
23
|
+
var f = 1;
|
|
24
|
+
var F = { PART_BOUNDARY: f, LAST_BOUNDARY: f *= 2 };
|
|
25
|
+
var LF = 10;
|
|
26
|
+
var CR = 13;
|
|
27
|
+
var SPACE = 32;
|
|
28
|
+
var HYPHEN = 45;
|
|
29
|
+
var COLON = 58;
|
|
30
|
+
var A = 97;
|
|
31
|
+
var Z = 122;
|
|
32
|
+
var lower = c((_) => _ | 32, "lower");
|
|
33
|
+
var noop = c(() => {
|
|
34
|
+
}, "noop");
|
|
35
|
+
var MultipartParser = class {
|
|
36
|
+
static {
|
|
37
|
+
__name(this, "MultipartParser");
|
|
38
|
+
}
|
|
39
|
+
static {
|
|
40
|
+
c(this, "MultipartParser");
|
|
41
|
+
}
|
|
42
|
+
constructor(a) {
|
|
43
|
+
this.index = 0, this.flags = 0, this.onHeaderEnd = noop, this.onHeaderField = noop, this.onHeadersEnd = noop, this.onHeaderValue = noop, this.onPartBegin = noop, this.onPartData = noop, this.onPartEnd = noop, this.boundaryChars = {}, a = `\r
|
|
44
|
+
--` + a;
|
|
45
|
+
const t = new Uint8Array(a.length);
|
|
46
|
+
for (let n = 0; n < a.length; n++) t[n] = a.charCodeAt(n), this.boundaryChars[t[n]] = true;
|
|
47
|
+
this.boundary = t, this.lookbehind = new Uint8Array(this.boundary.length + 8), this.state = S.START_BOUNDARY;
|
|
48
|
+
}
|
|
49
|
+
write(a) {
|
|
50
|
+
let t = 0;
|
|
51
|
+
const n = a.length;
|
|
52
|
+
let E = this.index, { lookbehind: d, boundary: h, boundaryChars: H, index: e, state: o, flags: l } = this;
|
|
53
|
+
const b = this.boundary.length, m = b - 1, O = a.length;
|
|
54
|
+
let r, P;
|
|
55
|
+
const u = c((D) => {
|
|
56
|
+
this[D + "Mark"] = t;
|
|
57
|
+
}, "mark"), i = c((D) => {
|
|
58
|
+
delete this[D + "Mark"];
|
|
59
|
+
}, "clear"), T = c((D, p, R, g) => {
|
|
60
|
+
(p === void 0 || p !== R) && this[D](g && g.subarray(p, R));
|
|
61
|
+
}, "callback"), L = c((D, p) => {
|
|
62
|
+
const R = D + "Mark";
|
|
63
|
+
R in this && (p ? (T(D, this[R], t, a), delete this[R]) : (T(D, this[R], a.length, a), this[R] = 0));
|
|
64
|
+
}, "dataCallback");
|
|
65
|
+
for (t = 0; t < n; t++) switch (r = a[t], o) {
|
|
66
|
+
case S.START_BOUNDARY:
|
|
67
|
+
if (e === h.length - 2) {
|
|
68
|
+
if (r === HYPHEN) l |= F.LAST_BOUNDARY;
|
|
69
|
+
else if (r !== CR) return;
|
|
70
|
+
e++;
|
|
71
|
+
break;
|
|
72
|
+
} else if (e - 1 === h.length - 2) {
|
|
73
|
+
if (l & F.LAST_BOUNDARY && r === HYPHEN) o = S.END, l = 0;
|
|
74
|
+
else if (!(l & F.LAST_BOUNDARY) && r === LF) e = 0, T("onPartBegin"), o = S.HEADER_FIELD_START;
|
|
75
|
+
else return;
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
r !== h[e + 2] && (e = -2), r === h[e + 2] && e++;
|
|
79
|
+
break;
|
|
80
|
+
case S.HEADER_FIELD_START:
|
|
81
|
+
o = S.HEADER_FIELD, u("onHeaderField"), e = 0;
|
|
82
|
+
case S.HEADER_FIELD:
|
|
83
|
+
if (r === CR) {
|
|
84
|
+
i("onHeaderField"), o = S.HEADERS_ALMOST_DONE;
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
if (e++, r === HYPHEN) break;
|
|
88
|
+
if (r === COLON) {
|
|
89
|
+
if (e === 1) return;
|
|
90
|
+
L("onHeaderField", true), o = S.HEADER_VALUE_START;
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
if (P = lower(r), P < A || P > Z) return;
|
|
94
|
+
break;
|
|
95
|
+
case S.HEADER_VALUE_START:
|
|
96
|
+
if (r === SPACE) break;
|
|
97
|
+
u("onHeaderValue"), o = S.HEADER_VALUE;
|
|
98
|
+
case S.HEADER_VALUE:
|
|
99
|
+
r === CR && (L("onHeaderValue", true), T("onHeaderEnd"), o = S.HEADER_VALUE_ALMOST_DONE);
|
|
100
|
+
break;
|
|
101
|
+
case S.HEADER_VALUE_ALMOST_DONE:
|
|
102
|
+
if (r !== LF) return;
|
|
103
|
+
o = S.HEADER_FIELD_START;
|
|
104
|
+
break;
|
|
105
|
+
case S.HEADERS_ALMOST_DONE:
|
|
106
|
+
if (r !== LF) return;
|
|
107
|
+
T("onHeadersEnd"), o = S.PART_DATA_START;
|
|
108
|
+
break;
|
|
109
|
+
case S.PART_DATA_START:
|
|
110
|
+
o = S.PART_DATA, u("onPartData");
|
|
111
|
+
case S.PART_DATA:
|
|
112
|
+
if (E = e, e === 0) {
|
|
113
|
+
for (t += m; t < O && !(a[t] in H); ) t += b;
|
|
114
|
+
t -= m, r = a[t];
|
|
115
|
+
}
|
|
116
|
+
if (e < h.length) h[e] === r ? (e === 0 && L("onPartData", true), e++) : e = 0;
|
|
117
|
+
else if (e === h.length) e++, r === CR ? l |= F.PART_BOUNDARY : r === HYPHEN ? l |= F.LAST_BOUNDARY : e = 0;
|
|
118
|
+
else if (e - 1 === h.length) if (l & F.PART_BOUNDARY) {
|
|
119
|
+
if (e = 0, r === LF) {
|
|
120
|
+
l &= ~F.PART_BOUNDARY, T("onPartEnd"), T("onPartBegin"), o = S.HEADER_FIELD_START;
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
} else l & F.LAST_BOUNDARY && r === HYPHEN ? (T("onPartEnd"), o = S.END, l = 0) : e = 0;
|
|
124
|
+
if (e > 0) d[e - 1] = r;
|
|
125
|
+
else if (E > 0) {
|
|
126
|
+
const D = new Uint8Array(d.buffer, d.byteOffset, d.byteLength);
|
|
127
|
+
T("onPartData", 0, E, D), E = 0, u("onPartData"), t--;
|
|
128
|
+
}
|
|
129
|
+
break;
|
|
130
|
+
case S.END:
|
|
131
|
+
break;
|
|
132
|
+
default:
|
|
133
|
+
throw new Error(`Unexpected state entered: ${o}`);
|
|
134
|
+
}
|
|
135
|
+
L("onHeaderField"), L("onHeaderValue"), L("onPartData"), this.index = e, this.state = o, this.flags = l;
|
|
136
|
+
}
|
|
137
|
+
end() {
|
|
138
|
+
if (this.state === S.HEADER_FIELD_START && this.index === 0 || this.state === S.PART_DATA && this.index === this.boundary.length) this.onPartEnd();
|
|
139
|
+
else if (this.state !== S.END) throw new Error("MultipartParser.end(): stream ended unexpectedly");
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
function _fileName(_) {
|
|
143
|
+
const a = _.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);
|
|
144
|
+
if (!a) return;
|
|
145
|
+
const t = a[2] || a[3] || "";
|
|
146
|
+
let n = t.slice(t.lastIndexOf("\\") + 1);
|
|
147
|
+
return n = n.replace(/%22/g, '"'), n = n.replace(/&#(\d{4});/g, (E, d) => String.fromCharCode(d)), n;
|
|
148
|
+
}
|
|
149
|
+
__name(_fileName, "_fileName");
|
|
150
|
+
c(_fileName, "_fileName");
|
|
151
|
+
async function toFormData(_, a) {
|
|
152
|
+
if (!/multipart/i.test(a)) throw new TypeError("Failed to fetch");
|
|
153
|
+
const t = a.match(/boundary=(?:"([^"]+)"|([^;]+))/i);
|
|
154
|
+
if (!t) throw new TypeError("no or bad content-type header, no multipart boundary");
|
|
155
|
+
const n = new MultipartParser(t[1] || t[2]);
|
|
156
|
+
let E, d, h, H, e, o;
|
|
157
|
+
const l = [], b = new node.FormData(), m = c((i) => {
|
|
158
|
+
h += u.decode(i, { stream: true });
|
|
159
|
+
}, "onPartData"), O = c((i) => {
|
|
160
|
+
l.push(i);
|
|
161
|
+
}, "appendToFile"), r = c(() => {
|
|
162
|
+
const i = new node.File(l, o, { type: e });
|
|
163
|
+
b.append(H, i);
|
|
164
|
+
}, "appendFileToFormData"), P = c(() => {
|
|
165
|
+
b.append(H, h);
|
|
166
|
+
}, "appendEntryToFormData"), u = new TextDecoder("utf-8");
|
|
167
|
+
u.decode(), n.onPartBegin = function() {
|
|
168
|
+
n.onPartData = m, n.onPartEnd = P, E = "", d = "", h = "", H = "", e = "", o = null, l.length = 0;
|
|
169
|
+
}, n.onHeaderField = function(i) {
|
|
170
|
+
E += u.decode(i, { stream: true });
|
|
171
|
+
}, n.onHeaderValue = function(i) {
|
|
172
|
+
d += u.decode(i, { stream: true });
|
|
173
|
+
}, n.onHeaderEnd = function() {
|
|
174
|
+
if (d += u.decode(), E = E.toLowerCase(), E === "content-disposition") {
|
|
175
|
+
const i = d.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);
|
|
176
|
+
i && (H = i[2] || i[3] || ""), o = _fileName(d), o && (n.onPartData = O, n.onPartEnd = r);
|
|
177
|
+
} else E === "content-type" && (e = d);
|
|
178
|
+
d = "", E = "";
|
|
179
|
+
};
|
|
180
|
+
for await (const i of _) n.write(i);
|
|
181
|
+
return n.end(), b;
|
|
182
|
+
}
|
|
183
|
+
__name(toFormData, "toFormData");
|
|
184
|
+
c(toFormData, "toFormData"), exports.toFormData = toFormData;
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
export default require_multipart_parser();
|