@ripplo/testing 0.7.18 → 0.7.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/express.js +626 -0
- package/dist/index.js +626 -0
- package/package.json +1 -1
package/dist/express.js
CHANGED
|
@@ -1,3 +1,625 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
8
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
19
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
20
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
21
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
22
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
23
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
24
|
+
mod
|
|
25
|
+
));
|
|
26
|
+
|
|
27
|
+
// ../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/index.js
|
|
28
|
+
var require_safe_stable_stringify = __commonJS({
|
|
29
|
+
"../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/index.js"(exports, module) {
|
|
30
|
+
"use strict";
|
|
31
|
+
var { hasOwnProperty } = Object.prototype;
|
|
32
|
+
var stringify2 = configure2();
|
|
33
|
+
stringify2.configure = configure2;
|
|
34
|
+
stringify2.stringify = stringify2;
|
|
35
|
+
stringify2.default = stringify2;
|
|
36
|
+
exports.stringify = stringify2;
|
|
37
|
+
exports.configure = configure2;
|
|
38
|
+
module.exports = stringify2;
|
|
39
|
+
var strEscapeSequencesRegExp = /[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;
|
|
40
|
+
function strEscape(str) {
|
|
41
|
+
if (str.length < 5e3 && !strEscapeSequencesRegExp.test(str)) {
|
|
42
|
+
return `"${str}"`;
|
|
43
|
+
}
|
|
44
|
+
return JSON.stringify(str);
|
|
45
|
+
}
|
|
46
|
+
function sort(array, comparator) {
|
|
47
|
+
if (array.length > 200 || comparator) {
|
|
48
|
+
return array.sort(comparator);
|
|
49
|
+
}
|
|
50
|
+
for (let i = 1; i < array.length; i++) {
|
|
51
|
+
const currentValue = array[i];
|
|
52
|
+
let position = i;
|
|
53
|
+
while (position !== 0 && array[position - 1] > currentValue) {
|
|
54
|
+
array[position] = array[position - 1];
|
|
55
|
+
position--;
|
|
56
|
+
}
|
|
57
|
+
array[position] = currentValue;
|
|
58
|
+
}
|
|
59
|
+
return array;
|
|
60
|
+
}
|
|
61
|
+
var typedArrayPrototypeGetSymbolToStringTag = Object.getOwnPropertyDescriptor(
|
|
62
|
+
Object.getPrototypeOf(
|
|
63
|
+
Object.getPrototypeOf(
|
|
64
|
+
new Int8Array()
|
|
65
|
+
)
|
|
66
|
+
),
|
|
67
|
+
Symbol.toStringTag
|
|
68
|
+
).get;
|
|
69
|
+
function isTypedArrayWithEntries(value) {
|
|
70
|
+
return typedArrayPrototypeGetSymbolToStringTag.call(value) !== void 0 && value.length !== 0;
|
|
71
|
+
}
|
|
72
|
+
function stringifyTypedArray(array, separator, maximumBreadth) {
|
|
73
|
+
if (array.length < maximumBreadth) {
|
|
74
|
+
maximumBreadth = array.length;
|
|
75
|
+
}
|
|
76
|
+
const whitespace = separator === "," ? "" : " ";
|
|
77
|
+
let res = `"0":${whitespace}${array[0]}`;
|
|
78
|
+
for (let i = 1; i < maximumBreadth; i++) {
|
|
79
|
+
res += `${separator}"${i}":${whitespace}${array[i]}`;
|
|
80
|
+
}
|
|
81
|
+
return res;
|
|
82
|
+
}
|
|
83
|
+
function getCircularValueOption(options) {
|
|
84
|
+
if (hasOwnProperty.call(options, "circularValue")) {
|
|
85
|
+
const circularValue = options.circularValue;
|
|
86
|
+
if (typeof circularValue === "string") {
|
|
87
|
+
return `"${circularValue}"`;
|
|
88
|
+
}
|
|
89
|
+
if (circularValue == null) {
|
|
90
|
+
return circularValue;
|
|
91
|
+
}
|
|
92
|
+
if (circularValue === Error || circularValue === TypeError) {
|
|
93
|
+
return {
|
|
94
|
+
toString() {
|
|
95
|
+
throw new TypeError("Converting circular structure to JSON");
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined');
|
|
100
|
+
}
|
|
101
|
+
return '"[Circular]"';
|
|
102
|
+
}
|
|
103
|
+
function getDeterministicOption(options) {
|
|
104
|
+
let value;
|
|
105
|
+
if (hasOwnProperty.call(options, "deterministic")) {
|
|
106
|
+
value = options.deterministic;
|
|
107
|
+
if (typeof value !== "boolean" && typeof value !== "function") {
|
|
108
|
+
throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return value === void 0 ? true : value;
|
|
112
|
+
}
|
|
113
|
+
function getBooleanOption(options, key) {
|
|
114
|
+
let value;
|
|
115
|
+
if (hasOwnProperty.call(options, key)) {
|
|
116
|
+
value = options[key];
|
|
117
|
+
if (typeof value !== "boolean") {
|
|
118
|
+
throw new TypeError(`The "${key}" argument must be of type boolean`);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return value === void 0 ? true : value;
|
|
122
|
+
}
|
|
123
|
+
function getPositiveIntegerOption(options, key) {
|
|
124
|
+
let value;
|
|
125
|
+
if (hasOwnProperty.call(options, key)) {
|
|
126
|
+
value = options[key];
|
|
127
|
+
if (typeof value !== "number") {
|
|
128
|
+
throw new TypeError(`The "${key}" argument must be of type number`);
|
|
129
|
+
}
|
|
130
|
+
if (!Number.isInteger(value)) {
|
|
131
|
+
throw new TypeError(`The "${key}" argument must be an integer`);
|
|
132
|
+
}
|
|
133
|
+
if (value < 1) {
|
|
134
|
+
throw new RangeError(`The "${key}" argument must be >= 1`);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return value === void 0 ? Infinity : value;
|
|
138
|
+
}
|
|
139
|
+
function getItemCount(number) {
|
|
140
|
+
if (number === 1) {
|
|
141
|
+
return "1 item";
|
|
142
|
+
}
|
|
143
|
+
return `${number} items`;
|
|
144
|
+
}
|
|
145
|
+
function getUniqueReplacerSet(replacerArray) {
|
|
146
|
+
const replacerSet = /* @__PURE__ */ new Set();
|
|
147
|
+
for (const value of replacerArray) {
|
|
148
|
+
if (typeof value === "string" || typeof value === "number") {
|
|
149
|
+
replacerSet.add(String(value));
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return replacerSet;
|
|
153
|
+
}
|
|
154
|
+
function getStrictOption(options) {
|
|
155
|
+
if (hasOwnProperty.call(options, "strict")) {
|
|
156
|
+
const value = options.strict;
|
|
157
|
+
if (typeof value !== "boolean") {
|
|
158
|
+
throw new TypeError('The "strict" argument must be of type boolean');
|
|
159
|
+
}
|
|
160
|
+
if (value) {
|
|
161
|
+
return (value2) => {
|
|
162
|
+
let message = `Object can not safely be stringified. Received type ${typeof value2}`;
|
|
163
|
+
if (typeof value2 !== "function") message += ` (${value2.toString()})`;
|
|
164
|
+
throw new Error(message);
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
function configure2(options) {
|
|
170
|
+
options = { ...options };
|
|
171
|
+
const fail2 = getStrictOption(options);
|
|
172
|
+
if (fail2) {
|
|
173
|
+
if (options.bigint === void 0) {
|
|
174
|
+
options.bigint = false;
|
|
175
|
+
}
|
|
176
|
+
if (!("circularValue" in options)) {
|
|
177
|
+
options.circularValue = Error;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
const circularValue = getCircularValueOption(options);
|
|
181
|
+
const bigint = getBooleanOption(options, "bigint");
|
|
182
|
+
const deterministic = getDeterministicOption(options);
|
|
183
|
+
const comparator = typeof deterministic === "function" ? deterministic : void 0;
|
|
184
|
+
const maximumDepth = getPositiveIntegerOption(options, "maximumDepth");
|
|
185
|
+
const maximumBreadth = getPositiveIntegerOption(options, "maximumBreadth");
|
|
186
|
+
function stringifyFnReplacer(key, parent, stack, replacer, spacer, indentation) {
|
|
187
|
+
let value = parent[key];
|
|
188
|
+
if (typeof value === "object" && value !== null && typeof value.toJSON === "function") {
|
|
189
|
+
value = value.toJSON(key);
|
|
190
|
+
}
|
|
191
|
+
value = replacer.call(parent, key, value);
|
|
192
|
+
switch (typeof value) {
|
|
193
|
+
case "string":
|
|
194
|
+
return strEscape(value);
|
|
195
|
+
case "object": {
|
|
196
|
+
if (value === null) {
|
|
197
|
+
return "null";
|
|
198
|
+
}
|
|
199
|
+
if (stack.indexOf(value) !== -1) {
|
|
200
|
+
return circularValue;
|
|
201
|
+
}
|
|
202
|
+
let res = "";
|
|
203
|
+
let join = ",";
|
|
204
|
+
const originalIndentation = indentation;
|
|
205
|
+
if (Array.isArray(value)) {
|
|
206
|
+
if (value.length === 0) {
|
|
207
|
+
return "[]";
|
|
208
|
+
}
|
|
209
|
+
if (maximumDepth < stack.length + 1) {
|
|
210
|
+
return '"[Array]"';
|
|
211
|
+
}
|
|
212
|
+
stack.push(value);
|
|
213
|
+
if (spacer !== "") {
|
|
214
|
+
indentation += spacer;
|
|
215
|
+
res += `
|
|
216
|
+
${indentation}`;
|
|
217
|
+
join = `,
|
|
218
|
+
${indentation}`;
|
|
219
|
+
}
|
|
220
|
+
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
221
|
+
let i = 0;
|
|
222
|
+
for (; i < maximumValuesToStringify - 1; i++) {
|
|
223
|
+
const tmp2 = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
|
|
224
|
+
res += tmp2 !== void 0 ? tmp2 : "null";
|
|
225
|
+
res += join;
|
|
226
|
+
}
|
|
227
|
+
const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
|
|
228
|
+
res += tmp !== void 0 ? tmp : "null";
|
|
229
|
+
if (value.length - 1 > maximumBreadth) {
|
|
230
|
+
const removedKeys = value.length - maximumBreadth - 1;
|
|
231
|
+
res += `${join}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
232
|
+
}
|
|
233
|
+
if (spacer !== "") {
|
|
234
|
+
res += `
|
|
235
|
+
${originalIndentation}`;
|
|
236
|
+
}
|
|
237
|
+
stack.pop();
|
|
238
|
+
return `[${res}]`;
|
|
239
|
+
}
|
|
240
|
+
let keys = Object.keys(value);
|
|
241
|
+
const keyLength = keys.length;
|
|
242
|
+
if (keyLength === 0) {
|
|
243
|
+
return "{}";
|
|
244
|
+
}
|
|
245
|
+
if (maximumDepth < stack.length + 1) {
|
|
246
|
+
return '"[Object]"';
|
|
247
|
+
}
|
|
248
|
+
let whitespace = "";
|
|
249
|
+
let separator = "";
|
|
250
|
+
if (spacer !== "") {
|
|
251
|
+
indentation += spacer;
|
|
252
|
+
join = `,
|
|
253
|
+
${indentation}`;
|
|
254
|
+
whitespace = " ";
|
|
255
|
+
}
|
|
256
|
+
const maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
|
|
257
|
+
if (deterministic && !isTypedArrayWithEntries(value)) {
|
|
258
|
+
keys = sort(keys, comparator);
|
|
259
|
+
}
|
|
260
|
+
stack.push(value);
|
|
261
|
+
for (let i = 0; i < maximumPropertiesToStringify; i++) {
|
|
262
|
+
const key2 = keys[i];
|
|
263
|
+
const tmp = stringifyFnReplacer(key2, value, stack, replacer, spacer, indentation);
|
|
264
|
+
if (tmp !== void 0) {
|
|
265
|
+
res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
|
|
266
|
+
separator = join;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
if (keyLength > maximumBreadth) {
|
|
270
|
+
const removedKeys = keyLength - maximumBreadth;
|
|
271
|
+
res += `${separator}"...":${whitespace}"${getItemCount(removedKeys)} not stringified"`;
|
|
272
|
+
separator = join;
|
|
273
|
+
}
|
|
274
|
+
if (spacer !== "" && separator.length > 1) {
|
|
275
|
+
res = `
|
|
276
|
+
${indentation}${res}
|
|
277
|
+
${originalIndentation}`;
|
|
278
|
+
}
|
|
279
|
+
stack.pop();
|
|
280
|
+
return `{${res}}`;
|
|
281
|
+
}
|
|
282
|
+
case "number":
|
|
283
|
+
return isFinite(value) ? String(value) : fail2 ? fail2(value) : "null";
|
|
284
|
+
case "boolean":
|
|
285
|
+
return value === true ? "true" : "false";
|
|
286
|
+
case "undefined":
|
|
287
|
+
return void 0;
|
|
288
|
+
case "bigint":
|
|
289
|
+
if (bigint) {
|
|
290
|
+
return String(value);
|
|
291
|
+
}
|
|
292
|
+
// fallthrough
|
|
293
|
+
default:
|
|
294
|
+
return fail2 ? fail2(value) : void 0;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
function stringifyArrayReplacer(key, value, stack, replacer, spacer, indentation) {
|
|
298
|
+
if (typeof value === "object" && value !== null && typeof value.toJSON === "function") {
|
|
299
|
+
value = value.toJSON(key);
|
|
300
|
+
}
|
|
301
|
+
switch (typeof value) {
|
|
302
|
+
case "string":
|
|
303
|
+
return strEscape(value);
|
|
304
|
+
case "object": {
|
|
305
|
+
if (value === null) {
|
|
306
|
+
return "null";
|
|
307
|
+
}
|
|
308
|
+
if (stack.indexOf(value) !== -1) {
|
|
309
|
+
return circularValue;
|
|
310
|
+
}
|
|
311
|
+
const originalIndentation = indentation;
|
|
312
|
+
let res = "";
|
|
313
|
+
let join = ",";
|
|
314
|
+
if (Array.isArray(value)) {
|
|
315
|
+
if (value.length === 0) {
|
|
316
|
+
return "[]";
|
|
317
|
+
}
|
|
318
|
+
if (maximumDepth < stack.length + 1) {
|
|
319
|
+
return '"[Array]"';
|
|
320
|
+
}
|
|
321
|
+
stack.push(value);
|
|
322
|
+
if (spacer !== "") {
|
|
323
|
+
indentation += spacer;
|
|
324
|
+
res += `
|
|
325
|
+
${indentation}`;
|
|
326
|
+
join = `,
|
|
327
|
+
${indentation}`;
|
|
328
|
+
}
|
|
329
|
+
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
330
|
+
let i = 0;
|
|
331
|
+
for (; i < maximumValuesToStringify - 1; i++) {
|
|
332
|
+
const tmp2 = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
|
|
333
|
+
res += tmp2 !== void 0 ? tmp2 : "null";
|
|
334
|
+
res += join;
|
|
335
|
+
}
|
|
336
|
+
const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
|
|
337
|
+
res += tmp !== void 0 ? tmp : "null";
|
|
338
|
+
if (value.length - 1 > maximumBreadth) {
|
|
339
|
+
const removedKeys = value.length - maximumBreadth - 1;
|
|
340
|
+
res += `${join}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
341
|
+
}
|
|
342
|
+
if (spacer !== "") {
|
|
343
|
+
res += `
|
|
344
|
+
${originalIndentation}`;
|
|
345
|
+
}
|
|
346
|
+
stack.pop();
|
|
347
|
+
return `[${res}]`;
|
|
348
|
+
}
|
|
349
|
+
stack.push(value);
|
|
350
|
+
let whitespace = "";
|
|
351
|
+
if (spacer !== "") {
|
|
352
|
+
indentation += spacer;
|
|
353
|
+
join = `,
|
|
354
|
+
${indentation}`;
|
|
355
|
+
whitespace = " ";
|
|
356
|
+
}
|
|
357
|
+
let separator = "";
|
|
358
|
+
for (const key2 of replacer) {
|
|
359
|
+
const tmp = stringifyArrayReplacer(key2, value[key2], stack, replacer, spacer, indentation);
|
|
360
|
+
if (tmp !== void 0) {
|
|
361
|
+
res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
|
|
362
|
+
separator = join;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
if (spacer !== "" && separator.length > 1) {
|
|
366
|
+
res = `
|
|
367
|
+
${indentation}${res}
|
|
368
|
+
${originalIndentation}`;
|
|
369
|
+
}
|
|
370
|
+
stack.pop();
|
|
371
|
+
return `{${res}}`;
|
|
372
|
+
}
|
|
373
|
+
case "number":
|
|
374
|
+
return isFinite(value) ? String(value) : fail2 ? fail2(value) : "null";
|
|
375
|
+
case "boolean":
|
|
376
|
+
return value === true ? "true" : "false";
|
|
377
|
+
case "undefined":
|
|
378
|
+
return void 0;
|
|
379
|
+
case "bigint":
|
|
380
|
+
if (bigint) {
|
|
381
|
+
return String(value);
|
|
382
|
+
}
|
|
383
|
+
// fallthrough
|
|
384
|
+
default:
|
|
385
|
+
return fail2 ? fail2(value) : void 0;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
function stringifyIndent(key, value, stack, spacer, indentation) {
|
|
389
|
+
switch (typeof value) {
|
|
390
|
+
case "string":
|
|
391
|
+
return strEscape(value);
|
|
392
|
+
case "object": {
|
|
393
|
+
if (value === null) {
|
|
394
|
+
return "null";
|
|
395
|
+
}
|
|
396
|
+
if (typeof value.toJSON === "function") {
|
|
397
|
+
value = value.toJSON(key);
|
|
398
|
+
if (typeof value !== "object") {
|
|
399
|
+
return stringifyIndent(key, value, stack, spacer, indentation);
|
|
400
|
+
}
|
|
401
|
+
if (value === null) {
|
|
402
|
+
return "null";
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
if (stack.indexOf(value) !== -1) {
|
|
406
|
+
return circularValue;
|
|
407
|
+
}
|
|
408
|
+
const originalIndentation = indentation;
|
|
409
|
+
if (Array.isArray(value)) {
|
|
410
|
+
if (value.length === 0) {
|
|
411
|
+
return "[]";
|
|
412
|
+
}
|
|
413
|
+
if (maximumDepth < stack.length + 1) {
|
|
414
|
+
return '"[Array]"';
|
|
415
|
+
}
|
|
416
|
+
stack.push(value);
|
|
417
|
+
indentation += spacer;
|
|
418
|
+
let res2 = `
|
|
419
|
+
${indentation}`;
|
|
420
|
+
const join2 = `,
|
|
421
|
+
${indentation}`;
|
|
422
|
+
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
423
|
+
let i = 0;
|
|
424
|
+
for (; i < maximumValuesToStringify - 1; i++) {
|
|
425
|
+
const tmp2 = stringifyIndent(String(i), value[i], stack, spacer, indentation);
|
|
426
|
+
res2 += tmp2 !== void 0 ? tmp2 : "null";
|
|
427
|
+
res2 += join2;
|
|
428
|
+
}
|
|
429
|
+
const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation);
|
|
430
|
+
res2 += tmp !== void 0 ? tmp : "null";
|
|
431
|
+
if (value.length - 1 > maximumBreadth) {
|
|
432
|
+
const removedKeys = value.length - maximumBreadth - 1;
|
|
433
|
+
res2 += `${join2}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
434
|
+
}
|
|
435
|
+
res2 += `
|
|
436
|
+
${originalIndentation}`;
|
|
437
|
+
stack.pop();
|
|
438
|
+
return `[${res2}]`;
|
|
439
|
+
}
|
|
440
|
+
let keys = Object.keys(value);
|
|
441
|
+
const keyLength = keys.length;
|
|
442
|
+
if (keyLength === 0) {
|
|
443
|
+
return "{}";
|
|
444
|
+
}
|
|
445
|
+
if (maximumDepth < stack.length + 1) {
|
|
446
|
+
return '"[Object]"';
|
|
447
|
+
}
|
|
448
|
+
indentation += spacer;
|
|
449
|
+
const join = `,
|
|
450
|
+
${indentation}`;
|
|
451
|
+
let res = "";
|
|
452
|
+
let separator = "";
|
|
453
|
+
let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
|
|
454
|
+
if (isTypedArrayWithEntries(value)) {
|
|
455
|
+
res += stringifyTypedArray(value, join, maximumBreadth);
|
|
456
|
+
keys = keys.slice(value.length);
|
|
457
|
+
maximumPropertiesToStringify -= value.length;
|
|
458
|
+
separator = join;
|
|
459
|
+
}
|
|
460
|
+
if (deterministic) {
|
|
461
|
+
keys = sort(keys, comparator);
|
|
462
|
+
}
|
|
463
|
+
stack.push(value);
|
|
464
|
+
for (let i = 0; i < maximumPropertiesToStringify; i++) {
|
|
465
|
+
const key2 = keys[i];
|
|
466
|
+
const tmp = stringifyIndent(key2, value[key2], stack, spacer, indentation);
|
|
467
|
+
if (tmp !== void 0) {
|
|
468
|
+
res += `${separator}${strEscape(key2)}: ${tmp}`;
|
|
469
|
+
separator = join;
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
if (keyLength > maximumBreadth) {
|
|
473
|
+
const removedKeys = keyLength - maximumBreadth;
|
|
474
|
+
res += `${separator}"...": "${getItemCount(removedKeys)} not stringified"`;
|
|
475
|
+
separator = join;
|
|
476
|
+
}
|
|
477
|
+
if (separator !== "") {
|
|
478
|
+
res = `
|
|
479
|
+
${indentation}${res}
|
|
480
|
+
${originalIndentation}`;
|
|
481
|
+
}
|
|
482
|
+
stack.pop();
|
|
483
|
+
return `{${res}}`;
|
|
484
|
+
}
|
|
485
|
+
case "number":
|
|
486
|
+
return isFinite(value) ? String(value) : fail2 ? fail2(value) : "null";
|
|
487
|
+
case "boolean":
|
|
488
|
+
return value === true ? "true" : "false";
|
|
489
|
+
case "undefined":
|
|
490
|
+
return void 0;
|
|
491
|
+
case "bigint":
|
|
492
|
+
if (bigint) {
|
|
493
|
+
return String(value);
|
|
494
|
+
}
|
|
495
|
+
// fallthrough
|
|
496
|
+
default:
|
|
497
|
+
return fail2 ? fail2(value) : void 0;
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
function stringifySimple(key, value, stack) {
|
|
501
|
+
switch (typeof value) {
|
|
502
|
+
case "string":
|
|
503
|
+
return strEscape(value);
|
|
504
|
+
case "object": {
|
|
505
|
+
if (value === null) {
|
|
506
|
+
return "null";
|
|
507
|
+
}
|
|
508
|
+
if (typeof value.toJSON === "function") {
|
|
509
|
+
value = value.toJSON(key);
|
|
510
|
+
if (typeof value !== "object") {
|
|
511
|
+
return stringifySimple(key, value, stack);
|
|
512
|
+
}
|
|
513
|
+
if (value === null) {
|
|
514
|
+
return "null";
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
if (stack.indexOf(value) !== -1) {
|
|
518
|
+
return circularValue;
|
|
519
|
+
}
|
|
520
|
+
let res = "";
|
|
521
|
+
const hasLength = value.length !== void 0;
|
|
522
|
+
if (hasLength && Array.isArray(value)) {
|
|
523
|
+
if (value.length === 0) {
|
|
524
|
+
return "[]";
|
|
525
|
+
}
|
|
526
|
+
if (maximumDepth < stack.length + 1) {
|
|
527
|
+
return '"[Array]"';
|
|
528
|
+
}
|
|
529
|
+
stack.push(value);
|
|
530
|
+
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
531
|
+
let i = 0;
|
|
532
|
+
for (; i < maximumValuesToStringify - 1; i++) {
|
|
533
|
+
const tmp2 = stringifySimple(String(i), value[i], stack);
|
|
534
|
+
res += tmp2 !== void 0 ? tmp2 : "null";
|
|
535
|
+
res += ",";
|
|
536
|
+
}
|
|
537
|
+
const tmp = stringifySimple(String(i), value[i], stack);
|
|
538
|
+
res += tmp !== void 0 ? tmp : "null";
|
|
539
|
+
if (value.length - 1 > maximumBreadth) {
|
|
540
|
+
const removedKeys = value.length - maximumBreadth - 1;
|
|
541
|
+
res += `,"... ${getItemCount(removedKeys)} not stringified"`;
|
|
542
|
+
}
|
|
543
|
+
stack.pop();
|
|
544
|
+
return `[${res}]`;
|
|
545
|
+
}
|
|
546
|
+
let keys = Object.keys(value);
|
|
547
|
+
const keyLength = keys.length;
|
|
548
|
+
if (keyLength === 0) {
|
|
549
|
+
return "{}";
|
|
550
|
+
}
|
|
551
|
+
if (maximumDepth < stack.length + 1) {
|
|
552
|
+
return '"[Object]"';
|
|
553
|
+
}
|
|
554
|
+
let separator = "";
|
|
555
|
+
let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
|
|
556
|
+
if (hasLength && isTypedArrayWithEntries(value)) {
|
|
557
|
+
res += stringifyTypedArray(value, ",", maximumBreadth);
|
|
558
|
+
keys = keys.slice(value.length);
|
|
559
|
+
maximumPropertiesToStringify -= value.length;
|
|
560
|
+
separator = ",";
|
|
561
|
+
}
|
|
562
|
+
if (deterministic) {
|
|
563
|
+
keys = sort(keys, comparator);
|
|
564
|
+
}
|
|
565
|
+
stack.push(value);
|
|
566
|
+
for (let i = 0; i < maximumPropertiesToStringify; i++) {
|
|
567
|
+
const key2 = keys[i];
|
|
568
|
+
const tmp = stringifySimple(key2, value[key2], stack);
|
|
569
|
+
if (tmp !== void 0) {
|
|
570
|
+
res += `${separator}${strEscape(key2)}:${tmp}`;
|
|
571
|
+
separator = ",";
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
if (keyLength > maximumBreadth) {
|
|
575
|
+
const removedKeys = keyLength - maximumBreadth;
|
|
576
|
+
res += `${separator}"...":"${getItemCount(removedKeys)} not stringified"`;
|
|
577
|
+
}
|
|
578
|
+
stack.pop();
|
|
579
|
+
return `{${res}}`;
|
|
580
|
+
}
|
|
581
|
+
case "number":
|
|
582
|
+
return isFinite(value) ? String(value) : fail2 ? fail2(value) : "null";
|
|
583
|
+
case "boolean":
|
|
584
|
+
return value === true ? "true" : "false";
|
|
585
|
+
case "undefined":
|
|
586
|
+
return void 0;
|
|
587
|
+
case "bigint":
|
|
588
|
+
if (bigint) {
|
|
589
|
+
return String(value);
|
|
590
|
+
}
|
|
591
|
+
// fallthrough
|
|
592
|
+
default:
|
|
593
|
+
return fail2 ? fail2(value) : void 0;
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
function stringify3(value, replacer, space) {
|
|
597
|
+
if (arguments.length > 1) {
|
|
598
|
+
let spacer = "";
|
|
599
|
+
if (typeof space === "number") {
|
|
600
|
+
spacer = " ".repeat(Math.min(space, 10));
|
|
601
|
+
} else if (typeof space === "string") {
|
|
602
|
+
spacer = space.slice(0, 10);
|
|
603
|
+
}
|
|
604
|
+
if (replacer != null) {
|
|
605
|
+
if (typeof replacer === "function") {
|
|
606
|
+
return stringifyFnReplacer("", { "": value }, [], replacer, spacer, "");
|
|
607
|
+
}
|
|
608
|
+
if (Array.isArray(replacer)) {
|
|
609
|
+
return stringifyArrayReplacer("", value, [], getUniqueReplacerSet(replacer), spacer, "");
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
if (spacer.length !== 0) {
|
|
613
|
+
return stringifyIndent("", value, [], spacer, "");
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
return stringifySimple("", value, []);
|
|
617
|
+
}
|
|
618
|
+
return stringify3;
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
});
|
|
622
|
+
|
|
1
623
|
// src/adapters/express.ts
|
|
2
624
|
import { json, Router } from "express";
|
|
3
625
|
|
|
@@ -310,6 +932,10 @@ var lockfileSchema = z4.object({
|
|
|
310
932
|
});
|
|
311
933
|
var lockfileCodec = defineCodec({ name: "ripplo-lockfile", schema: lockfileSchema });
|
|
312
934
|
|
|
935
|
+
// ../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/esm/wrapper.js
|
|
936
|
+
var import__ = __toESM(require_safe_stable_stringify(), 1);
|
|
937
|
+
var configure = import__.default.configure;
|
|
938
|
+
|
|
313
939
|
// ../spec/src/sync-payload.ts
|
|
314
940
|
import { z as z5 } from "zod";
|
|
315
941
|
var stepDescriptorSchema = z5.object({
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,625 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
8
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key2 of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key2) && key2 !== except)
|
|
14
|
+
__defProp(to, key2, { get: () => from[key2], enumerable: !(desc = __getOwnPropDesc(from, key2)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
19
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
20
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
21
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
22
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
23
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
24
|
+
mod
|
|
25
|
+
));
|
|
26
|
+
|
|
27
|
+
// ../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/index.js
|
|
28
|
+
var require_safe_stable_stringify = __commonJS({
|
|
29
|
+
"../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/index.js"(exports, module) {
|
|
30
|
+
"use strict";
|
|
31
|
+
var { hasOwnProperty } = Object.prototype;
|
|
32
|
+
var stringify2 = configure2();
|
|
33
|
+
stringify2.configure = configure2;
|
|
34
|
+
stringify2.stringify = stringify2;
|
|
35
|
+
stringify2.default = stringify2;
|
|
36
|
+
exports.stringify = stringify2;
|
|
37
|
+
exports.configure = configure2;
|
|
38
|
+
module.exports = stringify2;
|
|
39
|
+
var strEscapeSequencesRegExp = /[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;
|
|
40
|
+
function strEscape(str) {
|
|
41
|
+
if (str.length < 5e3 && !strEscapeSequencesRegExp.test(str)) {
|
|
42
|
+
return `"${str}"`;
|
|
43
|
+
}
|
|
44
|
+
return JSON.stringify(str);
|
|
45
|
+
}
|
|
46
|
+
function sort(array, comparator) {
|
|
47
|
+
if (array.length > 200 || comparator) {
|
|
48
|
+
return array.sort(comparator);
|
|
49
|
+
}
|
|
50
|
+
for (let i = 1; i < array.length; i++) {
|
|
51
|
+
const currentValue = array[i];
|
|
52
|
+
let position = i;
|
|
53
|
+
while (position !== 0 && array[position - 1] > currentValue) {
|
|
54
|
+
array[position] = array[position - 1];
|
|
55
|
+
position--;
|
|
56
|
+
}
|
|
57
|
+
array[position] = currentValue;
|
|
58
|
+
}
|
|
59
|
+
return array;
|
|
60
|
+
}
|
|
61
|
+
var typedArrayPrototypeGetSymbolToStringTag = Object.getOwnPropertyDescriptor(
|
|
62
|
+
Object.getPrototypeOf(
|
|
63
|
+
Object.getPrototypeOf(
|
|
64
|
+
new Int8Array()
|
|
65
|
+
)
|
|
66
|
+
),
|
|
67
|
+
Symbol.toStringTag
|
|
68
|
+
).get;
|
|
69
|
+
function isTypedArrayWithEntries(value2) {
|
|
70
|
+
return typedArrayPrototypeGetSymbolToStringTag.call(value2) !== void 0 && value2.length !== 0;
|
|
71
|
+
}
|
|
72
|
+
function stringifyTypedArray(array, separator, maximumBreadth) {
|
|
73
|
+
if (array.length < maximumBreadth) {
|
|
74
|
+
maximumBreadth = array.length;
|
|
75
|
+
}
|
|
76
|
+
const whitespace = separator === "," ? "" : " ";
|
|
77
|
+
let res = `"0":${whitespace}${array[0]}`;
|
|
78
|
+
for (let i = 1; i < maximumBreadth; i++) {
|
|
79
|
+
res += `${separator}"${i}":${whitespace}${array[i]}`;
|
|
80
|
+
}
|
|
81
|
+
return res;
|
|
82
|
+
}
|
|
83
|
+
function getCircularValueOption(options) {
|
|
84
|
+
if (hasOwnProperty.call(options, "circularValue")) {
|
|
85
|
+
const circularValue = options.circularValue;
|
|
86
|
+
if (typeof circularValue === "string") {
|
|
87
|
+
return `"${circularValue}"`;
|
|
88
|
+
}
|
|
89
|
+
if (circularValue == null) {
|
|
90
|
+
return circularValue;
|
|
91
|
+
}
|
|
92
|
+
if (circularValue === Error || circularValue === TypeError) {
|
|
93
|
+
return {
|
|
94
|
+
toString() {
|
|
95
|
+
throw new TypeError("Converting circular structure to JSON");
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined');
|
|
100
|
+
}
|
|
101
|
+
return '"[Circular]"';
|
|
102
|
+
}
|
|
103
|
+
function getDeterministicOption(options) {
|
|
104
|
+
let value2;
|
|
105
|
+
if (hasOwnProperty.call(options, "deterministic")) {
|
|
106
|
+
value2 = options.deterministic;
|
|
107
|
+
if (typeof value2 !== "boolean" && typeof value2 !== "function") {
|
|
108
|
+
throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return value2 === void 0 ? true : value2;
|
|
112
|
+
}
|
|
113
|
+
function getBooleanOption(options, key2) {
|
|
114
|
+
let value2;
|
|
115
|
+
if (hasOwnProperty.call(options, key2)) {
|
|
116
|
+
value2 = options[key2];
|
|
117
|
+
if (typeof value2 !== "boolean") {
|
|
118
|
+
throw new TypeError(`The "${key2}" argument must be of type boolean`);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return value2 === void 0 ? true : value2;
|
|
122
|
+
}
|
|
123
|
+
function getPositiveIntegerOption(options, key2) {
|
|
124
|
+
let value2;
|
|
125
|
+
if (hasOwnProperty.call(options, key2)) {
|
|
126
|
+
value2 = options[key2];
|
|
127
|
+
if (typeof value2 !== "number") {
|
|
128
|
+
throw new TypeError(`The "${key2}" argument must be of type number`);
|
|
129
|
+
}
|
|
130
|
+
if (!Number.isInteger(value2)) {
|
|
131
|
+
throw new TypeError(`The "${key2}" argument must be an integer`);
|
|
132
|
+
}
|
|
133
|
+
if (value2 < 1) {
|
|
134
|
+
throw new RangeError(`The "${key2}" argument must be >= 1`);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return value2 === void 0 ? Infinity : value2;
|
|
138
|
+
}
|
|
139
|
+
function getItemCount(number) {
|
|
140
|
+
if (number === 1) {
|
|
141
|
+
return "1 item";
|
|
142
|
+
}
|
|
143
|
+
return `${number} items`;
|
|
144
|
+
}
|
|
145
|
+
function getUniqueReplacerSet(replacerArray) {
|
|
146
|
+
const replacerSet = /* @__PURE__ */ new Set();
|
|
147
|
+
for (const value2 of replacerArray) {
|
|
148
|
+
if (typeof value2 === "string" || typeof value2 === "number") {
|
|
149
|
+
replacerSet.add(String(value2));
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return replacerSet;
|
|
153
|
+
}
|
|
154
|
+
function getStrictOption(options) {
|
|
155
|
+
if (hasOwnProperty.call(options, "strict")) {
|
|
156
|
+
const value2 = options.strict;
|
|
157
|
+
if (typeof value2 !== "boolean") {
|
|
158
|
+
throw new TypeError('The "strict" argument must be of type boolean');
|
|
159
|
+
}
|
|
160
|
+
if (value2) {
|
|
161
|
+
return (value3) => {
|
|
162
|
+
let message = `Object can not safely be stringified. Received type ${typeof value3}`;
|
|
163
|
+
if (typeof value3 !== "function") message += ` (${value3.toString()})`;
|
|
164
|
+
throw new Error(message);
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
function configure2(options) {
|
|
170
|
+
options = { ...options };
|
|
171
|
+
const fail = getStrictOption(options);
|
|
172
|
+
if (fail) {
|
|
173
|
+
if (options.bigint === void 0) {
|
|
174
|
+
options.bigint = false;
|
|
175
|
+
}
|
|
176
|
+
if (!("circularValue" in options)) {
|
|
177
|
+
options.circularValue = Error;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
const circularValue = getCircularValueOption(options);
|
|
181
|
+
const bigint = getBooleanOption(options, "bigint");
|
|
182
|
+
const deterministic = getDeterministicOption(options);
|
|
183
|
+
const comparator = typeof deterministic === "function" ? deterministic : void 0;
|
|
184
|
+
const maximumDepth = getPositiveIntegerOption(options, "maximumDepth");
|
|
185
|
+
const maximumBreadth = getPositiveIntegerOption(options, "maximumBreadth");
|
|
186
|
+
function stringifyFnReplacer(key2, parent, stack, replacer, spacer, indentation) {
|
|
187
|
+
let value2 = parent[key2];
|
|
188
|
+
if (typeof value2 === "object" && value2 !== null && typeof value2.toJSON === "function") {
|
|
189
|
+
value2 = value2.toJSON(key2);
|
|
190
|
+
}
|
|
191
|
+
value2 = replacer.call(parent, key2, value2);
|
|
192
|
+
switch (typeof value2) {
|
|
193
|
+
case "string":
|
|
194
|
+
return strEscape(value2);
|
|
195
|
+
case "object": {
|
|
196
|
+
if (value2 === null) {
|
|
197
|
+
return "null";
|
|
198
|
+
}
|
|
199
|
+
if (stack.indexOf(value2) !== -1) {
|
|
200
|
+
return circularValue;
|
|
201
|
+
}
|
|
202
|
+
let res = "";
|
|
203
|
+
let join = ",";
|
|
204
|
+
const originalIndentation = indentation;
|
|
205
|
+
if (Array.isArray(value2)) {
|
|
206
|
+
if (value2.length === 0) {
|
|
207
|
+
return "[]";
|
|
208
|
+
}
|
|
209
|
+
if (maximumDepth < stack.length + 1) {
|
|
210
|
+
return '"[Array]"';
|
|
211
|
+
}
|
|
212
|
+
stack.push(value2);
|
|
213
|
+
if (spacer !== "") {
|
|
214
|
+
indentation += spacer;
|
|
215
|
+
res += `
|
|
216
|
+
${indentation}`;
|
|
217
|
+
join = `,
|
|
218
|
+
${indentation}`;
|
|
219
|
+
}
|
|
220
|
+
const maximumValuesToStringify = Math.min(value2.length, maximumBreadth);
|
|
221
|
+
let i = 0;
|
|
222
|
+
for (; i < maximumValuesToStringify - 1; i++) {
|
|
223
|
+
const tmp2 = stringifyFnReplacer(String(i), value2, stack, replacer, spacer, indentation);
|
|
224
|
+
res += tmp2 !== void 0 ? tmp2 : "null";
|
|
225
|
+
res += join;
|
|
226
|
+
}
|
|
227
|
+
const tmp = stringifyFnReplacer(String(i), value2, stack, replacer, spacer, indentation);
|
|
228
|
+
res += tmp !== void 0 ? tmp : "null";
|
|
229
|
+
if (value2.length - 1 > maximumBreadth) {
|
|
230
|
+
const removedKeys = value2.length - maximumBreadth - 1;
|
|
231
|
+
res += `${join}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
232
|
+
}
|
|
233
|
+
if (spacer !== "") {
|
|
234
|
+
res += `
|
|
235
|
+
${originalIndentation}`;
|
|
236
|
+
}
|
|
237
|
+
stack.pop();
|
|
238
|
+
return `[${res}]`;
|
|
239
|
+
}
|
|
240
|
+
let keys = Object.keys(value2);
|
|
241
|
+
const keyLength = keys.length;
|
|
242
|
+
if (keyLength === 0) {
|
|
243
|
+
return "{}";
|
|
244
|
+
}
|
|
245
|
+
if (maximumDepth < stack.length + 1) {
|
|
246
|
+
return '"[Object]"';
|
|
247
|
+
}
|
|
248
|
+
let whitespace = "";
|
|
249
|
+
let separator = "";
|
|
250
|
+
if (spacer !== "") {
|
|
251
|
+
indentation += spacer;
|
|
252
|
+
join = `,
|
|
253
|
+
${indentation}`;
|
|
254
|
+
whitespace = " ";
|
|
255
|
+
}
|
|
256
|
+
const maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
|
|
257
|
+
if (deterministic && !isTypedArrayWithEntries(value2)) {
|
|
258
|
+
keys = sort(keys, comparator);
|
|
259
|
+
}
|
|
260
|
+
stack.push(value2);
|
|
261
|
+
for (let i = 0; i < maximumPropertiesToStringify; i++) {
|
|
262
|
+
const key3 = keys[i];
|
|
263
|
+
const tmp = stringifyFnReplacer(key3, value2, stack, replacer, spacer, indentation);
|
|
264
|
+
if (tmp !== void 0) {
|
|
265
|
+
res += `${separator}${strEscape(key3)}:${whitespace}${tmp}`;
|
|
266
|
+
separator = join;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
if (keyLength > maximumBreadth) {
|
|
270
|
+
const removedKeys = keyLength - maximumBreadth;
|
|
271
|
+
res += `${separator}"...":${whitespace}"${getItemCount(removedKeys)} not stringified"`;
|
|
272
|
+
separator = join;
|
|
273
|
+
}
|
|
274
|
+
if (spacer !== "" && separator.length > 1) {
|
|
275
|
+
res = `
|
|
276
|
+
${indentation}${res}
|
|
277
|
+
${originalIndentation}`;
|
|
278
|
+
}
|
|
279
|
+
stack.pop();
|
|
280
|
+
return `{${res}}`;
|
|
281
|
+
}
|
|
282
|
+
case "number":
|
|
283
|
+
return isFinite(value2) ? String(value2) : fail ? fail(value2) : "null";
|
|
284
|
+
case "boolean":
|
|
285
|
+
return value2 === true ? "true" : "false";
|
|
286
|
+
case "undefined":
|
|
287
|
+
return void 0;
|
|
288
|
+
case "bigint":
|
|
289
|
+
if (bigint) {
|
|
290
|
+
return String(value2);
|
|
291
|
+
}
|
|
292
|
+
// fallthrough
|
|
293
|
+
default:
|
|
294
|
+
return fail ? fail(value2) : void 0;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
function stringifyArrayReplacer(key2, value2, stack, replacer, spacer, indentation) {
|
|
298
|
+
if (typeof value2 === "object" && value2 !== null && typeof value2.toJSON === "function") {
|
|
299
|
+
value2 = value2.toJSON(key2);
|
|
300
|
+
}
|
|
301
|
+
switch (typeof value2) {
|
|
302
|
+
case "string":
|
|
303
|
+
return strEscape(value2);
|
|
304
|
+
case "object": {
|
|
305
|
+
if (value2 === null) {
|
|
306
|
+
return "null";
|
|
307
|
+
}
|
|
308
|
+
if (stack.indexOf(value2) !== -1) {
|
|
309
|
+
return circularValue;
|
|
310
|
+
}
|
|
311
|
+
const originalIndentation = indentation;
|
|
312
|
+
let res = "";
|
|
313
|
+
let join = ",";
|
|
314
|
+
if (Array.isArray(value2)) {
|
|
315
|
+
if (value2.length === 0) {
|
|
316
|
+
return "[]";
|
|
317
|
+
}
|
|
318
|
+
if (maximumDepth < stack.length + 1) {
|
|
319
|
+
return '"[Array]"';
|
|
320
|
+
}
|
|
321
|
+
stack.push(value2);
|
|
322
|
+
if (spacer !== "") {
|
|
323
|
+
indentation += spacer;
|
|
324
|
+
res += `
|
|
325
|
+
${indentation}`;
|
|
326
|
+
join = `,
|
|
327
|
+
${indentation}`;
|
|
328
|
+
}
|
|
329
|
+
const maximumValuesToStringify = Math.min(value2.length, maximumBreadth);
|
|
330
|
+
let i = 0;
|
|
331
|
+
for (; i < maximumValuesToStringify - 1; i++) {
|
|
332
|
+
const tmp2 = stringifyArrayReplacer(String(i), value2[i], stack, replacer, spacer, indentation);
|
|
333
|
+
res += tmp2 !== void 0 ? tmp2 : "null";
|
|
334
|
+
res += join;
|
|
335
|
+
}
|
|
336
|
+
const tmp = stringifyArrayReplacer(String(i), value2[i], stack, replacer, spacer, indentation);
|
|
337
|
+
res += tmp !== void 0 ? tmp : "null";
|
|
338
|
+
if (value2.length - 1 > maximumBreadth) {
|
|
339
|
+
const removedKeys = value2.length - maximumBreadth - 1;
|
|
340
|
+
res += `${join}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
341
|
+
}
|
|
342
|
+
if (spacer !== "") {
|
|
343
|
+
res += `
|
|
344
|
+
${originalIndentation}`;
|
|
345
|
+
}
|
|
346
|
+
stack.pop();
|
|
347
|
+
return `[${res}]`;
|
|
348
|
+
}
|
|
349
|
+
stack.push(value2);
|
|
350
|
+
let whitespace = "";
|
|
351
|
+
if (spacer !== "") {
|
|
352
|
+
indentation += spacer;
|
|
353
|
+
join = `,
|
|
354
|
+
${indentation}`;
|
|
355
|
+
whitespace = " ";
|
|
356
|
+
}
|
|
357
|
+
let separator = "";
|
|
358
|
+
for (const key3 of replacer) {
|
|
359
|
+
const tmp = stringifyArrayReplacer(key3, value2[key3], stack, replacer, spacer, indentation);
|
|
360
|
+
if (tmp !== void 0) {
|
|
361
|
+
res += `${separator}${strEscape(key3)}:${whitespace}${tmp}`;
|
|
362
|
+
separator = join;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
if (spacer !== "" && separator.length > 1) {
|
|
366
|
+
res = `
|
|
367
|
+
${indentation}${res}
|
|
368
|
+
${originalIndentation}`;
|
|
369
|
+
}
|
|
370
|
+
stack.pop();
|
|
371
|
+
return `{${res}}`;
|
|
372
|
+
}
|
|
373
|
+
case "number":
|
|
374
|
+
return isFinite(value2) ? String(value2) : fail ? fail(value2) : "null";
|
|
375
|
+
case "boolean":
|
|
376
|
+
return value2 === true ? "true" : "false";
|
|
377
|
+
case "undefined":
|
|
378
|
+
return void 0;
|
|
379
|
+
case "bigint":
|
|
380
|
+
if (bigint) {
|
|
381
|
+
return String(value2);
|
|
382
|
+
}
|
|
383
|
+
// fallthrough
|
|
384
|
+
default:
|
|
385
|
+
return fail ? fail(value2) : void 0;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
function stringifyIndent(key2, value2, stack, spacer, indentation) {
|
|
389
|
+
switch (typeof value2) {
|
|
390
|
+
case "string":
|
|
391
|
+
return strEscape(value2);
|
|
392
|
+
case "object": {
|
|
393
|
+
if (value2 === null) {
|
|
394
|
+
return "null";
|
|
395
|
+
}
|
|
396
|
+
if (typeof value2.toJSON === "function") {
|
|
397
|
+
value2 = value2.toJSON(key2);
|
|
398
|
+
if (typeof value2 !== "object") {
|
|
399
|
+
return stringifyIndent(key2, value2, stack, spacer, indentation);
|
|
400
|
+
}
|
|
401
|
+
if (value2 === null) {
|
|
402
|
+
return "null";
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
if (stack.indexOf(value2) !== -1) {
|
|
406
|
+
return circularValue;
|
|
407
|
+
}
|
|
408
|
+
const originalIndentation = indentation;
|
|
409
|
+
if (Array.isArray(value2)) {
|
|
410
|
+
if (value2.length === 0) {
|
|
411
|
+
return "[]";
|
|
412
|
+
}
|
|
413
|
+
if (maximumDepth < stack.length + 1) {
|
|
414
|
+
return '"[Array]"';
|
|
415
|
+
}
|
|
416
|
+
stack.push(value2);
|
|
417
|
+
indentation += spacer;
|
|
418
|
+
let res2 = `
|
|
419
|
+
${indentation}`;
|
|
420
|
+
const join2 = `,
|
|
421
|
+
${indentation}`;
|
|
422
|
+
const maximumValuesToStringify = Math.min(value2.length, maximumBreadth);
|
|
423
|
+
let i = 0;
|
|
424
|
+
for (; i < maximumValuesToStringify - 1; i++) {
|
|
425
|
+
const tmp2 = stringifyIndent(String(i), value2[i], stack, spacer, indentation);
|
|
426
|
+
res2 += tmp2 !== void 0 ? tmp2 : "null";
|
|
427
|
+
res2 += join2;
|
|
428
|
+
}
|
|
429
|
+
const tmp = stringifyIndent(String(i), value2[i], stack, spacer, indentation);
|
|
430
|
+
res2 += tmp !== void 0 ? tmp : "null";
|
|
431
|
+
if (value2.length - 1 > maximumBreadth) {
|
|
432
|
+
const removedKeys = value2.length - maximumBreadth - 1;
|
|
433
|
+
res2 += `${join2}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
434
|
+
}
|
|
435
|
+
res2 += `
|
|
436
|
+
${originalIndentation}`;
|
|
437
|
+
stack.pop();
|
|
438
|
+
return `[${res2}]`;
|
|
439
|
+
}
|
|
440
|
+
let keys = Object.keys(value2);
|
|
441
|
+
const keyLength = keys.length;
|
|
442
|
+
if (keyLength === 0) {
|
|
443
|
+
return "{}";
|
|
444
|
+
}
|
|
445
|
+
if (maximumDepth < stack.length + 1) {
|
|
446
|
+
return '"[Object]"';
|
|
447
|
+
}
|
|
448
|
+
indentation += spacer;
|
|
449
|
+
const join = `,
|
|
450
|
+
${indentation}`;
|
|
451
|
+
let res = "";
|
|
452
|
+
let separator = "";
|
|
453
|
+
let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
|
|
454
|
+
if (isTypedArrayWithEntries(value2)) {
|
|
455
|
+
res += stringifyTypedArray(value2, join, maximumBreadth);
|
|
456
|
+
keys = keys.slice(value2.length);
|
|
457
|
+
maximumPropertiesToStringify -= value2.length;
|
|
458
|
+
separator = join;
|
|
459
|
+
}
|
|
460
|
+
if (deterministic) {
|
|
461
|
+
keys = sort(keys, comparator);
|
|
462
|
+
}
|
|
463
|
+
stack.push(value2);
|
|
464
|
+
for (let i = 0; i < maximumPropertiesToStringify; i++) {
|
|
465
|
+
const key3 = keys[i];
|
|
466
|
+
const tmp = stringifyIndent(key3, value2[key3], stack, spacer, indentation);
|
|
467
|
+
if (tmp !== void 0) {
|
|
468
|
+
res += `${separator}${strEscape(key3)}: ${tmp}`;
|
|
469
|
+
separator = join;
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
if (keyLength > maximumBreadth) {
|
|
473
|
+
const removedKeys = keyLength - maximumBreadth;
|
|
474
|
+
res += `${separator}"...": "${getItemCount(removedKeys)} not stringified"`;
|
|
475
|
+
separator = join;
|
|
476
|
+
}
|
|
477
|
+
if (separator !== "") {
|
|
478
|
+
res = `
|
|
479
|
+
${indentation}${res}
|
|
480
|
+
${originalIndentation}`;
|
|
481
|
+
}
|
|
482
|
+
stack.pop();
|
|
483
|
+
return `{${res}}`;
|
|
484
|
+
}
|
|
485
|
+
case "number":
|
|
486
|
+
return isFinite(value2) ? String(value2) : fail ? fail(value2) : "null";
|
|
487
|
+
case "boolean":
|
|
488
|
+
return value2 === true ? "true" : "false";
|
|
489
|
+
case "undefined":
|
|
490
|
+
return void 0;
|
|
491
|
+
case "bigint":
|
|
492
|
+
if (bigint) {
|
|
493
|
+
return String(value2);
|
|
494
|
+
}
|
|
495
|
+
// fallthrough
|
|
496
|
+
default:
|
|
497
|
+
return fail ? fail(value2) : void 0;
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
function stringifySimple(key2, value2, stack) {
|
|
501
|
+
switch (typeof value2) {
|
|
502
|
+
case "string":
|
|
503
|
+
return strEscape(value2);
|
|
504
|
+
case "object": {
|
|
505
|
+
if (value2 === null) {
|
|
506
|
+
return "null";
|
|
507
|
+
}
|
|
508
|
+
if (typeof value2.toJSON === "function") {
|
|
509
|
+
value2 = value2.toJSON(key2);
|
|
510
|
+
if (typeof value2 !== "object") {
|
|
511
|
+
return stringifySimple(key2, value2, stack);
|
|
512
|
+
}
|
|
513
|
+
if (value2 === null) {
|
|
514
|
+
return "null";
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
if (stack.indexOf(value2) !== -1) {
|
|
518
|
+
return circularValue;
|
|
519
|
+
}
|
|
520
|
+
let res = "";
|
|
521
|
+
const hasLength = value2.length !== void 0;
|
|
522
|
+
if (hasLength && Array.isArray(value2)) {
|
|
523
|
+
if (value2.length === 0) {
|
|
524
|
+
return "[]";
|
|
525
|
+
}
|
|
526
|
+
if (maximumDepth < stack.length + 1) {
|
|
527
|
+
return '"[Array]"';
|
|
528
|
+
}
|
|
529
|
+
stack.push(value2);
|
|
530
|
+
const maximumValuesToStringify = Math.min(value2.length, maximumBreadth);
|
|
531
|
+
let i = 0;
|
|
532
|
+
for (; i < maximumValuesToStringify - 1; i++) {
|
|
533
|
+
const tmp2 = stringifySimple(String(i), value2[i], stack);
|
|
534
|
+
res += tmp2 !== void 0 ? tmp2 : "null";
|
|
535
|
+
res += ",";
|
|
536
|
+
}
|
|
537
|
+
const tmp = stringifySimple(String(i), value2[i], stack);
|
|
538
|
+
res += tmp !== void 0 ? tmp : "null";
|
|
539
|
+
if (value2.length - 1 > maximumBreadth) {
|
|
540
|
+
const removedKeys = value2.length - maximumBreadth - 1;
|
|
541
|
+
res += `,"... ${getItemCount(removedKeys)} not stringified"`;
|
|
542
|
+
}
|
|
543
|
+
stack.pop();
|
|
544
|
+
return `[${res}]`;
|
|
545
|
+
}
|
|
546
|
+
let keys = Object.keys(value2);
|
|
547
|
+
const keyLength = keys.length;
|
|
548
|
+
if (keyLength === 0) {
|
|
549
|
+
return "{}";
|
|
550
|
+
}
|
|
551
|
+
if (maximumDepth < stack.length + 1) {
|
|
552
|
+
return '"[Object]"';
|
|
553
|
+
}
|
|
554
|
+
let separator = "";
|
|
555
|
+
let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
|
|
556
|
+
if (hasLength && isTypedArrayWithEntries(value2)) {
|
|
557
|
+
res += stringifyTypedArray(value2, ",", maximumBreadth);
|
|
558
|
+
keys = keys.slice(value2.length);
|
|
559
|
+
maximumPropertiesToStringify -= value2.length;
|
|
560
|
+
separator = ",";
|
|
561
|
+
}
|
|
562
|
+
if (deterministic) {
|
|
563
|
+
keys = sort(keys, comparator);
|
|
564
|
+
}
|
|
565
|
+
stack.push(value2);
|
|
566
|
+
for (let i = 0; i < maximumPropertiesToStringify; i++) {
|
|
567
|
+
const key3 = keys[i];
|
|
568
|
+
const tmp = stringifySimple(key3, value2[key3], stack);
|
|
569
|
+
if (tmp !== void 0) {
|
|
570
|
+
res += `${separator}${strEscape(key3)}:${tmp}`;
|
|
571
|
+
separator = ",";
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
if (keyLength > maximumBreadth) {
|
|
575
|
+
const removedKeys = keyLength - maximumBreadth;
|
|
576
|
+
res += `${separator}"...":"${getItemCount(removedKeys)} not stringified"`;
|
|
577
|
+
}
|
|
578
|
+
stack.pop();
|
|
579
|
+
return `{${res}}`;
|
|
580
|
+
}
|
|
581
|
+
case "number":
|
|
582
|
+
return isFinite(value2) ? String(value2) : fail ? fail(value2) : "null";
|
|
583
|
+
case "boolean":
|
|
584
|
+
return value2 === true ? "true" : "false";
|
|
585
|
+
case "undefined":
|
|
586
|
+
return void 0;
|
|
587
|
+
case "bigint":
|
|
588
|
+
if (bigint) {
|
|
589
|
+
return String(value2);
|
|
590
|
+
}
|
|
591
|
+
// fallthrough
|
|
592
|
+
default:
|
|
593
|
+
return fail ? fail(value2) : void 0;
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
function stringify3(value2, replacer, space) {
|
|
597
|
+
if (arguments.length > 1) {
|
|
598
|
+
let spacer = "";
|
|
599
|
+
if (typeof space === "number") {
|
|
600
|
+
spacer = " ".repeat(Math.min(space, 10));
|
|
601
|
+
} else if (typeof space === "string") {
|
|
602
|
+
spacer = space.slice(0, 10);
|
|
603
|
+
}
|
|
604
|
+
if (replacer != null) {
|
|
605
|
+
if (typeof replacer === "function") {
|
|
606
|
+
return stringifyFnReplacer("", { "": value2 }, [], replacer, spacer, "");
|
|
607
|
+
}
|
|
608
|
+
if (Array.isArray(replacer)) {
|
|
609
|
+
return stringifyArrayReplacer("", value2, [], getUniqueReplacerSet(replacer), spacer, "");
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
if (spacer.length !== 0) {
|
|
613
|
+
return stringifyIndent("", value2, [], spacer, "");
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
return stringifySimple("", value2, []);
|
|
617
|
+
}
|
|
618
|
+
return stringify3;
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
});
|
|
622
|
+
|
|
1
623
|
// src/bindings.ts
|
|
2
624
|
function fieldBinding(descriptor, field2) {
|
|
3
625
|
return { __bind: { descriptor, field: field2, kind: "field" }, ref: "" };
|
|
@@ -1629,6 +2251,10 @@ var lockfileSchema = z4.object({
|
|
|
1629
2251
|
});
|
|
1630
2252
|
var lockfileCodec = defineCodec({ name: "ripplo-lockfile", schema: lockfileSchema });
|
|
1631
2253
|
|
|
2254
|
+
// ../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/esm/wrapper.js
|
|
2255
|
+
var import__ = __toESM(require_safe_stable_stringify(), 1);
|
|
2256
|
+
var configure = import__.default.configure;
|
|
2257
|
+
|
|
1632
2258
|
// ../spec/src/sync-payload.ts
|
|
1633
2259
|
import { z as z5 } from "zod";
|
|
1634
2260
|
var stepDescriptorSchema = z5.object({
|
package/package.json
CHANGED