LendAndRegret/node_modules/es-toolkit/dist/compat/object/setWith.js
2026-05-02 17:27:43 +08:00

19 lines
452 B
JavaScript

'use strict';
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;