codebay 0.16.1 → 0.17.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/.mochi/manifest.json +495 -479
- package/.mochi/svelte-client/HydratableIsland-62a2p50h.js +1 -0
- package/.mochi/svelte-client/_hydrate-AppShell_2rtnxn6pgp2rh-fktxecze.js +2 -0
- package/.mochi/svelte-client/{_hydrate-AvatarsView_257s9yq1wwr4f-ry83ck8a.js → _hydrate-AvatarsView_257s9yq1wwr4f-37mv682n.js} +1 -1
- package/.mochi/svelte-client/{_hydrate-InstanceView_2ma45l9bybfhl-vjt4jscf.js → _hydrate-InstanceView_2ma45l9bybfhl-jdpemn6g.js} +1 -1
- package/.mochi/svelte-client/{_hydrate-SettingsView_8hmarwmf8onq-1jdrk8x6.js → _hydrate-SettingsView_8hmarwmf8onq-vj17rdps.js} +1 -1
- package/.mochi/svelte-client/{chunk-b5s3mpg0.js → chunk-0pc6fadz.js} +1 -1
- package/.mochi/svelte-client/{chunk-3jqc40sp.js → chunk-2aps81ft.js} +1 -1
- package/.mochi/svelte-client/{chunk-bhseezf3.js → chunk-b3wr3bhy.js} +1 -1
- package/.mochi/svelte-client/{chunk-3cxaw5hr.js → chunk-g1xhwcez.js} +1 -1
- package/.mochi/svelte-client/{chunk-bhwkq8er.js → chunk-j38dj94z.js} +1 -1
- package/.mochi/svelte-client/chunk-jnrx9rdm.js +4 -0
- package/.mochi/svelte-client/{chunk-2dc6352a.js → chunk-vqjwsxn6.js} +1 -1
- package/.mochi/svelte-client/chunk-xw69wwcx.js +2 -0
- package/.mochi/svelte-client/{chunk-jm3ge348.js → chunk-y3wadere.js} +1 -1
- package/.mochi/svelte-compile/{App-8mpgrxza.server.js → App-hwb5e2v4.server.js} +11 -9
- package/.mochi/svelte-compile/{Avatars-y5nf6q25.server.js → Avatars-hwwkz663.server.js} +4 -4
- package/.mochi/svelte-compile/{Instance-3sbzyp0g.server.js → Instance-eejbc4tf.server.js} +5 -5
- package/.mochi/svelte-compile/{Settings-ysvh5vhh.server.js → Settings-bapas95r.server.js} +6 -6
- package/.mochi/svelte-compile/{chunk-vr0e32mv.js → chunk-180et7ce.js} +1 -1
- package/.mochi/svelte-compile/{chunk-gnf5cnct.js → chunk-en9cfkx7.js} +182 -65
- package/.mochi/svelte-compile/{chunk-jq7jj8jd.js → chunk-fyxcczwn.js} +1 -1
- package/.mochi/svelte-compile/{chunk-d2z3qxxe.js → chunk-gz27edm7.js} +1 -1
- package/.mochi/svelte-compile/{chunk-xmygdsj4.js → chunk-hpfzewm2.js} +142 -91
- package/.mochi/svelte-compile/{chunk-7zaw9t5a.js → chunk-p23q3y33.js} +1 -1
- package/.mochi/svelte-compile/{chunk-878xcmp4.js → chunk-q72ww0c1.js} +2 -2
- package/.mochi/svelte-compile/{chunk-zk4a9zms.js → chunk-w10vt8n2.js} +1 -1
- package/package.json +2 -1
- package/src/avatars/dragon.ts +17 -0
- package/src/avatars/house.ts +17 -0
- package/src/avatars/index.ts +6 -0
- package/src/avatars/spiral.ts +17 -0
- package/src/components/DashboardView.svelte +9 -3
- package/src/components/TopBar.svelte +2 -1
- package/src/lib/instances.server.ts +3 -1
- package/src/routes.ts +3 -2
- package/.mochi/svelte-client/HydratableIsland-6y9p903x.js +0 -1
- package/.mochi/svelte-client/_hydrate-AppShell_2rtnxn6pgp2rh-nv6yzk0x.js +0 -2
- package/.mochi/svelte-client/chunk-3pgw6t5j.js +0 -4
- package/.mochi/svelte-client/chunk-7g3xt6ez.js +0 -2
|
@@ -1330,9 +1330,6 @@ class DevalueError extends Error {
|
|
|
1330
1330
|
this.root = root;
|
|
1331
1331
|
}
|
|
1332
1332
|
}
|
|
1333
|
-
function is_primitive(thing) {
|
|
1334
|
-
return thing === null || typeof thing !== "object" && typeof thing !== "function";
|
|
1335
|
-
}
|
|
1336
1333
|
var object_proto_names = /* @__PURE__ */ Object.getOwnPropertyNames(Object.prototype).sort().join("\x00");
|
|
1337
1334
|
function is_plain_object(thing) {
|
|
1338
1335
|
const proto = Object.getPrototypeOf(thing);
|
|
@@ -1341,6 +1338,9 @@ function is_plain_object(thing) {
|
|
|
1341
1338
|
function get_type(thing) {
|
|
1342
1339
|
return Object.prototype.toString.call(thing).slice(8, -1);
|
|
1343
1340
|
}
|
|
1341
|
+
function is_buffer(thing) {
|
|
1342
|
+
return typeof Buffer !== "undefined" && Buffer.isBuffer(thing);
|
|
1343
|
+
}
|
|
1344
1344
|
function get_escaped_char(char) {
|
|
1345
1345
|
switch (char) {
|
|
1346
1346
|
case '"':
|
|
@@ -1410,23 +1410,130 @@ function is_valid_array_index_string(s) {
|
|
|
1410
1410
|
}
|
|
1411
1411
|
return is_valid_array_index(+s);
|
|
1412
1412
|
}
|
|
1413
|
-
function
|
|
1414
|
-
const keys = Object.keys(array);
|
|
1413
|
+
function array_index_cut(keys) {
|
|
1415
1414
|
for (var i = keys.length - 1;i >= 0; i--) {
|
|
1416
1415
|
if (is_valid_array_index_string(keys[i])) {
|
|
1417
1416
|
break;
|
|
1418
1417
|
}
|
|
1419
1418
|
}
|
|
1420
|
-
|
|
1419
|
+
return i + 1;
|
|
1420
|
+
}
|
|
1421
|
+
function valid_array_indices(array) {
|
|
1422
|
+
const keys = Object.keys(array);
|
|
1423
|
+
keys.length = array_index_cut(keys);
|
|
1421
1424
|
return keys;
|
|
1422
1425
|
}
|
|
1423
1426
|
|
|
1427
|
+
// node_modules/devalue/src/operations.js
|
|
1428
|
+
function merge_operations(defaults, overrides) {
|
|
1429
|
+
if (!overrides)
|
|
1430
|
+
return defaults;
|
|
1431
|
+
const merged = {};
|
|
1432
|
+
for (const key of Object.keys(defaults)) {
|
|
1433
|
+
merged[key] = overrides[key] ?? defaults[key];
|
|
1434
|
+
}
|
|
1435
|
+
return merged;
|
|
1436
|
+
}
|
|
1437
|
+
var NOT_PLAIN = Object.freeze({ kind: "not-plain" });
|
|
1438
|
+
var SYMBOL_KEYS = Object.freeze({ kind: "symbol-keys" });
|
|
1439
|
+
var stringify_operations = {
|
|
1440
|
+
identify: (value) => value,
|
|
1441
|
+
typeOf: (value) => value === null ? "null" : typeof value,
|
|
1442
|
+
toPrimitive: (value) => value,
|
|
1443
|
+
tagOf: (value) => get_type(value),
|
|
1444
|
+
isThenable: (value) => typeof value.then === "function",
|
|
1445
|
+
toPromise: (thenable) => Promise.resolve(thenable),
|
|
1446
|
+
unbox: (boxed) => boxed.valueOf(),
|
|
1447
|
+
toISOString: (date) => isNaN(date.getDate()) ? "" : date.toISOString(),
|
|
1448
|
+
toStringValue: (value) => value.toString(),
|
|
1449
|
+
regExpInfo: (regexp) => ({ source: regexp.source, flags: regexp.flags }),
|
|
1450
|
+
valuesOf: (set) => set,
|
|
1451
|
+
entriesOf: (map) => map,
|
|
1452
|
+
viewInfo: (view) => {
|
|
1453
|
+
if (is_buffer(view))
|
|
1454
|
+
view = new Uint8Array(view);
|
|
1455
|
+
return {
|
|
1456
|
+
buffer: view.buffer,
|
|
1457
|
+
byteOffset: view.byteOffset,
|
|
1458
|
+
byteLength: view.byteLength,
|
|
1459
|
+
length: view.length,
|
|
1460
|
+
bufferByteLength: view.buffer.byteLength
|
|
1461
|
+
};
|
|
1462
|
+
},
|
|
1463
|
+
toArrayBuffer: (buffer2) => buffer2,
|
|
1464
|
+
lengthOf: (array) => array.length,
|
|
1465
|
+
hasOwn: (value, key) => Object.hasOwn(value, key),
|
|
1466
|
+
indicesOf: (array) => valid_array_indices(array),
|
|
1467
|
+
shapeOf: (value) => {
|
|
1468
|
+
if (!is_plain_object(value))
|
|
1469
|
+
return NOT_PLAIN;
|
|
1470
|
+
if (enumerable_symbols(value).length > 0)
|
|
1471
|
+
return SYMBOL_KEYS;
|
|
1472
|
+
return {
|
|
1473
|
+
kind: Object.getPrototypeOf(value) === null ? "null-proto" : "plain",
|
|
1474
|
+
keys: Object.keys(value)
|
|
1475
|
+
};
|
|
1476
|
+
},
|
|
1477
|
+
get: (value, key) => value[key]
|
|
1478
|
+
};
|
|
1479
|
+
var default_stringify_operations = Object.freeze(stringify_operations);
|
|
1480
|
+
var array_buffer_byte_length = Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength").get;
|
|
1481
|
+
var shared_array_buffer_byte_length = typeof SharedArrayBuffer === "undefined" ? undefined : Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype, "byteLength").get;
|
|
1482
|
+
var parse_operations = {
|
|
1483
|
+
fromPrimitive: (primitive) => primitive,
|
|
1484
|
+
fromISOString: (iso) => new Date(iso),
|
|
1485
|
+
fromStringValue: (tag, text) => {
|
|
1486
|
+
if (tag === "URL")
|
|
1487
|
+
return new URL(text);
|
|
1488
|
+
if (tag === "URLSearchParams")
|
|
1489
|
+
return new URLSearchParams(text);
|
|
1490
|
+
return Temporal[tag.slice(9)].from(text);
|
|
1491
|
+
},
|
|
1492
|
+
fromArrayBuffer: (buffer2) => buffer2,
|
|
1493
|
+
fromRegExpInfo: (source, flags) => new RegExp(source, flags),
|
|
1494
|
+
fromViewInfo: (tag, buffer2, byteOffset, length) => {
|
|
1495
|
+
try {
|
|
1496
|
+
array_buffer_byte_length.call(buffer2);
|
|
1497
|
+
} catch (error) {
|
|
1498
|
+
if (!shared_array_buffer_byte_length)
|
|
1499
|
+
throw error;
|
|
1500
|
+
shared_array_buffer_byte_length.call(buffer2);
|
|
1501
|
+
}
|
|
1502
|
+
const Constructor = globalThis[tag];
|
|
1503
|
+
return byteOffset !== undefined ? new Constructor(buffer2, byteOffset, length) : new Constructor(buffer2);
|
|
1504
|
+
},
|
|
1505
|
+
box: (value) => Object(value),
|
|
1506
|
+
createArray: (length) => new Array(length),
|
|
1507
|
+
createSparseArray: (length) => {
|
|
1508
|
+
const array = [];
|
|
1509
|
+
array[MAX_ARRAY_INDEX] = undefined;
|
|
1510
|
+
delete array[MAX_ARRAY_INDEX];
|
|
1511
|
+
array.length = length;
|
|
1512
|
+
return array;
|
|
1513
|
+
},
|
|
1514
|
+
createObject: () => ({}),
|
|
1515
|
+
createNullPrototypeObject: () => Object.create(null),
|
|
1516
|
+
createSet: () => new Set,
|
|
1517
|
+
createMap: () => new Map,
|
|
1518
|
+
set: (target, key, value) => {
|
|
1519
|
+
target[key] = value;
|
|
1520
|
+
},
|
|
1521
|
+
addValue: (set, value) => {
|
|
1522
|
+
set.add(value);
|
|
1523
|
+
},
|
|
1524
|
+
addEntry: (map, key, value) => {
|
|
1525
|
+
map.set(key, value);
|
|
1526
|
+
}
|
|
1527
|
+
};
|
|
1528
|
+
var default_parse_operations = Object.freeze(parse_operations);
|
|
1529
|
+
|
|
1424
1530
|
// node_modules/devalue/src/stringify.js
|
|
1425
|
-
function stringify(value, reducers) {
|
|
1426
|
-
const stringified = run(false, value, reducers);
|
|
1531
|
+
function stringify(value, reducers, options) {
|
|
1532
|
+
const stringified = run(false, value, reducers, options);
|
|
1427
1533
|
return typeof stringified === "string" ? stringified : `[${stringified.join(",")}]`;
|
|
1428
1534
|
}
|
|
1429
|
-
function run(async, value, reducers) {
|
|
1535
|
+
function run(async, value, reducers, options) {
|
|
1536
|
+
const ops = merge_operations(default_stringify_operations, options?.operations);
|
|
1430
1537
|
const stringified = [];
|
|
1431
1538
|
const indexes = new Map;
|
|
1432
1539
|
const custom = [];
|
|
@@ -1438,20 +1545,26 @@ function run(async, value, reducers) {
|
|
|
1438
1545
|
const keys = [];
|
|
1439
1546
|
let p = 0;
|
|
1440
1547
|
function flatten(thing, index2) {
|
|
1441
|
-
|
|
1548
|
+
const type = ops.typeOf(thing);
|
|
1549
|
+
if (type === "undefined")
|
|
1442
1550
|
return UNDEFINED;
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1551
|
+
let number;
|
|
1552
|
+
if (type === "number") {
|
|
1553
|
+
number = ops.toPrimitive(thing);
|
|
1554
|
+
if (Number.isNaN(number))
|
|
1555
|
+
return NAN;
|
|
1556
|
+
if (number === Infinity)
|
|
1557
|
+
return POSITIVE_INFINITY;
|
|
1558
|
+
if (number === -Infinity)
|
|
1559
|
+
return NEGATIVE_INFINITY;
|
|
1560
|
+
if (number === 0 && 1 / number < 0)
|
|
1561
|
+
return NEGATIVE_ZERO;
|
|
1562
|
+
}
|
|
1563
|
+
const id = ops.identify(thing);
|
|
1564
|
+
if (indexes.has(id))
|
|
1565
|
+
return indexes.get(id);
|
|
1453
1566
|
index2 ??= p++;
|
|
1454
|
-
indexes.set(
|
|
1567
|
+
indexes.set(id, index2);
|
|
1455
1568
|
for (const { key, fn } of custom) {
|
|
1456
1569
|
const value2 = fn(thing);
|
|
1457
1570
|
if (value2) {
|
|
@@ -1459,70 +1572,71 @@ function run(async, value, reducers) {
|
|
|
1459
1572
|
return index2;
|
|
1460
1573
|
}
|
|
1461
1574
|
}
|
|
1462
|
-
if (
|
|
1575
|
+
if (type === "function") {
|
|
1463
1576
|
throw new DevalueError(`Cannot stringify a function`, keys, thing, value);
|
|
1464
|
-
} else if (
|
|
1577
|
+
} else if (type === "symbol") {
|
|
1465
1578
|
throw new DevalueError(`Cannot stringify a Symbol primitive`, keys, thing, value);
|
|
1466
1579
|
}
|
|
1467
1580
|
let str = "";
|
|
1468
|
-
if (
|
|
1469
|
-
str = stringify_primitive(thing);
|
|
1470
|
-
} else if (
|
|
1581
|
+
if (type !== "object") {
|
|
1582
|
+
str = stringify_primitive(type === "number" ? number : ops.toPrimitive(thing));
|
|
1583
|
+
} else if (ops.isThenable(thing)) {
|
|
1471
1584
|
if (!async) {
|
|
1472
1585
|
throw new DevalueError(`Cannot stringify a Promise or thenable \u2014 use stringifyAsync instead`, keys, thing, value);
|
|
1473
1586
|
}
|
|
1474
|
-
str =
|
|
1587
|
+
str = ops.toPromise(thing).then((value2) => {
|
|
1475
1588
|
const i = flatten(value2, index2);
|
|
1476
1589
|
if (i < 0)
|
|
1477
1590
|
stringified[index2] = i;
|
|
1478
1591
|
});
|
|
1592
|
+
str.catch(() => {});
|
|
1479
1593
|
} else {
|
|
1480
|
-
const
|
|
1481
|
-
switch (
|
|
1594
|
+
const tag = ops.tagOf(thing);
|
|
1595
|
+
switch (tag) {
|
|
1482
1596
|
case "Number":
|
|
1483
1597
|
case "String":
|
|
1484
1598
|
case "Boolean":
|
|
1485
1599
|
case "BigInt":
|
|
1486
|
-
str = `["Object",${flatten(
|
|
1600
|
+
str = `["Object",${flatten(ops.unbox(thing))}]`;
|
|
1487
1601
|
break;
|
|
1488
1602
|
case "Date":
|
|
1489
|
-
|
|
1490
|
-
str = `["Date","${valid ? thing.toISOString() : ""}"]`;
|
|
1603
|
+
str = `["Date","${ops.toISOString(thing)}"]`;
|
|
1491
1604
|
break;
|
|
1492
1605
|
case "URL":
|
|
1493
|
-
str = `["URL",${stringify_string(
|
|
1606
|
+
str = `["URL",${stringify_string(ops.toStringValue(thing))}]`;
|
|
1494
1607
|
break;
|
|
1495
1608
|
case "URLSearchParams":
|
|
1496
|
-
str = `["URLSearchParams",${stringify_string(
|
|
1609
|
+
str = `["URLSearchParams",${stringify_string(ops.toStringValue(thing))}]`;
|
|
1497
1610
|
break;
|
|
1498
1611
|
case "RegExp":
|
|
1499
|
-
const { source, flags } = thing;
|
|
1612
|
+
const { source, flags } = ops.regExpInfo(thing);
|
|
1500
1613
|
str = flags ? `["RegExp",${stringify_string(source)},"${flags}"]` : `["RegExp",${stringify_string(source)}]`;
|
|
1501
1614
|
break;
|
|
1502
1615
|
case "Array": {
|
|
1503
1616
|
let mostly_dense = false;
|
|
1617
|
+
const length = ops.lengthOf(thing);
|
|
1504
1618
|
str = "[";
|
|
1505
|
-
for (let i = 0;i <
|
|
1619
|
+
for (let i = 0;i < length; i += 1) {
|
|
1506
1620
|
if (i > 0)
|
|
1507
1621
|
str += ",";
|
|
1508
|
-
if (
|
|
1622
|
+
if (ops.hasOwn(thing, i)) {
|
|
1509
1623
|
keys.push(`[${i}]`);
|
|
1510
|
-
str += flatten(thing
|
|
1624
|
+
str += flatten(ops.get(thing, i));
|
|
1511
1625
|
keys.pop();
|
|
1512
1626
|
} else if (mostly_dense) {
|
|
1513
1627
|
str += HOLE;
|
|
1514
1628
|
} else {
|
|
1515
|
-
const populated_keys =
|
|
1629
|
+
const populated_keys = ops.indicesOf(thing);
|
|
1516
1630
|
const population = populated_keys.length;
|
|
1517
|
-
const d = String(
|
|
1518
|
-
const hole_cost = (
|
|
1631
|
+
const d = String(length).length;
|
|
1632
|
+
const hole_cost = (length - population) * 3;
|
|
1519
1633
|
const sparse_cost = 4 + d + population * (d + 1);
|
|
1520
1634
|
if (hole_cost > sparse_cost) {
|
|
1521
|
-
str = "[" + SPARSE + "," +
|
|
1635
|
+
str = "[" + SPARSE + "," + length;
|
|
1522
1636
|
for (let j = 0;j < populated_keys.length; j++) {
|
|
1523
1637
|
const key = populated_keys[j];
|
|
1524
1638
|
keys.push(`[${key}]`);
|
|
1525
|
-
str += "," + key + "," + flatten(thing
|
|
1639
|
+
str += "," + key + "," + flatten(ops.get(thing, key));
|
|
1526
1640
|
keys.pop();
|
|
1527
1641
|
}
|
|
1528
1642
|
break;
|
|
@@ -1537,15 +1651,17 @@ function run(async, value, reducers) {
|
|
|
1537
1651
|
}
|
|
1538
1652
|
case "Set":
|
|
1539
1653
|
str = '["Set"';
|
|
1540
|
-
for (const value2 of thing) {
|
|
1654
|
+
for (const value2 of ops.valuesOf(thing)) {
|
|
1541
1655
|
str += `,${flatten(value2)}`;
|
|
1542
1656
|
}
|
|
1543
1657
|
str += "]";
|
|
1544
1658
|
break;
|
|
1545
1659
|
case "Map":
|
|
1546
1660
|
str = '["Map"';
|
|
1547
|
-
for (const [key, value2] of thing) {
|
|
1548
|
-
|
|
1661
|
+
for (const [key, value2] of ops.entriesOf(thing)) {
|
|
1662
|
+
const key_type = ops.typeOf(key);
|
|
1663
|
+
const key_is_primitive = key_type !== "object" && key_type !== "function" && key_type !== "symbol";
|
|
1664
|
+
keys.push(`.get(${key_is_primitive ? stringify_primitive(ops.toPrimitive(key)) : "..."})`);
|
|
1549
1665
|
str += `,${flatten(key)},${flatten(value2)}`;
|
|
1550
1666
|
keys.pop();
|
|
1551
1667
|
}
|
|
@@ -1563,26 +1679,25 @@ function run(async, value, reducers) {
|
|
|
1563
1679
|
case "Float64Array":
|
|
1564
1680
|
case "BigInt64Array":
|
|
1565
1681
|
case "BigUint64Array": {
|
|
1566
|
-
const
|
|
1567
|
-
str = '["' +
|
|
1568
|
-
if (
|
|
1569
|
-
str += `,${
|
|
1682
|
+
const info = ops.viewInfo(thing);
|
|
1683
|
+
str = '["' + tag + '",' + flatten(info.buffer);
|
|
1684
|
+
if (info.byteLength !== info.bufferByteLength) {
|
|
1685
|
+
str += `,${info.byteOffset},${info.length}`;
|
|
1570
1686
|
}
|
|
1571
1687
|
str += "]";
|
|
1572
1688
|
break;
|
|
1573
1689
|
}
|
|
1574
1690
|
case "DataView": {
|
|
1575
|
-
const
|
|
1576
|
-
str = '["' +
|
|
1577
|
-
if (
|
|
1578
|
-
str += `,${
|
|
1691
|
+
const info = ops.viewInfo(thing);
|
|
1692
|
+
str = '["' + tag + '",' + flatten(info.buffer);
|
|
1693
|
+
if (info.byteLength !== info.bufferByteLength) {
|
|
1694
|
+
str += `,${info.byteOffset},${info.byteLength}`;
|
|
1579
1695
|
}
|
|
1580
1696
|
str += "]";
|
|
1581
1697
|
break;
|
|
1582
1698
|
}
|
|
1583
1699
|
case "ArrayBuffer": {
|
|
1584
|
-
const
|
|
1585
|
-
const base64 = encode64(arraybuffer);
|
|
1700
|
+
const base64 = encode64(ops.toArrayBuffer(thing));
|
|
1586
1701
|
str = `["ArrayBuffer","${base64}"]`;
|
|
1587
1702
|
break;
|
|
1588
1703
|
}
|
|
@@ -1594,30 +1709,31 @@ function run(async, value, reducers) {
|
|
|
1594
1709
|
case "Temporal.PlainMonthDay":
|
|
1595
1710
|
case "Temporal.PlainYearMonth":
|
|
1596
1711
|
case "Temporal.ZonedDateTime":
|
|
1597
|
-
str = `["${
|
|
1712
|
+
str = `["${tag}",${stringify_string(ops.toStringValue(thing))}]`;
|
|
1598
1713
|
break;
|
|
1599
|
-
default:
|
|
1600
|
-
|
|
1714
|
+
default: {
|
|
1715
|
+
const shape = ops.shapeOf(thing);
|
|
1716
|
+
if (shape.kind === "not-plain") {
|
|
1601
1717
|
throw new DevalueError(`Cannot stringify arbitrary non-POJOs`, keys, thing, value);
|
|
1602
1718
|
}
|
|
1603
|
-
if (
|
|
1719
|
+
if (shape.kind === "symbol-keys") {
|
|
1604
1720
|
throw new DevalueError(`Cannot stringify POJOs with symbolic keys`, keys, thing, value);
|
|
1605
1721
|
}
|
|
1606
|
-
if (
|
|
1722
|
+
if (shape.kind === "null-proto") {
|
|
1607
1723
|
str = '["null"';
|
|
1608
|
-
for (const key of
|
|
1724
|
+
for (const key of shape.keys) {
|
|
1609
1725
|
if (key === "__proto__") {
|
|
1610
1726
|
throw new DevalueError(`Cannot stringify objects with __proto__ keys`, keys, thing, value);
|
|
1611
1727
|
}
|
|
1612
1728
|
keys.push(stringify_key(key));
|
|
1613
|
-
str += `,${stringify_string(key)},${flatten(thing
|
|
1729
|
+
str += `,${stringify_string(key)},${flatten(ops.get(thing, key))}`;
|
|
1614
1730
|
keys.pop();
|
|
1615
1731
|
}
|
|
1616
1732
|
str += "]";
|
|
1617
1733
|
} else {
|
|
1618
1734
|
str = "{";
|
|
1619
1735
|
let started = false;
|
|
1620
|
-
for (const key of
|
|
1736
|
+
for (const key of shape.keys) {
|
|
1621
1737
|
if (key === "__proto__") {
|
|
1622
1738
|
throw new DevalueError(`Cannot stringify objects with __proto__ keys`, keys, thing, value);
|
|
1623
1739
|
}
|
|
@@ -1625,11 +1741,12 @@ function run(async, value, reducers) {
|
|
|
1625
1741
|
str += ",";
|
|
1626
1742
|
started = true;
|
|
1627
1743
|
keys.push(stringify_key(key));
|
|
1628
|
-
str += `${stringify_string(key)}:${flatten(thing
|
|
1744
|
+
str += `${stringify_string(key)}:${flatten(ops.get(thing, key))}`;
|
|
1629
1745
|
keys.pop();
|
|
1630
1746
|
}
|
|
1631
1747
|
str += "}";
|
|
1632
1748
|
}
|
|
1749
|
+
}
|
|
1633
1750
|
}
|
|
1634
1751
|
}
|
|
1635
1752
|
stringified[index2] = str;
|