mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-28 18:23:35 +00:00
refactor(cloudcmd) forEach -> for-of
This commit is contained in:
parent
f7e47d2167
commit
ee59fbf8d2
4 changed files with 22 additions and 30 deletions
|
|
@ -16,7 +16,6 @@ module.exports = {
|
|||
|
||||
'C - Create User Menu File': async ({DOM, CloudCmd, tryToCatch}) => {
|
||||
const {
|
||||
Dialog,
|
||||
RESTful,
|
||||
CurrentInfo,
|
||||
} = DOM;
|
||||
|
|
|
|||
|
|
@ -168,21 +168,22 @@ function initConfig(Config, options) {
|
|||
if (!options)
|
||||
return config;
|
||||
|
||||
Object.keys(options).forEach((name) => {
|
||||
const names = Object.keys(options);
|
||||
for (const name of names) {
|
||||
const isConfig = !!config[name];
|
||||
const item = options[name];
|
||||
const isFunc = itype.function(item);
|
||||
|
||||
if (!isFunc || !isConfig) {
|
||||
config[name] = options[name];
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
|
||||
const func = config[name];
|
||||
config[name] = () => {
|
||||
exec.series([func, item]);
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
return config;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue