CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
index.js80 linesDownload Raw Back to lodash.isnumber
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 numberTag = '[object Number]';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 object-like. A value is object-like if it's not `null`24 * and has a `typeof` result of "object".25 *26 * @static27 * @memberOf _28 * @category Lang29 * @param {*} value The value to check.30 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.31 * @example32 *33 * _.isObjectLike({});34 * // => true35 *36 * _.isObjectLike([1, 2, 3]);37 * // => true38 *39 * _.isObjectLike(_.noop);40 * // => false41 *42 * _.isObjectLike(null);43 * // => false44 */45function isObjectLike(value) {46  return !!value && typeof value == 'object';47}48 49/**50 * Checks if `value` is classified as a `Number` primitive or object.51 *52 * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified53 * as numbers, use the `_.isFinite` method.54 *55 * @static56 * @memberOf _57 * @category Lang58 * @param {*} value The value to check.59 * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.60 * @example61 *62 * _.isNumber(3);63 * // => true64 *65 * _.isNumber(Number.MIN_VALUE);66 * // => true67 *68 * _.isNumber(Infinity);69 * // => true70 *71 * _.isNumber('3');72 * // => false73 */74function isNumber(value) {75  return typeof value == 'number' ||76    (isObjectLike(value) && objectToString.call(value) == numberTag);77}78 79module.exports = isNumber;80 
basant307/AI_Governance_Project · CoolFace