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")