Files
lan-manager/web/node_modules/@antv/util/esm/set.js
openclaw 0a5f6a8047 Initial commit: Lan-manager project code
- Go backend (server/)
- Frontend (web/, server/static/)
- Database and deployment files
- Scripts and docs

Co-Authored-By: 狸花猫/Claude-Qwen3.6-Plus 🐾
2026-04-20 00:52:58 +08:00

27 lines
708 B
JavaScript

import isObject from './is-object';
import isString from './is-string';
import isNumber from './is-number';
/**
* https://github.com/developit/dlv/blob/master/index.js
* @param obj
* @param path
* @param value
*/
export default (function (obj, path, value) {
var o = obj;
var keyArr = isString(path) ? path.split('.') : path;
keyArr.forEach(function (key, idx) {
// 不是最后一个
if (idx < keyArr.length - 1) {
if (!isObject(o[key])) {
o[key] = isNumber(keyArr[idx + 1]) ? [] : {};
}
o = o[key];
}
else {
o[key] = value;
}
});
return obj;
});
//# sourceMappingURL=set.js.map