Sha256: d41055c9b49f6a0bbc2ea53ccdea2514d41a3d2cd0317c4d0df664114cc103ec

Contents?: true

Size: 531 Bytes

Versions: 28

Compression:

Stored size: 531 Bytes

Contents

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>>;

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
clapton-0.0.26 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/merge.d.ts
clapton-0.0.25 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/merge.d.ts
clapton-0.0.24 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/merge.d.ts
clapton-0.0.23 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/merge.d.ts
clapton-0.0.22 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/merge.d.ts
clapton-0.0.21 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/merge.d.ts
clapton-0.0.20 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/merge.d.ts
clapton-0.0.19 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/merge.d.ts
clapton-0.0.18 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/merge.d.ts
clapton-0.0.17 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/merge.d.ts
clapton-0.0.16 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/merge.d.ts
clapton-0.0.15 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/merge.d.ts
clapton-0.0.14 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/merge.d.ts
clapton-0.0.13 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/merge.d.ts
clapton-0.0.12 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/merge.d.ts
clapton-0.0.11 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/merge.d.ts
clapton-0.0.10 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/merge.d.ts
clapton-0.0.9 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/merge.d.ts
clapton-0.0.8 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/merge.d.ts
clapton-0.0.7 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/merge.d.ts