frontend/.pnpm-store/v3/files/0b/4ea3287ff036e0b37d3ccf2b83ec36454641d002f3ee0c9194ce607c46677687d0d30ab494947cef4e6422384e53d8d1f369d90d8a1733ca093c8870c1ae80

26 lines
531 B
Plaintext

import {Except} from './except';
import {Simplify} from './simplify';
type Merge_<FirstType, SecondType> = Except<FirstType, Extract<keyof FirstType, keyof SecondType>> & SecondType;
/**
Merge two types into a new type. Keys of the second type overrides keys of the first type.
@example
```
import {Merge} from 'type-fest';
type Foo = {
a: number;
b: string;
};
type Bar = {
b: number;
};
const ab: Merge<Foo, Bar> = {a: 1, b: 2};
```
*/
export type Merge<FirstType, SecondType> = Simplify<Merge_<FirstType, SecondType>>;