Casts value as a function if it's not one.
$ npm install cast-function
const castFunction = require('cast-function');
const unicorn = '🦄';
const rainbow = () => '🌈';
console.log(castFunction(unicorn)()); // 🦄
console.log(castFunction(rainbow)()); // 🌈
Casts value as a function that returns value if it's not one.
MIT © Cristian Pallarés