( fields: Struct.Fields, out: Record<PropertyKey, unknown> )
| 2846 | } |
| 2847 | |
| 2848 | const lazilyMergeDefaults = ( |
| 2849 | fields: Struct.Fields, |
| 2850 | out: Record<PropertyKey, unknown> |
| 2851 | ): { [x: string | symbol]: unknown } => { |
| 2852 | const ownKeys = Reflect.ownKeys(fields) |
| 2853 | for (const key of ownKeys) { |
| 2854 | const field = fields[key] |
| 2855 | if (out[key] === undefined && isPropertySignature(field)) { |
| 2856 | const ast = field.ast |
| 2857 | const defaultValue = ast._tag === "PropertySignatureDeclaration" ? ast.defaultValue : ast.to.defaultValue |
| 2858 | if (defaultValue !== undefined) { |
| 2859 | out[key] = defaultValue() |
| 2860 | } |
| 2861 | } |
| 2862 | } |
| 2863 | return out |
| 2864 | } |
| 2865 | |
| 2866 | function makeTypeLiteralClass<Fields extends Struct.Fields, const Records extends IndexSignature.Records>( |
| 2867 | fields: Fields, |
no test coverage detected