zod 4.1.7 → 4.1.8
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/package.json +1 -1
- package/src/v4/core/registries.ts +2 -2
- package/src/v4/core/versions.ts +1 -1
- package/v4/core/registries.cjs +2 -2
- package/v4/core/registries.d.cts +1 -1
- package/v4/core/registries.d.ts +1 -1
- package/v4/core/registries.js +2 -2
- package/v4/core/versions.cjs +1 -1
- package/v4/core/versions.js +1 -1
package/package.json
CHANGED
|
@@ -27,7 +27,7 @@ type MetadataType = object | undefined;
|
|
|
27
27
|
export class $ZodRegistry<Meta extends MetadataType = MetadataType, Schema extends $ZodType = $ZodType> {
|
|
28
28
|
_meta!: Meta;
|
|
29
29
|
_schema!: Schema;
|
|
30
|
-
_map:
|
|
30
|
+
_map: WeakMap<Schema, $replace<Meta, Schema>> = new WeakMap();
|
|
31
31
|
_idmap: Map<string, Schema> = new Map();
|
|
32
32
|
|
|
33
33
|
add<S extends Schema>(
|
|
@@ -46,7 +46,7 @@ export class $ZodRegistry<Meta extends MetadataType = MetadataType, Schema exten
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
clear(): this {
|
|
49
|
-
this._map = new
|
|
49
|
+
this._map = new WeakMap();
|
|
50
50
|
this._idmap = new Map();
|
|
51
51
|
return this;
|
|
52
52
|
}
|
package/src/v4/core/versions.ts
CHANGED
package/v4/core/registries.cjs
CHANGED
|
@@ -6,7 +6,7 @@ exports.$output = Symbol("ZodOutput");
|
|
|
6
6
|
exports.$input = Symbol("ZodInput");
|
|
7
7
|
class $ZodRegistry {
|
|
8
8
|
constructor() {
|
|
9
|
-
this._map = new
|
|
9
|
+
this._map = new WeakMap();
|
|
10
10
|
this._idmap = new Map();
|
|
11
11
|
}
|
|
12
12
|
add(schema, ..._meta) {
|
|
@@ -21,7 +21,7 @@ class $ZodRegistry {
|
|
|
21
21
|
return this;
|
|
22
22
|
}
|
|
23
23
|
clear() {
|
|
24
|
-
this._map = new
|
|
24
|
+
this._map = new WeakMap();
|
|
25
25
|
this._idmap = new Map();
|
|
26
26
|
return this;
|
|
27
27
|
}
|
package/v4/core/registries.d.cts
CHANGED
|
@@ -13,7 +13,7 @@ type MetadataType = object | undefined;
|
|
|
13
13
|
export declare class $ZodRegistry<Meta extends MetadataType = MetadataType, Schema extends $ZodType = $ZodType> {
|
|
14
14
|
_meta: Meta;
|
|
15
15
|
_schema: Schema;
|
|
16
|
-
_map:
|
|
16
|
+
_map: WeakMap<Schema, $replace<Meta, Schema>>;
|
|
17
17
|
_idmap: Map<string, Schema>;
|
|
18
18
|
add<S extends Schema>(schema: S, ..._meta: undefined extends Meta ? [$replace<Meta, S>?] : [$replace<Meta, S>]): this;
|
|
19
19
|
clear(): this;
|
package/v4/core/registries.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ type MetadataType = object | undefined;
|
|
|
13
13
|
export declare class $ZodRegistry<Meta extends MetadataType = MetadataType, Schema extends $ZodType = $ZodType> {
|
|
14
14
|
_meta: Meta;
|
|
15
15
|
_schema: Schema;
|
|
16
|
-
_map:
|
|
16
|
+
_map: WeakMap<Schema, $replace<Meta, Schema>>;
|
|
17
17
|
_idmap: Map<string, Schema>;
|
|
18
18
|
add<S extends Schema>(schema: S, ..._meta: undefined extends Meta ? [$replace<Meta, S>?] : [$replace<Meta, S>]): this;
|
|
19
19
|
clear(): this;
|
package/v4/core/registries.js
CHANGED
|
@@ -2,7 +2,7 @@ export const $output = Symbol("ZodOutput");
|
|
|
2
2
|
export const $input = Symbol("ZodInput");
|
|
3
3
|
export class $ZodRegistry {
|
|
4
4
|
constructor() {
|
|
5
|
-
this._map = new
|
|
5
|
+
this._map = new WeakMap();
|
|
6
6
|
this._idmap = new Map();
|
|
7
7
|
}
|
|
8
8
|
add(schema, ..._meta) {
|
|
@@ -17,7 +17,7 @@ export class $ZodRegistry {
|
|
|
17
17
|
return this;
|
|
18
18
|
}
|
|
19
19
|
clear() {
|
|
20
|
-
this._map = new
|
|
20
|
+
this._map = new WeakMap();
|
|
21
21
|
this._idmap = new Map();
|
|
22
22
|
return this;
|
|
23
23
|
}
|
package/v4/core/versions.cjs
CHANGED
package/v4/core/versions.js
CHANGED