1 var isObjectLike = require('./isObjectLike');
3 /** `Object#toString` result references. */
4 var boolTag = '[object Boolean]';
6 /** Used for built-in method references. */
7 var objectProto = Object.prototype;
10 * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
13 var objectToString = objectProto.toString;
16 * Checks if `value` is classified as a boolean primitive or object.
21 * @param {*} value The value to check.
22 * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
31 function isBoolean(value) {
32 return value === true || value === false ||
33 (isObjectLike(value) && objectToString.call(value) == boolTag);
36 module.exports = isBoolean;