@sz-sw-le0/flag-function-generator
v1.0.0
Published
Creates a new function that accepts flags / modifiers.
Downloads
8
Readme
flag-function-generator
Creates a new function that accepts flags / modifiers.
Example usage:
const flagFunctionGenerator = require("flag-function-generator")
const realFunction = function(modifiers, ...args) {
// modifiers is an array
}
const doSomething = flagFunctionGenerator(realFunction, ["flag1", "flag2"])
// calls realFunction with flag1 and flag2 set
doSomething.flag1.flag2("something")