If isFunction(callbackfn) is false, throw a TypeError exception.
npm install assert-is-function-x href="https://travis-ci.org/Xotic750/assert-is-function-x"
title="Travis status"> src="https://travis-ci.org/Xotic750/assert-is-function-x.svg?branch=master"
alt="Travis status" height="18">
href="https://david-dm.org/Xotic750/assert-is-function-x"
title="Dependency status"> alt="Dependency status" height="18"/>
href="https://david-dm.org/Xotic750/assert-is-function-x?type=dev"
title="devDependency status"> alt="devDependency status" height="18"/>
href="https://badge.fury.io/js/assert-is-function-x"
title="npm version"> alt="npm version" height="18">
href="https://www.jsdelivr.com/package/npm/assert-is-function-x"
title="jsDelivr hits"> alt="jsDelivr hits" height="18">
href="https://bettercodehub.com/results/Xotic750/assert-is-function-x"
title="bettercodehub score"> alt="bettercodehub score" height="18">
href="https://coveralls.io/github/Xotic750/assert-is-function-x?branch=master"
title="Coverage Status"> alt="Coverage Status" height="18">
If isFunction(callbackfn) is false, throw a TypeError exception.
Tests callback to see if it is a function, throws a TypeError if it is
not. Otherwise returns the callback.
Kind: Exported function
Returns: \* - Returns callback if it is function.
Throws:
- TypeError Throws if callback is not a function.
| Param | Type | Description |
| --------- | ------------------- | ----------------------------- |
| callback | \* | The argument to be tested. |
| [message] | string | Optional alternative message. |
Example
``js
import assertIsFunction from 'assert-is-function-x';
const primitive = true;
const mySymbol = Symbol('mySymbol');
const symObj = Object(mySymbol);
const object = {};
const fn = function fn() {};
assertIsFunction(primitive); // TypeError 'true is not a function'.
assertIsFunction(object); // TypeError '#