Files
klz-cables.com/.pnpm-store/v10/files/89/a46c30795d50880602504b61678a340695e3ee2832f065a239b5fae5fba716f07215e415e3b805e10165539e44b8e0334c41a77b78529c72bb0b1bb4d01ca7
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

43 lines
1.5 KiB
Plaintext

import deepMerge from 'deepmerge';
import { isPlainObject } from './isPlainObject.js';
export { deepMerge };
/**
* Fully-featured deepMerge.
*
* Array handling: Arrays in the target object are combined with the source object's arrays.
*/ export function deepMergeWithCombinedArrays(obj1, obj2, options = {}) {
return deepMerge(obj1, obj2, {
arrayMerge: (target, source, options)=>{
const destination = target.slice();
source.forEach((item, index)=>{
if (typeof destination[index] === 'undefined') {
destination[index] = options?.cloneUnlessOtherwiseSpecified(item, options);
} else if (options?.isMergeableObject(item)) {
destination[index] = deepMerge(target[index], item, options);
} else if (target.indexOf(item) === -1) {
destination.push(item);
}
});
return destination;
},
...options
});
}
/**
* Fully-featured deepMerge.
*
* Array handling: Arrays in the target object are replaced by the source object's arrays.
*/ export function deepMergeWithSourceArrays(obj1, obj2) {
return deepMerge(obj1, obj2, {
arrayMerge: (_, source)=>source
});
}
/**
* Fully-featured deepMerge. Does not clone React components by default.
*/ export function deepMergeWithReactComponents(obj1, obj2) {
return deepMerge(obj1, obj2, {
isMergeableObject: isPlainObject
});
}
//# sourceMappingURL=deepMerge.js.map