Files
wdi-dashboard/node_modules/@chakra-ui/object-utils/dist/chunk-OLTBUDV5.mjs
2024-08-16 15:06:52 +05:30

24 lines
569 B
JavaScript

// src/assign-after.ts
function assignAfter(target, ...sources) {
if (target == null) {
throw new TypeError("Cannot convert undefined or null to object");
}
const result = { ...target };
for (const nextSource of sources) {
if (nextSource == null)
continue;
for (const nextKey in nextSource) {
if (!Object.prototype.hasOwnProperty.call(nextSource, nextKey))
continue;
if (nextKey in result)
delete result[nextKey];
result[nextKey] = nextSource[nextKey];
}
}
return result;
}
export {
assignAfter
};