You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Fixed type check in .middleware() method
`if (typeof callback === 'object')` should be `if (typeof callback === 'function')`
See Issue #1214 for details
* middewareFactory accepts a function, not an object
According to [the docs for the `.middleware()` method](http://yargs.js.org/docs/#api-middlewarecallbacks):
> The `callbacks` parameter can be a function or a list of functions
See Issue #1214 for more details
* Added/Updated middleware tests
I added a new test to verify that the `.middleware()` method works when a single function is passed, rather than an array of functions.
Also enhanced an existing test to ensure that _all_ middleware is run before commands, regardless of whether it was added as an array of functions or a single function.
0 commit comments