rambda
Version:
Lightweight faster alternative to Ramda
15 lines (14 loc) • 376 B
text/typescript
/** Update the fields of **`O`** with the ones of **`O1`**
* (only the existing fields will be updated)
* @param O to update
* @param O1 to update with
* @returns **`object`**
* @example
* ```ts
* ```
*/
export type Overwrite<O extends object, O1 extends object> = {
[K in keyof O]: K extends keyof O1
? O1[K]
: O[K]
} & {}