Skip to content

Returns the first argument if it is a function (regular, async, generator, …), or your custom fallback value otherwise.

Notifications You must be signed in to change notification settings

mk-pmb/if-fun-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

if-fun

Returns the first argument if it is a function (regular, async, generator, …), or your custom fallback value otherwise.

API

This module exports one function:

ifFun(x[, no])

Return x if x seems to be some kind of function, otherwise return no. In case no is omitted, JavaScript rules makes it default to undefined.

Usage

See test/usage.js for examples.

Known issues

  • Needs more/better tests and docs.

 

License

ISC

About

Returns the first argument if it is a function (regular, async, generator, …), or your custom fallback value otherwise.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published