avancement planning

This commit is contained in:
2026-05-26 11:58:39 +02:00
parent 619a2b240a
commit 150b97cd2e
4892 changed files with 99214 additions and 429382 deletions
+7 -4
View File
@@ -1,8 +1,9 @@
var _a;
export const $output = Symbol("ZodOutput");
export const $input = Symbol("ZodInput");
export class $ZodRegistry {
constructor() {
this._map = new Map();
this._map = new WeakMap();
this._idmap = new Map();
}
add(schema, ..._meta) {
@@ -17,7 +18,7 @@ export class $ZodRegistry {
return this;
}
clear() {
this._map = new Map();
this._map = new WeakMap();
this._idmap = new Map();
return this;
}
@@ -36,7 +37,8 @@ export class $ZodRegistry {
if (p) {
const pm = { ...(this.get(p) ?? {}) };
delete pm.id; // do not inherit id
return { ...pm, ...this._map.get(schema) };
const f = { ...pm, ...this._map.get(schema) };
return Object.keys(f).length ? f : undefined;
}
return this._map.get(schema);
}
@@ -48,4 +50,5 @@ export class $ZodRegistry {
export function registry() {
return new $ZodRegistry();
}
export const globalRegistry = /*@__PURE__*/ registry();
(_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
export const globalRegistry = globalThis.__zod_globalRegistry;