@commercetools/sync-actions
Version:
Build API update actions for the commercetools platform.
10 lines (9 loc) • 467 B
TypeScript
/**
* @function copyEmptyArrayProps
* @description Create new key with empty array value on `newobj` for the arrays exist on `oldObj` and doesnt exist on `newobj`
* One use case is to easily compare two object without generating this error `Cannot read property '0' of undefined`
* @param {Object} oldObj
* @param {Object} newObj
* @returns {Array} Ordered Array [oldObj, newObj]
*/
export default function copyEmptyArrayProps(oldObj?: {}, newObj?: {}): {}[];