npm.io
1.0.0 • Published 7 years ago

error-if-not-function

Licence
MIT
Version
1.0.0
Deps
0
Size
2 kB
Vulns
0
Weekly
0

errorIfNotFunction(arg): void

Triggers error if arg is not a function.

Example

errorIfNotFunction(false);
// Error: "Input must be function"

Installation

npm i error-if-not-function

Loading

// if using TypeScript:
import { errorIfNotFunction } from 'error-if-not-function';
// if using ES5 JavaScript:
var errorIfNotFunction = require('error-if-not-function').errorIfNotFunction;

Keywords