mirror of
https://github.com/Sevichecc/Urara-Blog.git
synced 2025-05-02 16:59:30 +08:00
17 lines
361 B
Text
17 lines
361 B
Text
export function defaults(target, ...sources) {
|
|
for (let source of sources) {
|
|
for (let k in source) {
|
|
if (!target?.hasOwnProperty?.(k)) {
|
|
target[k] = source[k]
|
|
}
|
|
}
|
|
|
|
for (let k of Object.getOwnPropertySymbols(source)) {
|
|
if (!target?.hasOwnProperty?.(k)) {
|
|
target[k] = source[k]
|
|
}
|
|
}
|
|
}
|
|
|
|
return target
|
|
}
|