123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
-
-
-
- var reIsUint = /^\d+$/;
-
-
- var MAX_SAFE_INTEGER = 9007199254740991;
-
-
- function baseProperty(key) {
- return function(object) {
- return object == null ? undefined : object[key];
- };
- }
-
-
- var getLength = baseProperty('length');
-
-
- function isArrayLike(value) {
- return value != null && isLength(getLength(value));
- }
-
-
- function isIndex(value, length) {
- value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
- length = length == null ? MAX_SAFE_INTEGER : length;
- return value > -1 && value % 1 == 0 && value < length;
- }
-
-
- function isIterateeCall(value, index, object) {
- if (!isObject(object)) {
- return false;
- }
- var type = typeof index;
- if (type == 'number'
- ? (isArrayLike(object) && isIndex(index, object.length))
- : (type == 'string' && index in object)) {
- var other = object[index];
- return value === value ? (value === other) : (other !== other);
- }
- return false;
- }
-
-
- function isLength(value) {
- return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
- }
-
-
- function isObject(value) {
-
-
- var type = typeof value;
- return !!value && (type == 'object' || type == 'function');
- }
-
- module.exports = isIterateeCall;
|