Minor Adjustments
This commit is contained in:
parent
1084f5d937
commit
f486d50efa
60 changed files with 1965 additions and 127 deletions
17
libold/common/executor/executor-configurator.js
Normal file
17
libold/common/executor/executor-configurator.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
const funcify = (v) => () => v;
|
||||
|
||||
export function verify(config) {
|
||||
for (var k in config) {
|
||||
if (typeof config[k] !== "function")
|
||||
throw Error("All config options must be functions!");
|
||||
}
|
||||
}
|
||||
|
||||
export function normalize(conf) {
|
||||
const config = { ...conf };
|
||||
for (var k in config) {
|
||||
if (typeof config[k] === "function") continue;
|
||||
config[k] = funcify(config[k]);
|
||||
}
|
||||
return config;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue