Minor Adjustments

This commit is contained in:
Dunemask 2023-03-19 13:53:37 -04:00
parent 1084f5d937
commit f486d50efa
60 changed files with 1965 additions and 127 deletions

View 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;
}