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AAC,CAAA;SAClB;KACF;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AAPD,gCAOC","sourcesContent":["function isObject(x: any) {\n if (Array.isArray(x)) {\n return false\n }\n\n const type = typeof x\n return type === \"object\" || type === \"function\"\n}\n\nfunction assignKey(target: any, from: any, key: string) {\n const value = from[key]\n // https://github.com/electron-userland/electron-builder/pull/562\n if (value === undefined) {\n return\n }\n\n const prevValue = target[key]\n if (prevValue == null || value == null || !isObject(prevValue) || !isObject(value)) {\n target[key] = value\n }\n else {\n target[key] = assign(prevValue, value)\n }\n}\n\nfunction assign(to: any, from: any) {\n if (to !== from) {\n for (const key of Object.getOwnPropertyNames(from)) {\n assignKey(to, from, key)\n }\n }\n return to\n}\n\nexport function deepAssign(target: T, ...objects: Array): T {\n for (const o of objects) {\n if (o != null) {\n assign(target, o)\n }\n }\n return target\n}"]}