Home

Awesome

useware npmjs.com The MIT License

Accept Arguments object or multiple arguments that can be any value, including deeply nested arrays. Flatten the arguments/values then filter them to be only functions.
Useful for .use methods.

code climate standard code style travis build status coverage status dependency status

Install

npm i useware --save
npm test

Usage

For more use-cases see the tests

const useware = require('useware')

function fixtureArguments () {
  return useware(arguments)
}

function fixtureMultiple () {
  return useware.apply(this, arguments)
}

function fn1 () {}
function fn2 () {}
function fn3 () {}

fixtureArguments(fn1, [1, [2, 3, fn2]], {foo: 'bar'}, [fn3, [4, 5]])
//=> [fn1, fn2, fn3]

fixtureMultiple([1, fn1, [2, [fn3, [4, 5]], fn2]], fn1, [6, [fn3, 7, 'a']])
//=> [fn1, fn3, fn2, fn1, fn3]

Note that functions are not uniqueified

Related

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, please read the CONTRIBUTING.md guidelines.

Charlike Make Reagent new message to charlike freenode #charlike

tunnckocore.tk keybase tunnckocore tunnckoCore npm tunnckoCore twitter tunnckoCore github