({ find, create, update }: UpsertOptions<T>)
| 7 | } |
| 8 | |
| 9 | export async function upsert<T>({ find, create, update }: UpsertOptions<T>) { |
| 10 | const existing = await find(); |
| 11 | if (!existing) return create(); |
| 12 | return update(existing); |
| 13 | } |
| 14 | |
| 15 | export async function upsertMany<T, F, Data>(calls: { |
| 16 | input: Data[]; |
no outgoing calls
no test coverage detected