tiny-types
Version:
A tiny library that brings Tiny Types to JavaScript and TypeScript
20 lines • 616 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isFunction = isFunction;
const Predicate_1 = require("./Predicate");
/**
* @desc Ensures that the `value` is a {@link Function}.
*
* @example
* import { ensure, isFunction, TinyType } from 'tiny-types';
*
* function myFunction(callback: (error?: Error) => void): void {
* ensure('callback', callback, isFunction());
* }
*
* @returns {Predicate<Function>}
*/
function isFunction() {
return Predicate_1.Predicate.to(`be a function`, (value) => typeof value === 'function');
}
//# sourceMappingURL=isFunction.js.map