init commit
This commit is contained in:
17
src/services/env.js
Normal file
17
src/services/env.js
Normal file
@@ -0,0 +1,17 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user