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'
- Host: GitHub
- URL: https://github.com/writetome51/error-if-not-function
- Owner: writetome51
- License: mit
- Created: 2019-04-08T19:14:29.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-08T19:14:45.000Z (almost 7 years ago)
- Last Synced: 2025-02-03T17:03:55.827Z (11 months ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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;
```