@sz-sw-le0/flag-function-generator

1.0.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i @sz-sw-le0/flag-function-generator

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

2.24 kB

Total Files

4

Last publish

Collaborators

  • sz-coder