(schema: S)
| 58 | } |
| 59 | |
| 60 | get<S extends Schema>(schema: S): $replace<Meta, S> | undefined { |
| 61 | // return this._map.get(schema) as any; |
| 62 | |
| 63 | // inherit metadata |
| 64 | const p = schema._zod.parent as Schema; |
| 65 | if (p) { |
| 66 | const pm: any = { ...(this.get(p) ?? {}) }; |
| 67 | delete pm.id; // do not inherit id |
| 68 | const f = { ...pm, ...this._map.get(schema) } as any; |
| 69 | return Object.keys(f).length ? f : undefined; |
| 70 | } |
| 71 | return this._map.get(schema) as any; |
| 72 | } |
| 73 | |
| 74 | has(schema: Schema): boolean { |
| 75 | return this._map.has(schema); |
no outgoing calls