forked from XiaoMo/ChatGPT-Next-Web
10 lines
275 B
TypeScript
10 lines
275 B
TypeScript
export function merge(target: any, source: any) {
|
|
Object.keys(source).forEach(function (key) {
|
|
if (source[key] && typeof source[key] === "object") {
|
|
merge((target[key] = target[key] || {}), source[key]);
|
|
return;
|
|
}
|
|
target[key] = source[key];
|
|
});
|
|
}
|