1.0.0 • Published 3 years ago

@sz-sw-le0/flag-function-generator v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

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