document-model 2.7.1 → 2.8.0
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/browser/cjs/document-model.js +2 -2
- package/dist/browser/cjs/document.js +2 -2
- package/dist/browser/cjs/index.js +2 -2
- package/dist/{node/cjs/internal/index-B2y863wl.js → browser/cjs/internal/index-C1zE8gB2.js} +2 -2
- package/dist/browser/cjs/internal/index-C1zE8gB2.js.map +1 -0
- package/dist/browser/cjs/internal/{index-DoC1l5xM.js → index-lPRldkww.js} +2 -2
- package/dist/browser/cjs/internal/{index-DoC1l5xM.js.map → index-lPRldkww.js.map} +1 -1
- package/dist/browser/cjs/internal/{object-Brd1syhl.js → object-Cwxm4B8F.js} +511 -501
- package/dist/browser/cjs/internal/{object-Brd1syhl.js.map → object-Cwxm4B8F.js.map} +1 -1
- package/dist/browser/es/document-model.js +2 -2
- package/dist/browser/es/document.js +2 -2
- package/dist/browser/es/index.js +2 -2
- package/dist/browser/es/internal/{index-CBRub8R0.js → index-D7g8OoD_.js} +2 -2
- package/dist/browser/es/internal/{index-CBRub8R0.js.map → index-D7g8OoD_.js.map} +1 -1
- package/dist/browser/es/internal/{index-7l2m9dPm.js → index-DB3PHVmg.js} +2 -2
- package/dist/browser/es/internal/index-DB3PHVmg.js.map +1 -0
- package/dist/browser/es/internal/{object-CsjSWEK1.js → object-ivG479sP.js} +511 -501
- package/dist/browser/es/internal/{object-CsjSWEK1.js.map → object-ivG479sP.js.map} +1 -1
- package/dist/browser/src/document/utils/crypto.d.ts +1 -1
- package/dist/browser/src/document/utils/node.d.ts +2 -2
- package/dist/browser/src/document-model/gen/schema/zod.d.ts +42 -42
- package/dist/node/cjs/document-model.js +2 -2
- package/dist/node/cjs/document.js +2 -2
- package/dist/node/cjs/index.js +2 -2
- package/dist/node/cjs/internal/{index-Ch1ayz7D.js → index-5zAjb9ey.js} +2 -2
- package/dist/node/cjs/internal/{index-Ch1ayz7D.js.map → index-5zAjb9ey.js.map} +1 -1
- package/dist/{browser/cjs/internal/index-m-qdCuuQ.js → node/cjs/internal/index-Dsv6Zoey.js} +2 -2
- package/dist/node/cjs/internal/index-Dsv6Zoey.js.map +1 -0
- package/dist/node/cjs/internal/{object-CJevfZM5.js → object-DgmfygmD.js} +508 -498
- package/dist/node/cjs/internal/{object-CJevfZM5.js.map → object-DgmfygmD.js.map} +1 -1
- package/dist/node/es/document-model.js +2 -2
- package/dist/node/es/document.js +2 -2
- package/dist/node/es/index.js +2 -2
- package/dist/node/es/internal/{index-Bv8zfoJ5.js → index-CA0xV5XL.js} +2 -2
- package/dist/node/es/internal/index-CA0xV5XL.js.map +1 -0
- package/dist/node/es/internal/{index-B2-BdbFk.js → index-CmgkUOei.js} +2 -2
- package/dist/node/es/internal/{index-B2-BdbFk.js.map → index-CmgkUOei.js.map} +1 -1
- package/dist/node/es/internal/{object-zdIAWN5c.js → object-890lc6IO.js} +508 -498
- package/dist/node/es/internal/{object-zdIAWN5c.js.map → object-890lc6IO.js.map} +1 -1
- package/dist/node/src/document/utils/crypto.d.ts +1 -1
- package/dist/node/src/document/utils/node.d.ts +2 -2
- package/dist/node/src/document-model/gen/schema/zod.d.ts +42 -42
- package/package.json +9 -9
- package/dist/browser/cjs/internal/index-m-qdCuuQ.js.map +0 -1
- package/dist/browser/es/internal/index-7l2m9dPm.js.map +0 -1
- package/dist/node/cjs/internal/index-B2y863wl.js.map +0 -1
- package/dist/node/es/internal/index-Bv8zfoJ5.js.map +0 -1
|
@@ -149,594 +149,604 @@ function getDefaultExportFromCjs(x) {
|
|
|
149
149
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
150
150
|
}
|
|
151
151
|
var safeStableStringify = { exports: {} };
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
return
|
|
152
|
+
var hasRequiredSafeStableStringify;
|
|
153
|
+
function requireSafeStableStringify() {
|
|
154
|
+
if (hasRequiredSafeStableStringify) return safeStableStringify.exports;
|
|
155
|
+
hasRequiredSafeStableStringify = 1;
|
|
156
|
+
(function(module2, exports2) {
|
|
157
|
+
const { hasOwnProperty } = Object.prototype;
|
|
158
|
+
const stringify = configure();
|
|
159
|
+
stringify.configure = configure;
|
|
160
|
+
stringify.stringify = stringify;
|
|
161
|
+
stringify.default = stringify;
|
|
162
|
+
exports2.stringify = stringify;
|
|
163
|
+
exports2.configure = configure;
|
|
164
|
+
module2.exports = stringify;
|
|
165
|
+
const strEscapeSequencesRegExp = /[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;
|
|
166
|
+
function strEscape(str) {
|
|
167
|
+
if (str.length < 5e3 && !strEscapeSequencesRegExp.test(str)) {
|
|
168
|
+
return `"${str}"`;
|
|
169
|
+
}
|
|
170
|
+
return JSON.stringify(str);
|
|
171
171
|
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
172
|
+
function sort(array, comparator) {
|
|
173
|
+
if (array.length > 200 || comparator) {
|
|
174
|
+
return array.sort(comparator);
|
|
175
|
+
}
|
|
176
|
+
for (let i = 1; i < array.length; i++) {
|
|
177
|
+
const currentValue = array[i];
|
|
178
|
+
let position = i;
|
|
179
|
+
while (position !== 0 && array[position - 1] > currentValue) {
|
|
180
|
+
array[position] = array[position - 1];
|
|
181
|
+
position--;
|
|
182
|
+
}
|
|
183
|
+
array[position] = currentValue;
|
|
178
184
|
}
|
|
179
|
-
array
|
|
185
|
+
return array;
|
|
180
186
|
}
|
|
181
|
-
|
|
182
|
-
}
|
|
183
|
-
const typedArrayPrototypeGetSymbolToStringTag = Object.getOwnPropertyDescriptor(
|
|
184
|
-
Object.getPrototypeOf(
|
|
187
|
+
const typedArrayPrototypeGetSymbolToStringTag = Object.getOwnPropertyDescriptor(
|
|
185
188
|
Object.getPrototypeOf(
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
function stringifyTypedArray(array, separator, maximumBreadth) {
|
|
195
|
-
if (array.length < maximumBreadth) {
|
|
196
|
-
maximumBreadth = array.length;
|
|
197
|
-
}
|
|
198
|
-
const whitespace = separator === "," ? "" : " ";
|
|
199
|
-
let res = `"0":${whitespace}${array[0]}`;
|
|
200
|
-
for (let i = 1; i < maximumBreadth; i++) {
|
|
201
|
-
res += `${separator}"${i}":${whitespace}${array[i]}`;
|
|
189
|
+
Object.getPrototypeOf(
|
|
190
|
+
new Int8Array()
|
|
191
|
+
)
|
|
192
|
+
),
|
|
193
|
+
Symbol.toStringTag
|
|
194
|
+
).get;
|
|
195
|
+
function isTypedArrayWithEntries(value) {
|
|
196
|
+
return typedArrayPrototypeGetSymbolToStringTag.call(value) !== void 0 && value.length !== 0;
|
|
202
197
|
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
if (hasOwnProperty.call(options, "circularValue")) {
|
|
207
|
-
const circularValue = options.circularValue;
|
|
208
|
-
if (typeof circularValue === "string") {
|
|
209
|
-
return `"${circularValue}"`;
|
|
198
|
+
function stringifyTypedArray(array, separator, maximumBreadth) {
|
|
199
|
+
if (array.length < maximumBreadth) {
|
|
200
|
+
maximumBreadth = array.length;
|
|
210
201
|
}
|
|
211
|
-
|
|
212
|
-
|
|
202
|
+
const whitespace = separator === "," ? "" : " ";
|
|
203
|
+
let res = `"0":${whitespace}${array[0]}`;
|
|
204
|
+
for (let i = 1; i < maximumBreadth; i++) {
|
|
205
|
+
res += `${separator}"${i}":${whitespace}${array[i]}`;
|
|
213
206
|
}
|
|
214
|
-
|
|
215
|
-
return {
|
|
216
|
-
toString() {
|
|
217
|
-
throw new TypeError("Converting circular structure to JSON");
|
|
218
|
-
}
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined');
|
|
207
|
+
return res;
|
|
222
208
|
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
209
|
+
function getCircularValueOption(options) {
|
|
210
|
+
if (hasOwnProperty.call(options, "circularValue")) {
|
|
211
|
+
const circularValue = options.circularValue;
|
|
212
|
+
if (typeof circularValue === "string") {
|
|
213
|
+
return `"${circularValue}"`;
|
|
214
|
+
}
|
|
215
|
+
if (circularValue == null) {
|
|
216
|
+
return circularValue;
|
|
217
|
+
}
|
|
218
|
+
if (circularValue === Error || circularValue === TypeError) {
|
|
219
|
+
return {
|
|
220
|
+
toString() {
|
|
221
|
+
throw new TypeError("Converting circular structure to JSON");
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined');
|
|
231
226
|
}
|
|
227
|
+
return '"[Circular]"';
|
|
232
228
|
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
throw new TypeError(`The "${key}" argument must be of type boolean`);
|
|
229
|
+
function getDeterministicOption(options) {
|
|
230
|
+
let value;
|
|
231
|
+
if (hasOwnProperty.call(options, "deterministic")) {
|
|
232
|
+
value = options.deterministic;
|
|
233
|
+
if (typeof value !== "boolean" && typeof value !== "function") {
|
|
234
|
+
throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');
|
|
235
|
+
}
|
|
241
236
|
}
|
|
237
|
+
return value === void 0 ? true : value;
|
|
242
238
|
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
throw new TypeError(`The "${key}" argument must be of type number`);
|
|
251
|
-
}
|
|
252
|
-
if (!Number.isInteger(value)) {
|
|
253
|
-
throw new TypeError(`The "${key}" argument must be an integer`);
|
|
254
|
-
}
|
|
255
|
-
if (value < 1) {
|
|
256
|
-
throw new RangeError(`The "${key}" argument must be >= 1`);
|
|
239
|
+
function getBooleanOption(options, key) {
|
|
240
|
+
let value;
|
|
241
|
+
if (hasOwnProperty.call(options, key)) {
|
|
242
|
+
value = options[key];
|
|
243
|
+
if (typeof value !== "boolean") {
|
|
244
|
+
throw new TypeError(`The "${key}" argument must be of type boolean`);
|
|
245
|
+
}
|
|
257
246
|
}
|
|
247
|
+
return value === void 0 ? true : value;
|
|
258
248
|
}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
249
|
+
function getPositiveIntegerOption(options, key) {
|
|
250
|
+
let value;
|
|
251
|
+
if (hasOwnProperty.call(options, key)) {
|
|
252
|
+
value = options[key];
|
|
253
|
+
if (typeof value !== "number") {
|
|
254
|
+
throw new TypeError(`The "${key}" argument must be of type number`);
|
|
255
|
+
}
|
|
256
|
+
if (!Number.isInteger(value)) {
|
|
257
|
+
throw new TypeError(`The "${key}" argument must be an integer`);
|
|
258
|
+
}
|
|
259
|
+
if (value < 1) {
|
|
260
|
+
throw new RangeError(`The "${key}" argument must be >= 1`);
|
|
261
|
+
}
|
|
272
262
|
}
|
|
263
|
+
return value === void 0 ? Infinity : value;
|
|
273
264
|
}
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
if (hasOwnProperty.call(options, "strict")) {
|
|
278
|
-
const value = options.strict;
|
|
279
|
-
if (typeof value !== "boolean") {
|
|
280
|
-
throw new TypeError('The "strict" argument must be of type boolean');
|
|
281
|
-
}
|
|
282
|
-
if (value) {
|
|
283
|
-
return (value2) => {
|
|
284
|
-
let message = `Object can not safely be stringified. Received type ${typeof value2}`;
|
|
285
|
-
if (typeof value2 !== "function") message += ` (${value2.toString()})`;
|
|
286
|
-
throw new Error(message);
|
|
287
|
-
};
|
|
265
|
+
function getItemCount(number) {
|
|
266
|
+
if (number === 1) {
|
|
267
|
+
return "1 item";
|
|
288
268
|
}
|
|
269
|
+
return `${number} items`;
|
|
289
270
|
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
options.bigint = false;
|
|
271
|
+
function getUniqueReplacerSet(replacerArray) {
|
|
272
|
+
const replacerSet = /* @__PURE__ */ new Set();
|
|
273
|
+
for (const value of replacerArray) {
|
|
274
|
+
if (typeof value === "string" || typeof value === "number") {
|
|
275
|
+
replacerSet.add(String(value));
|
|
276
|
+
}
|
|
297
277
|
}
|
|
298
|
-
|
|
299
|
-
|
|
278
|
+
return replacerSet;
|
|
279
|
+
}
|
|
280
|
+
function getStrictOption(options) {
|
|
281
|
+
if (hasOwnProperty.call(options, "strict")) {
|
|
282
|
+
const value = options.strict;
|
|
283
|
+
if (typeof value !== "boolean") {
|
|
284
|
+
throw new TypeError('The "strict" argument must be of type boolean');
|
|
285
|
+
}
|
|
286
|
+
if (value) {
|
|
287
|
+
return (value2) => {
|
|
288
|
+
let message = `Object can not safely be stringified. Received type ${typeof value2}`;
|
|
289
|
+
if (typeof value2 !== "function") message += ` (${value2.toString()})`;
|
|
290
|
+
throw new Error(message);
|
|
291
|
+
};
|
|
292
|
+
}
|
|
300
293
|
}
|
|
301
294
|
}
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
295
|
+
function configure(options) {
|
|
296
|
+
options = { ...options };
|
|
297
|
+
const fail = getStrictOption(options);
|
|
298
|
+
if (fail) {
|
|
299
|
+
if (options.bigint === void 0) {
|
|
300
|
+
options.bigint = false;
|
|
301
|
+
}
|
|
302
|
+
if (!("circularValue" in options)) {
|
|
303
|
+
options.circularValue = Error;
|
|
304
|
+
}
|
|
312
305
|
}
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
306
|
+
const circularValue = getCircularValueOption(options);
|
|
307
|
+
const bigint = getBooleanOption(options, "bigint");
|
|
308
|
+
const deterministic = getDeterministicOption(options);
|
|
309
|
+
const comparator = typeof deterministic === "function" ? deterministic : void 0;
|
|
310
|
+
const maximumDepth = getPositiveIntegerOption(options, "maximumDepth");
|
|
311
|
+
const maximumBreadth = getPositiveIntegerOption(options, "maximumBreadth");
|
|
312
|
+
function stringifyFnReplacer(key, parent, stack, replacer, spacer, indentation) {
|
|
313
|
+
let value = parent[key];
|
|
314
|
+
if (typeof value === "object" && value !== null && typeof value.toJSON === "function") {
|
|
315
|
+
value = value.toJSON(key);
|
|
316
|
+
}
|
|
317
|
+
value = replacer.call(parent, key, value);
|
|
318
|
+
switch (typeof value) {
|
|
319
|
+
case "string":
|
|
320
|
+
return strEscape(value);
|
|
321
|
+
case "object": {
|
|
322
|
+
if (value === null) {
|
|
323
|
+
return "null";
|
|
324
|
+
}
|
|
325
|
+
if (stack.indexOf(value) !== -1) {
|
|
326
|
+
return circularValue;
|
|
327
|
+
}
|
|
328
|
+
let res = "";
|
|
329
|
+
let join = ",";
|
|
330
|
+
const originalIndentation = indentation;
|
|
331
|
+
if (Array.isArray(value)) {
|
|
332
|
+
if (value.length === 0) {
|
|
333
|
+
return "[]";
|
|
334
|
+
}
|
|
335
|
+
if (maximumDepth < stack.length + 1) {
|
|
336
|
+
return '"[Array]"';
|
|
337
|
+
}
|
|
338
|
+
stack.push(value);
|
|
339
|
+
if (spacer !== "") {
|
|
340
|
+
indentation += spacer;
|
|
341
|
+
res += `
|
|
342
|
+
${indentation}`;
|
|
343
|
+
join = `,
|
|
344
|
+
${indentation}`;
|
|
345
|
+
}
|
|
346
|
+
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
347
|
+
let i = 0;
|
|
348
|
+
for (; i < maximumValuesToStringify - 1; i++) {
|
|
349
|
+
const tmp2 = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
|
|
350
|
+
res += tmp2 !== void 0 ? tmp2 : "null";
|
|
351
|
+
res += join;
|
|
352
|
+
}
|
|
353
|
+
const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
|
|
354
|
+
res += tmp !== void 0 ? tmp : "null";
|
|
355
|
+
if (value.length - 1 > maximumBreadth) {
|
|
356
|
+
const removedKeys = value.length - maximumBreadth - 1;
|
|
357
|
+
res += `${join}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
358
|
+
}
|
|
359
|
+
if (spacer !== "") {
|
|
360
|
+
res += `
|
|
361
|
+
${originalIndentation}`;
|
|
362
|
+
}
|
|
363
|
+
stack.pop();
|
|
364
|
+
return `[${res}]`;
|
|
365
|
+
}
|
|
366
|
+
let keys = Object.keys(value);
|
|
367
|
+
const keyLength = keys.length;
|
|
368
|
+
if (keyLength === 0) {
|
|
369
|
+
return "{}";
|
|
330
370
|
}
|
|
331
371
|
if (maximumDepth < stack.length + 1) {
|
|
332
|
-
return '"[
|
|
372
|
+
return '"[Object]"';
|
|
333
373
|
}
|
|
334
|
-
|
|
374
|
+
let whitespace = "";
|
|
375
|
+
let separator = "";
|
|
335
376
|
if (spacer !== "") {
|
|
336
377
|
indentation += spacer;
|
|
337
|
-
res += `
|
|
338
|
-
${indentation}`;
|
|
339
378
|
join = `,
|
|
340
379
|
${indentation}`;
|
|
380
|
+
whitespace = " ";
|
|
341
381
|
}
|
|
342
|
-
const
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
const tmp2 = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
|
|
346
|
-
res += tmp2 !== void 0 ? tmp2 : "null";
|
|
347
|
-
res += join;
|
|
348
|
-
}
|
|
349
|
-
const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
|
|
350
|
-
res += tmp !== void 0 ? tmp : "null";
|
|
351
|
-
if (value.length - 1 > maximumBreadth) {
|
|
352
|
-
const removedKeys = value.length - maximumBreadth - 1;
|
|
353
|
-
res += `${join}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
382
|
+
const maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
|
|
383
|
+
if (deterministic && !isTypedArrayWithEntries(value)) {
|
|
384
|
+
keys = sort(keys, comparator);
|
|
354
385
|
}
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
386
|
+
stack.push(value);
|
|
387
|
+
for (let i = 0; i < maximumPropertiesToStringify; i++) {
|
|
388
|
+
const key2 = keys[i];
|
|
389
|
+
const tmp = stringifyFnReplacer(key2, value, stack, replacer, spacer, indentation);
|
|
390
|
+
if (tmp !== void 0) {
|
|
391
|
+
res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
|
|
392
|
+
separator = join;
|
|
393
|
+
}
|
|
358
394
|
}
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
let keys = Object.keys(value);
|
|
363
|
-
const keyLength = keys.length;
|
|
364
|
-
if (keyLength === 0) {
|
|
365
|
-
return "{}";
|
|
366
|
-
}
|
|
367
|
-
if (maximumDepth < stack.length + 1) {
|
|
368
|
-
return '"[Object]"';
|
|
369
|
-
}
|
|
370
|
-
let whitespace = "";
|
|
371
|
-
let separator = "";
|
|
372
|
-
if (spacer !== "") {
|
|
373
|
-
indentation += spacer;
|
|
374
|
-
join = `,
|
|
375
|
-
${indentation}`;
|
|
376
|
-
whitespace = " ";
|
|
377
|
-
}
|
|
378
|
-
const maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
|
|
379
|
-
if (deterministic && !isTypedArrayWithEntries(value)) {
|
|
380
|
-
keys = sort(keys, comparator);
|
|
381
|
-
}
|
|
382
|
-
stack.push(value);
|
|
383
|
-
for (let i = 0; i < maximumPropertiesToStringify; i++) {
|
|
384
|
-
const key2 = keys[i];
|
|
385
|
-
const tmp = stringifyFnReplacer(key2, value, stack, replacer, spacer, indentation);
|
|
386
|
-
if (tmp !== void 0) {
|
|
387
|
-
res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
|
|
395
|
+
if (keyLength > maximumBreadth) {
|
|
396
|
+
const removedKeys = keyLength - maximumBreadth;
|
|
397
|
+
res += `${separator}"...":${whitespace}"${getItemCount(removedKeys)} not stringified"`;
|
|
388
398
|
separator = join;
|
|
389
399
|
}
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
const removedKeys = keyLength - maximumBreadth;
|
|
393
|
-
res += `${separator}"...":${whitespace}"${getItemCount(removedKeys)} not stringified"`;
|
|
394
|
-
separator = join;
|
|
395
|
-
}
|
|
396
|
-
if (spacer !== "" && separator.length > 1) {
|
|
397
|
-
res = `
|
|
400
|
+
if (spacer !== "" && separator.length > 1) {
|
|
401
|
+
res = `
|
|
398
402
|
${indentation}${res}
|
|
399
403
|
${originalIndentation}`;
|
|
404
|
+
}
|
|
405
|
+
stack.pop();
|
|
406
|
+
return `{${res}}`;
|
|
400
407
|
}
|
|
401
|
-
|
|
402
|
-
|
|
408
|
+
case "number":
|
|
409
|
+
return isFinite(value) ? String(value) : fail ? fail(value) : "null";
|
|
410
|
+
case "boolean":
|
|
411
|
+
return value === true ? "true" : "false";
|
|
412
|
+
case "undefined":
|
|
413
|
+
return void 0;
|
|
414
|
+
case "bigint":
|
|
415
|
+
if (bigint) {
|
|
416
|
+
return String(value);
|
|
417
|
+
}
|
|
418
|
+
// fallthrough
|
|
419
|
+
default:
|
|
420
|
+
return fail ? fail(value) : void 0;
|
|
403
421
|
}
|
|
404
|
-
case "number":
|
|
405
|
-
return isFinite(value) ? String(value) : fail ? fail(value) : "null";
|
|
406
|
-
case "boolean":
|
|
407
|
-
return value === true ? "true" : "false";
|
|
408
|
-
case "undefined":
|
|
409
|
-
return void 0;
|
|
410
|
-
case "bigint":
|
|
411
|
-
if (bigint) {
|
|
412
|
-
return String(value);
|
|
413
|
-
}
|
|
414
|
-
default:
|
|
415
|
-
return fail ? fail(value) : void 0;
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
function stringifyArrayReplacer(key, value, stack, replacer, spacer, indentation) {
|
|
419
|
-
if (typeof value === "object" && value !== null && typeof value.toJSON === "function") {
|
|
420
|
-
value = value.toJSON(key);
|
|
421
422
|
}
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
const originalIndentation = indentation;
|
|
433
|
-
let res = "";
|
|
434
|
-
let join = ",";
|
|
435
|
-
if (Array.isArray(value)) {
|
|
436
|
-
if (value.length === 0) {
|
|
437
|
-
return "[]";
|
|
423
|
+
function stringifyArrayReplacer(key, value, stack, replacer, spacer, indentation) {
|
|
424
|
+
if (typeof value === "object" && value !== null && typeof value.toJSON === "function") {
|
|
425
|
+
value = value.toJSON(key);
|
|
426
|
+
}
|
|
427
|
+
switch (typeof value) {
|
|
428
|
+
case "string":
|
|
429
|
+
return strEscape(value);
|
|
430
|
+
case "object": {
|
|
431
|
+
if (value === null) {
|
|
432
|
+
return "null";
|
|
438
433
|
}
|
|
439
|
-
if (
|
|
440
|
-
return
|
|
434
|
+
if (stack.indexOf(value) !== -1) {
|
|
435
|
+
return circularValue;
|
|
436
|
+
}
|
|
437
|
+
const originalIndentation = indentation;
|
|
438
|
+
let res = "";
|
|
439
|
+
let join = ",";
|
|
440
|
+
if (Array.isArray(value)) {
|
|
441
|
+
if (value.length === 0) {
|
|
442
|
+
return "[]";
|
|
443
|
+
}
|
|
444
|
+
if (maximumDepth < stack.length + 1) {
|
|
445
|
+
return '"[Array]"';
|
|
446
|
+
}
|
|
447
|
+
stack.push(value);
|
|
448
|
+
if (spacer !== "") {
|
|
449
|
+
indentation += spacer;
|
|
450
|
+
res += `
|
|
451
|
+
${indentation}`;
|
|
452
|
+
join = `,
|
|
453
|
+
${indentation}`;
|
|
454
|
+
}
|
|
455
|
+
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
456
|
+
let i = 0;
|
|
457
|
+
for (; i < maximumValuesToStringify - 1; i++) {
|
|
458
|
+
const tmp2 = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
|
|
459
|
+
res += tmp2 !== void 0 ? tmp2 : "null";
|
|
460
|
+
res += join;
|
|
461
|
+
}
|
|
462
|
+
const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
|
|
463
|
+
res += tmp !== void 0 ? tmp : "null";
|
|
464
|
+
if (value.length - 1 > maximumBreadth) {
|
|
465
|
+
const removedKeys = value.length - maximumBreadth - 1;
|
|
466
|
+
res += `${join}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
467
|
+
}
|
|
468
|
+
if (spacer !== "") {
|
|
469
|
+
res += `
|
|
470
|
+
${originalIndentation}`;
|
|
471
|
+
}
|
|
472
|
+
stack.pop();
|
|
473
|
+
return `[${res}]`;
|
|
441
474
|
}
|
|
442
475
|
stack.push(value);
|
|
476
|
+
let whitespace = "";
|
|
443
477
|
if (spacer !== "") {
|
|
444
478
|
indentation += spacer;
|
|
445
|
-
res += `
|
|
446
|
-
${indentation}`;
|
|
447
479
|
join = `,
|
|
448
480
|
${indentation}`;
|
|
481
|
+
whitespace = " ";
|
|
449
482
|
}
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
483
|
+
let separator = "";
|
|
484
|
+
for (const key2 of replacer) {
|
|
485
|
+
const tmp = stringifyArrayReplacer(key2, value[key2], stack, replacer, spacer, indentation);
|
|
486
|
+
if (tmp !== void 0) {
|
|
487
|
+
res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
|
|
488
|
+
separator = join;
|
|
489
|
+
}
|
|
456
490
|
}
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
const removedKeys = value.length - maximumBreadth - 1;
|
|
461
|
-
res += `${join}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
462
|
-
}
|
|
463
|
-
if (spacer !== "") {
|
|
464
|
-
res += `
|
|
491
|
+
if (spacer !== "" && separator.length > 1) {
|
|
492
|
+
res = `
|
|
493
|
+
${indentation}${res}
|
|
465
494
|
${originalIndentation}`;
|
|
466
495
|
}
|
|
467
496
|
stack.pop();
|
|
468
|
-
return `
|
|
497
|
+
return `{${res}}`;
|
|
469
498
|
}
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
for (const key2 of replacer) {
|
|
480
|
-
const tmp = stringifyArrayReplacer(key2, value[key2], stack, replacer, spacer, indentation);
|
|
481
|
-
if (tmp !== void 0) {
|
|
482
|
-
res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
|
|
483
|
-
separator = join;
|
|
499
|
+
case "number":
|
|
500
|
+
return isFinite(value) ? String(value) : fail ? fail(value) : "null";
|
|
501
|
+
case "boolean":
|
|
502
|
+
return value === true ? "true" : "false";
|
|
503
|
+
case "undefined":
|
|
504
|
+
return void 0;
|
|
505
|
+
case "bigint":
|
|
506
|
+
if (bigint) {
|
|
507
|
+
return String(value);
|
|
484
508
|
}
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
${indentation}${res}
|
|
489
|
-
${originalIndentation}`;
|
|
490
|
-
}
|
|
491
|
-
stack.pop();
|
|
492
|
-
return `{${res}}`;
|
|
509
|
+
// fallthrough
|
|
510
|
+
default:
|
|
511
|
+
return fail ? fail(value) : void 0;
|
|
493
512
|
}
|
|
494
|
-
case "number":
|
|
495
|
-
return isFinite(value) ? String(value) : fail ? fail(value) : "null";
|
|
496
|
-
case "boolean":
|
|
497
|
-
return value === true ? "true" : "false";
|
|
498
|
-
case "undefined":
|
|
499
|
-
return void 0;
|
|
500
|
-
case "bigint":
|
|
501
|
-
if (bigint) {
|
|
502
|
-
return String(value);
|
|
503
|
-
}
|
|
504
|
-
default:
|
|
505
|
-
return fail ? fail(value) : void 0;
|
|
506
513
|
}
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
case "object": {
|
|
513
|
-
if (value === null) {
|
|
514
|
-
return "null";
|
|
515
|
-
}
|
|
516
|
-
if (typeof value.toJSON === "function") {
|
|
517
|
-
value = value.toJSON(key);
|
|
518
|
-
if (typeof value !== "object") {
|
|
519
|
-
return stringifyIndent(key, value, stack, spacer, indentation);
|
|
520
|
-
}
|
|
514
|
+
function stringifyIndent(key, value, stack, spacer, indentation) {
|
|
515
|
+
switch (typeof value) {
|
|
516
|
+
case "string":
|
|
517
|
+
return strEscape(value);
|
|
518
|
+
case "object": {
|
|
521
519
|
if (value === null) {
|
|
522
520
|
return "null";
|
|
523
521
|
}
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
522
|
+
if (typeof value.toJSON === "function") {
|
|
523
|
+
value = value.toJSON(key);
|
|
524
|
+
if (typeof value !== "object") {
|
|
525
|
+
return stringifyIndent(key, value, stack, spacer, indentation);
|
|
526
|
+
}
|
|
527
|
+
if (value === null) {
|
|
528
|
+
return "null";
|
|
529
|
+
}
|
|
532
530
|
}
|
|
533
|
-
if (
|
|
534
|
-
return
|
|
531
|
+
if (stack.indexOf(value) !== -1) {
|
|
532
|
+
return circularValue;
|
|
535
533
|
}
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
534
|
+
const originalIndentation = indentation;
|
|
535
|
+
if (Array.isArray(value)) {
|
|
536
|
+
if (value.length === 0) {
|
|
537
|
+
return "[]";
|
|
538
|
+
}
|
|
539
|
+
if (maximumDepth < stack.length + 1) {
|
|
540
|
+
return '"[Array]"';
|
|
541
|
+
}
|
|
542
|
+
stack.push(value);
|
|
543
|
+
indentation += spacer;
|
|
544
|
+
let res2 = `
|
|
539
545
|
${indentation}`;
|
|
540
|
-
|
|
546
|
+
const join2 = `,
|
|
541
547
|
${indentation}`;
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
+
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
549
|
+
let i = 0;
|
|
550
|
+
for (; i < maximumValuesToStringify - 1; i++) {
|
|
551
|
+
const tmp2 = stringifyIndent(String(i), value[i], stack, spacer, indentation);
|
|
552
|
+
res2 += tmp2 !== void 0 ? tmp2 : "null";
|
|
553
|
+
res2 += join2;
|
|
554
|
+
}
|
|
555
|
+
const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation);
|
|
556
|
+
res2 += tmp !== void 0 ? tmp : "null";
|
|
557
|
+
if (value.length - 1 > maximumBreadth) {
|
|
558
|
+
const removedKeys = value.length - maximumBreadth - 1;
|
|
559
|
+
res2 += `${join2}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
560
|
+
}
|
|
561
|
+
res2 += `
|
|
562
|
+
${originalIndentation}`;
|
|
563
|
+
stack.pop();
|
|
564
|
+
return `[${res2}]`;
|
|
548
565
|
}
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
if (
|
|
552
|
-
|
|
553
|
-
res2 += `${join2}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
566
|
+
let keys = Object.keys(value);
|
|
567
|
+
const keyLength = keys.length;
|
|
568
|
+
if (keyLength === 0) {
|
|
569
|
+
return "{}";
|
|
554
570
|
}
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
let keys = Object.keys(value);
|
|
561
|
-
const keyLength = keys.length;
|
|
562
|
-
if (keyLength === 0) {
|
|
563
|
-
return "{}";
|
|
564
|
-
}
|
|
565
|
-
if (maximumDepth < stack.length + 1) {
|
|
566
|
-
return '"[Object]"';
|
|
567
|
-
}
|
|
568
|
-
indentation += spacer;
|
|
569
|
-
const join = `,
|
|
571
|
+
if (maximumDepth < stack.length + 1) {
|
|
572
|
+
return '"[Object]"';
|
|
573
|
+
}
|
|
574
|
+
indentation += spacer;
|
|
575
|
+
const join = `,
|
|
570
576
|
${indentation}`;
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
separator = join;
|
|
579
|
-
}
|
|
580
|
-
if (deterministic) {
|
|
581
|
-
keys = sort(keys, comparator);
|
|
582
|
-
}
|
|
583
|
-
stack.push(value);
|
|
584
|
-
for (let i = 0; i < maximumPropertiesToStringify; i++) {
|
|
585
|
-
const key2 = keys[i];
|
|
586
|
-
const tmp = stringifyIndent(key2, value[key2], stack, spacer, indentation);
|
|
587
|
-
if (tmp !== void 0) {
|
|
588
|
-
res += `${separator}${strEscape(key2)}: ${tmp}`;
|
|
577
|
+
let res = "";
|
|
578
|
+
let separator = "";
|
|
579
|
+
let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
|
|
580
|
+
if (isTypedArrayWithEntries(value)) {
|
|
581
|
+
res += stringifyTypedArray(value, join, maximumBreadth);
|
|
582
|
+
keys = keys.slice(value.length);
|
|
583
|
+
maximumPropertiesToStringify -= value.length;
|
|
589
584
|
separator = join;
|
|
590
585
|
}
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
586
|
+
if (deterministic) {
|
|
587
|
+
keys = sort(keys, comparator);
|
|
588
|
+
}
|
|
589
|
+
stack.push(value);
|
|
590
|
+
for (let i = 0; i < maximumPropertiesToStringify; i++) {
|
|
591
|
+
const key2 = keys[i];
|
|
592
|
+
const tmp = stringifyIndent(key2, value[key2], stack, spacer, indentation);
|
|
593
|
+
if (tmp !== void 0) {
|
|
594
|
+
res += `${separator}${strEscape(key2)}: ${tmp}`;
|
|
595
|
+
separator = join;
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
if (keyLength > maximumBreadth) {
|
|
599
|
+
const removedKeys = keyLength - maximumBreadth;
|
|
600
|
+
res += `${separator}"...": "${getItemCount(removedKeys)} not stringified"`;
|
|
601
|
+
separator = join;
|
|
602
|
+
}
|
|
603
|
+
if (separator !== "") {
|
|
604
|
+
res = `
|
|
599
605
|
${indentation}${res}
|
|
600
606
|
${originalIndentation}`;
|
|
607
|
+
}
|
|
608
|
+
stack.pop();
|
|
609
|
+
return `{${res}}`;
|
|
601
610
|
}
|
|
602
|
-
|
|
603
|
-
|
|
611
|
+
case "number":
|
|
612
|
+
return isFinite(value) ? String(value) : fail ? fail(value) : "null";
|
|
613
|
+
case "boolean":
|
|
614
|
+
return value === true ? "true" : "false";
|
|
615
|
+
case "undefined":
|
|
616
|
+
return void 0;
|
|
617
|
+
case "bigint":
|
|
618
|
+
if (bigint) {
|
|
619
|
+
return String(value);
|
|
620
|
+
}
|
|
621
|
+
// fallthrough
|
|
622
|
+
default:
|
|
623
|
+
return fail ? fail(value) : void 0;
|
|
604
624
|
}
|
|
605
|
-
case "number":
|
|
606
|
-
return isFinite(value) ? String(value) : fail ? fail(value) : "null";
|
|
607
|
-
case "boolean":
|
|
608
|
-
return value === true ? "true" : "false";
|
|
609
|
-
case "undefined":
|
|
610
|
-
return void 0;
|
|
611
|
-
case "bigint":
|
|
612
|
-
if (bigint) {
|
|
613
|
-
return String(value);
|
|
614
|
-
}
|
|
615
|
-
default:
|
|
616
|
-
return fail ? fail(value) : void 0;
|
|
617
625
|
}
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
case "object": {
|
|
624
|
-
if (value === null) {
|
|
625
|
-
return "null";
|
|
626
|
-
}
|
|
627
|
-
if (typeof value.toJSON === "function") {
|
|
628
|
-
value = value.toJSON(key);
|
|
629
|
-
if (typeof value !== "object") {
|
|
630
|
-
return stringifySimple(key, value, stack);
|
|
631
|
-
}
|
|
626
|
+
function stringifySimple(key, value, stack) {
|
|
627
|
+
switch (typeof value) {
|
|
628
|
+
case "string":
|
|
629
|
+
return strEscape(value);
|
|
630
|
+
case "object": {
|
|
632
631
|
if (value === null) {
|
|
633
632
|
return "null";
|
|
634
633
|
}
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
634
|
+
if (typeof value.toJSON === "function") {
|
|
635
|
+
value = value.toJSON(key);
|
|
636
|
+
if (typeof value !== "object") {
|
|
637
|
+
return stringifySimple(key, value, stack);
|
|
638
|
+
}
|
|
639
|
+
if (value === null) {
|
|
640
|
+
return "null";
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
if (stack.indexOf(value) !== -1) {
|
|
644
|
+
return circularValue;
|
|
645
|
+
}
|
|
646
|
+
let res = "";
|
|
647
|
+
const hasLength = value.length !== void 0;
|
|
648
|
+
if (hasLength && Array.isArray(value)) {
|
|
649
|
+
if (value.length === 0) {
|
|
650
|
+
return "[]";
|
|
651
|
+
}
|
|
652
|
+
if (maximumDepth < stack.length + 1) {
|
|
653
|
+
return '"[Array]"';
|
|
654
|
+
}
|
|
655
|
+
stack.push(value);
|
|
656
|
+
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
657
|
+
let i = 0;
|
|
658
|
+
for (; i < maximumValuesToStringify - 1; i++) {
|
|
659
|
+
const tmp2 = stringifySimple(String(i), value[i], stack);
|
|
660
|
+
res += tmp2 !== void 0 ? tmp2 : "null";
|
|
661
|
+
res += ",";
|
|
662
|
+
}
|
|
663
|
+
const tmp = stringifySimple(String(i), value[i], stack);
|
|
664
|
+
res += tmp !== void 0 ? tmp : "null";
|
|
665
|
+
if (value.length - 1 > maximumBreadth) {
|
|
666
|
+
const removedKeys = value.length - maximumBreadth - 1;
|
|
667
|
+
res += `,"... ${getItemCount(removedKeys)} not stringified"`;
|
|
668
|
+
}
|
|
669
|
+
stack.pop();
|
|
670
|
+
return `[${res}]`;
|
|
671
|
+
}
|
|
672
|
+
let keys = Object.keys(value);
|
|
673
|
+
const keyLength = keys.length;
|
|
674
|
+
if (keyLength === 0) {
|
|
675
|
+
return "{}";
|
|
644
676
|
}
|
|
645
677
|
if (maximumDepth < stack.length + 1) {
|
|
646
|
-
return '"[
|
|
678
|
+
return '"[Object]"';
|
|
679
|
+
}
|
|
680
|
+
let separator = "";
|
|
681
|
+
let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
|
|
682
|
+
if (hasLength && isTypedArrayWithEntries(value)) {
|
|
683
|
+
res += stringifyTypedArray(value, ",", maximumBreadth);
|
|
684
|
+
keys = keys.slice(value.length);
|
|
685
|
+
maximumPropertiesToStringify -= value.length;
|
|
686
|
+
separator = ",";
|
|
687
|
+
}
|
|
688
|
+
if (deterministic) {
|
|
689
|
+
keys = sort(keys, comparator);
|
|
647
690
|
}
|
|
648
691
|
stack.push(value);
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
692
|
+
for (let i = 0; i < maximumPropertiesToStringify; i++) {
|
|
693
|
+
const key2 = keys[i];
|
|
694
|
+
const tmp = stringifySimple(key2, value[key2], stack);
|
|
695
|
+
if (tmp !== void 0) {
|
|
696
|
+
res += `${separator}${strEscape(key2)}:${tmp}`;
|
|
697
|
+
separator = ",";
|
|
698
|
+
}
|
|
655
699
|
}
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
const removedKeys = value.length - maximumBreadth - 1;
|
|
660
|
-
res += `,"... ${getItemCount(removedKeys)} not stringified"`;
|
|
700
|
+
if (keyLength > maximumBreadth) {
|
|
701
|
+
const removedKeys = keyLength - maximumBreadth;
|
|
702
|
+
res += `${separator}"...":"${getItemCount(removedKeys)} not stringified"`;
|
|
661
703
|
}
|
|
662
704
|
stack.pop();
|
|
663
|
-
return `
|
|
664
|
-
}
|
|
665
|
-
let keys = Object.keys(value);
|
|
666
|
-
const keyLength = keys.length;
|
|
667
|
-
if (keyLength === 0) {
|
|
668
|
-
return "{}";
|
|
669
|
-
}
|
|
670
|
-
if (maximumDepth < stack.length + 1) {
|
|
671
|
-
return '"[Object]"';
|
|
672
|
-
}
|
|
673
|
-
let separator = "";
|
|
674
|
-
let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
|
|
675
|
-
if (hasLength && isTypedArrayWithEntries(value)) {
|
|
676
|
-
res += stringifyTypedArray(value, ",", maximumBreadth);
|
|
677
|
-
keys = keys.slice(value.length);
|
|
678
|
-
maximumPropertiesToStringify -= value.length;
|
|
679
|
-
separator = ",";
|
|
705
|
+
return `{${res}}`;
|
|
680
706
|
}
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
if (
|
|
689
|
-
|
|
690
|
-
separator = ",";
|
|
707
|
+
case "number":
|
|
708
|
+
return isFinite(value) ? String(value) : fail ? fail(value) : "null";
|
|
709
|
+
case "boolean":
|
|
710
|
+
return value === true ? "true" : "false";
|
|
711
|
+
case "undefined":
|
|
712
|
+
return void 0;
|
|
713
|
+
case "bigint":
|
|
714
|
+
if (bigint) {
|
|
715
|
+
return String(value);
|
|
691
716
|
}
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
res += `${separator}"...":"${getItemCount(removedKeys)} not stringified"`;
|
|
696
|
-
}
|
|
697
|
-
stack.pop();
|
|
698
|
-
return `{${res}}`;
|
|
717
|
+
// fallthrough
|
|
718
|
+
default:
|
|
719
|
+
return fail ? fail(value) : void 0;
|
|
699
720
|
}
|
|
700
|
-
case "number":
|
|
701
|
-
return isFinite(value) ? String(value) : fail ? fail(value) : "null";
|
|
702
|
-
case "boolean":
|
|
703
|
-
return value === true ? "true" : "false";
|
|
704
|
-
case "undefined":
|
|
705
|
-
return void 0;
|
|
706
|
-
case "bigint":
|
|
707
|
-
if (bigint) {
|
|
708
|
-
return String(value);
|
|
709
|
-
}
|
|
710
|
-
default:
|
|
711
|
-
return fail ? fail(value) : void 0;
|
|
712
721
|
}
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
spacer = space.slice(0, 10);
|
|
721
|
-
}
|
|
722
|
-
if (replacer != null) {
|
|
723
|
-
if (typeof replacer === "function") {
|
|
724
|
-
return stringifyFnReplacer("", { "": value }, [], replacer, spacer, "");
|
|
722
|
+
function stringify2(value, replacer, space) {
|
|
723
|
+
if (arguments.length > 1) {
|
|
724
|
+
let spacer = "";
|
|
725
|
+
if (typeof space === "number") {
|
|
726
|
+
spacer = " ".repeat(Math.min(space, 10));
|
|
727
|
+
} else if (typeof space === "string") {
|
|
728
|
+
spacer = space.slice(0, 10);
|
|
725
729
|
}
|
|
726
|
-
if (
|
|
727
|
-
|
|
730
|
+
if (replacer != null) {
|
|
731
|
+
if (typeof replacer === "function") {
|
|
732
|
+
return stringifyFnReplacer("", { "": value }, [], replacer, spacer, "");
|
|
733
|
+
}
|
|
734
|
+
if (Array.isArray(replacer)) {
|
|
735
|
+
return stringifyArrayReplacer("", value, [], getUniqueReplacerSet(replacer), spacer, "");
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
if (spacer.length !== 0) {
|
|
739
|
+
return stringifyIndent("", value, [], spacer, "");
|
|
728
740
|
}
|
|
729
741
|
}
|
|
730
|
-
|
|
731
|
-
return stringifyIndent("", value, [], spacer, "");
|
|
732
|
-
}
|
|
742
|
+
return stringifySimple("", value, []);
|
|
733
743
|
}
|
|
734
|
-
return
|
|
744
|
+
return stringify2;
|
|
735
745
|
}
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
}
|
|
739
|
-
var safeStableStringifyExports =
|
|
746
|
+
})(safeStableStringify, safeStableStringify.exports);
|
|
747
|
+
return safeStableStringify.exports;
|
|
748
|
+
}
|
|
749
|
+
var safeStableStringifyExports = requireSafeStableStringify();
|
|
740
750
|
const cjsModule = /* @__PURE__ */ getDefaultExportFromCjs(safeStableStringifyExports);
|
|
741
751
|
cjsModule.configure;
|
|
742
752
|
let getRandomValues;
|
|
@@ -2480,4 +2490,4 @@ exports.updateHeader = updateHeader;
|
|
|
2480
2490
|
exports.validateOperations = validateOperations;
|
|
2481
2491
|
exports.verifyOperationSignature = verifyOperationSignature;
|
|
2482
2492
|
exports.zod = zod;
|
|
2483
|
-
//# sourceMappingURL=object-
|
|
2493
|
+
//# sourceMappingURL=object-DgmfygmD.js.map
|