An open API service indexing awesome lists of open source software.

https://github.com/writetome51/error-if-not-function

Function triggers error if argument is not type 'function'
https://github.com/writetome51/error-if-not-function

Last synced: 5 months ago
JSON representation

Function triggers error if argument is not type 'function'

Awesome Lists containing this project

README

          

# 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
```ts
// if using TypeScript:
import { errorIfNotFunction } from 'error-if-not-function';
// if using ES5 JavaScript:
var errorIfNotFunction = require('error-if-not-function').errorIfNotFunction;
```