mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-08 10:17:05 +08:00
feat: partial locale type
This commit is contained in:
9
app/utils/merge.ts
Normal file
9
app/utils/merge.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
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];
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user