mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-22 05:11:20 -08:00
Refactor Artplayer class to add isGetter utility function
This commit is contained in:
1 parent
b6df6a6148
commit
3cece10f9e
7 files changed
+101
-71
No files matched your search
@@ -9,6 +9,11 @@ export function get(obj, name) {
|
||||
return Object.getOwnPropertyDescriptor(obj, name);
|
||||
}
|
||||
|
||||
export function isGetter(obj, prop) {
|
||||
const descriptor = Object.getOwnPropertyDescriptor(obj, prop);
|
||||
return descriptor !== undefined && typeof descriptor.get === 'function';
|
||||
}
|
||||
|
||||
export function mergeDeep(...objects) {
|
||||
const isObject = (item) => item && typeof item === 'object' && !Array.isArray(item);
|
||||
return objects.reduce((prev, obj) => {
|
||||
|
||||
Reference in new issue
Block a user