es-toolkit
Version:
A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.
19 lines (14 loc) • 452 B
JavaScript
;
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const updateWith = require('./updateWith.js');
function setWith(obj, path, value, customizer) {
let customizerFn;
if (typeof customizer === 'function') {
customizerFn = customizer;
}
else {
customizerFn = () => undefined;
}
return updateWith.updateWith(obj, path, () => value, customizerFn);
}
exports.setWith = setWith;