Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
23 lines
415 B
Plaintext
23 lines
415 B
Plaintext
import {Except} from './except';
|
|
|
|
/**
|
|
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> = Except<FirstType, Extract<keyof FirstType, keyof SecondType>> & SecondType;
|