@aopslabs/aops-server 0.2.7 → 0.2.9
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/LICENSE +54 -14
- package/NOTICE +3 -3
- package/THIRD_PARTY_NOTICES +411 -80
- package/THIRD_PARTY_NOTICES.inventory.json +114 -89
- package/build/client/_app/immutable/chunks/{BnoJcvzp.js → BYPZX9Wo.js} +1 -1
- package/build/client/_app/immutable/entry/{app.KzHGg5wP.js → app.A3JdvVfL.js} +2 -2
- package/build/client/_app/immutable/entry/start.CiIm7sOm.js +1 -0
- package/build/client/_app/immutable/nodes/{1.BLvxZIDx.js → 1.DjNWgxeg.js} +1 -1
- package/build/client/_app/version.json +1 -1
- package/build/handler.js +3 -3
- package/build/index.js +3 -3
- package/build/server/chunks/{1-ZL9pGcjT.js → 1-BJzlk8ku.js} +2 -2
- package/build/server/chunks/{_server.ts-BiZ-vBWT.js → _server.ts-BdY2JsaQ.js} +1 -1
- package/build/server/chunks/{_server.ts-y2EbSSo4.js → _server.ts-BiaO5iJe.js} +1 -1
- package/build/server/chunks/{_server.ts-CRF4Jqut.js → _server.ts-BjeSh_9L.js} +1 -1
- package/build/server/chunks/{_server.ts-CneqbG24.js → _server.ts-BlqHo41R.js} +1 -1
- package/build/server/chunks/{_server.ts-DXsBB8F4.js → _server.ts-Bnc8VoZt.js} +1 -1
- package/build/server/chunks/{_server.ts-DE1gUBuD.js → _server.ts-Boj-nSfz.js} +1 -1
- package/build/server/chunks/{_server.ts-DDYrNP1a.js → _server.ts-CEZb0qQM.js} +1 -1
- package/build/server/chunks/{_server.ts-CclHSo1a.js → _server.ts-D9NPnh7b.js} +1 -1
- package/build/server/chunks/{_server.ts-Ck6kw5WN.js → _server.ts-DDE7Qj9s.js} +1 -1
- package/build/server/chunks/{_server.ts-G5KZG37S.js → _server.ts-DLm7WPPZ.js} +1 -1
- package/build/server/chunks/{_server.ts-DHwYncca.js → _server.ts-DSvQTrqh.js} +1 -1
- package/build/server/chunks/{_server.ts-BUBWNB6n.js → _server.ts-DWGAAi-W.js} +1 -1
- package/build/server/chunks/{_server.ts-Bz5YaA26.js → _server.ts-DX-_KeHW.js} +1 -1
- package/build/server/chunks/{_server.ts-Cmh_K3Gz.js → _server.ts-Daul6O6T.js} +1 -1
- package/build/server/chunks/{_server.ts-DoqzEEZJ.js → _server.ts-NZjOV9Ec.js} +1 -1
- package/build/server/chunks/{_server.ts-2T66veqc.js → _server.ts-QAR2kInF.js} +1 -1
- package/build/server/chunks/{_server.ts-BR79Rls5.js → _server.ts-iQyRIpt-.js} +1 -1
- package/build/server/chunks/{_server.ts-qwOnDe2O.js → _server.ts-s5Rfq1_a.js} +1 -1
- package/build/server/chunks/{error.svelte-CvGgWsFZ.js → error.svelte-C3C2fP5p.js} +1 -1
- package/build/server/chunks/{handler-rWhRFHmo.js → handler-BohKk247.js} +2 -2
- package/build/server/chunks/{hooks.server-7hLyaH14.js → hooks.server-QpuxZ7sx.js} +1 -1
- package/build/server/chunks/{index.js-Lbn6Vjdj.js → index.js-B0n9KWWU.js} +227 -118
- package/build/server/chunks/{manifest.js-BBHQTRPT.js → manifest.js-CfVEzEmC.js} +20 -20
- package/cockpit/.vite/manifest.json +1 -1
- package/cockpit/assets/{index-DvE4aCzF.js → index-Bw71Beie.js} +1 -1
- package/cockpit/community.module-inventory.json +170 -170
- package/cockpit/index.html +1 -1
- package/npm-shrinkwrap.json +255 -192
- package/package.json +14 -14
- package/runtime-closure.package.json +62 -63
- package/build/client/_app/immutable/entry/start.ldCqYhYq.js +0 -1
|
@@ -227,14 +227,17 @@ function is_valid_array_index_string(s) {
|
|
|
227
227
|
}
|
|
228
228
|
return is_valid_array_index(+s);
|
|
229
229
|
}
|
|
230
|
-
function
|
|
231
|
-
const keys = Object.keys(array);
|
|
230
|
+
function array_index_cut(keys) {
|
|
232
231
|
for (var i = keys.length - 1; i >= 0; i--) {
|
|
233
232
|
if (is_valid_array_index_string(keys[i])) {
|
|
234
233
|
break;
|
|
235
234
|
}
|
|
236
235
|
}
|
|
237
|
-
|
|
236
|
+
return i + 1;
|
|
237
|
+
}
|
|
238
|
+
function valid_array_indices(array) {
|
|
239
|
+
const keys = Object.keys(array);
|
|
240
|
+
keys.length = array_index_cut(keys);
|
|
238
241
|
return keys;
|
|
239
242
|
}
|
|
240
243
|
const chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$";
|
|
@@ -285,6 +288,7 @@ function uneval(value, replacer) {
|
|
|
285
288
|
case "Map":
|
|
286
289
|
for (const [key, value2] of thing) {
|
|
287
290
|
keys.push(`.get(${is_primitive(key) ? stringify_primitive$1(key) : "..."})`);
|
|
291
|
+
walk(key);
|
|
288
292
|
walk(value2);
|
|
289
293
|
keys.pop();
|
|
290
294
|
}
|
|
@@ -392,7 +396,6 @@ function uneval(value, replacer) {
|
|
|
392
396
|
return `Object.assign(Array(${thing.length}),{${entries}})`;
|
|
393
397
|
}
|
|
394
398
|
has_holes = true;
|
|
395
|
-
i -= 1;
|
|
396
399
|
}
|
|
397
400
|
}
|
|
398
401
|
const tail = thing.length === 0 || thing.length - 1 in thing ? "" : ",";
|
|
@@ -415,8 +418,7 @@ function uneval(value, replacer) {
|
|
|
415
418
|
case "BigUint64Array": {
|
|
416
419
|
let str2 = `new ${type}`;
|
|
417
420
|
if (!names.has(thing.buffer)) {
|
|
418
|
-
|
|
419
|
-
str2 += `([${array}])`;
|
|
421
|
+
str2 += `([${stringify_typed_array_elements(new thing.constructor(thing.buffer))}])`;
|
|
420
422
|
} else {
|
|
421
423
|
str2 += `(${stringify(thing.buffer)})`;
|
|
422
424
|
}
|
|
@@ -435,7 +437,7 @@ function uneval(value, replacer) {
|
|
|
435
437
|
str2 += `(${stringify(thing.buffer)}`;
|
|
436
438
|
}
|
|
437
439
|
if (thing.byteLength !== thing.buffer.byteLength) {
|
|
438
|
-
str2 += `,${thing.
|
|
440
|
+
str2 += `,${thing.byteOffset},${thing.byteLength}`;
|
|
439
441
|
}
|
|
440
442
|
return str2 + ")";
|
|
441
443
|
}
|
|
@@ -467,6 +469,7 @@ function uneval(value, replacer) {
|
|
|
467
469
|
const params = [];
|
|
468
470
|
const statements = [];
|
|
469
471
|
const values = [];
|
|
472
|
+
const reconstructions = [];
|
|
470
473
|
names.forEach((name, thing) => {
|
|
471
474
|
params.push(name);
|
|
472
475
|
if (custom.has(thing)) {
|
|
@@ -508,18 +511,20 @@ function uneval(value, replacer) {
|
|
|
508
511
|
statements.push(`${name}[${i}]=${stringify(v)}`);
|
|
509
512
|
});
|
|
510
513
|
break;
|
|
511
|
-
case "Set":
|
|
514
|
+
case "Set": {
|
|
512
515
|
values.push(`new Set`);
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
);
|
|
516
|
+
const adds = Array.from(thing).map((v) => `.add(${stringify(v)})`);
|
|
517
|
+
if (adds.length > 0) statements.push(name + adds.join(""));
|
|
516
518
|
break;
|
|
517
|
-
|
|
519
|
+
}
|
|
520
|
+
case "Map": {
|
|
518
521
|
values.push(`new Map`);
|
|
519
|
-
|
|
520
|
-
|
|
522
|
+
const sets = Array.from(thing).map(
|
|
523
|
+
([k, v]) => `.set(${stringify(k)}, ${stringify(v)})`
|
|
521
524
|
);
|
|
525
|
+
if (sets.length > 0) statements.push(name + sets.join(""));
|
|
522
526
|
break;
|
|
527
|
+
}
|
|
523
528
|
case "Int8Array":
|
|
524
529
|
case "Uint8Array":
|
|
525
530
|
case "Uint8ClampedArray":
|
|
@@ -534,8 +539,7 @@ function uneval(value, replacer) {
|
|
|
534
539
|
case "BigUint64Array": {
|
|
535
540
|
let str2 = `new ${type}`;
|
|
536
541
|
if (!names.has(thing.buffer)) {
|
|
537
|
-
|
|
538
|
-
str2 += `([${array}])`;
|
|
542
|
+
str2 += `([${stringify_typed_array_elements(new thing.constructor(thing.buffer))}])`;
|
|
539
543
|
} else {
|
|
540
544
|
str2 += `(${stringify(thing.buffer)})`;
|
|
541
545
|
}
|
|
@@ -545,7 +549,7 @@ function uneval(value, replacer) {
|
|
|
545
549
|
str2 += `.subarray(${start},${end})`;
|
|
546
550
|
}
|
|
547
551
|
values.push(`{}`);
|
|
548
|
-
|
|
552
|
+
reconstructions.push(`${name}=${str2}`);
|
|
549
553
|
break;
|
|
550
554
|
}
|
|
551
555
|
case "DataView": {
|
|
@@ -560,12 +564,22 @@ function uneval(value, replacer) {
|
|
|
560
564
|
}
|
|
561
565
|
str2 += ")";
|
|
562
566
|
values.push(`{}`);
|
|
563
|
-
|
|
567
|
+
reconstructions.push(`${name}=${str2}`);
|
|
564
568
|
break;
|
|
565
569
|
}
|
|
566
570
|
case "ArrayBuffer":
|
|
567
571
|
values.push(`new Uint8Array([${new Uint8Array(thing)}]).buffer`);
|
|
568
572
|
break;
|
|
573
|
+
case "Temporal.Duration":
|
|
574
|
+
case "Temporal.Instant":
|
|
575
|
+
case "Temporal.PlainDate":
|
|
576
|
+
case "Temporal.PlainTime":
|
|
577
|
+
case "Temporal.PlainDateTime":
|
|
578
|
+
case "Temporal.PlainMonthDay":
|
|
579
|
+
case "Temporal.PlainYearMonth":
|
|
580
|
+
case "Temporal.ZonedDateTime":
|
|
581
|
+
values.push(`${type}.from(${stringify_string(thing.toString())})`);
|
|
582
|
+
break;
|
|
569
583
|
default:
|
|
570
584
|
values.push(Object.getPrototypeOf(thing) === null ? "Object.create(null)" : "{}");
|
|
571
585
|
Object.keys(thing).forEach((key) => {
|
|
@@ -574,11 +588,18 @@ function uneval(value, replacer) {
|
|
|
574
588
|
}
|
|
575
589
|
});
|
|
576
590
|
statements.push(`return ${str}`);
|
|
577
|
-
|
|
591
|
+
const body = [...reconstructions, ...statements].join(";");
|
|
592
|
+
return `(function(${params.join(",")}){${body}}(${values.join(",")}))`;
|
|
578
593
|
} else {
|
|
579
594
|
return str;
|
|
580
595
|
}
|
|
581
596
|
}
|
|
597
|
+
function stringify_typed_array_elements(array) {
|
|
598
|
+
if (array instanceof BigInt64Array || array instanceof BigUint64Array) {
|
|
599
|
+
return Array.from(array, (element) => `${element}n`).join(",");
|
|
600
|
+
}
|
|
601
|
+
return array.toString();
|
|
602
|
+
}
|
|
582
603
|
function get_name(num) {
|
|
583
604
|
let name = "";
|
|
584
605
|
do {
|
|
@@ -829,10 +850,92 @@ const native = typeof Uint8Array.fromBase64 === "function";
|
|
|
829
850
|
const buffer = typeof process === "object" && process.versions?.node !== void 0;
|
|
830
851
|
const encode64 = native ? encode_native : buffer ? encode_buffer : encode_legacy;
|
|
831
852
|
const decode64 = native ? decode_native : buffer ? decode_buffer : decode_legacy;
|
|
832
|
-
function
|
|
853
|
+
function merge_operations(defaults, overrides) {
|
|
854
|
+
return defaults;
|
|
855
|
+
}
|
|
856
|
+
const NOT_PLAIN = Object.freeze({ kind: "not-plain" });
|
|
857
|
+
const SYMBOL_KEYS = Object.freeze({ kind: "symbol-keys" });
|
|
858
|
+
const stringify_operations = {
|
|
859
|
+
identify: (value) => value,
|
|
860
|
+
typeOf: (value) => value === null ? "null" : typeof value,
|
|
861
|
+
toPrimitive: (value) => value,
|
|
862
|
+
tagOf: (value) => get_type(value),
|
|
863
|
+
isThenable: (value) => typeof value.then === "function",
|
|
864
|
+
toPromise: (thenable) => Promise.resolve(thenable),
|
|
865
|
+
unbox: (boxed) => boxed.valueOf(),
|
|
866
|
+
toISOString: (date) => isNaN(date.getDate()) ? "" : date.toISOString(),
|
|
867
|
+
toStringValue: (value) => value.toString(),
|
|
868
|
+
regExpInfo: (regexp) => ({ source: regexp.source, flags: regexp.flags }),
|
|
869
|
+
valuesOf: (set) => set,
|
|
870
|
+
entriesOf: (map) => map,
|
|
871
|
+
viewInfo: (view) => ({
|
|
872
|
+
buffer: view.buffer,
|
|
873
|
+
byteOffset: view.byteOffset,
|
|
874
|
+
byteLength: view.byteLength,
|
|
875
|
+
length: view.length,
|
|
876
|
+
bufferByteLength: view.buffer.byteLength
|
|
877
|
+
}),
|
|
878
|
+
toArrayBuffer: (buffer2) => buffer2,
|
|
879
|
+
lengthOf: (array) => array.length,
|
|
880
|
+
hasOwn: (value, key) => Object.hasOwn(value, key),
|
|
881
|
+
indicesOf: (array) => valid_array_indices(array),
|
|
882
|
+
shapeOf: (value) => {
|
|
883
|
+
if (!is_plain_object(value)) return NOT_PLAIN;
|
|
884
|
+
if (enumerable_symbols(value).length > 0) return SYMBOL_KEYS;
|
|
885
|
+
return {
|
|
886
|
+
kind: Object.getPrototypeOf(value) === null ? "null-proto" : "plain",
|
|
887
|
+
keys: Object.keys(value)
|
|
888
|
+
};
|
|
889
|
+
},
|
|
890
|
+
get: (value, key) => value[key]
|
|
891
|
+
};
|
|
892
|
+
const default_stringify_operations = Object.freeze(stringify_operations);
|
|
893
|
+
const parse_operations = {
|
|
894
|
+
fromPrimitive: (primitive) => primitive,
|
|
895
|
+
fromISOString: (iso) => new Date(iso),
|
|
896
|
+
fromStringValue: (tag, text2) => {
|
|
897
|
+
if (tag === "URL") return new URL(text2);
|
|
898
|
+
if (tag === "URLSearchParams") return new URLSearchParams(text2);
|
|
899
|
+
return Temporal[tag.slice(9)].from(text2);
|
|
900
|
+
},
|
|
901
|
+
fromArrayBuffer: (buffer2) => buffer2,
|
|
902
|
+
fromRegExpInfo: (source, flags) => new RegExp(source, flags),
|
|
903
|
+
fromViewInfo: (tag, buffer2, byteOffset, length) => {
|
|
904
|
+
const Constructor = (
|
|
905
|
+
/** @type {any} */
|
|
906
|
+
globalThis[tag]
|
|
907
|
+
);
|
|
908
|
+
return byteOffset !== void 0 ? new Constructor(buffer2, byteOffset, length) : new Constructor(buffer2);
|
|
909
|
+
},
|
|
910
|
+
box: (value) => Object(value),
|
|
911
|
+
createArray: (length) => new Array(length),
|
|
912
|
+
createSparseArray: (length) => {
|
|
913
|
+
const array = [];
|
|
914
|
+
array[MAX_ARRAY_INDEX] = void 0;
|
|
915
|
+
delete array[MAX_ARRAY_INDEX];
|
|
916
|
+
array.length = length;
|
|
917
|
+
return array;
|
|
918
|
+
},
|
|
919
|
+
createObject: () => ({}),
|
|
920
|
+
createNullPrototypeObject: () => /* @__PURE__ */ Object.create(null),
|
|
921
|
+
createSet: () => /* @__PURE__ */ new Set(),
|
|
922
|
+
createMap: () => /* @__PURE__ */ new Map(),
|
|
923
|
+
set: (target, key, value) => {
|
|
924
|
+
target[key] = value;
|
|
925
|
+
},
|
|
926
|
+
addValue: (set, value) => {
|
|
927
|
+
set.add(value);
|
|
928
|
+
},
|
|
929
|
+
addEntry: (map, key, value) => {
|
|
930
|
+
map.set(key, value);
|
|
931
|
+
}
|
|
932
|
+
};
|
|
933
|
+
const default_parse_operations = Object.freeze(parse_operations);
|
|
934
|
+
function parse(serialized, revivers, options) {
|
|
833
935
|
return unflatten(JSON.parse(serialized), revivers);
|
|
834
936
|
}
|
|
835
|
-
function unflatten(parsed, revivers) {
|
|
937
|
+
function unflatten(parsed, revivers, options) {
|
|
938
|
+
const ops = merge_operations(default_parse_operations);
|
|
836
939
|
if (typeof parsed === "number") return hydrate(parsed, true);
|
|
837
940
|
if (!Array.isArray(parsed) || parsed.length === 0) {
|
|
838
941
|
throw new Error("Invalid input");
|
|
@@ -844,18 +947,18 @@ function unflatten(parsed, revivers) {
|
|
|
844
947
|
const hydrated = Array(values.length);
|
|
845
948
|
let hydrating = null;
|
|
846
949
|
function hydrate(index, standalone = false) {
|
|
847
|
-
if (index === UNDEFINED) return void 0;
|
|
848
|
-
if (index === NAN) return NaN;
|
|
849
|
-
if (index === POSITIVE_INFINITY) return Infinity;
|
|
850
|
-
if (index === NEGATIVE_INFINITY) return -Infinity;
|
|
851
|
-
if (index === NEGATIVE_ZERO) return -0;
|
|
950
|
+
if (index === UNDEFINED) return ops.fromPrimitive(void 0);
|
|
951
|
+
if (index === NAN) return ops.fromPrimitive(NaN);
|
|
952
|
+
if (index === POSITIVE_INFINITY) return ops.fromPrimitive(Infinity);
|
|
953
|
+
if (index === NEGATIVE_INFINITY) return ops.fromPrimitive(-Infinity);
|
|
954
|
+
if (index === NEGATIVE_ZERO) return ops.fromPrimitive(-0);
|
|
852
955
|
if (standalone || typeof index !== "number") {
|
|
853
956
|
throw new Error(`Invalid input`);
|
|
854
957
|
}
|
|
855
958
|
if (index in hydrated) return hydrated[index];
|
|
856
959
|
const value = values[index];
|
|
857
960
|
if (!value || typeof value !== "object") {
|
|
858
|
-
hydrated[index] = value;
|
|
961
|
+
hydrated[index] = ops.fromPrimitive(value);
|
|
859
962
|
} else if (Array.isArray(value)) {
|
|
860
963
|
if (typeof value[0] === "string") {
|
|
861
964
|
const type = value[0];
|
|
@@ -865,6 +968,9 @@ function unflatten(parsed, revivers) {
|
|
|
865
968
|
if (typeof i !== "number") {
|
|
866
969
|
i = values.push(value[1]) - 1;
|
|
867
970
|
}
|
|
971
|
+
if (Object.hasOwn(hydrated, i)) {
|
|
972
|
+
return hydrated[index] = reviver(hydrated[i]);
|
|
973
|
+
}
|
|
868
974
|
hydrating ??= /* @__PURE__ */ new Set();
|
|
869
975
|
if (hydrating.has(i)) {
|
|
870
976
|
throw new Error("Invalid circular reference");
|
|
@@ -876,44 +982,44 @@ function unflatten(parsed, revivers) {
|
|
|
876
982
|
}
|
|
877
983
|
switch (type) {
|
|
878
984
|
case "Date":
|
|
879
|
-
hydrated[index] =
|
|
985
|
+
hydrated[index] = ops.fromISOString(value[1]);
|
|
880
986
|
break;
|
|
881
987
|
case "Set":
|
|
882
|
-
const set =
|
|
988
|
+
const set = ops.createSet();
|
|
883
989
|
hydrated[index] = set;
|
|
884
990
|
for (let i = 1; i < value.length; i += 1) {
|
|
885
|
-
|
|
991
|
+
ops.addValue(set, hydrate(value[i]));
|
|
886
992
|
}
|
|
887
993
|
break;
|
|
888
994
|
case "Map":
|
|
889
|
-
const map =
|
|
995
|
+
const map = ops.createMap();
|
|
890
996
|
hydrated[index] = map;
|
|
891
997
|
for (let i = 1; i < value.length; i += 2) {
|
|
892
|
-
|
|
998
|
+
ops.addEntry(map, hydrate(value[i]), hydrate(value[i + 1]));
|
|
893
999
|
}
|
|
894
1000
|
break;
|
|
895
1001
|
case "RegExp":
|
|
896
|
-
hydrated[index] =
|
|
1002
|
+
hydrated[index] = ops.fromRegExpInfo(value[1], value[2]);
|
|
897
1003
|
break;
|
|
898
1004
|
case "Object": {
|
|
899
1005
|
const wrapped_index = value[1];
|
|
900
1006
|
if (typeof values[wrapped_index] === "object" && values[wrapped_index][0] !== "BigInt") {
|
|
901
1007
|
throw new Error("Invalid input");
|
|
902
1008
|
}
|
|
903
|
-
hydrated[index] =
|
|
1009
|
+
hydrated[index] = ops.box(hydrate(wrapped_index));
|
|
904
1010
|
break;
|
|
905
1011
|
}
|
|
906
1012
|
case "BigInt":
|
|
907
|
-
hydrated[index] = BigInt(value[1]);
|
|
1013
|
+
hydrated[index] = ops.fromPrimitive(BigInt(value[1]));
|
|
908
1014
|
break;
|
|
909
1015
|
case "null":
|
|
910
|
-
const obj =
|
|
1016
|
+
const obj = ops.createNullPrototypeObject();
|
|
911
1017
|
hydrated[index] = obj;
|
|
912
1018
|
for (let i = 1; i < value.length; i += 2) {
|
|
913
1019
|
if (value[i] === "__proto__") {
|
|
914
1020
|
throw new Error("Cannot parse an object with a `__proto__` property");
|
|
915
1021
|
}
|
|
916
|
-
obj
|
|
1022
|
+
ops.set(obj, value[i], hydrate(value[i + 1]));
|
|
917
1023
|
}
|
|
918
1024
|
break;
|
|
919
1025
|
case "Int8Array":
|
|
@@ -932,9 +1038,8 @@ function unflatten(parsed, revivers) {
|
|
|
932
1038
|
if (values[value[1]][0] !== "ArrayBuffer") {
|
|
933
1039
|
throw new Error("Invalid data");
|
|
934
1040
|
}
|
|
935
|
-
const TypedArrayConstructor = globalThis[type];
|
|
936
1041
|
const buffer2 = hydrate(value[1]);
|
|
937
|
-
hydrated[index] =
|
|
1042
|
+
hydrated[index] = ops.fromViewInfo(type, buffer2, value[2], value[3]);
|
|
938
1043
|
break;
|
|
939
1044
|
}
|
|
940
1045
|
case "ArrayBuffer": {
|
|
@@ -942,10 +1047,11 @@ function unflatten(parsed, revivers) {
|
|
|
942
1047
|
if (typeof base64 !== "string") {
|
|
943
1048
|
throw new Error("Invalid ArrayBuffer encoding");
|
|
944
1049
|
}
|
|
945
|
-
|
|
946
|
-
hydrated[index] = arraybuffer;
|
|
1050
|
+
hydrated[index] = ops.fromArrayBuffer(decode64(base64));
|
|
947
1051
|
break;
|
|
948
1052
|
}
|
|
1053
|
+
case "URL":
|
|
1054
|
+
case "URLSearchParams":
|
|
949
1055
|
case "Temporal.Duration":
|
|
950
1056
|
case "Temporal.Instant":
|
|
951
1057
|
case "Temporal.PlainDate":
|
|
@@ -954,18 +1060,7 @@ function unflatten(parsed, revivers) {
|
|
|
954
1060
|
case "Temporal.PlainMonthDay":
|
|
955
1061
|
case "Temporal.PlainYearMonth":
|
|
956
1062
|
case "Temporal.ZonedDateTime": {
|
|
957
|
-
|
|
958
|
-
hydrated[index] = Temporal[temporalName].from(value[1]);
|
|
959
|
-
break;
|
|
960
|
-
}
|
|
961
|
-
case "URL": {
|
|
962
|
-
const url = new URL(value[1]);
|
|
963
|
-
hydrated[index] = url;
|
|
964
|
-
break;
|
|
965
|
-
}
|
|
966
|
-
case "URLSearchParams": {
|
|
967
|
-
const url = new URLSearchParams(value[1]);
|
|
968
|
-
hydrated[index] = url;
|
|
1063
|
+
hydrated[index] = ops.fromStringValue(type, value[1]);
|
|
969
1064
|
break;
|
|
970
1065
|
}
|
|
971
1066
|
default:
|
|
@@ -976,47 +1071,44 @@ function unflatten(parsed, revivers) {
|
|
|
976
1071
|
if (!is_valid_array_len(len)) {
|
|
977
1072
|
throw new Error("Invalid input");
|
|
978
1073
|
}
|
|
979
|
-
const array =
|
|
1074
|
+
const array = ops.createSparseArray(len);
|
|
980
1075
|
hydrated[index] = array;
|
|
981
|
-
array[MAX_ARRAY_INDEX] = void 0;
|
|
982
|
-
delete array[MAX_ARRAY_INDEX];
|
|
983
1076
|
for (let i = 2; i < value.length; i += 2) {
|
|
984
1077
|
const idx = value[i];
|
|
985
1078
|
if (!is_valid_array_index(idx) || idx >= len) {
|
|
986
1079
|
throw new Error("Invalid input");
|
|
987
1080
|
}
|
|
988
|
-
array
|
|
1081
|
+
ops.set(array, idx, hydrate(value[i + 1]));
|
|
989
1082
|
}
|
|
990
|
-
array.length = len;
|
|
991
1083
|
} else {
|
|
992
|
-
const array =
|
|
1084
|
+
const array = ops.createArray(value.length);
|
|
993
1085
|
hydrated[index] = array;
|
|
994
1086
|
for (let i = 0; i < value.length; i += 1) {
|
|
995
1087
|
const n = value[i];
|
|
996
1088
|
if (n === HOLE) continue;
|
|
997
|
-
array
|
|
1089
|
+
ops.set(array, i, hydrate(n));
|
|
998
1090
|
}
|
|
999
1091
|
}
|
|
1000
1092
|
} else {
|
|
1001
|
-
const object =
|
|
1093
|
+
const object = ops.createObject();
|
|
1002
1094
|
hydrated[index] = object;
|
|
1003
1095
|
for (const key of Object.keys(value)) {
|
|
1004
1096
|
if (key === "__proto__") {
|
|
1005
1097
|
throw new Error("Cannot parse an object with a `__proto__` property");
|
|
1006
1098
|
}
|
|
1007
|
-
|
|
1008
|
-
object[key] = hydrate(n);
|
|
1099
|
+
ops.set(object, key, hydrate(value[key]));
|
|
1009
1100
|
}
|
|
1010
1101
|
}
|
|
1011
1102
|
return hydrated[index];
|
|
1012
1103
|
}
|
|
1013
1104
|
return hydrate(0);
|
|
1014
1105
|
}
|
|
1015
|
-
function stringify$1(value, reducers) {
|
|
1106
|
+
function stringify$1(value, reducers, options) {
|
|
1016
1107
|
const stringified = run(false, value, reducers);
|
|
1017
1108
|
return typeof stringified === "string" ? stringified : `[${stringified.join(",")}]`;
|
|
1018
1109
|
}
|
|
1019
|
-
function run(async, value, reducers) {
|
|
1110
|
+
function run(async, value, reducers, options) {
|
|
1111
|
+
const ops = merge_operations(default_stringify_operations);
|
|
1020
1112
|
const stringified = [];
|
|
1021
1113
|
const indexes = /* @__PURE__ */ new Map();
|
|
1022
1114
|
const custom = [];
|
|
@@ -1028,17 +1120,24 @@ function run(async, value, reducers) {
|
|
|
1028
1120
|
const keys = [];
|
|
1029
1121
|
let p = 0;
|
|
1030
1122
|
function flatten(thing, index2) {
|
|
1031
|
-
|
|
1032
|
-
if (
|
|
1033
|
-
|
|
1034
|
-
if (
|
|
1035
|
-
|
|
1036
|
-
|
|
1123
|
+
const type = ops.typeOf(thing);
|
|
1124
|
+
if (type === "undefined") return UNDEFINED;
|
|
1125
|
+
let number;
|
|
1126
|
+
if (type === "number") {
|
|
1127
|
+
number = /** @type {number} */
|
|
1128
|
+
ops.toPrimitive(thing);
|
|
1129
|
+
if (Number.isNaN(number)) return NAN;
|
|
1130
|
+
if (number === Infinity) return POSITIVE_INFINITY;
|
|
1131
|
+
if (number === -Infinity) return NEGATIVE_INFINITY;
|
|
1132
|
+
if (number === 0 && 1 / number < 0) return NEGATIVE_ZERO;
|
|
1133
|
+
}
|
|
1134
|
+
const id = ops.identify(thing);
|
|
1135
|
+
if (indexes.has(id)) return (
|
|
1037
1136
|
/** @type {number} */
|
|
1038
|
-
indexes.get(
|
|
1137
|
+
indexes.get(id)
|
|
1039
1138
|
);
|
|
1040
1139
|
index2 ??= p++;
|
|
1041
|
-
indexes.set(
|
|
1140
|
+
indexes.set(id, index2);
|
|
1042
1141
|
for (const { key, fn } of custom) {
|
|
1043
1142
|
const value2 = fn(thing);
|
|
1044
1143
|
if (value2) {
|
|
@@ -1046,15 +1145,15 @@ function run(async, value, reducers) {
|
|
|
1046
1145
|
return index2;
|
|
1047
1146
|
}
|
|
1048
1147
|
}
|
|
1049
|
-
if (
|
|
1148
|
+
if (type === "function") {
|
|
1050
1149
|
throw new DevalueError(`Cannot stringify a function`, keys, thing, value);
|
|
1051
|
-
} else if (
|
|
1150
|
+
} else if (type === "symbol") {
|
|
1052
1151
|
throw new DevalueError(`Cannot stringify a Symbol primitive`, keys, thing, value);
|
|
1053
1152
|
}
|
|
1054
1153
|
let str = "";
|
|
1055
|
-
if (
|
|
1056
|
-
str = stringify_primitive(thing);
|
|
1057
|
-
} else if (
|
|
1154
|
+
if (type !== "object") {
|
|
1155
|
+
str = stringify_primitive(type === "number" ? number : ops.toPrimitive(thing));
|
|
1156
|
+
} else if (ops.isThenable(thing)) {
|
|
1058
1157
|
{
|
|
1059
1158
|
throw new DevalueError(
|
|
1060
1159
|
`Cannot stringify a Promise or thenable — use stringifyAsync instead`,
|
|
@@ -1064,54 +1163,51 @@ function run(async, value, reducers) {
|
|
|
1064
1163
|
);
|
|
1065
1164
|
}
|
|
1066
1165
|
} else {
|
|
1067
|
-
const
|
|
1068
|
-
switch (
|
|
1166
|
+
const tag = ops.tagOf(thing);
|
|
1167
|
+
switch (tag) {
|
|
1069
1168
|
case "Number":
|
|
1070
1169
|
case "String":
|
|
1071
1170
|
case "Boolean":
|
|
1072
1171
|
case "BigInt":
|
|
1073
|
-
str = `["Object",${flatten(
|
|
1172
|
+
str = `["Object",${flatten(ops.unbox(thing))}]`;
|
|
1074
1173
|
break;
|
|
1075
1174
|
case "Date":
|
|
1076
|
-
|
|
1077
|
-
str = `["Date","${valid ? thing.toISOString() : ""}"]`;
|
|
1175
|
+
str = `["Date","${ops.toISOString(thing)}"]`;
|
|
1078
1176
|
break;
|
|
1079
1177
|
case "URL":
|
|
1080
|
-
str = `["URL",${stringify_string(
|
|
1178
|
+
str = `["URL",${stringify_string(ops.toStringValue(thing))}]`;
|
|
1081
1179
|
break;
|
|
1082
1180
|
case "URLSearchParams":
|
|
1083
|
-
str = `["URLSearchParams",${stringify_string(
|
|
1181
|
+
str = `["URLSearchParams",${stringify_string(ops.toStringValue(thing))}]`;
|
|
1084
1182
|
break;
|
|
1085
1183
|
case "RegExp":
|
|
1086
|
-
const { source, flags } = thing;
|
|
1184
|
+
const { source, flags } = ops.regExpInfo(thing);
|
|
1087
1185
|
str = flags ? `["RegExp",${stringify_string(source)},"${flags}"]` : `["RegExp",${stringify_string(source)}]`;
|
|
1088
1186
|
break;
|
|
1089
1187
|
case "Array": {
|
|
1090
1188
|
let mostly_dense = false;
|
|
1189
|
+
const length = ops.lengthOf(thing);
|
|
1091
1190
|
str = "[";
|
|
1092
|
-
for (let i = 0; i <
|
|
1191
|
+
for (let i = 0; i < length; i += 1) {
|
|
1093
1192
|
if (i > 0) str += ",";
|
|
1094
|
-
if (
|
|
1193
|
+
if (ops.hasOwn(thing, i)) {
|
|
1095
1194
|
keys.push(`[${i}]`);
|
|
1096
|
-
str += flatten(thing
|
|
1195
|
+
str += flatten(ops.get(thing, i));
|
|
1097
1196
|
keys.pop();
|
|
1098
1197
|
} else if (mostly_dense) {
|
|
1099
1198
|
str += HOLE;
|
|
1100
1199
|
} else {
|
|
1101
|
-
const populated_keys =
|
|
1102
|
-
/** @type {any[]} */
|
|
1103
|
-
thing
|
|
1104
|
-
);
|
|
1200
|
+
const populated_keys = ops.indicesOf(thing);
|
|
1105
1201
|
const population = populated_keys.length;
|
|
1106
|
-
const d = String(
|
|
1107
|
-
const hole_cost = (
|
|
1202
|
+
const d = String(length).length;
|
|
1203
|
+
const hole_cost = (length - population) * 3;
|
|
1108
1204
|
const sparse_cost = 4 + d + population * (d + 1);
|
|
1109
1205
|
if (hole_cost > sparse_cost) {
|
|
1110
|
-
str = "[" + SPARSE + "," +
|
|
1206
|
+
str = "[" + SPARSE + "," + length;
|
|
1111
1207
|
for (let j = 0; j < populated_keys.length; j++) {
|
|
1112
1208
|
const key = populated_keys[j];
|
|
1113
1209
|
keys.push(`[${key}]`);
|
|
1114
|
-
str += "," + key + "," + flatten(thing
|
|
1210
|
+
str += "," + key + "," + flatten(ops.get(thing, key));
|
|
1115
1211
|
keys.pop();
|
|
1116
1212
|
}
|
|
1117
1213
|
break;
|
|
@@ -1126,15 +1222,19 @@ function run(async, value, reducers) {
|
|
|
1126
1222
|
}
|
|
1127
1223
|
case "Set":
|
|
1128
1224
|
str = '["Set"';
|
|
1129
|
-
for (const value2 of thing) {
|
|
1225
|
+
for (const value2 of ops.valuesOf(thing)) {
|
|
1130
1226
|
str += `,${flatten(value2)}`;
|
|
1131
1227
|
}
|
|
1132
1228
|
str += "]";
|
|
1133
1229
|
break;
|
|
1134
1230
|
case "Map":
|
|
1135
1231
|
str = '["Map"';
|
|
1136
|
-
for (const [key, value2] of thing) {
|
|
1137
|
-
|
|
1232
|
+
for (const [key, value2] of ops.entriesOf(thing)) {
|
|
1233
|
+
const key_type = ops.typeOf(key);
|
|
1234
|
+
const key_is_primitive = key_type !== "object" && key_type !== "function" && key_type !== "symbol";
|
|
1235
|
+
keys.push(
|
|
1236
|
+
`.get(${key_is_primitive ? stringify_primitive(ops.toPrimitive(key)) : "..."})`
|
|
1237
|
+
);
|
|
1138
1238
|
str += `,${flatten(key)},${flatten(value2)}`;
|
|
1139
1239
|
keys.pop();
|
|
1140
1240
|
}
|
|
@@ -1151,19 +1251,26 @@ function run(async, value, reducers) {
|
|
|
1151
1251
|
case "Float32Array":
|
|
1152
1252
|
case "Float64Array":
|
|
1153
1253
|
case "BigInt64Array":
|
|
1154
|
-
case "BigUint64Array":
|
|
1254
|
+
case "BigUint64Array": {
|
|
1255
|
+
const info = ops.viewInfo(thing);
|
|
1256
|
+
str = '["' + tag + '",' + flatten(info.buffer);
|
|
1257
|
+
if (info.byteLength !== info.bufferByteLength) {
|
|
1258
|
+
str += `,${info.byteOffset},${info.length}`;
|
|
1259
|
+
}
|
|
1260
|
+
str += "]";
|
|
1261
|
+
break;
|
|
1262
|
+
}
|
|
1155
1263
|
case "DataView": {
|
|
1156
|
-
const
|
|
1157
|
-
str = '["' +
|
|
1158
|
-
if (
|
|
1159
|
-
str += `,${
|
|
1264
|
+
const info = ops.viewInfo(thing);
|
|
1265
|
+
str = '["' + tag + '",' + flatten(info.buffer);
|
|
1266
|
+
if (info.byteLength !== info.bufferByteLength) {
|
|
1267
|
+
str += `,${info.byteOffset},${info.byteLength}`;
|
|
1160
1268
|
}
|
|
1161
1269
|
str += "]";
|
|
1162
1270
|
break;
|
|
1163
1271
|
}
|
|
1164
1272
|
case "ArrayBuffer": {
|
|
1165
|
-
const
|
|
1166
|
-
const base64 = encode64(arraybuffer);
|
|
1273
|
+
const base64 = encode64(ops.toArrayBuffer(thing));
|
|
1167
1274
|
str = `["ArrayBuffer","${base64}"]`;
|
|
1168
1275
|
break;
|
|
1169
1276
|
}
|
|
@@ -1175,18 +1282,19 @@ function run(async, value, reducers) {
|
|
|
1175
1282
|
case "Temporal.PlainMonthDay":
|
|
1176
1283
|
case "Temporal.PlainYearMonth":
|
|
1177
1284
|
case "Temporal.ZonedDateTime":
|
|
1178
|
-
str = `["${
|
|
1285
|
+
str = `["${tag}",${stringify_string(ops.toStringValue(thing))}]`;
|
|
1179
1286
|
break;
|
|
1180
|
-
default:
|
|
1181
|
-
|
|
1287
|
+
default: {
|
|
1288
|
+
const shape = ops.shapeOf(thing);
|
|
1289
|
+
if (shape.kind === "not-plain") {
|
|
1182
1290
|
throw new DevalueError(`Cannot stringify arbitrary non-POJOs`, keys, thing, value);
|
|
1183
1291
|
}
|
|
1184
|
-
if (
|
|
1292
|
+
if (shape.kind === "symbol-keys") {
|
|
1185
1293
|
throw new DevalueError(`Cannot stringify POJOs with symbolic keys`, keys, thing, value);
|
|
1186
1294
|
}
|
|
1187
|
-
if (
|
|
1295
|
+
if (shape.kind === "null-proto") {
|
|
1188
1296
|
str = '["null"';
|
|
1189
|
-
for (const key of
|
|
1297
|
+
for (const key of shape.keys) {
|
|
1190
1298
|
if (key === "__proto__") {
|
|
1191
1299
|
throw new DevalueError(
|
|
1192
1300
|
`Cannot stringify objects with __proto__ keys`,
|
|
@@ -1196,14 +1304,14 @@ function run(async, value, reducers) {
|
|
|
1196
1304
|
);
|
|
1197
1305
|
}
|
|
1198
1306
|
keys.push(stringify_key(key));
|
|
1199
|
-
str += `,${stringify_string(key)},${flatten(thing
|
|
1307
|
+
str += `,${stringify_string(key)},${flatten(ops.get(thing, key))}`;
|
|
1200
1308
|
keys.pop();
|
|
1201
1309
|
}
|
|
1202
1310
|
str += "]";
|
|
1203
1311
|
} else {
|
|
1204
1312
|
str = "{";
|
|
1205
1313
|
let started = false;
|
|
1206
|
-
for (const key of
|
|
1314
|
+
for (const key of shape.keys) {
|
|
1207
1315
|
if (key === "__proto__") {
|
|
1208
1316
|
throw new DevalueError(
|
|
1209
1317
|
`Cannot stringify objects with __proto__ keys`,
|
|
@@ -1215,11 +1323,12 @@ function run(async, value, reducers) {
|
|
|
1215
1323
|
if (started) str += ",";
|
|
1216
1324
|
started = true;
|
|
1217
1325
|
keys.push(stringify_key(key));
|
|
1218
|
-
str += `${stringify_string(key)}:${flatten(thing
|
|
1326
|
+
str += `${stringify_string(key)}:${flatten(ops.get(thing, key))}`;
|
|
1219
1327
|
keys.pop();
|
|
1220
1328
|
}
|
|
1221
1329
|
str += "}";
|
|
1222
1330
|
}
|
|
1331
|
+
}
|
|
1223
1332
|
}
|
|
1224
1333
|
}
|
|
1225
1334
|
stringified[index2] = str;
|
|
@@ -6575,7 +6684,7 @@ const options = {
|
|
|
6575
6684
|
app: ({ head, body, assets, nonce, env }) => '<!doctype html>\n<html lang="en">\n <head>\n <meta charset="utf-8" />\n <link rel="icon" href="' + assets + '/favicon.png" />\n <meta name="viewport" content="width=device-width, initial-scale=1" />\n ' + head + '\n </head>\n <body data-sveltekit-preload-data="hover">\n <div style="display: contents">' + body + "</div>\n </body>\n</html>\n",
|
|
6576
6685
|
error
|
|
6577
6686
|
},
|
|
6578
|
-
version_hash: "
|
|
6687
|
+
version_hash: "axz9qz"
|
|
6579
6688
|
};
|
|
6580
6689
|
async function get_hooks() {
|
|
6581
6690
|
let handle;
|
|
@@ -6583,7 +6692,7 @@ async function get_hooks() {
|
|
|
6583
6692
|
let handleError;
|
|
6584
6693
|
let handleValidationError;
|
|
6585
6694
|
let init;
|
|
6586
|
-
({ handle, handleFetch, handleError, handleValidationError, init } = await import('./hooks.server-
|
|
6695
|
+
({ handle, handleFetch, handleError, handleValidationError, init } = await import('./hooks.server-QpuxZ7sx.js'));
|
|
6587
6696
|
let reroute;
|
|
6588
6697
|
let transport;
|
|
6589
6698
|
return {
|