rambda
Version:
Lightweight faster alternative to Ramda
17 lines (15 loc) • 445 B
text/typescript
import {At} from './At'
import {Replace} from '../Union/Replace'
import {x} from '../Any/x'
import {Exclude} from '../Union/Exclude'
/** Modify **`O`** with **`OMod`** & the **`x`** placeholder
* @param O to copy from
* @param OMod to copy to
* @returns **`object`**
* @example
* ```ts
* ```
*/
export type Modify<O extends object, OMod extends object> = {
[K in keyof OMod]: Replace<OMod[K], x, Exclude<At<O, K>, undefined>>
} & {}