(
{ _etag, ...e }: E
)
| 10 | } |
| 11 | |
| 12 | export const makeETag = <E extends PersistenceModelType<{}>>( |
| 13 | { _etag, ...e }: E |
| 14 | ): E => |
| 15 | ({ |
| 16 | ...e, |
| 17 | // we have to hash the JSON, as hashing the object might contain elements that won't be serialized anyway |
| 18 | _etag: crypto.createHash("sha256").update(JSON.stringify(e)).digest("hex") |
| 19 | }) as any |
| 20 | |
| 21 | export const makeUpdateETag = (type: string) => |
| 22 | Effect.fnUntraced(function*<IdKey extends keyof E, E extends PersistenceModelType<{}>>( |
searching dependent graphs…