@lynx-js/rspeedy-canary 0.13.0-canary-20260105-ec1caf1a → 0.13.0-canary-20260105-03ea61ec
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/CHANGELOG.md +1 -1
- package/dist/{0~vendors-node_modules_pnpm_ipaddr_js_2_3_0_node_modules_ipaddr_js_lib_ipaddr_js.js → 0~node_modules_pnpm_ipaddr_js_2_3_0_node_modules_ipaddr_js_lib_ipaddr_js.js} +3 -6
- package/dist/0~src_cli_exit_ts.js +98 -108
- package/dist/0~src_config_output_dist-path_ts.js +2 -0
- package/dist/0~src_config_validate_ts.js +41917 -41925
- package/dist/0~src_plugins_api_plugin_ts.js +21 -31
- package/dist/0~src_plugins_chunkLoading_plugin_ts.js +10 -20
- package/dist/0~src_plugins_dev_plugin_ts.js +168 -179
- package/dist/0~src_plugins_emitOnErrors_plugin_ts.js +10 -20
- package/dist/0~src_plugins_index_ts.js +63 -51
- package/dist/0~src_plugins_inspect_plugin_ts.js +434 -39
- package/dist/0~src_plugins_minify_plugin_ts.js +66 -76
- package/dist/0~src_plugins_optimization_plugin_ts.js +14 -24
- package/dist/0~src_plugins_output_plugin_ts.js +29 -45
- package/dist/0~src_plugins_resolve_plugin_ts.js +10 -20
- package/dist/0~src_plugins_rsdoctor_plugin_ts.js +39 -49
- package/dist/0~src_plugins_sourcemap_plugin_ts.js +86 -96
- package/dist/0~src_plugins_swc_plugin_ts.js +20 -38
- package/dist/0~src_plugins_target_plugin_ts.js +21 -39
- package/dist/0~src_utils_getESVersionTarget_ts.js +4 -0
- package/dist/1~node_modules_pnpm_chokidar_4_0_3_node_modules_chokidar_esm_index_js.js +1422 -0
- package/dist/{1~vendors-node_modules_pnpm_commander_13_1_0_node_modules_commander_esm_mjs.js → 1~node_modules_pnpm_commander_13_1_0_node_modules_commander_esm_mjs.js} +17 -24
- package/dist/{1~vendors-node_modules_pnpm_ipaddr_js_2_3_0_node_modules_ipaddr_js_lib_ipaddr_js.js → 1~node_modules_pnpm_ipaddr_js_2_3_0_node_modules_ipaddr_js_lib_ipaddr_js.js} +3 -6
- package/dist/1~src_cli_build_ts.js +35 -424
- package/dist/1~src_cli_commands_ts.js +56 -74
- package/dist/1~src_cli_dev_ts.js +29 -410
- package/dist/1~src_cli_init_ts-src_create-rspeedy_ts.js +318 -0
- package/dist/1~src_cli_inspect_ts.js +18 -356
- package/dist/1~src_cli_preview_ts.js +23 -359
- package/dist/1~src_cli_watch_ts.js +39 -0
- package/dist/1~src_config_output_dist-path_ts.js +2 -0
- package/dist/1~src_config_validate_ts.js +41917 -41925
- package/dist/1~src_plugins_api_plugin_ts.js +22 -31
- package/dist/1~src_plugins_chunkLoading_plugin_ts.js +10 -20
- package/dist/1~src_plugins_dev_plugin_ts.js +170 -179
- package/dist/1~src_plugins_emitOnErrors_plugin_ts.js +10 -20
- package/dist/1~src_plugins_index_ts.js +63 -51
- package/dist/1~src_plugins_inspect_plugin_ts.js +436 -39
- package/dist/1~src_plugins_minify_plugin_ts.js +66 -76
- package/dist/1~src_plugins_optimization_plugin_ts.js +14 -24
- package/dist/1~src_plugins_output_plugin_ts.js +29 -45
- package/dist/1~src_plugins_resolve_plugin_ts.js +10 -20
- package/dist/1~src_plugins_rsdoctor_plugin_ts.js +37 -55
- package/dist/1~src_plugins_sourcemap_plugin_ts.js +86 -96
- package/dist/1~src_plugins_swc_plugin_ts.js +20 -38
- package/dist/1~src_plugins_target_plugin_ts.js +21 -39
- package/dist/1~src_utils_getESVersionTarget_ts.js +4 -0
- package/dist/1~src_utils_is-ci_ts.js +4 -0
- package/dist/1~src_version_ts.js +6 -18
- package/dist/cli/main.js +1 -357
- package/dist/cli/start.js +16 -130
- package/dist/index.js +1 -524
- package/dist/node_fs.js +7 -0
- package/dist/node_path.js +7 -0
- package/dist/node_url.js +1 -0
- package/dist/rslib-runtime.js +75 -0
- package/dist/src_cli_main_ts.js +149 -0
- package/dist/src_debug_ts.js +93 -0
- package/dist/src_index_ts.js +381 -0
- package/package.json +1 -1
- package/dist/0~vendors-node_modules_pnpm_javascript-stringify_2_1_0_node_modules_javascript-stringify_dist_i-562fbc.js +0 -417
- package/dist/1~events-fs-fs_promises-os-path-stream.js +0 -30
- package/dist/1~node_child_process-node_events-node_fs-node_path.js +0 -22
- package/dist/1~vendors-node_modules_pnpm_chokidar_4_0_3_node_modules_chokidar_esm_index_js.js +0 -1432
- package/dist/1~vendors-node_modules_pnpm_javascript-stringify_2_1_0_node_modules_javascript-stringify_dist_i-562fbc.js +0 -417
- /package/dist/{1~vendors-node_modules_pnpm_chokidar_4_0_3_node_modules_chokidar_esm_index_js.js.LICENSE.txt → 1~node_modules_pnpm_chokidar_4_0_3_node_modules_chokidar_esm_index_js.js.LICENSE.txt} +0 -0
|
@@ -1,417 +0,0 @@
|
|
|
1
|
-
export const __rspack_esm_id = "vendors-node_modules_pnpm_javascript-stringify_2_1_0_node_modules_javascript-stringify_dist_i-562fbc";
|
|
2
|
-
export const __rspack_esm_ids = [
|
|
3
|
-
"vendors-node_modules_pnpm_javascript-stringify_2_1_0_node_modules_javascript-stringify_dist_i-562fbc"
|
|
4
|
-
];
|
|
5
|
-
export const __webpack_modules__ = {
|
|
6
|
-
"../../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/array.js" (__unused_rspack_module, exports) {
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports.arrayToString = void 0;
|
|
11
|
-
const arrayToString = (array, space, next)=>{
|
|
12
|
-
const values = array.map(function(value, index) {
|
|
13
|
-
const result = next(value, index);
|
|
14
|
-
if (void 0 === result) return String(result);
|
|
15
|
-
return space + result.split("\n").join(`\n${space}`);
|
|
16
|
-
}).join(space ? ",\n" : ",");
|
|
17
|
-
const eol = space && values ? "\n" : "";
|
|
18
|
-
return `[${eol}${values}${eol}]`;
|
|
19
|
-
};
|
|
20
|
-
exports.arrayToString = arrayToString;
|
|
21
|
-
},
|
|
22
|
-
"../../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/function.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
23
|
-
Object.defineProperty(exports, "__esModule", {
|
|
24
|
-
value: true
|
|
25
|
-
});
|
|
26
|
-
exports.FunctionParser = exports.dedentFunction = exports.functionToString = exports.USED_METHOD_KEY = void 0;
|
|
27
|
-
const quote_1 = __webpack_require__("../../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/quote.js");
|
|
28
|
-
const METHOD_NAMES_ARE_QUOTED = '"' === ({
|
|
29
|
-
" " () {}
|
|
30
|
-
})[" "].toString().charAt(0);
|
|
31
|
-
const FUNCTION_PREFIXES = {
|
|
32
|
-
Function: "function ",
|
|
33
|
-
GeneratorFunction: "function* ",
|
|
34
|
-
AsyncFunction: "async function ",
|
|
35
|
-
AsyncGeneratorFunction: "async function* "
|
|
36
|
-
};
|
|
37
|
-
const METHOD_PREFIXES = {
|
|
38
|
-
Function: "",
|
|
39
|
-
GeneratorFunction: "*",
|
|
40
|
-
AsyncFunction: "async ",
|
|
41
|
-
AsyncGeneratorFunction: "async *"
|
|
42
|
-
};
|
|
43
|
-
const TOKENS_PRECEDING_REGEXPS = new Set("case delete else in instanceof new return throw typeof void , ; : + - ! ~ & | ^ * / % < > ? =".split(" "));
|
|
44
|
-
exports.USED_METHOD_KEY = new WeakSet();
|
|
45
|
-
const functionToString = (fn, space, next, key)=>{
|
|
46
|
-
const name = "string" == typeof key ? key : void 0;
|
|
47
|
-
if (void 0 !== name) exports.USED_METHOD_KEY.add(fn);
|
|
48
|
-
return new FunctionParser(fn, space, next, name).stringify();
|
|
49
|
-
};
|
|
50
|
-
exports.functionToString = functionToString;
|
|
51
|
-
function dedentFunction(fnString) {
|
|
52
|
-
let found;
|
|
53
|
-
for (const line of fnString.split("\n").slice(1)){
|
|
54
|
-
const m = /^[\s\t]+/.exec(line);
|
|
55
|
-
if (!m) return fnString;
|
|
56
|
-
const [str] = m;
|
|
57
|
-
if (void 0 === found) found = str;
|
|
58
|
-
else if (str.length < found.length) found = str;
|
|
59
|
-
}
|
|
60
|
-
return found ? fnString.split(`\n${found}`).join("\n") : fnString;
|
|
61
|
-
}
|
|
62
|
-
exports.dedentFunction = dedentFunction;
|
|
63
|
-
class FunctionParser {
|
|
64
|
-
constructor(fn, indent, next, key){
|
|
65
|
-
this.fn = fn;
|
|
66
|
-
this.indent = indent;
|
|
67
|
-
this.next = next;
|
|
68
|
-
this.key = key;
|
|
69
|
-
this.pos = 0;
|
|
70
|
-
this.hadKeyword = false;
|
|
71
|
-
this.fnString = Function.prototype.toString.call(fn);
|
|
72
|
-
this.fnType = fn.constructor.name;
|
|
73
|
-
this.keyQuote = void 0 === key ? "" : quote_1.quoteKey(key, next);
|
|
74
|
-
this.keyPrefix = void 0 === key ? "" : `${this.keyQuote}:${indent ? " " : ""}`;
|
|
75
|
-
this.isMethodCandidate = void 0 === key ? false : "" === this.fn.name || this.fn.name === key;
|
|
76
|
-
}
|
|
77
|
-
stringify() {
|
|
78
|
-
const value = this.tryParse();
|
|
79
|
-
if (!value) return `${this.keyPrefix}void ${this.next(this.fnString)}`;
|
|
80
|
-
return dedentFunction(value);
|
|
81
|
-
}
|
|
82
|
-
getPrefix() {
|
|
83
|
-
if (this.isMethodCandidate && !this.hadKeyword) return METHOD_PREFIXES[this.fnType] + this.keyQuote;
|
|
84
|
-
return this.keyPrefix + FUNCTION_PREFIXES[this.fnType];
|
|
85
|
-
}
|
|
86
|
-
tryParse() {
|
|
87
|
-
if ("}" !== this.fnString[this.fnString.length - 1]) return this.keyPrefix + this.fnString;
|
|
88
|
-
if (this.fn.name) {
|
|
89
|
-
const result = this.tryStrippingName();
|
|
90
|
-
if (result) return result;
|
|
91
|
-
}
|
|
92
|
-
const prevPos = this.pos;
|
|
93
|
-
if ("class" === this.consumeSyntax()) return this.fnString;
|
|
94
|
-
this.pos = prevPos;
|
|
95
|
-
if (this.tryParsePrefixTokens()) {
|
|
96
|
-
const result = this.tryStrippingName();
|
|
97
|
-
if (result) return result;
|
|
98
|
-
let offset = this.pos;
|
|
99
|
-
switch(this.consumeSyntax("WORD_LIKE")){
|
|
100
|
-
case "WORD_LIKE":
|
|
101
|
-
if (this.isMethodCandidate && !this.hadKeyword) offset = this.pos;
|
|
102
|
-
case "()":
|
|
103
|
-
if ("=>" === this.fnString.substr(this.pos, 2)) return this.keyPrefix + this.fnString;
|
|
104
|
-
this.pos = offset;
|
|
105
|
-
case '"':
|
|
106
|
-
case "'":
|
|
107
|
-
case "[]":
|
|
108
|
-
return this.getPrefix() + this.fnString.substr(this.pos);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
tryStrippingName() {
|
|
113
|
-
if (METHOD_NAMES_ARE_QUOTED) return;
|
|
114
|
-
let start = this.pos;
|
|
115
|
-
const prefix = this.fnString.substr(this.pos, this.fn.name.length);
|
|
116
|
-
if (prefix === this.fn.name) {
|
|
117
|
-
this.pos += prefix.length;
|
|
118
|
-
if ("()" === this.consumeSyntax() && "{}" === this.consumeSyntax() && this.pos === this.fnString.length) {
|
|
119
|
-
if (this.isMethodCandidate || !quote_1.isValidVariableName(prefix)) start += prefix.length;
|
|
120
|
-
return this.getPrefix() + this.fnString.substr(start);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
this.pos = start;
|
|
124
|
-
}
|
|
125
|
-
tryParsePrefixTokens() {
|
|
126
|
-
let posPrev = this.pos;
|
|
127
|
-
this.hadKeyword = false;
|
|
128
|
-
switch(this.fnType){
|
|
129
|
-
case "AsyncFunction":
|
|
130
|
-
if ("async" !== this.consumeSyntax()) return false;
|
|
131
|
-
posPrev = this.pos;
|
|
132
|
-
case "Function":
|
|
133
|
-
if ("function" === this.consumeSyntax()) this.hadKeyword = true;
|
|
134
|
-
else this.pos = posPrev;
|
|
135
|
-
return true;
|
|
136
|
-
case "AsyncGeneratorFunction":
|
|
137
|
-
if ("async" !== this.consumeSyntax()) return false;
|
|
138
|
-
case "GeneratorFunction":
|
|
139
|
-
let token = this.consumeSyntax();
|
|
140
|
-
if ("function" === token) {
|
|
141
|
-
token = this.consumeSyntax();
|
|
142
|
-
this.hadKeyword = true;
|
|
143
|
-
}
|
|
144
|
-
return "*" === token;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
consumeSyntax(wordLikeToken) {
|
|
148
|
-
const m = this.consumeMatch(/^(?:([A-Za-z_0-9$\xA0-\uFFFF]+)|=>|\+\+|\-\-|.)/);
|
|
149
|
-
if (!m) return;
|
|
150
|
-
const [token, match] = m;
|
|
151
|
-
this.consumeWhitespace();
|
|
152
|
-
if (match) return wordLikeToken || match;
|
|
153
|
-
switch(token){
|
|
154
|
-
case "(":
|
|
155
|
-
return this.consumeSyntaxUntil("(", ")");
|
|
156
|
-
case "[":
|
|
157
|
-
return this.consumeSyntaxUntil("[", "]");
|
|
158
|
-
case "{":
|
|
159
|
-
return this.consumeSyntaxUntil("{", "}");
|
|
160
|
-
case "`":
|
|
161
|
-
return this.consumeTemplate();
|
|
162
|
-
case '"':
|
|
163
|
-
return this.consumeRegExp(/^(?:[^\\"]|\\.)*"/, '"');
|
|
164
|
-
case "'":
|
|
165
|
-
return this.consumeRegExp(/^(?:[^\\']|\\.)*'/, "'");
|
|
166
|
-
}
|
|
167
|
-
return token;
|
|
168
|
-
}
|
|
169
|
-
consumeSyntaxUntil(startToken, endToken) {
|
|
170
|
-
let isRegExpAllowed = true;
|
|
171
|
-
for(;;){
|
|
172
|
-
const token = this.consumeSyntax();
|
|
173
|
-
if (token === endToken) return startToken + endToken;
|
|
174
|
-
if (!token || ")" === token || "]" === token || "}" === token) return;
|
|
175
|
-
if ("/" === token && isRegExpAllowed && this.consumeMatch(/^(?:\\.|[^\\\/\n[]|\[(?:\\.|[^\]])*\])+\/[a-z]*/)) {
|
|
176
|
-
isRegExpAllowed = false;
|
|
177
|
-
this.consumeWhitespace();
|
|
178
|
-
} else isRegExpAllowed = TOKENS_PRECEDING_REGEXPS.has(token);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
consumeMatch(re) {
|
|
182
|
-
const m = re.exec(this.fnString.substr(this.pos));
|
|
183
|
-
if (m) this.pos += m[0].length;
|
|
184
|
-
return m;
|
|
185
|
-
}
|
|
186
|
-
consumeRegExp(re, token) {
|
|
187
|
-
const m = re.exec(this.fnString.substr(this.pos));
|
|
188
|
-
if (!m) return;
|
|
189
|
-
this.pos += m[0].length;
|
|
190
|
-
this.consumeWhitespace();
|
|
191
|
-
return token;
|
|
192
|
-
}
|
|
193
|
-
consumeTemplate() {
|
|
194
|
-
for(;;){
|
|
195
|
-
this.consumeMatch(/^(?:[^`$\\]|\\.|\$(?!{))*/);
|
|
196
|
-
if ("`" === this.fnString[this.pos]) {
|
|
197
|
-
this.pos++;
|
|
198
|
-
this.consumeWhitespace();
|
|
199
|
-
return "`";
|
|
200
|
-
}
|
|
201
|
-
if ("${" === this.fnString.substr(this.pos, 2)) {
|
|
202
|
-
this.pos += 2;
|
|
203
|
-
this.consumeWhitespace();
|
|
204
|
-
if (this.consumeSyntaxUntil("{", "}")) continue;
|
|
205
|
-
}
|
|
206
|
-
return;
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
consumeWhitespace() {
|
|
210
|
-
this.consumeMatch(/^(?:\s|\/\/.*|\/\*[^]*?\*\/)*/);
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
exports.FunctionParser = FunctionParser;
|
|
214
|
-
},
|
|
215
|
-
"../../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/index.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
216
|
-
exports.stringify = void 0;
|
|
217
|
-
const stringify_1 = __webpack_require__("../../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/stringify.js");
|
|
218
|
-
const quote_1 = __webpack_require__("../../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/quote.js");
|
|
219
|
-
const ROOT_SENTINEL = Symbol("root");
|
|
220
|
-
function stringify(value, replacer, indent, options = {}) {
|
|
221
|
-
const space = "string" == typeof indent ? indent : " ".repeat(indent || 0);
|
|
222
|
-
const path = [];
|
|
223
|
-
const stack = new Set();
|
|
224
|
-
const tracking = new Map();
|
|
225
|
-
const unpack = new Map();
|
|
226
|
-
let valueCount = 0;
|
|
227
|
-
const { maxDepth = 100, references = false, skipUndefinedProperties = false, maxValues = 100000 } = options;
|
|
228
|
-
const valueToString = replacerToString(replacer);
|
|
229
|
-
const onNext = (value, key)=>{
|
|
230
|
-
if (++valueCount > maxValues) return;
|
|
231
|
-
if (skipUndefinedProperties && void 0 === value) return;
|
|
232
|
-
if (path.length > maxDepth) return;
|
|
233
|
-
if (void 0 === key) return valueToString(value, space, onNext, key);
|
|
234
|
-
path.push(key);
|
|
235
|
-
const result = builder(value, key === ROOT_SENTINEL ? void 0 : key);
|
|
236
|
-
path.pop();
|
|
237
|
-
return result;
|
|
238
|
-
};
|
|
239
|
-
const builder = references ? (value, key)=>{
|
|
240
|
-
if (null !== value && ("object" == typeof value || "function" == typeof value || "symbol" == typeof value)) {
|
|
241
|
-
if (tracking.has(value)) {
|
|
242
|
-
unpack.set(path.slice(1), tracking.get(value));
|
|
243
|
-
return valueToString(void 0, space, onNext, key);
|
|
244
|
-
}
|
|
245
|
-
tracking.set(value, path.slice(1));
|
|
246
|
-
}
|
|
247
|
-
return valueToString(value, space, onNext, key);
|
|
248
|
-
} : (value, key)=>{
|
|
249
|
-
if (stack.has(value)) return;
|
|
250
|
-
stack.add(value);
|
|
251
|
-
const result = valueToString(value, space, onNext, key);
|
|
252
|
-
stack.delete(value);
|
|
253
|
-
return result;
|
|
254
|
-
};
|
|
255
|
-
const result = onNext(value, ROOT_SENTINEL);
|
|
256
|
-
if (unpack.size) {
|
|
257
|
-
const sp = space ? " " : "";
|
|
258
|
-
const eol = space ? "\n" : "";
|
|
259
|
-
let wrapper = `var x${sp}=${sp}${result};${eol}`;
|
|
260
|
-
for (const [key, value] of unpack.entries()){
|
|
261
|
-
const keyPath = quote_1.stringifyPath(key, onNext);
|
|
262
|
-
const valuePath = quote_1.stringifyPath(value, onNext);
|
|
263
|
-
wrapper += `x${keyPath}${sp}=${sp}x${valuePath};${eol}`;
|
|
264
|
-
}
|
|
265
|
-
return `(function${sp}()${sp}{${eol}${wrapper}return x;${eol}}())`;
|
|
266
|
-
}
|
|
267
|
-
return result;
|
|
268
|
-
}
|
|
269
|
-
exports.stringify = stringify;
|
|
270
|
-
function replacerToString(replacer) {
|
|
271
|
-
if (!replacer) return stringify_1.toString;
|
|
272
|
-
return (value, space, next, key)=>replacer(value, space, (value)=>stringify_1.toString(value, space, next, key), key);
|
|
273
|
-
}
|
|
274
|
-
},
|
|
275
|
-
"../../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/object.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
276
|
-
Object.defineProperty(exports, "__esModule", {
|
|
277
|
-
value: true
|
|
278
|
-
});
|
|
279
|
-
exports.objectToString = void 0;
|
|
280
|
-
const quote_1 = __webpack_require__("../../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/quote.js");
|
|
281
|
-
const function_1 = __webpack_require__("../../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/function.js");
|
|
282
|
-
const array_1 = __webpack_require__("../../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/array.js");
|
|
283
|
-
const objectToString = (value, space, next, key)=>{
|
|
284
|
-
if ("function" == typeof Buffer && Buffer.isBuffer(value)) return `Buffer.from(${next(value.toString("base64"))}, 'base64')`;
|
|
285
|
-
if ("object" == typeof global && value === global) return globalToString(value, space, next, key);
|
|
286
|
-
const toString = OBJECT_TYPES[Object.prototype.toString.call(value)];
|
|
287
|
-
return toString ? toString(value, space, next, key) : void 0;
|
|
288
|
-
};
|
|
289
|
-
exports.objectToString = objectToString;
|
|
290
|
-
const rawObjectToString = (obj, indent, next, key)=>{
|
|
291
|
-
const eol = indent ? "\n" : "";
|
|
292
|
-
const space = indent ? " " : "";
|
|
293
|
-
const values = Object.keys(obj).reduce(function(values, key) {
|
|
294
|
-
const fn = obj[key];
|
|
295
|
-
const result = next(fn, key);
|
|
296
|
-
if (void 0 === result) return values;
|
|
297
|
-
const value = result.split("\n").join(`\n${indent}`);
|
|
298
|
-
if (function_1.USED_METHOD_KEY.has(fn)) {
|
|
299
|
-
values.push(`${indent}${value}`);
|
|
300
|
-
return values;
|
|
301
|
-
}
|
|
302
|
-
values.push(`${indent}${quote_1.quoteKey(key, next)}:${space}${value}`);
|
|
303
|
-
return values;
|
|
304
|
-
}, []).join(`,${eol}`);
|
|
305
|
-
if ("" === values) return "{}";
|
|
306
|
-
return `{${eol}${values}${eol}}`;
|
|
307
|
-
};
|
|
308
|
-
const globalToString = (value, space, next)=>`Function(${next("return this")})()`;
|
|
309
|
-
const OBJECT_TYPES = {
|
|
310
|
-
"[object Array]": array_1.arrayToString,
|
|
311
|
-
"[object Object]": rawObjectToString,
|
|
312
|
-
"[object Error]": (error, space, next)=>`new Error(${next(error.message)})`,
|
|
313
|
-
"[object Date]": (date)=>`new Date(${date.getTime()})`,
|
|
314
|
-
"[object String]": (str, space, next)=>`new String(${next(str.toString())})`,
|
|
315
|
-
"[object Number]": (num)=>`new Number(${num})`,
|
|
316
|
-
"[object Boolean]": (bool)=>`new Boolean(${bool})`,
|
|
317
|
-
"[object Set]": (set, space, next)=>`new Set(${next(Array.from(set))})`,
|
|
318
|
-
"[object Map]": (map, space, next)=>`new Map(${next(Array.from(map))})`,
|
|
319
|
-
"[object RegExp]": String,
|
|
320
|
-
"[object global]": globalToString,
|
|
321
|
-
"[object Window]": globalToString
|
|
322
|
-
};
|
|
323
|
-
},
|
|
324
|
-
"../../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/quote.js" (__unused_rspack_module, exports) {
|
|
325
|
-
Object.defineProperty(exports, "__esModule", {
|
|
326
|
-
value: true
|
|
327
|
-
});
|
|
328
|
-
exports.stringifyPath = exports.quoteKey = exports.isValidVariableName = exports.IS_VALID_IDENTIFIER = exports.quoteString = void 0;
|
|
329
|
-
const ESCAPABLE = /[\\\'\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
|
|
330
|
-
const META_CHARS = new Map([
|
|
331
|
-
[
|
|
332
|
-
"\b",
|
|
333
|
-
"\\b"
|
|
334
|
-
],
|
|
335
|
-
[
|
|
336
|
-
"\t",
|
|
337
|
-
"\\t"
|
|
338
|
-
],
|
|
339
|
-
[
|
|
340
|
-
"\n",
|
|
341
|
-
"\\n"
|
|
342
|
-
],
|
|
343
|
-
[
|
|
344
|
-
"\f",
|
|
345
|
-
"\\f"
|
|
346
|
-
],
|
|
347
|
-
[
|
|
348
|
-
"\r",
|
|
349
|
-
"\\r"
|
|
350
|
-
],
|
|
351
|
-
[
|
|
352
|
-
"'",
|
|
353
|
-
"\\'"
|
|
354
|
-
],
|
|
355
|
-
[
|
|
356
|
-
'"',
|
|
357
|
-
'\\"'
|
|
358
|
-
],
|
|
359
|
-
[
|
|
360
|
-
"\\",
|
|
361
|
-
"\\\\"
|
|
362
|
-
]
|
|
363
|
-
]);
|
|
364
|
-
function escapeChar(char) {
|
|
365
|
-
return META_CHARS.get(char) || `\\u${`0000${char.charCodeAt(0).toString(16)}`.slice(-4)}`;
|
|
366
|
-
}
|
|
367
|
-
function quoteString(str) {
|
|
368
|
-
return `'${str.replace(ESCAPABLE, escapeChar)}'`;
|
|
369
|
-
}
|
|
370
|
-
exports.quoteString = quoteString;
|
|
371
|
-
const RESERVED_WORDS = new Set("break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield".split(" "));
|
|
372
|
-
exports.IS_VALID_IDENTIFIER = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
|
|
373
|
-
function isValidVariableName(name) {
|
|
374
|
-
return "string" == typeof name && !RESERVED_WORDS.has(name) && exports.IS_VALID_IDENTIFIER.test(name);
|
|
375
|
-
}
|
|
376
|
-
exports.isValidVariableName = isValidVariableName;
|
|
377
|
-
function quoteKey(key, next) {
|
|
378
|
-
return isValidVariableName(key) ? key : next(key);
|
|
379
|
-
}
|
|
380
|
-
exports.quoteKey = quoteKey;
|
|
381
|
-
function stringifyPath(path, next) {
|
|
382
|
-
let result = "";
|
|
383
|
-
for (const key of path)if (isValidVariableName(key)) result += `.${key}`;
|
|
384
|
-
else result += `[${next(key)}]`;
|
|
385
|
-
return result;
|
|
386
|
-
}
|
|
387
|
-
exports.stringifyPath = stringifyPath;
|
|
388
|
-
},
|
|
389
|
-
"../../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/stringify.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
390
|
-
Object.defineProperty(exports, "__esModule", {
|
|
391
|
-
value: true
|
|
392
|
-
});
|
|
393
|
-
exports.toString = void 0;
|
|
394
|
-
const quote_1 = __webpack_require__("../../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/quote.js");
|
|
395
|
-
const object_1 = __webpack_require__("../../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/object.js");
|
|
396
|
-
const function_1 = __webpack_require__("../../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/function.js");
|
|
397
|
-
const PRIMITIVE_TYPES = {
|
|
398
|
-
string: quote_1.quoteString,
|
|
399
|
-
number: (value)=>Object.is(value, -0) ? "-0" : String(value),
|
|
400
|
-
boolean: String,
|
|
401
|
-
symbol: (value, space, next)=>{
|
|
402
|
-
const key = Symbol.keyFor(value);
|
|
403
|
-
if (void 0 !== key) return `Symbol.for(${next(key)})`;
|
|
404
|
-
return `Symbol(${next(value.description)})`;
|
|
405
|
-
},
|
|
406
|
-
bigint: (value, space, next)=>`BigInt(${next(String(value))})`,
|
|
407
|
-
undefined: String,
|
|
408
|
-
object: object_1.objectToString,
|
|
409
|
-
function: function_1.functionToString
|
|
410
|
-
};
|
|
411
|
-
const toString = (value, space, next, key)=>{
|
|
412
|
-
if (null === value) return "null";
|
|
413
|
-
return PRIMITIVE_TYPES[typeof value](value, space, next, key);
|
|
414
|
-
};
|
|
415
|
-
exports.toString = toString;
|
|
416
|
-
}
|
|
417
|
-
};
|