CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes45downloads
index.js71 linesDownload Raw Back to lodash.isboolean
1/**2 * lodash 3.0.3 (Custom Build) <https://lodash.com/>3 * Build: `lodash modularize exports="npm" -o ./`4 * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>5 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>6 * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors7 * Available under MIT license <https://lodash.com/license>8 */9 10/** `Object#toString` result references. */11var boolTag = '[object Boolean]';12 13/** Used for built-in method references. */14var objectProto = Object.prototype;15 16/**17 * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)18 * of values.19 */20var objectToString = objectProto.toString;21 22/**23 * Checks if `value` is classified as a boolean primitive or object.24 *25 * @static26 * @memberOf _27 * @category Lang28 * @param {*} value The value to check.29 * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.30 * @example31 *32 * _.isBoolean(false);33 * // => true34 *35 * _.isBoolean(null);36 * // => false37 */38function isBoolean(value) {39  return value === true || value === false ||40    (isObjectLike(value) && objectToString.call(value) == boolTag);41}42 43/**44 * Checks if `value` is object-like. A value is object-like if it's not `null`45 * and has a `typeof` result of "object".46 *47 * @static48 * @memberOf _49 * @category Lang50 * @param {*} value The value to check.51 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.52 * @example53 *54 * _.isObjectLike({});55 * // => true56 *57 * _.isObjectLike([1, 2, 3]);58 * // => true59 *60 * _.isObjectLike(_.noop);61 * // => false62 *63 * _.isObjectLike(null);64 * // => false65 */66function isObjectLike(value) {67  return !!value && typeof value == 'object';68}69 70module.exports = isBoolean;71 
basant307/AI_Governance_Project · CoolFace