mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-15 17:16:16 -08:00
Update index.js
This commit is contained in:
1 parent
743a812860
commit
6b716c622c
1 file changed
+5
-5
@@ -179,11 +179,11 @@ export function downloadFile(url, name) {
|
||||
}
|
||||
|
||||
export function proxyPropertys(target, ...sources) {
|
||||
sources.forEach(source => {
|
||||
return sources.reduce((result, source) => {
|
||||
Object.getOwnPropertyNames(source).forEach(key => {
|
||||
if (!hasOwnProperty(target, key)) {
|
||||
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
||||
}
|
||||
errorHandle(!hasOwnProperty(result, key), `Target attribute name is duplicated: ${key}`);
|
||||
Object.defineProperty(result, key, Object.getOwnPropertyDescriptor(source, key));
|
||||
});
|
||||
});
|
||||
return result;
|
||||
}, target);
|
||||
}
|
||||
Reference in new issue
Block a user