zod 4.1.7 → 4.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zod",
3
- "version": "4.1.7",
3
+ "version": "4.1.9",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Colin McDonnell <zod@colinhacks.com>",
@@ -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: Map<Schema, $replace<Meta, Schema>> = new 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 Map();
49
+ this._map = new WeakMap();
50
50
  this._idmap = new Map();
51
51
  return this;
52
52
  }
@@ -1,5 +1,5 @@
1
1
  export const version = {
2
2
  major: 4,
3
3
  minor: 1,
4
- patch: 7 as number,
4
+ patch: 9 as number,
5
5
  } as const;
@@ -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 Map();
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 Map();
24
+ this._map = new WeakMap();
25
25
  this._idmap = new Map();
26
26
  return this;
27
27
  }
@@ -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: Map<Schema, $replace<Meta, Schema>>;
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;
@@ -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: Map<Schema, $replace<Meta, Schema>>;
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;
@@ -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 Map();
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 Map();
20
+ this._map = new WeakMap();
21
21
  this._idmap = new Map();
22
22
  return this;
23
23
  }
@@ -4,5 +4,5 @@ exports.version = void 0;
4
4
  exports.version = {
5
5
  major: 4,
6
6
  minor: 1,
7
- patch: 7,
7
+ patch: 9,
8
8
  };
@@ -1,5 +1,5 @@
1
1
  export const version = {
2
2
  major: 4,
3
3
  minor: 1,
4
- patch: 7,
4
+ patch: 9,
5
5
  };