Merge remote-tracking branch 'upstream/main'

This commit is contained in:
Hk-Gosuto
2023-08-28 19:53:05 +08:00
35 changed files with 1363 additions and 106 deletions

View File

@@ -1,6 +1,12 @@
export function merge(target: any, source: any) {
Object.keys(source).forEach(function (key) {
if (source[key] && typeof source[key] === "object") {
if (
(source.hasOwnProperty(key) && // Check if the property is not inherited
source[key] &&
typeof source[key] === "object") ||
key === "__proto__" ||
key === "constructor"
) {
merge((target[key] = target[key] || {}), source[key]);
return;
}