Skip to content

Commit

Permalink
Add deepmerge (#2000)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarlakxen authored and gantoine committed Mar 27, 2018
1 parent 0215e23 commit e6922b8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
12 changes: 12 additions & 0 deletions definitions/npm/deepmerge_v2.1.x/flow_v0.57.3-/deepmerge_v2.1.x.js
@@ -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
};

}
8 changes: 8 additions & 0 deletions definitions/npm/deepmerge_v2.1.x/test_deepmerge_v2.1.x.js
@@ -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: '' })

0 comments on commit e6922b8

Please sign in to comment.