Anonymous View
Skip to content

bendrucker/assert-function

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

assert-function Build Status Greenkeeper badge

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

About

Assert that a value is a function

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors