Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
definitions/npm/deepmerge_v2.1.x/flow_v0.57.3-/deepmerge_v2.1.x.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
declare module 'deepmerge' { | ||
declare type Options = { | ||
clone?: boolean, | ||
arrayMerge?: (destination: any[], source: any[], options?: Options) => Array<any> | ||
} | ||
|
||
declare module.exports: { | ||
<A, B>(a: A, b: B, options?: Options): A & B, | ||
all<T>(objects: Array<$Shape<T>>, options?: Options): T | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const deepmerge = require("deepmerge"); | ||
|
||
const m1: { a: string, b: string } = deepmerge({a: ''}, { b: '' }) | ||
|
||
const m2: { a: string, b: string } = deepmerge.all([ {a: ''}, { b: '' } ]) | ||
|
||
// $ExpectError | ||
const m3: { a: number, b: string } = deepmerge({a: ''}, { b: '' }) |