@powerlines/plugin-automd 0.1.221 → 0.1.223

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 +0 -2
  2. package/dist/index.cjs +5 -5
  3. package/dist/index.d.mts +1 -1
  4. package/dist/index.mjs +7 -7
  5. package/dist/types/plugin.d.mts +3 -3
  6. package/package.json +4 -4
  7. package/dist/_virtual/rolldown_runtime.mjs +0 -32
  8. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.cjs +0 -78
  9. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +0 -77
  10. package/dist/node_modules/.pnpm/acorn@8.15.0/node_modules/acorn/dist/acorn.cjs +0 -5032
  11. package/dist/node_modules/.pnpm/acorn@8.15.0/node_modules/acorn/dist/acorn.mjs +0 -5031
  12. package/dist/node_modules/.pnpm/automd@0.4.2_patch_hash_0fe864a2d6fa1461e144747e5f0fbc0a5fb51435ec6b3217ffb18ff2d7058778_magicast@0.5.1/node_modules/automd/dist/shared/automd.CjwUz8DJ.cjs +0 -593
  13. package/dist/node_modules/.pnpm/automd@0.4.2_patch_hash_0fe864a2d6fa1461e144747e5f0fbc0a5fb51435ec6b3217ffb18ff2d7058778_magicast@0.5.1/node_modules/automd/dist/shared/automd.CjwUz8DJ.mjs +0 -590
  14. package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DA7CpUDY.cjs +0 -23
  15. package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DA7CpUDY.mjs +0 -22
  16. package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DnMsyigM.cjs +0 -405
  17. package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DnMsyigM.mjs +0 -404
  18. package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.cjs +0 -46
  19. package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs +0 -45
  20. package/dist/node_modules/.pnpm/didyoumean2@7.0.4/node_modules/didyoumean2/dist/index.cjs +0 -204
  21. package/dist/node_modules/.pnpm/didyoumean2@7.0.4/node_modules/didyoumean2/dist/index.mjs +0 -202
  22. package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.cjs +0 -1013
  23. package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.mjs +0 -1007
  24. package/dist/node_modules/.pnpm/fastest-levenshtein@1.0.16/node_modules/fastest-levenshtein/mod.cjs +0 -128
  25. package/dist/node_modules/.pnpm/fastest-levenshtein@1.0.16/node_modules/fastest-levenshtein/mod.mjs +0 -123
  26. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/babel.cjs +0 -41464
  27. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/babel.mjs +0 -41461
  28. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/jiti.cjs +0 -4387
  29. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/jiti.mjs +0 -4384
  30. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/lib/jiti.cjs +0 -26
  31. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/lib/jiti.mjs +0 -26
  32. package/dist/node_modules/.pnpm/lodash.deburr@4.1.0/node_modules/lodash.deburr/index.cjs +0 -370
  33. package/dist/node_modules/.pnpm/lodash.deburr@4.1.0/node_modules/lodash.deburr/index.mjs +0 -367
  34. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.cjs +0 -939
  35. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs +0 -939
  36. package/dist/node_modules/.pnpm/mdbox@0.1.1/node_modules/mdbox/dist/index.cjs +0 -67
  37. package/dist/node_modules/.pnpm/mdbox@0.1.1/node_modules/mdbox/dist/index.mjs +0 -64
  38. package/dist/node_modules/.pnpm/mlly@1.8.0/node_modules/mlly/dist/index.cjs +0 -1292
  39. package/dist/node_modules/.pnpm/mlly@1.8.0/node_modules/mlly/dist/index.mjs +0 -1284
  40. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.cjs +0 -179
  41. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs +0 -179
  42. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.cjs +0 -20
  43. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.mjs +0 -18
  44. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.cjs +0 -3975
  45. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.mjs +0 -3961
  46. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DfbY2q-x.cjs +0 -16
  47. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DfbY2q-x.mjs +0 -14
  48. package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.cjs +0 -36
  49. package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.mjs +0 -33
  50. package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.cjs +0 -227
  51. package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs +0 -225
  52. package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.cjs +0 -139
  53. package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs +0 -133
  54. package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.cjs +0 -77
  55. package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs +0 -76
  56. package/dist/node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.cjs +0 -72
  57. package/dist/node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.mjs +0 -69
  58. package/dist/node_modules/.pnpm/ufo@1.6.3/node_modules/ufo/dist/index.cjs +0 -181
  59. package/dist/node_modules/.pnpm/ufo@1.6.3/node_modules/ufo/dist/index.mjs +0 -178
  60. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/babel.cjs +0 -12337
  61. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/babel.mjs +0 -12337
  62. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/loader.cjs +0 -19
  63. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/loader.mjs +0 -18
  64. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.BTwOq8Jl.cjs +0 -71
  65. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.BTwOq8Jl.mjs +0 -71
  66. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.Br_uXjZG.cjs +0 -110
  67. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.Br_uXjZG.mjs +0 -100
  68. /package/dist/{packages/powerlines → powerlines}/src/internal/helpers/hooks.d.mts +0 -0
  69. /package/dist/{packages/powerlines → powerlines}/src/types/api.d.mts +0 -0
  70. /package/dist/{packages/powerlines → powerlines}/src/types/babel.d.mts +0 -0
  71. /package/dist/{packages/powerlines → powerlines}/src/types/build.d.mts +0 -0
  72. /package/dist/{packages/powerlines → powerlines}/src/types/commands.d.mts +0 -0
  73. /package/dist/{packages/powerlines → powerlines}/src/types/config.d.mts +0 -0
  74. /package/dist/{packages/powerlines → powerlines}/src/types/context.d.mts +0 -0
  75. /package/dist/{packages/powerlines → powerlines}/src/types/fs.d.mts +0 -0
  76. /package/dist/{packages/powerlines → powerlines}/src/types/hooks.d.mts +0 -0
  77. /package/dist/{packages/powerlines → powerlines}/src/types/plugin.d.mts +0 -0
  78. /package/dist/{packages/powerlines → powerlines}/src/types/resolved.d.mts +0 -0
  79. /package/dist/{packages/powerlines → powerlines}/src/types/tsconfig.d.mts +0 -0
  80. /package/dist/{packages/powerlines → powerlines}/src/types/unplugin.d.mts +0 -0
@@ -1,179 +0,0 @@
1
- require('../shared/node-fetch-native.DfbY2q-x.cjs');
2
- const require_node = require('../node.cjs');
3
- let node_fs = require("node:fs");
4
- let node_url = require("node:url");
5
- let node_path = require("node:path");
6
- let node_util = require("node:util");
7
- let node_http = require("node:http");
8
- let node_https = require("node:https");
9
- let node_zlib = require("node:zlib");
10
- let node_stream = require("node:stream");
11
- let node_buffer = require("node:buffer");
12
- let node_net = require("node:net");
13
-
14
- //#region ../../node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs
15
- var B = Object.defineProperty;
16
- var E = (u, a) => B(u, "name", {
17
- value: a,
18
- configurable: !0
19
- });
20
- let D = 0;
21
- const t = {
22
- START_BOUNDARY: D++,
23
- HEADER_FIELD_START: D++,
24
- HEADER_FIELD: D++,
25
- HEADER_VALUE_START: D++,
26
- HEADER_VALUE: D++,
27
- HEADER_VALUE_ALMOST_DONE: D++,
28
- HEADERS_ALMOST_DONE: D++,
29
- PART_DATA_START: D++,
30
- PART_DATA: D++,
31
- END: D++
32
- };
33
- let w = 1;
34
- const R = {
35
- PART_BOUNDARY: w,
36
- LAST_BOUNDARY: w *= 2
37
- }, g = 10, N = 13, x = 32, P = 45, C = 58, I = 97, M = 122, $ = E((u) => u | 32, "lower"), m = E(() => {}, "noop"), F = class F$1 {
38
- constructor(a) {
39
- this.index = 0, this.flags = 0, this.onHeaderEnd = m, this.onHeaderField = m, this.onHeadersEnd = m, this.onHeaderValue = m, this.onPartBegin = m, this.onPartData = m, this.onPartEnd = m, this.boundaryChars = {}, a = `\r
40
- --` + a;
41
- const n = new Uint8Array(a.length);
42
- for (let r = 0; r < a.length; r++) n[r] = a.charCodeAt(r), this.boundaryChars[n[r]] = !0;
43
- this.boundary = n, this.lookbehind = new Uint8Array(this.boundary.length + 8), this.state = t.START_BOUNDARY;
44
- }
45
- write(a) {
46
- let n = 0;
47
- const r = a.length;
48
- let d = this.index, { lookbehind: l, boundary: c, boundaryChars: p, index: e, state: i, flags: A } = this;
49
- const H = this.boundary.length, O = H - 1, y = a.length;
50
- let o, L;
51
- const f = E((h) => {
52
- this[h + "Mark"] = n;
53
- }, "mark"), s = E((h) => {
54
- delete this[h + "Mark"];
55
- }, "clear"), T = E((h, S, _, U) => {
56
- (S === void 0 || S !== _) && this[h](U && U.subarray(S, _));
57
- }, "callback"), b = E((h, S) => {
58
- const _ = h + "Mark";
59
- _ in this && (S ? (T(h, this[_], n, a), delete this[_]) : (T(h, this[_], a.length, a), this[_] = 0));
60
- }, "dataCallback");
61
- for (n = 0; n < r; n++) switch (o = a[n], i) {
62
- case t.START_BOUNDARY:
63
- if (e === c.length - 2) {
64
- if (o === P) A |= R.LAST_BOUNDARY;
65
- else if (o !== N) return;
66
- e++;
67
- break;
68
- } else if (e - 1 === c.length - 2) {
69
- if (A & R.LAST_BOUNDARY && o === P) i = t.END, A = 0;
70
- else if (!(A & R.LAST_BOUNDARY) && o === g) e = 0, T("onPartBegin"), i = t.HEADER_FIELD_START;
71
- else return;
72
- break;
73
- }
74
- o !== c[e + 2] && (e = -2), o === c[e + 2] && e++;
75
- break;
76
- case t.HEADER_FIELD_START: i = t.HEADER_FIELD, f("onHeaderField"), e = 0;
77
- case t.HEADER_FIELD:
78
- if (o === N) {
79
- s("onHeaderField"), i = t.HEADERS_ALMOST_DONE;
80
- break;
81
- }
82
- if (e++, o === P) break;
83
- if (o === C) {
84
- if (e === 1) return;
85
- b("onHeaderField", !0), i = t.HEADER_VALUE_START;
86
- break;
87
- }
88
- if (L = $(o), L < I || L > M) return;
89
- break;
90
- case t.HEADER_VALUE_START:
91
- if (o === x) break;
92
- f("onHeaderValue"), i = t.HEADER_VALUE;
93
- case t.HEADER_VALUE:
94
- o === N && (b("onHeaderValue", !0), T("onHeaderEnd"), i = t.HEADER_VALUE_ALMOST_DONE);
95
- break;
96
- case t.HEADER_VALUE_ALMOST_DONE:
97
- if (o !== g) return;
98
- i = t.HEADER_FIELD_START;
99
- break;
100
- case t.HEADERS_ALMOST_DONE:
101
- if (o !== g) return;
102
- T("onHeadersEnd"), i = t.PART_DATA_START;
103
- break;
104
- case t.PART_DATA_START: i = t.PART_DATA, f("onPartData");
105
- case t.PART_DATA:
106
- if (d = e, e === 0) {
107
- for (n += O; n < y && !(a[n] in p);) n += H;
108
- n -= O, o = a[n];
109
- }
110
- if (e < c.length) c[e] === o ? (e === 0 && b("onPartData", !0), e++) : e = 0;
111
- else if (e === c.length) e++, o === N ? A |= R.PART_BOUNDARY : o === P ? A |= R.LAST_BOUNDARY : e = 0;
112
- else if (e - 1 === c.length) if (A & R.PART_BOUNDARY) {
113
- if (e = 0, o === g) {
114
- A &= ~R.PART_BOUNDARY, T("onPartEnd"), T("onPartBegin"), i = t.HEADER_FIELD_START;
115
- break;
116
- }
117
- } else A & R.LAST_BOUNDARY && o === P ? (T("onPartEnd"), i = t.END, A = 0) : e = 0;
118
- if (e > 0) l[e - 1] = o;
119
- else if (d > 0) {
120
- const h = new Uint8Array(l.buffer, l.byteOffset, l.byteLength);
121
- T("onPartData", 0, d, h), d = 0, f("onPartData"), n--;
122
- }
123
- break;
124
- case t.END: break;
125
- default: throw new Error(`Unexpected state entered: ${i}`);
126
- }
127
- b("onHeaderField"), b("onHeaderValue"), b("onPartData"), this.index = e, this.state = i, this.flags = A;
128
- }
129
- end() {
130
- if (this.state === t.HEADER_FIELD_START && this.index === 0 || this.state === t.PART_DATA && this.index === this.boundary.length) this.onPartEnd();
131
- else if (this.state !== t.END) throw new Error("MultipartParser.end(): stream ended unexpectedly");
132
- }
133
- };
134
- E(F, "MultipartParser");
135
- let k = F;
136
- function v(u) {
137
- const a = u.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);
138
- if (!a) return;
139
- const n = a[2] || a[3] || "";
140
- let r = n.slice(n.lastIndexOf("\\") + 1);
141
- return r = r.replace(/%22/g, "\""), r = r.replace(/&#(\d{4});/g, (d, l) => String.fromCharCode(l)), r;
142
- }
143
- E(v, "_fileName");
144
- async function Z(u, a) {
145
- if (!/multipart/i.test(a)) throw new TypeError("Failed to fetch");
146
- const n = a.match(/boundary=(?:"([^"]+)"|([^;]+))/i);
147
- if (!n) throw new TypeError("no or bad content-type header, no multipart boundary");
148
- const r = new k(n[1] || n[2]);
149
- let d, l, c, p, e, i;
150
- const A = [], H = new require_node.br(), O = E((s) => {
151
- c += f.decode(s, { stream: !0 });
152
- }, "onPartData"), y = E((s) => {
153
- A.push(s);
154
- }, "appendToFile"), o = E(() => {
155
- const s = new require_node.qn(A, i, { type: e });
156
- H.append(p, s);
157
- }, "appendFileToFormData"), L = E(() => {
158
- H.append(p, c);
159
- }, "appendEntryToFormData"), f = new TextDecoder("utf-8");
160
- f.decode(), r.onPartBegin = function() {
161
- r.onPartData = O, r.onPartEnd = L, d = "", l = "", c = "", p = "", e = "", i = null, A.length = 0;
162
- }, r.onHeaderField = function(s) {
163
- d += f.decode(s, { stream: !0 });
164
- }, r.onHeaderValue = function(s) {
165
- l += f.decode(s, { stream: !0 });
166
- }, r.onHeaderEnd = function() {
167
- if (l += f.decode(), d = d.toLowerCase(), d === "content-disposition") {
168
- const s = l.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);
169
- s && (p = s[2] || s[3] || ""), i = v(l), i && (r.onPartData = y, r.onPartEnd = o);
170
- } else d === "content-type" && (e = l);
171
- l = "", d = "";
172
- };
173
- for await (const s of u) r.write(s);
174
- return r.end(), H;
175
- }
176
- E(Z, "toFormData");
177
-
178
- //#endregion
179
- exports.toFormData = Z;
@@ -1,179 +0,0 @@
1
- import "../shared/node-fetch-native.DfbY2q-x.mjs";
2
- import { br, qn } from "../node.mjs";
3
- import "node:fs";
4
- import "node:url";
5
- import "node:path";
6
- import "node:util";
7
- import "node:http";
8
- import "node:https";
9
- import "node:zlib";
10
- import "node:stream";
11
- import "node:buffer";
12
- import "node:net";
13
-
14
- //#region ../../node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs
15
- var B = Object.defineProperty;
16
- var E = (u, a) => B(u, "name", {
17
- value: a,
18
- configurable: !0
19
- });
20
- let D = 0;
21
- const t = {
22
- START_BOUNDARY: D++,
23
- HEADER_FIELD_START: D++,
24
- HEADER_FIELD: D++,
25
- HEADER_VALUE_START: D++,
26
- HEADER_VALUE: D++,
27
- HEADER_VALUE_ALMOST_DONE: D++,
28
- HEADERS_ALMOST_DONE: D++,
29
- PART_DATA_START: D++,
30
- PART_DATA: D++,
31
- END: D++
32
- };
33
- let w = 1;
34
- const R = {
35
- PART_BOUNDARY: w,
36
- LAST_BOUNDARY: w *= 2
37
- }, g = 10, N = 13, x = 32, P = 45, C = 58, I = 97, M = 122, $ = E((u) => u | 32, "lower"), m = E(() => {}, "noop"), F = class F$1 {
38
- constructor(a) {
39
- this.index = 0, this.flags = 0, this.onHeaderEnd = m, this.onHeaderField = m, this.onHeadersEnd = m, this.onHeaderValue = m, this.onPartBegin = m, this.onPartData = m, this.onPartEnd = m, this.boundaryChars = {}, a = `\r
40
- --` + a;
41
- const n = new Uint8Array(a.length);
42
- for (let r = 0; r < a.length; r++) n[r] = a.charCodeAt(r), this.boundaryChars[n[r]] = !0;
43
- this.boundary = n, this.lookbehind = new Uint8Array(this.boundary.length + 8), this.state = t.START_BOUNDARY;
44
- }
45
- write(a) {
46
- let n = 0;
47
- const r = a.length;
48
- let d = this.index, { lookbehind: l, boundary: c, boundaryChars: p, index: e, state: i, flags: A } = this;
49
- const H = this.boundary.length, O = H - 1, y = a.length;
50
- let o, L;
51
- const f = E((h) => {
52
- this[h + "Mark"] = n;
53
- }, "mark"), s = E((h) => {
54
- delete this[h + "Mark"];
55
- }, "clear"), T = E((h, S, _, U) => {
56
- (S === void 0 || S !== _) && this[h](U && U.subarray(S, _));
57
- }, "callback"), b = E((h, S) => {
58
- const _ = h + "Mark";
59
- _ in this && (S ? (T(h, this[_], n, a), delete this[_]) : (T(h, this[_], a.length, a), this[_] = 0));
60
- }, "dataCallback");
61
- for (n = 0; n < r; n++) switch (o = a[n], i) {
62
- case t.START_BOUNDARY:
63
- if (e === c.length - 2) {
64
- if (o === P) A |= R.LAST_BOUNDARY;
65
- else if (o !== N) return;
66
- e++;
67
- break;
68
- } else if (e - 1 === c.length - 2) {
69
- if (A & R.LAST_BOUNDARY && o === P) i = t.END, A = 0;
70
- else if (!(A & R.LAST_BOUNDARY) && o === g) e = 0, T("onPartBegin"), i = t.HEADER_FIELD_START;
71
- else return;
72
- break;
73
- }
74
- o !== c[e + 2] && (e = -2), o === c[e + 2] && e++;
75
- break;
76
- case t.HEADER_FIELD_START: i = t.HEADER_FIELD, f("onHeaderField"), e = 0;
77
- case t.HEADER_FIELD:
78
- if (o === N) {
79
- s("onHeaderField"), i = t.HEADERS_ALMOST_DONE;
80
- break;
81
- }
82
- if (e++, o === P) break;
83
- if (o === C) {
84
- if (e === 1) return;
85
- b("onHeaderField", !0), i = t.HEADER_VALUE_START;
86
- break;
87
- }
88
- if (L = $(o), L < I || L > M) return;
89
- break;
90
- case t.HEADER_VALUE_START:
91
- if (o === x) break;
92
- f("onHeaderValue"), i = t.HEADER_VALUE;
93
- case t.HEADER_VALUE:
94
- o === N && (b("onHeaderValue", !0), T("onHeaderEnd"), i = t.HEADER_VALUE_ALMOST_DONE);
95
- break;
96
- case t.HEADER_VALUE_ALMOST_DONE:
97
- if (o !== g) return;
98
- i = t.HEADER_FIELD_START;
99
- break;
100
- case t.HEADERS_ALMOST_DONE:
101
- if (o !== g) return;
102
- T("onHeadersEnd"), i = t.PART_DATA_START;
103
- break;
104
- case t.PART_DATA_START: i = t.PART_DATA, f("onPartData");
105
- case t.PART_DATA:
106
- if (d = e, e === 0) {
107
- for (n += O; n < y && !(a[n] in p);) n += H;
108
- n -= O, o = a[n];
109
- }
110
- if (e < c.length) c[e] === o ? (e === 0 && b("onPartData", !0), e++) : e = 0;
111
- else if (e === c.length) e++, o === N ? A |= R.PART_BOUNDARY : o === P ? A |= R.LAST_BOUNDARY : e = 0;
112
- else if (e - 1 === c.length) if (A & R.PART_BOUNDARY) {
113
- if (e = 0, o === g) {
114
- A &= ~R.PART_BOUNDARY, T("onPartEnd"), T("onPartBegin"), i = t.HEADER_FIELD_START;
115
- break;
116
- }
117
- } else A & R.LAST_BOUNDARY && o === P ? (T("onPartEnd"), i = t.END, A = 0) : e = 0;
118
- if (e > 0) l[e - 1] = o;
119
- else if (d > 0) {
120
- const h = new Uint8Array(l.buffer, l.byteOffset, l.byteLength);
121
- T("onPartData", 0, d, h), d = 0, f("onPartData"), n--;
122
- }
123
- break;
124
- case t.END: break;
125
- default: throw new Error(`Unexpected state entered: ${i}`);
126
- }
127
- b("onHeaderField"), b("onHeaderValue"), b("onPartData"), this.index = e, this.state = i, this.flags = A;
128
- }
129
- end() {
130
- if (this.state === t.HEADER_FIELD_START && this.index === 0 || this.state === t.PART_DATA && this.index === this.boundary.length) this.onPartEnd();
131
- else if (this.state !== t.END) throw new Error("MultipartParser.end(): stream ended unexpectedly");
132
- }
133
- };
134
- E(F, "MultipartParser");
135
- let k = F;
136
- function v(u) {
137
- const a = u.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);
138
- if (!a) return;
139
- const n = a[2] || a[3] || "";
140
- let r = n.slice(n.lastIndexOf("\\") + 1);
141
- return r = r.replace(/%22/g, "\""), r = r.replace(/&#(\d{4});/g, (d, l) => String.fromCharCode(l)), r;
142
- }
143
- E(v, "_fileName");
144
- async function Z(u, a) {
145
- if (!/multipart/i.test(a)) throw new TypeError("Failed to fetch");
146
- const n = a.match(/boundary=(?:"([^"]+)"|([^;]+))/i);
147
- if (!n) throw new TypeError("no or bad content-type header, no multipart boundary");
148
- const r = new k(n[1] || n[2]);
149
- let d, l, c, p, e, i;
150
- const A = [], H = new br(), O = E((s) => {
151
- c += f.decode(s, { stream: !0 });
152
- }, "onPartData"), y = E((s) => {
153
- A.push(s);
154
- }, "appendToFile"), o = E(() => {
155
- const s = new qn(A, i, { type: e });
156
- H.append(p, s);
157
- }, "appendFileToFormData"), L = E(() => {
158
- H.append(p, c);
159
- }, "appendEntryToFormData"), f = new TextDecoder("utf-8");
160
- f.decode(), r.onPartBegin = function() {
161
- r.onPartData = O, r.onPartEnd = L, d = "", l = "", c = "", p = "", e = "", i = null, A.length = 0;
162
- }, r.onHeaderField = function(s) {
163
- d += f.decode(s, { stream: !0 });
164
- }, r.onHeaderValue = function(s) {
165
- l += f.decode(s, { stream: !0 });
166
- }, r.onHeaderEnd = function() {
167
- if (l += f.decode(), d = d.toLowerCase(), d === "content-disposition") {
168
- const s = l.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);
169
- s && (p = s[2] || s[3] || ""), i = v(l), i && (r.onPartData = y, r.onPartEnd = o);
170
- } else d === "content-type" && (e = l);
171
- l = "", d = "";
172
- };
173
- for await (const s of u) r.write(s);
174
- return r.end(), H;
175
- }
176
- E(Z, "toFormData");
177
-
178
- //#endregion
179
- export { Z as toFormData };
@@ -1,20 +0,0 @@
1
- require('./shared/node-fetch-native.DfbY2q-x.cjs');
2
- const require_node = require('./node.cjs');
3
- let node_fs = require("node:fs");
4
- let node_url = require("node:url");
5
- let node_path = require("node:path");
6
- let node_util = require("node:util");
7
- let node_http = require("node:http");
8
- let node_https = require("node:https");
9
- let node_zlib = require("node:zlib");
10
- let node_stream = require("node:stream");
11
- let node_buffer = require("node:buffer");
12
- let node_net = require("node:net");
13
-
14
- //#region ../../node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.mjs
15
- const o = !!globalThis.process?.env?.FORCE_NODE_FETCH, r = !o && globalThis.fetch || require_node.Mi, p = !o && globalThis.Blob || require_node.ut, F = !o && globalThis.File || require_node.qn, h = !o && globalThis.FormData || require_node.br, n = !o && globalThis.Headers || require_node.ye, c = !o && globalThis.Request || require_node.dt, R = !o && globalThis.Response || require_node.le, T = !o && globalThis.AbortController || require_node.Mn;
16
-
17
- //#endregion
18
- exports.T = T;
19
- exports.n = n;
20
- exports.r = r;
@@ -1,18 +0,0 @@
1
- import "./shared/node-fetch-native.DfbY2q-x.mjs";
2
- import { G, Mi, Mn, _r, br, dt, jn, le, qn, ut, ye } from "./node.mjs";
3
- import "node:fs";
4
- import "node:url";
5
- import "node:path";
6
- import "node:util";
7
- import "node:http";
8
- import "node:https";
9
- import "node:zlib";
10
- import "node:stream";
11
- import "node:buffer";
12
- import "node:net";
13
-
14
- //#region ../../node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.mjs
15
- const o = !!globalThis.process?.env?.FORCE_NODE_FETCH, r = !o && globalThis.fetch || Mi, p = !o && globalThis.Blob || ut, F = !o && globalThis.File || qn, h = !o && globalThis.FormData || br, n = !o && globalThis.Headers || ye, c = !o && globalThis.Request || dt, R = !o && globalThis.Response || le, T = !o && globalThis.AbortController || Mn;
16
-
17
- //#endregion
18
- export { T, n, r };