Son CV dans un terminal web en Javascript!
https://terminal-cv.gregandev.fr
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
531 B
25 lines
531 B
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>>;
|
|
|