Sha256: de96c686f3c501ae65c1cc429bfcb85d7374907e497a3a962b1caee401b23089
Contents?: true
Size: 645 Bytes
Versions: 26
Compression:
Stored size: 645 Bytes
Contents
import { isObject } from './isObject.mjs'; function mergeRight(left, right) { return Object.entries(right).reduce( (result, [key, rightValue]) => { const leftValue = result[key]; if (Array.isArray(leftValue) && Array.isArray(rightValue)) { result[key] = leftValue.concat(rightValue); return result; } if (isObject(leftValue) && isObject(rightValue)) { result[key] = mergeRight(leftValue, rightValue); return result; } result[key] = rightValue; return result; }, Object.assign({}, left) ); } export { mergeRight }; //# sourceMappingURL=mergeRight.mjs.map
Version data entries
26 entries across 26 versions & 1 rubygems