MCPcopy Create free account
hub / github.com/microsoft/SandDance / cloneUnlessOtherwiseSpecified

Function cloneUnlessOtherwiseSpecified

docs/app/js/sanddance-app.js:6910–6912  ·  view source on GitHub ↗
(value, options)

Source from the content-addressed store, hash-verified

6908 return Array.isArray(val) ? [] : {};
6909}
6910function cloneUnlessOtherwiseSpecified(value, options) {
6911 return options.clone !== false && options.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options) : value;
6912}
6913function defaultArrayMerge(target, source, options) {
6914 return target.concat(source).map(function(element) {
6915 return cloneUnlessOtherwiseSpecified(element, options);

Callers 3

defaultArrayMergeFunction · 0.70
mergeObjectFunction · 0.70
deepmergeFunction · 0.70

Calls 2

deepmergeFunction · 0.70
emptyTargetFunction · 0.70

Tested by

no test coverage detected