es-toolkit
Version:
A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.
15 lines (12 loc) • 345 B
JavaScript
import { updateWith } from './updateWith.mjs';
function setWith(obj, path, value, customizer) {
let customizerFn;
if (typeof customizer === 'function') {
customizerFn = customizer;
}
else {
customizerFn = () => undefined;
}
return updateWith(obj, path, () => value, customizerFn);
}
export { setWith };