1-liners
Version:
Useful oneliners and shorthand functions
20 lines (19 loc) • 413 B
JavaScript
/**
* @module 1-liners/isBoolean
*
* @description
*
* Same as `typeof value === 'boolean'`.
*
* @example
*
* const isBoolean = require('1-liners/isBoolean');
*
* isBoolean(false); // => true
* isBoolean(true); // => true
*
* isBoolean(null); // => false
* isBoolean(/anything else/); // => false
*
*/
export default (value) => typeof value === 'boolean';