mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-26 17:01:20 -08:00
return play() result
This commit is contained in:
1 parent
3f21ce9223
commit
2c83ea4760
10 files changed
+52
-18
No files matched your search
@@ -7,20 +7,24 @@ export function has(obj, name) {
|
||||
return hasOwnProperty.call(obj, name);
|
||||
}
|
||||
|
||||
export function get(obj, name) {
|
||||
return Object.getOwnPropertyDescriptor(obj, name);
|
||||
}
|
||||
|
||||
export function proxyPropertys(target, ...sources) {
|
||||
return sources.reduce((result, source) => {
|
||||
Object.getOwnPropertyNames(source).forEach(key => {
|
||||
Object.getOwnPropertyNames(source).forEach((key) => {
|
||||
errorHandle(!has(result, key), `Target attribute name is duplicated: ${key}`);
|
||||
def(result, key, Object.getOwnPropertyDescriptor(source, key));
|
||||
def(result, key, get(source, key));
|
||||
});
|
||||
return result;
|
||||
}, target);
|
||||
}
|
||||
|
||||
export function mergeDeep(...objects) {
|
||||
const isObject = item => item && typeof item === 'object' && !Array.isArray(item);
|
||||
const isObject = (item) => item && typeof item === 'object' && !Array.isArray(item);
|
||||
return objects.reduce((prev, obj) => {
|
||||
Object.keys(obj).forEach(key => {
|
||||
Object.keys(obj).forEach((key) => {
|
||||
const pVal = prev[key];
|
||||
const oVal = obj[key];
|
||||
if (Array.isArray(pVal) && Array.isArray(oVal)) {
|
||||
|
||||
Reference in new issue
Block a user