@tangle-network/agent-interface 5.10.0 → 5.10.1
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.
|
@@ -52,7 +52,13 @@ export function ownPropertyRecordSchema(valueSchema, { maxEntries = CONTRACT_MAX
|
|
|
52
52
|
return encoded;
|
|
53
53
|
}, z.record(z
|
|
54
54
|
.string()
|
|
55
|
-
.regex(/^u(?:[0-9a-f]{4})*$/, "record keys must contain valid Unicode"), valueSchema).
|
|
55
|
+
.regex(/^u(?:[0-9a-f]{4})*$/, "record keys must contain valid Unicode"), valueSchema).superRefine((_record, context) => {
|
|
56
|
+
for (const issue of context.issues) {
|
|
57
|
+
const key = issue.path?.[0];
|
|
58
|
+
if (typeof key === "string" && /^[ui](?:[0-9a-f]{4})*$/.test(key))
|
|
59
|
+
issue.path[0] = decodeRecordKey(key);
|
|
60
|
+
}
|
|
61
|
+
}, { when: () => true }).transform((record) => {
|
|
56
62
|
const restored = {};
|
|
57
63
|
for (const [encodedKey, value] of Object.entries(record)) {
|
|
58
64
|
Object.defineProperty(restored, decodeRecordKey(encodedKey), {
|