| 1836 | > extends $ZodType<any, any, $ZodObjectInternals<Shape, Params>> {} |
| 1837 | |
| 1838 | function normalizeDef(def: $ZodObjectDef) { |
| 1839 | const keys = Object.keys(def.shape); |
| 1840 | for (const k of keys) { |
| 1841 | if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) { |
| 1842 | throw new Error(`Invalid element at key "${k}": expected a Zod schema`); |
| 1843 | } |
| 1844 | } |
| 1845 | const okeys = util.optionalKeys(def.shape); |
| 1846 | |
| 1847 | return { |
| 1848 | ...def, |
| 1849 | keys, |
| 1850 | keySet: new Set(keys), |
| 1851 | numKeys: keys.length, |
| 1852 | optionalKeys: new Set(okeys), |
| 1853 | }; |
| 1854 | } |
| 1855 | |
| 1856 | function handleCatchall( |
| 1857 | proms: Promise<any>[], |