assert-function

1.0.0 • Public • Published

assert-function Build Status

Assert that a value is a function

Install

$ npm install --save assert-function

Usage

var assertFunction = require('assert-function')
 
assertFunction(function () {})
//=> noop
 
assertFunction('foo')
// => TypeError: Expected function, got: foo

API

assertFunction(value) -> undefined

value

Required
Type: any

A value to check. A TypeError is throw for non-function values.

License

MIT © Ben Drucker

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.0742latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.0742

Package Sidebar

Install

npm i assert-function

Weekly Downloads

742

Version

1.0.0

License

MIT

Last publish

Collaborators

  • bendrucker