-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
1 parent
966abc1
commit a1e24be
Showing
4 changed files
with
50 additions
and
11 deletions.
There are no files selected for viewing
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
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,13 @@ | ||
'use strict'; | ||
|
||
const deepmerge = require('deepmerge'); | ||
const arrayUnion = require('array-union'); | ||
|
||
const arrayMerge = (a, b) => arrayUnion(b, a); | ||
|
||
module.exports = (...args) => { | ||
return deepmerge.all(args, { | ||
arrayMerge, | ||
}); | ||
} | ||
|
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,29 @@ | ||
'use strict'; | ||
|
||
const test = require('supertape'); | ||
const merge = require('./merge'); | ||
|
||
test('merge', (t) => { | ||
const defaultConfig = { | ||
plugins: [ | ||
'remove-unused-variables', | ||
] | ||
}; | ||
|
||
const result = merge(defaultConfig, { | ||
plugins: [ | ||
'extract-sequence-expressions', | ||
] | ||
}); | ||
|
||
const expected = { | ||
plugins: [ | ||
'extract-sequence-expressions', | ||
'remove-unused-variables', | ||
] | ||
}; | ||
|
||
t.deepEqual(result, expected); | ||
t.end(); | ||
}); | ||
|
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