| 68 | } |
| 69 | |
| 70 | function convertPartial< |
| 71 | InputType extends ShapeOf<OutputType> & Record<string, unknown>, |
| 72 | OutputType extends ShapeOf<InputType>, |
| 73 | >( |
| 74 | conversions: Conversions<InputType, OutputType>, |
| 75 | input: Partial<InputType>, |
| 76 | ): Partial<OutputType> { |
| 77 | const c = conversions as Record<string, Conversion<InputType, OutputType>> |
| 78 | |
| 79 | return Object.fromEntries( |
| 80 | Object.keys(input).map((k: string) => { |
| 81 | const value = input[k] |
| 82 | return [k, c[k]?.(value as any) ?? value] |
| 83 | }), |
| 84 | ) as OutputType |
| 85 | } |
| 86 | |
| 87 | export type TrailBaseSyncMode = SyncMode |
| 88 | |