react / wstein / node_modules / jest-cli / node_modules / lodash.template / node_modules / lodash.keys / node_modules / lodash.isarguments / index.js
81145 views/**1* lodash 3.0.3 (Custom Build) <https://lodash.com/>2* Build: `lodash modern modularize exports="npm" -o ./`3* Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>4* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>5* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors6* Available under MIT license <https://lodash.com/license>7*/89/** `Object#toString` result references. */10var argsTag = '[object Arguments]';1112/**13* Checks if `value` is object-like.14*15* @private16* @param {*} value The value to check.17* @returns {boolean} Returns `true` if `value` is object-like, else `false`.18*/19function isObjectLike(value) {20return !!value && typeof value == 'object';21}2223/** Used for native method references. */24var objectProto = Object.prototype;2526/**27* Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)28* of values.29*/30var objToString = objectProto.toString;3132/**33* Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer)34* of an array-like value.35*/36var MAX_SAFE_INTEGER = 9007199254740991;3738/**39* The base implementation of `_.property` without support for deep paths.40*41* @private42* @param {string} key The key of the property to get.43* @returns {Function} Returns the new function.44*/45function baseProperty(key) {46return function(object) {47return object == null ? undefined : object[key];48};49}5051/**52* Gets the "length" property value of `object`.53*54* **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)55* that affects Safari on at least iOS 8.1-8.3 ARM64.56*57* @private58* @param {Object} object The object to query.59* @returns {*} Returns the "length" value.60*/61var getLength = baseProperty('length');6263/**64* Checks if `value` is array-like.65*66* @private67* @param {*} value The value to check.68* @returns {boolean} Returns `true` if `value` is array-like, else `false`.69*/70function isArrayLike(value) {71return value != null && isLength(getLength(value));72}7374/**75* Checks if `value` is a valid array-like length.76*77* **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength).78*79* @private80* @param {*} value The value to check.81* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.82*/83function isLength(value) {84return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;85}8687/**88* Checks if `value` is classified as an `arguments` object.89*90* @static91* @memberOf _92* @category Lang93* @param {*} value The value to check.94* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.95* @example96*97* _.isArguments(function() { return arguments; }());98* // => true99*100* _.isArguments([1, 2, 3]);101* // => false102*/103function isArguments(value) {104return isObjectLike(value) && isArrayLike(value) && objToString.call(value) == argsTag;105}106107module.exports = isArguments;108109110