mirror of
https://github.com/actions/labeler.git
synced 2025-12-19 00:26:47 +00:00
build
This commit is contained in:
19
node_modules/jest-snapshot/build/utils.js
generated
vendored
19
node_modules/jest-snapshot/build/utils.js
generated
vendored
@@ -253,6 +253,23 @@ const saveSnapshotFile = (snapshotData, snapshotPath) => {
|
||||
|
||||
exports.saveSnapshotFile = saveSnapshotFile;
|
||||
|
||||
const deepMergeArray = (target, source) => {
|
||||
const mergedOutput = Array.from(target);
|
||||
source.forEach((sourceElement, index) => {
|
||||
const targetElement = mergedOutput[index];
|
||||
|
||||
if (Array.isArray(target[index])) {
|
||||
mergedOutput[index] = deepMergeArray(target[index], sourceElement);
|
||||
} else if (isObject(targetElement)) {
|
||||
mergedOutput[index] = deepMerge(target[index], sourceElement);
|
||||
} else {
|
||||
// Source does not exist in target or target is primitive and cannot be deep merged
|
||||
mergedOutput[index] = sourceElement;
|
||||
}
|
||||
});
|
||||
return mergedOutput;
|
||||
};
|
||||
|
||||
const deepMerge = (target, source) => {
|
||||
const mergedOutput = _objectSpread({}, target);
|
||||
|
||||
@@ -264,6 +281,8 @@ const deepMerge = (target, source) => {
|
||||
[key]: source[key]
|
||||
});
|
||||
else mergedOutput[key] = deepMerge(target[key], source[key]);
|
||||
} else if (Array.isArray(source[key])) {
|
||||
mergedOutput[key] = deepMergeArray(target[key], source[key]);
|
||||
} else {
|
||||
Object.assign(mergedOutput, {
|
||||
[key]: source[key]
|
||||
|
||||
Reference in New Issue
Block a user