17 lines
401 B
JavaScript
17 lines
401 B
JavaScript
import _global from "../polyfill/_global";
|
|
|
|
|
|
export function execFunc(target, func, ...options) {
|
|
if (target) {
|
|
let funcs = func.split('.');
|
|
let instant = target;
|
|
while (funcs.length > 1) {
|
|
instant = instant[funcs.shift()];
|
|
}
|
|
if (instant && funcs.length == 1) {
|
|
if (instant.hasOwnProperty(funcs[0])) {
|
|
return instant[funcs[0]](...options);
|
|
}
|
|
}
|
|
}
|
|
} |