This repository has been archived by the owner on Jul 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
disable some tests we don't want to comply to
- Loading branch information
Showing
6 changed files
with
69 additions
and
35 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
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,45 @@ | ||
'use strict'; | ||
|
||
|
||
function clone(value) { | ||
if (typeof value === 'object' && value !== null) { | ||
return merge(Array.isArray(value) ? [] : {}, value); | ||
} | ||
return value; | ||
} | ||
|
||
// NOTE: this behaves like lodash/merge, but does mutate functions if they are a source | ||
function merge() { | ||
var sources = Array.prototype.slice.call(arguments); | ||
var target = sources.shift(); | ||
|
||
return sources.reduce(function(acc, source) { | ||
if (acc === source) { | ||
return acc; | ||
} | ||
|
||
if (source === undefined) { | ||
return acc; | ||
} | ||
|
||
if (acc === undefined) { | ||
return clone(source); | ||
} | ||
|
||
if (typeof acc !== 'object' && typeof acc !== 'function') { | ||
return clone(source); | ||
} | ||
|
||
if (typeof source !== 'object' && typeof source !== 'function') { | ||
return acc; | ||
} | ||
|
||
Object.keys(source).forEach(function(key) { | ||
acc[key] = merge(acc[key], source[key]); | ||
}); | ||
|
||
return acc; | ||
}, target); | ||
} | ||
|
||
module.exports = merge; |
This file was deleted.
Oops, something went wrong.
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