UNPKG

@newdash/newdash

Version:

javascript/typescript utility library

32 lines (31 loc) 932 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.isBoolean = void 0; const getTag_1 = __importDefault(require("./.internal/getTag")); const isObjectLike_1 = __importDefault(require("./isObjectLike")); /** * Checks if `value` is classified as a boolean primitive or object. * * @since 5.5.0 * @category Lang * @param value The value to check. * @returns Returns `true` if `value` is a boolean, else `false`. * @example * * ```js * isBoolean(false) * // => true * * isBoolean(null) * // => false * ``` */ function isBoolean(value) { return value === true || value === false || ((0, isObjectLike_1.default)(value) && (0, getTag_1.default)(value) == "[object Boolean]"); } exports.isBoolean = isBoolean; exports.default = isBoolean;