mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 17:07:49 +00:00
Compare commits
3 Commits
4.14.0-amd
...
4.15.0-amd
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fff78cbd5a | ||
|
|
3d3ce0979f | ||
|
|
623a72a129 |
@@ -1,4 +1,4 @@
|
|||||||
# lodash-amd v4.14.0
|
# lodash-amd v4.15.0
|
||||||
|
|
||||||
The [Lodash](https://lodash.com/) library exported as [AMD](https://github.com/amdjs/amdjs-api/wiki/AMD) modules.
|
The [Lodash](https://lodash.com/) library exported as [AMD](https://github.com/amdjs/amdjs-api/wiki/AMD) modules.
|
||||||
|
|
||||||
@@ -27,4 +27,4 @@ require({
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
See the [package source](https://github.com/lodash/lodash/tree/4.14.0-amd) for more details.
|
See the [package source](https://github.com/lodash/lodash/tree/4.15.0-amd) for more details.
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
define(['./_root'], function(root) {
|
|
||||||
|
|
||||||
/** Built-in value references. */
|
|
||||||
var Reflect = root.Reflect;
|
|
||||||
|
|
||||||
return Reflect;
|
|
||||||
});
|
|
||||||
@@ -5,7 +5,7 @@ define(['./_baseIndexOf'], function(baseIndexOf) {
|
|||||||
* specifying an index to search from.
|
* specifying an index to search from.
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @param {Array} [array] The array to search.
|
* @param {Array} [array] The array to inspect.
|
||||||
* @param {*} target The value to search for.
|
* @param {*} target The value to search for.
|
||||||
* @returns {boolean} Returns `true` if `target` is found, else `false`.
|
* @returns {boolean} Returns `true` if `target` is found, else `false`.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ define([], function() {
|
|||||||
* This function is like `arrayIncludes` except that it accepts a comparator.
|
* This function is like `arrayIncludes` except that it accepts a comparator.
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @param {Array} [array] The array to search.
|
* @param {Array} [array] The array to inspect.
|
||||||
* @param {*} target The value to search for.
|
* @param {*} target The value to search for.
|
||||||
* @param {Function} comparator The comparator invoked per element.
|
* @param {Function} comparator The comparator invoked per element.
|
||||||
* @returns {boolean} Returns `true` if `target` is found, else `false`.
|
* @returns {boolean} Returns `true` if `target` is found, else `false`.
|
||||||
|
|||||||
37
_arrayLikeKeys.js
Normal file
37
_arrayLikeKeys.js
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
define(['./_baseTimes', './isArguments', './isArray', './_isIndex'], function(baseTimes, isArguments, isArray, isIndex) {
|
||||||
|
|
||||||
|
/** Used for built-in method references. */
|
||||||
|
var objectProto = Object.prototype;
|
||||||
|
|
||||||
|
/** Used to check objects for own properties. */
|
||||||
|
var hasOwnProperty = objectProto.hasOwnProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an array of the enumerable property names of the array-like `value`.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {*} value The value to query.
|
||||||
|
* @param {boolean} inherited Specify returning inherited property names.
|
||||||
|
* @returns {Array} Returns the array of property names.
|
||||||
|
*/
|
||||||
|
function arrayLikeKeys(value, inherited) {
|
||||||
|
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
|
||||||
|
// Safari 9 makes `arguments.length` enumerable in strict mode.
|
||||||
|
var result = (isArray(value) || isArguments(value))
|
||||||
|
? baseTimes(value.length, String)
|
||||||
|
: [];
|
||||||
|
|
||||||
|
var length = result.length,
|
||||||
|
skipIndexes = !!length;
|
||||||
|
|
||||||
|
for (var key in value) {
|
||||||
|
if ((inherited || hasOwnProperty.call(value, key)) &&
|
||||||
|
!(skipIndexes && (key == 'length' || isIndex(key, length)))) {
|
||||||
|
result.push(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return arrayLikeKeys;
|
||||||
|
});
|
||||||
13
_asciiSize.js
Normal file
13
_asciiSize.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
define(['./_baseProperty'], function(baseProperty) {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the size of an ASCII `string`.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {string} string The string inspect.
|
||||||
|
* @returns {number} Returns the string size.
|
||||||
|
*/
|
||||||
|
var asciiSize = baseProperty('length');
|
||||||
|
|
||||||
|
return asciiSize;
|
||||||
|
});
|
||||||
15
_asciiToArray.js
Normal file
15
_asciiToArray.js
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
define([], function() {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts an ASCII `string` to an array.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {string} string The string to convert.
|
||||||
|
* @returns {Array} Returns the converted array.
|
||||||
|
*/
|
||||||
|
function asciiToArray(string) {
|
||||||
|
return string.split('');
|
||||||
|
}
|
||||||
|
|
||||||
|
return asciiToArray;
|
||||||
|
});
|
||||||
18
_asciiWords.js
Normal file
18
_asciiWords.js
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
define([], function() {
|
||||||
|
|
||||||
|
/** Used to match words composed of alphanumeric characters. */
|
||||||
|
var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Splits an ASCII `string` into an array of its words.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {string} The string to inspect.
|
||||||
|
* @returns {Array} Returns the words of `string`.
|
||||||
|
*/
|
||||||
|
function asciiWords(string) {
|
||||||
|
return string.match(reAsciiWord) || [];
|
||||||
|
}
|
||||||
|
|
||||||
|
return asciiWords;
|
||||||
|
});
|
||||||
@@ -11,7 +11,7 @@ define(['./eq'], function(eq) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Assigns `value` to `key` of `object` if the existing value is not equivalent
|
* Assigns `value` to `key` of `object` if the existing value is not equivalent
|
||||||
* using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
|
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
||||||
* for equality comparisons.
|
* for equality comparisons.
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ define(['./eq'], function(eq) {
|
|||||||
* Gets the index at which the `key` is found in `array` of key-value pairs.
|
* Gets the index at which the `key` is found in `array` of key-value pairs.
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @param {Array} array The array to search.
|
* @param {Array} array The array to inspect.
|
||||||
* @param {*} key The key to search for.
|
* @param {*} key The key to search for.
|
||||||
* @returns {number} Returns the index of the matched value, else `-1`.
|
* @returns {number} Returns the index of the matched value, else `-1`.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -120,9 +120,6 @@ define(['./_Stack', './_arrayEach', './_assignValue', './_baseAssign', './_clone
|
|||||||
// Recursively populate clone (susceptible to call stack limits).
|
// Recursively populate clone (susceptible to call stack limits).
|
||||||
assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));
|
assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));
|
||||||
});
|
});
|
||||||
if (!isFull) {
|
|
||||||
stack['delete'](value);
|
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,14 +16,13 @@ define([], function() {
|
|||||||
if (object == null) {
|
if (object == null) {
|
||||||
return !length;
|
return !length;
|
||||||
}
|
}
|
||||||
var index = length;
|
object = Object(object);
|
||||||
while (index--) {
|
while (length--) {
|
||||||
var key = props[index],
|
var key = props[length],
|
||||||
predicate = source[key],
|
predicate = source[key],
|
||||||
value = object[key];
|
value = object[key];
|
||||||
|
|
||||||
if ((value === undefined &&
|
if ((value === undefined && !(key in object)) || !predicate(value)) {
|
||||||
!(key in Object(object))) || !predicate(value)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ define([], function() {
|
|||||||
* @param {Function} func The function to delay.
|
* @param {Function} func The function to delay.
|
||||||
* @param {number} wait The number of milliseconds to delay invocation.
|
* @param {number} wait The number of milliseconds to delay invocation.
|
||||||
* @param {Array} args The arguments to provide to `func`.
|
* @param {Array} args The arguments to provide to `func`.
|
||||||
* @returns {number} Returns the timer id.
|
* @returns {number|Object} Returns the timer id or timeout object.
|
||||||
*/
|
*/
|
||||||
function baseDelay(func, wait, args) {
|
function baseDelay(func, wait, args) {
|
||||||
if (typeof func != 'function') {
|
if (typeof func != 'function') {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ define([], function() {
|
|||||||
* support for iteratee shorthands.
|
* support for iteratee shorthands.
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @param {Array} array The array to search.
|
* @param {Array} array The array to inspect.
|
||||||
* @param {Function} predicate The function invoked per iteration.
|
* @param {Function} predicate The function invoked per iteration.
|
||||||
* @param {number} fromIndex The index to search from.
|
* @param {number} fromIndex The index to search from.
|
||||||
* @param {boolean} [fromRight] Specify iterating from right to left.
|
* @param {boolean} [fromRight] Specify iterating from right to left.
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ define([], function() {
|
|||||||
* using `eachFunc`.
|
* using `eachFunc`.
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @param {Array|Object} collection The collection to search.
|
* @param {Array|Object} collection The collection to inspect.
|
||||||
* @param {Function} predicate The function invoked per iteration.
|
* @param {Function} predicate The function invoked per iteration.
|
||||||
* @param {Function} eachFunc The function to iterate over `collection`.
|
* @param {Function} eachFunc The function to iterate over `collection`.
|
||||||
* @returns {*} Returns the found element or its key, else `undefined`.
|
* @returns {*} Returns the found element or its key, else `undefined`.
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ define([], function() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to resolve the
|
* Used to resolve the
|
||||||
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
||||||
* of values.
|
* of values.
|
||||||
*/
|
*/
|
||||||
var objectToString = objectProto.toString;
|
var objectToString = objectProto.toString;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
define(['./_getPrototype'], function(getPrototype) {
|
define([], function() {
|
||||||
|
|
||||||
/** Used for built-in method references. */
|
/** Used for built-in method references. */
|
||||||
var objectProto = Object.prototype;
|
var objectProto = Object.prototype;
|
||||||
@@ -15,12 +15,7 @@ define(['./_getPrototype'], function(getPrototype) {
|
|||||||
* @returns {boolean} Returns `true` if `key` exists, else `false`.
|
* @returns {boolean} Returns `true` if `key` exists, else `false`.
|
||||||
*/
|
*/
|
||||||
function baseHas(object, key) {
|
function baseHas(object, key) {
|
||||||
// Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,
|
return object != null && hasOwnProperty.call(object, key);
|
||||||
// that are composed entirely of index properties, return `false` for
|
|
||||||
// `hasOwnProperty` checks of them.
|
|
||||||
return object != null &&
|
|
||||||
(hasOwnProperty.call(object, key) ||
|
|
||||||
(typeof object == 'object' && key in object && getPrototype(object) === null));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return baseHas;
|
return baseHas;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ define(['./_baseFindIndex', './_baseIsNaN'], function(baseFindIndex, baseIsNaN)
|
|||||||
* The base implementation of `_.indexOf` without `fromIndex` bounds checks.
|
* The base implementation of `_.indexOf` without `fromIndex` bounds checks.
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @param {Array} array The array to search.
|
* @param {Array} array The array to inspect.
|
||||||
* @param {*} value The value to search for.
|
* @param {*} value The value to search for.
|
||||||
* @param {number} fromIndex The index to search from.
|
* @param {number} fromIndex The index to search from.
|
||||||
* @returns {number} Returns the index of the matched value, else `-1`.
|
* @returns {number} Returns the index of the matched value, else `-1`.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ define([], function() {
|
|||||||
* This function is like `baseIndexOf` except that it accepts a comparator.
|
* This function is like `baseIndexOf` except that it accepts a comparator.
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @param {Array} array The array to search.
|
* @param {Array} array The array to inspect.
|
||||||
* @param {*} value The value to search for.
|
* @param {*} value The value to search for.
|
||||||
* @param {number} fromIndex The index to search from.
|
* @param {number} fromIndex The index to search from.
|
||||||
* @param {Function} comparator The comparator invoked per element.
|
* @param {Function} comparator The comparator invoked per element.
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ define(['./isObjectLike'], function(isObjectLike) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to resolve the
|
* Used to resolve the
|
||||||
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
||||||
* of values.
|
* of values.
|
||||||
*/
|
*/
|
||||||
var objectToString = objectProto.toString;
|
var objectToString = objectProto.toString;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ define(['./isObjectLike'], function(isObjectLike) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to resolve the
|
* Used to resolve the
|
||||||
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
||||||
* of values.
|
* of values.
|
||||||
*/
|
*/
|
||||||
var objectToString = objectProto.toString;
|
var objectToString = objectProto.toString;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ define(['./isFunction', './_isHostObject', './_isMasked', './isObject', './_toSo
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to match `RegExp`
|
* Used to match `RegExp`
|
||||||
* [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns).
|
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
||||||
*/
|
*/
|
||||||
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
||||||
|
|
||||||
@@ -10,10 +10,11 @@ define(['./isFunction', './_isHostObject', './_isMasked', './isObject', './_toSo
|
|||||||
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
||||||
|
|
||||||
/** Used for built-in method references. */
|
/** Used for built-in method references. */
|
||||||
var objectProto = Object.prototype;
|
var funcProto = Function.prototype,
|
||||||
|
objectProto = Object.prototype;
|
||||||
|
|
||||||
/** Used to resolve the decompiled source of functions. */
|
/** Used to resolve the decompiled source of functions. */
|
||||||
var funcToString = Function.prototype.toString;
|
var funcToString = funcProto.toString;
|
||||||
|
|
||||||
/** Used to check objects for own properties. */
|
/** Used to check objects for own properties. */
|
||||||
var hasOwnProperty = objectProto.hasOwnProperty;
|
var hasOwnProperty = objectProto.hasOwnProperty;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ define(['./isObject'], function(isObject) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to resolve the
|
* Used to resolve the
|
||||||
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
||||||
* of values.
|
* of values.
|
||||||
*/
|
*/
|
||||||
var objectToString = objectProto.toString;
|
var objectToString = objectProto.toString;
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ define(['./isLength', './isObjectLike'], function(isLength, isObjectLike) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to resolve the
|
* Used to resolve the
|
||||||
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
||||||
* of values.
|
* of values.
|
||||||
*/
|
*/
|
||||||
var objectToString = objectProto.toString;
|
var objectToString = objectProto.toString;
|
||||||
|
|||||||
25
_baseKeys.js
25
_baseKeys.js
@@ -1,17 +1,30 @@
|
|||||||
define(['./_overArg'], function(overArg) {
|
define(['./_isPrototype', './_nativeKeys'], function(isPrototype, nativeKeys) {
|
||||||
|
|
||||||
/* Built-in method references for those with the same name as other `lodash` methods. */
|
/** Used for built-in method references. */
|
||||||
var nativeKeys = Object.keys;
|
var objectProto = Object.prototype;
|
||||||
|
|
||||||
|
/** Used to check objects for own properties. */
|
||||||
|
var hasOwnProperty = objectProto.hasOwnProperty;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The base implementation of `_.keys` which doesn't skip the constructor
|
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
|
||||||
* property of prototypes or treat sparse arrays as dense.
|
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @param {Object} object The object to query.
|
* @param {Object} object The object to query.
|
||||||
* @returns {Array} Returns the array of property names.
|
* @returns {Array} Returns the array of property names.
|
||||||
*/
|
*/
|
||||||
var baseKeys = overArg(nativeKeys, Object);
|
function baseKeys(object) {
|
||||||
|
if (!isPrototype(object)) {
|
||||||
|
return nativeKeys(object);
|
||||||
|
}
|
||||||
|
var result = [];
|
||||||
|
for (var key in Object(object)) {
|
||||||
|
if (hasOwnProperty.call(object, key) && key != 'constructor') {
|
||||||
|
result.push(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
return baseKeys;
|
return baseKeys;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,39 +1,32 @@
|
|||||||
define(['./_Reflect', './_iteratorToArray'], function(Reflect, iteratorToArray) {
|
define(['./isObject', './_isPrototype', './_nativeKeysIn'], function(isObject, isPrototype, nativeKeysIn) {
|
||||||
|
|
||||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
|
||||||
var undefined;
|
|
||||||
|
|
||||||
/** Used for built-in method references. */
|
/** Used for built-in method references. */
|
||||||
var objectProto = Object.prototype;
|
var objectProto = Object.prototype;
|
||||||
|
|
||||||
/** Built-in value references. */
|
/** Used to check objects for own properties. */
|
||||||
var enumerate = Reflect ? Reflect.enumerate : undefined,
|
var hasOwnProperty = objectProto.hasOwnProperty;
|
||||||
propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The base implementation of `_.keysIn` which doesn't skip the constructor
|
* The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
|
||||||
* property of prototypes or treat sparse arrays as dense.
|
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @param {Object} object The object to query.
|
* @param {Object} object The object to query.
|
||||||
* @returns {Array} Returns the array of property names.
|
* @returns {Array} Returns the array of property names.
|
||||||
*/
|
*/
|
||||||
function baseKeysIn(object) {
|
function baseKeysIn(object) {
|
||||||
object = object == null ? object : Object(object);
|
if (!isObject(object)) {
|
||||||
|
return nativeKeysIn(object);
|
||||||
|
}
|
||||||
|
var isProto = isPrototype(object),
|
||||||
|
result = [];
|
||||||
|
|
||||||
var result = [];
|
|
||||||
for (var key in object) {
|
for (var key in object) {
|
||||||
result.push(key);
|
if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
|
||||||
|
result.push(key);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fallback for IE < 9 with es6-shim.
|
|
||||||
if (enumerate && !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf')) {
|
|
||||||
baseKeysIn = function(object) {
|
|
||||||
return iteratorToArray(enumerate(object));
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return baseKeysIn;
|
return baseKeysIn;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
define(['./_Stack', './_arrayEach', './_assignMergeValue', './_baseMergeDeep', './isArray', './isObject', './isTypedArray', './keysIn'], function(Stack, arrayEach, assignMergeValue, baseMergeDeep, isArray, isObject, isTypedArray, keysIn) {
|
define(['./_Stack', './_arrayEach', './_assignMergeValue', './_baseKeysIn', './_baseMergeDeep', './isArray', './isObject', './isTypedArray'], function(Stack, arrayEach, assignMergeValue, baseKeysIn, baseMergeDeep, isArray, isObject, isTypedArray) {
|
||||||
|
|
||||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||||
var undefined;
|
var undefined;
|
||||||
@@ -19,7 +19,7 @@ define(['./_Stack', './_arrayEach', './_assignMergeValue', './_baseMergeDeep', '
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!(isArray(source) || isTypedArray(source))) {
|
if (!(isArray(source) || isTypedArray(source))) {
|
||||||
var props = keysIn(source);
|
var props = baseKeysIn(source);
|
||||||
}
|
}
|
||||||
arrayEach(props || source, function(srcValue, key) {
|
arrayEach(props || source, function(srcValue, key) {
|
||||||
if (props) {
|
if (props) {
|
||||||
|
|||||||
28
_baseSet.js
28
_baseSet.js
@@ -7,13 +7,16 @@ define(['./_assignValue', './_castPath', './_isIndex', './_isKey', './isObject',
|
|||||||
* The base implementation of `_.set`.
|
* The base implementation of `_.set`.
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @param {Object} object The object to query.
|
* @param {Object} object The object to modify.
|
||||||
* @param {Array|string} path The path of the property to set.
|
* @param {Array|string} path The path of the property to set.
|
||||||
* @param {*} value The value to set.
|
* @param {*} value The value to set.
|
||||||
* @param {Function} [customizer] The function to customize path creation.
|
* @param {Function} [customizer] The function to customize path creation.
|
||||||
* @returns {Object} Returns `object`.
|
* @returns {Object} Returns `object`.
|
||||||
*/
|
*/
|
||||||
function baseSet(object, path, value, customizer) {
|
function baseSet(object, path, value, customizer) {
|
||||||
|
if (!isObject(object)) {
|
||||||
|
return object;
|
||||||
|
}
|
||||||
path = isKey(path, object) ? [path] : castPath(path);
|
path = isKey(path, object) ? [path] : castPath(path);
|
||||||
|
|
||||||
var index = -1,
|
var index = -1,
|
||||||
@@ -22,20 +25,19 @@ define(['./_assignValue', './_castPath', './_isIndex', './_isKey', './isObject',
|
|||||||
nested = object;
|
nested = object;
|
||||||
|
|
||||||
while (nested != null && ++index < length) {
|
while (nested != null && ++index < length) {
|
||||||
var key = toKey(path[index]);
|
var key = toKey(path[index]),
|
||||||
if (isObject(nested)) {
|
newValue = value;
|
||||||
var newValue = value;
|
|
||||||
if (index != lastIndex) {
|
if (index != lastIndex) {
|
||||||
var objValue = nested[key];
|
var objValue = nested[key];
|
||||||
newValue = customizer ? customizer(objValue, key, nested) : undefined;
|
newValue = customizer ? customizer(objValue, key, nested) : undefined;
|
||||||
if (newValue === undefined) {
|
if (newValue === undefined) {
|
||||||
newValue = objValue == null
|
newValue = isObject(objValue)
|
||||||
? (isIndex(path[index + 1]) ? [] : {})
|
? objValue
|
||||||
: objValue;
|
: (isIndex(path[index + 1]) ? [] : {});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
assignValue(nested, key, newValue);
|
|
||||||
}
|
}
|
||||||
|
assignValue(nested, key, newValue);
|
||||||
nested = nested[key];
|
nested = nested[key];
|
||||||
}
|
}
|
||||||
return object;
|
return object;
|
||||||
|
|||||||
@@ -1,4 +1,10 @@
|
|||||||
define(['./_baseHas', './_castPath', './_isKey', './last', './_parent', './_toKey'], function(baseHas, castPath, isKey, last, parent, toKey) {
|
define(['./_castPath', './_isKey', './last', './_parent', './_toKey'], function(castPath, isKey, last, parent, toKey) {
|
||||||
|
|
||||||
|
/** Used for built-in method references. */
|
||||||
|
var objectProto = Object.prototype;
|
||||||
|
|
||||||
|
/** Used to check objects for own properties. */
|
||||||
|
var hasOwnProperty = objectProto.hasOwnProperty;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The base implementation of `_.unset`.
|
* The base implementation of `_.unset`.
|
||||||
@@ -13,7 +19,7 @@ define(['./_baseHas', './_castPath', './_isKey', './last', './_parent', './_toKe
|
|||||||
object = parent(object, path);
|
object = parent(object, path);
|
||||||
|
|
||||||
var key = toKey(last(path));
|
var key = toKey(last(path));
|
||||||
return !(object != null && baseHas(object, key)) || delete object[key];
|
return !(object != null && hasOwnProperty.call(object, key)) || delete object[key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return baseUnset;
|
return baseUnset;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ define(['./_baseGet', './_baseSet'], function(baseGet, baseSet) {
|
|||||||
* The base implementation of `_.update`.
|
* The base implementation of `_.update`.
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @param {Object} object The object to query.
|
* @param {Object} object The object to modify.
|
||||||
* @param {Array|string} path The path of the property to update.
|
* @param {Array|string} path The path of the property to update.
|
||||||
* @param {Function} updater The function to produce the updated value.
|
* @param {Function} updater The function to produce the updated value.
|
||||||
* @param {Function} [customizer] The function to customize path creation.
|
* @param {Function} [customizer] The function to customize path creation.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
define(['./_castSlice', './_reHasComplexSymbol', './_stringToArray', './toString'], function(castSlice, reHasComplexSymbol, stringToArray, toString) {
|
define(['./_castSlice', './_hasUnicode', './_stringToArray', './toString'], function(castSlice, hasUnicode, stringToArray, toString) {
|
||||||
|
|
||||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||||
var undefined;
|
var undefined;
|
||||||
@@ -14,7 +14,7 @@ define(['./_castSlice', './_reHasComplexSymbol', './_stringToArray', './toString
|
|||||||
return function(string) {
|
return function(string) {
|
||||||
string = toString(string);
|
string = toString(string);
|
||||||
|
|
||||||
var strSymbols = reHasComplexSymbol.test(string)
|
var strSymbols = hasUnicode(string)
|
||||||
? stringToArray(string)
|
? stringToArray(string)
|
||||||
: undefined;
|
: undefined;
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ define(['./_baseCreate', './isObject'], function(baseCreate, isObject) {
|
|||||||
function createCtor(Ctor) {
|
function createCtor(Ctor) {
|
||||||
return function() {
|
return function() {
|
||||||
// Use a `switch` statement to work with class constructors. See
|
// Use a `switch` statement to work with class constructors. See
|
||||||
// http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
|
// http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
|
||||||
// for more details.
|
// for more details.
|
||||||
var args = arguments;
|
var args = arguments;
|
||||||
switch (args.length) {
|
switch (args.length) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
define(['./_baseRepeat', './_baseToString', './_castSlice', './_reHasComplexSymbol', './_stringSize', './_stringToArray'], function(baseRepeat, baseToString, castSlice, reHasComplexSymbol, stringSize, stringToArray) {
|
define(['./_baseRepeat', './_baseToString', './_castSlice', './_hasUnicode', './_stringSize', './_stringToArray'], function(baseRepeat, baseToString, castSlice, hasUnicode, stringSize, stringToArray) {
|
||||||
|
|
||||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||||
var undefined;
|
var undefined;
|
||||||
@@ -23,7 +23,7 @@ define(['./_baseRepeat', './_baseToString', './_castSlice', './_reHasComplexSymb
|
|||||||
return charsLength ? baseRepeat(chars, length) : chars;
|
return charsLength ? baseRepeat(chars, length) : chars;
|
||||||
}
|
}
|
||||||
var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
|
var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
|
||||||
return reHasComplexSymbol.test(chars)
|
return hasUnicode(chars)
|
||||||
? castSlice(stringToArray(result), 0, length).join('')
|
? castSlice(stringToArray(result), 0, length).join('')
|
||||||
: result.slice(0, length);
|
: result.slice(0, length);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
define(['./_baseRange', './_isIterateeCall', './toNumber'], function(baseRange, isIterateeCall, toNumber) {
|
define(['./_baseRange', './_isIterateeCall', './toFinite'], function(baseRange, isIterateeCall, toFinite) {
|
||||||
|
|
||||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||||
var undefined;
|
var undefined;
|
||||||
@@ -16,15 +16,14 @@ define(['./_baseRange', './_isIterateeCall', './toNumber'], function(baseRange,
|
|||||||
end = step = undefined;
|
end = step = undefined;
|
||||||
}
|
}
|
||||||
// Ensure the sign of `-0` is preserved.
|
// Ensure the sign of `-0` is preserved.
|
||||||
start = toNumber(start);
|
start = toFinite(start);
|
||||||
start = start === start ? start : 0;
|
|
||||||
if (end === undefined) {
|
if (end === undefined) {
|
||||||
end = start;
|
end = start;
|
||||||
start = 0;
|
start = 0;
|
||||||
} else {
|
} else {
|
||||||
end = toNumber(end) || 0;
|
end = toFinite(end);
|
||||||
}
|
}
|
||||||
step = step === undefined ? (start < end ? 1 : -1) : (toNumber(step) || 0);
|
step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
|
||||||
return baseRange(start, end, step, fromRight);
|
return baseRange(start, end, step, fromRight);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
define(['./_basePropertyOf'], function(basePropertyOf) {
|
define(['./_basePropertyOf'], function(basePropertyOf) {
|
||||||
|
|
||||||
/** Used to map latin-1 supplementary letters to basic latin letters. */
|
/** Used to map Latin Unicode letters to basic Latin letters. */
|
||||||
var deburredLetters = {
|
var deburredLetters = {
|
||||||
|
// Latin-1 Supplement block.
|
||||||
'\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
|
'\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
|
||||||
'\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
|
'\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
|
||||||
'\xc7': 'C', '\xe7': 'c',
|
'\xc7': 'C', '\xe7': 'c',
|
||||||
'\xd0': 'D', '\xf0': 'd',
|
'\xd0': 'D', '\xf0': 'd',
|
||||||
'\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
|
'\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
|
||||||
'\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
|
'\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
|
||||||
'\xcC': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
|
'\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
|
||||||
'\xeC': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
|
'\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
|
||||||
'\xd1': 'N', '\xf1': 'n',
|
'\xd1': 'N', '\xf1': 'n',
|
||||||
'\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
|
'\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
|
||||||
'\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
|
'\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
|
||||||
@@ -18,11 +19,48 @@ define(['./_basePropertyOf'], function(basePropertyOf) {
|
|||||||
'\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
|
'\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
|
||||||
'\xc6': 'Ae', '\xe6': 'ae',
|
'\xc6': 'Ae', '\xe6': 'ae',
|
||||||
'\xde': 'Th', '\xfe': 'th',
|
'\xde': 'Th', '\xfe': 'th',
|
||||||
'\xdf': 'ss'
|
'\xdf': 'ss',
|
||||||
|
// Latin Extended-A block.
|
||||||
|
'\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
|
||||||
|
'\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
|
||||||
|
'\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
|
||||||
|
'\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
|
||||||
|
'\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
|
||||||
|
'\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
|
||||||
|
'\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
|
||||||
|
'\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
|
||||||
|
'\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
|
||||||
|
'\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
|
||||||
|
'\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
|
||||||
|
'\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
|
||||||
|
'\u0134': 'J', '\u0135': 'j',
|
||||||
|
'\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
|
||||||
|
'\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
|
||||||
|
'\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
|
||||||
|
'\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
|
||||||
|
'\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
|
||||||
|
'\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
|
||||||
|
'\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
|
||||||
|
'\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
|
||||||
|
'\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
|
||||||
|
'\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
|
||||||
|
'\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
|
||||||
|
'\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
|
||||||
|
'\u0163': 't', '\u0165': 't', '\u0167': 't',
|
||||||
|
'\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
|
||||||
|
'\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
|
||||||
|
'\u0174': 'W', '\u0175': 'w',
|
||||||
|
'\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
|
||||||
|
'\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
|
||||||
|
'\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
|
||||||
|
'\u0132': 'IJ', '\u0133': 'ij',
|
||||||
|
'\u0152': 'Oe', '\u0153': 'oe',
|
||||||
|
'\u0149': "'n", '\u017f': 'ss'
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used by `_.deburr` to convert latin-1 supplementary letters to basic latin letters.
|
* Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
|
||||||
|
* letters to basic Latin letters.
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @param {string} letter The matched letter to deburr.
|
* @param {string} letter The matched letter to deburr.
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ define(['./_SetCache', './_arraySome'], function(SetCache, arraySome) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
stack['delete'](array);
|
stack['delete'](array);
|
||||||
|
stack['delete'](other);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ define(['./_Symbol', './_Uint8Array', './eq', './_equalArrays', './_mapToArray',
|
|||||||
case regexpTag:
|
case regexpTag:
|
||||||
case stringTag:
|
case stringTag:
|
||||||
// Coerce regexes to strings and treat strings, primitives and objects,
|
// Coerce regexes to strings and treat strings, primitives and objects,
|
||||||
// as equal. See http://www.ecma-international.org/ecma-262/6.0/#sec-regexp.prototype.tostring
|
// as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
|
||||||
// for more details.
|
// for more details.
|
||||||
return object == (other + '');
|
return object == (other + '');
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
define(['./_baseHas', './keys'], function(baseHas, keys) {
|
define(['./keys'], function(keys) {
|
||||||
|
|
||||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||||
var undefined;
|
var undefined;
|
||||||
@@ -6,6 +6,12 @@ define(['./_baseHas', './keys'], function(baseHas, keys) {
|
|||||||
/** Used to compose bitmasks for comparison styles. */
|
/** Used to compose bitmasks for comparison styles. */
|
||||||
var PARTIAL_COMPARE_FLAG = 2;
|
var PARTIAL_COMPARE_FLAG = 2;
|
||||||
|
|
||||||
|
/** Used for built-in method references. */
|
||||||
|
var objectProto = Object.prototype;
|
||||||
|
|
||||||
|
/** Used to check objects for own properties. */
|
||||||
|
var hasOwnProperty = objectProto.hasOwnProperty;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A specialized version of `baseIsEqualDeep` for objects with support for
|
* A specialized version of `baseIsEqualDeep` for objects with support for
|
||||||
* partial deep comparisons.
|
* partial deep comparisons.
|
||||||
@@ -33,7 +39,7 @@ define(['./_baseHas', './keys'], function(baseHas, keys) {
|
|||||||
var index = objLength;
|
var index = objLength;
|
||||||
while (index--) {
|
while (index--) {
|
||||||
var key = objProps[index];
|
var key = objProps[index];
|
||||||
if (!(isPartial ? key in other : baseHas(other, key))) {
|
if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -80,6 +86,7 @@ define(['./_baseHas', './keys'], function(baseHas, keys) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
stack['delete'](object);
|
stack['delete'](object);
|
||||||
|
stack['delete'](other);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
define(['./_baseProperty'], function(baseProperty) {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the "length" property value of `object`.
|
|
||||||
*
|
|
||||||
* **Note:** This function is used to avoid a
|
|
||||||
* [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects
|
|
||||||
* Safari on at least iOS 8.1-8.3 ARM64.
|
|
||||||
*
|
|
||||||
* @private
|
|
||||||
* @param {Object} object The object to query.
|
|
||||||
* @returns {*} Returns the "length" value.
|
|
||||||
*/
|
|
||||||
var getLength = baseProperty('length');
|
|
||||||
|
|
||||||
return getLength;
|
|
||||||
});
|
|
||||||
@@ -1,16 +1,7 @@
|
|||||||
define(['./_overArg'], function(overArg) {
|
define(['./_overArg'], function(overArg) {
|
||||||
|
|
||||||
/* Built-in method references for those with the same name as other `lodash` methods. */
|
/** Built-in value references. */
|
||||||
var nativeGetPrototype = Object.getPrototypeOf;
|
var getPrototype = overArg(Object.getPrototypeOf, Object);
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the `[[Prototype]]` of `value`.
|
|
||||||
*
|
|
||||||
* @private
|
|
||||||
* @param {*} value The value to query.
|
|
||||||
* @returns {null|Object} Returns the `[[Prototype]]`.
|
|
||||||
*/
|
|
||||||
var getPrototype = overArg(nativeGetPrototype, Object);
|
|
||||||
|
|
||||||
return getPrototype;
|
return getPrototype;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
define(['./_arrayPush', './_getPrototype', './_getSymbols'], function(arrayPush, getPrototype, getSymbols) {
|
define(['./_arrayPush', './_getPrototype', './_getSymbols', './stubArray'], function(arrayPush, getPrototype, getSymbols, stubArray) {
|
||||||
|
|
||||||
/* Built-in method references for those with the same name as other `lodash` methods. */
|
/* Built-in method references for those with the same name as other `lodash` methods. */
|
||||||
var nativeGetSymbols = Object.getOwnPropertySymbols;
|
var nativeGetSymbols = Object.getOwnPropertySymbols;
|
||||||
@@ -11,7 +11,7 @@ define(['./_arrayPush', './_getPrototype', './_getSymbols'], function(arrayPush,
|
|||||||
* @param {Object} object The object to query.
|
* @param {Object} object The object to query.
|
||||||
* @returns {Array} Returns the array of symbols.
|
* @returns {Array} Returns the array of symbols.
|
||||||
*/
|
*/
|
||||||
var getSymbolsIn = !nativeGetSymbols ? getSymbols : function(object) {
|
var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
|
||||||
var result = [];
|
var result = [];
|
||||||
while (object) {
|
while (object) {
|
||||||
arrayPush(result, getSymbols(object));
|
arrayPush(result, getSymbols(object));
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ define(['./_DataView', './_Map', './_Promise', './_Set', './_WeakMap', './_baseG
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to resolve the
|
* Used to resolve the
|
||||||
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
||||||
* of values.
|
* of values.
|
||||||
*/
|
*/
|
||||||
var objectToString = objectProto.toString;
|
var objectToString = objectProto.toString;
|
||||||
@@ -39,7 +39,7 @@ define(['./_DataView', './_Map', './_Promise', './_Set', './_WeakMap', './_baseG
|
|||||||
var getTag = baseGetTag;
|
var getTag = baseGetTag;
|
||||||
|
|
||||||
// Fallback for data views, maps, sets, and weak maps in IE 11,
|
// Fallback for data views, maps, sets, and weak maps in IE 11,
|
||||||
// for data views in Edge, and promises in Node.js.
|
// for data views in Edge < 14, and promises in Node.js.
|
||||||
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
|
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
|
||||||
(Map && getTag(new Map) != mapTag) ||
|
(Map && getTag(new Map) != mapTag) ||
|
||||||
(Promise && getTag(Promise.resolve()) != promiseTag) ||
|
(Promise && getTag(Promise.resolve()) != promiseTag) ||
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
define(['./_castPath', './isArguments', './isArray', './_isIndex', './_isKey', './isLength', './isString', './_toKey'], function(castPath, isArguments, isArray, isIndex, isKey, isLength, isString, toKey) {
|
define(['./_castPath', './isArguments', './isArray', './_isIndex', './_isKey', './isLength', './_toKey'], function(castPath, isArguments, isArray, isIndex, isKey, isLength, toKey) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if `path` exists on `object`.
|
* Checks if `path` exists on `object`.
|
||||||
@@ -28,7 +28,7 @@ define(['./_castPath', './isArguments', './isArray', './_isIndex', './_isKey', '
|
|||||||
}
|
}
|
||||||
var length = object ? object.length : 0;
|
var length = object ? object.length : 0;
|
||||||
return !!length && isLength(length) && isIndex(key, length) &&
|
return !!length && isLength(length) && isIndex(key, length) &&
|
||||||
(isArray(object) || isString(object) || isArguments(object));
|
(isArray(object) || isArguments(object));
|
||||||
}
|
}
|
||||||
|
|
||||||
return hasPath;
|
return hasPath;
|
||||||
|
|||||||
@@ -10,7 +10,18 @@ define([], function() {
|
|||||||
var rsZWJ = '\\u200d';
|
var rsZWJ = '\\u200d';
|
||||||
|
|
||||||
/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
|
/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
|
||||||
var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']');
|
var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']');
|
||||||
|
|
||||||
return reHasComplexSymbol;
|
/**
|
||||||
|
* Checks if `string` contains Unicode symbols.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {string} string The string to inspect.
|
||||||
|
* @returns {boolean} Returns `true` if a symbol is found, else `false`.
|
||||||
|
*/
|
||||||
|
function hasUnicode(string) {
|
||||||
|
return reHasUnicode.test(string);
|
||||||
|
}
|
||||||
|
|
||||||
|
return hasUnicode;
|
||||||
});
|
});
|
||||||
18
_hasUnicodeWord.js
Normal file
18
_hasUnicodeWord.js
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
define([], function() {
|
||||||
|
|
||||||
|
/** Used to detect strings that need a more robust regexp to match words. */
|
||||||
|
var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if `string` contains a word composed of Unicode symbols.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {string} string The string to inspect.
|
||||||
|
* @returns {boolean} Returns `true` if a word is found, else `false`.
|
||||||
|
*/
|
||||||
|
function hasUnicodeWord(string) {
|
||||||
|
return reHasUnicodeWord.test(string);
|
||||||
|
}
|
||||||
|
|
||||||
|
return hasUnicodeWord;
|
||||||
|
});
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
define(['./_baseTimes', './isArguments', './isArray', './isLength', './isString'], function(baseTimes, isArguments, isArray, isLength, isString) {
|
|
||||||
|
|
||||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
|
||||||
var undefined;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates an array of index keys for `object` values of arrays,
|
|
||||||
* `arguments` objects, and strings, otherwise `null` is returned.
|
|
||||||
*
|
|
||||||
* @private
|
|
||||||
* @param {Object} object The object to query.
|
|
||||||
* @returns {Array|null} Returns index keys, else `null`.
|
|
||||||
*/
|
|
||||||
function indexKeys(object) {
|
|
||||||
var length = object ? object.length : undefined;
|
|
||||||
if (isLength(length) &&
|
|
||||||
(isArray(object) || isString(object) || isArguments(object))) {
|
|
||||||
return baseTimes(length, String);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return indexKeys;
|
|
||||||
});
|
|
||||||
@@ -15,7 +15,7 @@ define(['./_Symbol', './isArguments', './isArray'], function(Symbol, isArguments
|
|||||||
*/
|
*/
|
||||||
function isFlattenable(value) {
|
function isFlattenable(value) {
|
||||||
return isArray(value) || isArguments(value) ||
|
return isArray(value) || isArguments(value) ||
|
||||||
!!(spreadableSymbol && value && value[spreadableSymbol])
|
!!(spreadableSymbol && value && value[spreadableSymbol]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return isFlattenable;
|
return isFlattenable;
|
||||||
|
|||||||
7
_nativeKeys.js
Normal file
7
_nativeKeys.js
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
define(['./_overArg'], function(overArg) {
|
||||||
|
|
||||||
|
/* Built-in method references for those with the same name as other `lodash` methods. */
|
||||||
|
var nativeKeys = overArg(Object.keys, Object);
|
||||||
|
|
||||||
|
return nativeKeys;
|
||||||
|
});
|
||||||
23
_nativeKeysIn.js
Normal file
23
_nativeKeysIn.js
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
define([], function() {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function is like
|
||||||
|
* [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
|
||||||
|
* except that it includes inherited enumerable properties.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Object} object The object to query.
|
||||||
|
* @returns {Array} Returns the array of property names.
|
||||||
|
*/
|
||||||
|
function nativeKeysIn(object) {
|
||||||
|
var result = [];
|
||||||
|
if (object != null) {
|
||||||
|
for (var key in Object(object)) {
|
||||||
|
result.push(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return nativeKeysIn;
|
||||||
|
});
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
define(['./_freeGlobal'], function(freeGlobal) {
|
define(['./_freeGlobal'], function(freeGlobal) {
|
||||||
|
|
||||||
/** Detect free variable `exports`. */
|
/** Detect free variable `exports`. */
|
||||||
var freeExports = freeGlobal && typeof exports == 'object' && exports;
|
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
|
||||||
|
|
||||||
/** Detect free variable `module`. */
|
/** Detect free variable `module`. */
|
||||||
var freeModule = freeExports && typeof module == 'object' && module;
|
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
|
||||||
|
|
||||||
/** Detect the popular CommonJS extension `module.exports`. */
|
/** Detect the popular CommonJS extension `module.exports`. */
|
||||||
var moduleExports = freeModule && freeModule.exports === freeExports;
|
var moduleExports = freeModule && freeModule.exports === freeExports;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
define([], function() {
|
define([], function() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a function that invokes `func` with its first argument transformed.
|
* Creates a unary function that invokes `func` with its argument transformed.
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @param {Function} func The function to wrap.
|
* @param {Function} func The function to wrap.
|
||||||
|
|||||||
@@ -1,30 +1,4 @@
|
|||||||
define(['./_reHasComplexSymbol'], function(reHasComplexSymbol) {
|
define(['./_asciiSize', './_hasUnicode', './_unicodeSize'], function(asciiSize, hasUnicode, unicodeSize) {
|
||||||
|
|
||||||
/** Used to compose unicode character classes. */
|
|
||||||
var rsAstralRange = '\\ud800-\\udfff',
|
|
||||||
rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23',
|
|
||||||
rsComboSymbolsRange = '\\u20d0-\\u20f0',
|
|
||||||
rsVarRange = '\\ufe0e\\ufe0f';
|
|
||||||
|
|
||||||
/** Used to compose unicode capture groups. */
|
|
||||||
var rsAstral = '[' + rsAstralRange + ']',
|
|
||||||
rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']',
|
|
||||||
rsFitz = '\\ud83c[\\udffb-\\udfff]',
|
|
||||||
rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
|
|
||||||
rsNonAstral = '[^' + rsAstralRange + ']',
|
|
||||||
rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
|
|
||||||
rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
|
|
||||||
rsZWJ = '\\u200d';
|
|
||||||
|
|
||||||
/** Used to compose unicode regexes. */
|
|
||||||
var reOptMod = rsModifier + '?',
|
|
||||||
rsOptVar = '[' + rsVarRange + ']?',
|
|
||||||
rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
|
|
||||||
rsSeq = rsOptVar + reOptMod + rsOptJoin,
|
|
||||||
rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
|
|
||||||
|
|
||||||
/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
|
|
||||||
var reComplexSymbol = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the number of symbols in `string`.
|
* Gets the number of symbols in `string`.
|
||||||
@@ -34,14 +8,9 @@ define(['./_reHasComplexSymbol'], function(reHasComplexSymbol) {
|
|||||||
* @returns {number} Returns the string size.
|
* @returns {number} Returns the string size.
|
||||||
*/
|
*/
|
||||||
function stringSize(string) {
|
function stringSize(string) {
|
||||||
if (!(string && reHasComplexSymbol.test(string))) {
|
return hasUnicode(string)
|
||||||
return string.length;
|
? unicodeSize(string)
|
||||||
}
|
: asciiSize(string);
|
||||||
var result = reComplexSymbol.lastIndex = 0;
|
|
||||||
while (reComplexSymbol.test(string)) {
|
|
||||||
result++;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return stringSize;
|
return stringSize;
|
||||||
|
|||||||
@@ -1,30 +1,4 @@
|
|||||||
define([], function() {
|
define(['./_asciiToArray', './_hasUnicode', './_unicodeToArray'], function(asciiToArray, hasUnicode, unicodeToArray) {
|
||||||
|
|
||||||
/** Used to compose unicode character classes. */
|
|
||||||
var rsAstralRange = '\\ud800-\\udfff',
|
|
||||||
rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23',
|
|
||||||
rsComboSymbolsRange = '\\u20d0-\\u20f0',
|
|
||||||
rsVarRange = '\\ufe0e\\ufe0f';
|
|
||||||
|
|
||||||
/** Used to compose unicode capture groups. */
|
|
||||||
var rsAstral = '[' + rsAstralRange + ']',
|
|
||||||
rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']',
|
|
||||||
rsFitz = '\\ud83c[\\udffb-\\udfff]',
|
|
||||||
rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
|
|
||||||
rsNonAstral = '[^' + rsAstralRange + ']',
|
|
||||||
rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
|
|
||||||
rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
|
|
||||||
rsZWJ = '\\u200d';
|
|
||||||
|
|
||||||
/** Used to compose unicode regexes. */
|
|
||||||
var reOptMod = rsModifier + '?',
|
|
||||||
rsOptVar = '[' + rsVarRange + ']?',
|
|
||||||
rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
|
|
||||||
rsSeq = rsOptVar + reOptMod + rsOptJoin,
|
|
||||||
rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
|
|
||||||
|
|
||||||
/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
|
|
||||||
var reComplexSymbol = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts `string` to an array.
|
* Converts `string` to an array.
|
||||||
@@ -34,7 +8,9 @@ define([], function() {
|
|||||||
* @returns {Array} Returns the converted array.
|
* @returns {Array} Returns the converted array.
|
||||||
*/
|
*/
|
||||||
function stringToArray(string) {
|
function stringToArray(string) {
|
||||||
return string.match(reComplexSymbol);
|
return hasUnicode(string)
|
||||||
|
? unicodeToArray(string)
|
||||||
|
: asciiToArray(string);
|
||||||
}
|
}
|
||||||
|
|
||||||
return stringToArray;
|
return stringToArray;
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
define(['./memoize', './toString'], function(memoize, toString) {
|
define(['./memoize', './toString'], function(memoize, toString) {
|
||||||
|
|
||||||
/** Used to match property names within property paths. */
|
/** Used to match property names within property paths. */
|
||||||
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(\.|\[\])(?:\4|$))/g;
|
var reLeadingDot = /^\./,
|
||||||
|
rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
||||||
|
|
||||||
/** Used to match backslashes in property paths. */
|
/** Used to match backslashes in property paths. */
|
||||||
var reEscapeChar = /\\(\\)?/g;
|
var reEscapeChar = /\\(\\)?/g;
|
||||||
@@ -14,8 +15,13 @@ define(['./memoize', './toString'], function(memoize, toString) {
|
|||||||
* @returns {Array} Returns the property path array.
|
* @returns {Array} Returns the property path array.
|
||||||
*/
|
*/
|
||||||
var stringToPath = memoize(function(string) {
|
var stringToPath = memoize(function(string) {
|
||||||
|
string = toString(string);
|
||||||
|
|
||||||
var result = [];
|
var result = [];
|
||||||
toString(string).replace(rePropName, function(match, number, quote, string) {
|
if (reLeadingDot.test(string)) {
|
||||||
|
result.push('');
|
||||||
|
}
|
||||||
|
string.replace(rePropName, function(match, number, quote, string) {
|
||||||
result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
|
result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
|
||||||
});
|
});
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
define([], function() {
|
define([], function() {
|
||||||
|
|
||||||
|
/** Used for built-in method references. */
|
||||||
|
var funcProto = Function.prototype;
|
||||||
|
|
||||||
/** Used to resolve the decompiled source of functions. */
|
/** Used to resolve the decompiled source of functions. */
|
||||||
var funcToString = Function.prototype.toString;
|
var funcToString = funcProto.toString;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts `func` to its source code.
|
* Converts `func` to its source code.
|
||||||
|
|||||||
45
_unicodeSize.js
Normal file
45
_unicodeSize.js
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
define([], function() {
|
||||||
|
|
||||||
|
/** Used to compose unicode character classes. */
|
||||||
|
var rsAstralRange = '\\ud800-\\udfff',
|
||||||
|
rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23',
|
||||||
|
rsComboSymbolsRange = '\\u20d0-\\u20f0',
|
||||||
|
rsVarRange = '\\ufe0e\\ufe0f';
|
||||||
|
|
||||||
|
/** Used to compose unicode capture groups. */
|
||||||
|
var rsAstral = '[' + rsAstralRange + ']',
|
||||||
|
rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']',
|
||||||
|
rsFitz = '\\ud83c[\\udffb-\\udfff]',
|
||||||
|
rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
|
||||||
|
rsNonAstral = '[^' + rsAstralRange + ']',
|
||||||
|
rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
|
||||||
|
rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
|
||||||
|
rsZWJ = '\\u200d';
|
||||||
|
|
||||||
|
/** Used to compose unicode regexes. */
|
||||||
|
var reOptMod = rsModifier + '?',
|
||||||
|
rsOptVar = '[' + rsVarRange + ']?',
|
||||||
|
rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
|
||||||
|
rsSeq = rsOptVar + reOptMod + rsOptJoin,
|
||||||
|
rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
|
||||||
|
|
||||||
|
/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
|
||||||
|
var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the size of a Unicode `string`.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {string} string The string inspect.
|
||||||
|
* @returns {number} Returns the string size.
|
||||||
|
*/
|
||||||
|
function unicodeSize(string) {
|
||||||
|
var result = reUnicode.lastIndex = 0;
|
||||||
|
while (reUnicode.test(string)) {
|
||||||
|
result++;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return unicodeSize;
|
||||||
|
});
|
||||||
41
_unicodeToArray.js
Normal file
41
_unicodeToArray.js
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
define([], function() {
|
||||||
|
|
||||||
|
/** Used to compose unicode character classes. */
|
||||||
|
var rsAstralRange = '\\ud800-\\udfff',
|
||||||
|
rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23',
|
||||||
|
rsComboSymbolsRange = '\\u20d0-\\u20f0',
|
||||||
|
rsVarRange = '\\ufe0e\\ufe0f';
|
||||||
|
|
||||||
|
/** Used to compose unicode capture groups. */
|
||||||
|
var rsAstral = '[' + rsAstralRange + ']',
|
||||||
|
rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']',
|
||||||
|
rsFitz = '\\ud83c[\\udffb-\\udfff]',
|
||||||
|
rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
|
||||||
|
rsNonAstral = '[^' + rsAstralRange + ']',
|
||||||
|
rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
|
||||||
|
rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
|
||||||
|
rsZWJ = '\\u200d';
|
||||||
|
|
||||||
|
/** Used to compose unicode regexes. */
|
||||||
|
var reOptMod = rsModifier + '?',
|
||||||
|
rsOptVar = '[' + rsVarRange + ']?',
|
||||||
|
rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
|
||||||
|
rsSeq = rsOptVar + reOptMod + rsOptJoin,
|
||||||
|
rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
|
||||||
|
|
||||||
|
/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
|
||||||
|
var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts a Unicode `string` to an array.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {string} string The string to convert.
|
||||||
|
* @returns {Array} Returns the converted array.
|
||||||
|
*/
|
||||||
|
function unicodeToArray(string) {
|
||||||
|
return string.match(reUnicode) || [];
|
||||||
|
}
|
||||||
|
|
||||||
|
return unicodeToArray;
|
||||||
|
});
|
||||||
66
_unicodeWords.js
Normal file
66
_unicodeWords.js
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
define([], function() {
|
||||||
|
|
||||||
|
/** Used to compose unicode character classes. */
|
||||||
|
var rsAstralRange = '\\ud800-\\udfff',
|
||||||
|
rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23',
|
||||||
|
rsComboSymbolsRange = '\\u20d0-\\u20f0',
|
||||||
|
rsDingbatRange = '\\u2700-\\u27bf',
|
||||||
|
rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
|
||||||
|
rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
|
||||||
|
rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
|
||||||
|
rsPunctuationRange = '\\u2000-\\u206f',
|
||||||
|
rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',
|
||||||
|
rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
|
||||||
|
rsVarRange = '\\ufe0e\\ufe0f',
|
||||||
|
rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
|
||||||
|
|
||||||
|
/** Used to compose unicode capture groups. */
|
||||||
|
var rsApos = "['\u2019]",
|
||||||
|
rsBreak = '[' + rsBreakRange + ']',
|
||||||
|
rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']',
|
||||||
|
rsDigits = '\\d+',
|
||||||
|
rsDingbat = '[' + rsDingbatRange + ']',
|
||||||
|
rsLower = '[' + rsLowerRange + ']',
|
||||||
|
rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
|
||||||
|
rsFitz = '\\ud83c[\\udffb-\\udfff]',
|
||||||
|
rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
|
||||||
|
rsNonAstral = '[^' + rsAstralRange + ']',
|
||||||
|
rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
|
||||||
|
rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
|
||||||
|
rsUpper = '[' + rsUpperRange + ']',
|
||||||
|
rsZWJ = '\\u200d';
|
||||||
|
|
||||||
|
/** Used to compose unicode regexes. */
|
||||||
|
var rsLowerMisc = '(?:' + rsLower + '|' + rsMisc + ')',
|
||||||
|
rsUpperMisc = '(?:' + rsUpper + '|' + rsMisc + ')',
|
||||||
|
rsOptLowerContr = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
|
||||||
|
rsOptUpperContr = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
|
||||||
|
reOptMod = rsModifier + '?',
|
||||||
|
rsOptVar = '[' + rsVarRange + ']?',
|
||||||
|
rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
|
||||||
|
rsSeq = rsOptVar + reOptMod + rsOptJoin,
|
||||||
|
rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq;
|
||||||
|
|
||||||
|
/** Used to match complex or compound words. */
|
||||||
|
var reUnicodeWord = RegExp([
|
||||||
|
rsUpper + '?' + rsLower + '+' + rsOptLowerContr + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
|
||||||
|
rsUpperMisc + '+' + rsOptUpperContr + '(?=' + [rsBreak, rsUpper + rsLowerMisc, '$'].join('|') + ')',
|
||||||
|
rsUpper + '?' + rsLowerMisc + '+' + rsOptLowerContr,
|
||||||
|
rsUpper + '+' + rsOptUpperContr,
|
||||||
|
rsDigits,
|
||||||
|
rsEmoji
|
||||||
|
].join('|'), 'g');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Splits a Unicode `string` into an array of its words.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {string} The string to inspect.
|
||||||
|
* @returns {Array} Returns the words of `string`.
|
||||||
|
*/
|
||||||
|
function unicodeWords(string) {
|
||||||
|
return string.match(reUnicodeWord) || [];
|
||||||
|
}
|
||||||
|
|
||||||
|
return unicodeWords;
|
||||||
|
});
|
||||||
19
assignIn.js
19
assignIn.js
@@ -1,13 +1,4 @@
|
|||||||
define(['./_assignValue', './_copyObject', './_createAssigner', './isArrayLike', './_isPrototype', './keysIn'], function(assignValue, copyObject, createAssigner, isArrayLike, isPrototype, keysIn) {
|
define(['./_copyObject', './_createAssigner', './keysIn'], function(copyObject, createAssigner, keysIn) {
|
||||||
|
|
||||||
/** Used for built-in method references. */
|
|
||||||
var objectProto = Object.prototype;
|
|
||||||
|
|
||||||
/** Built-in value references. */
|
|
||||||
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
|
||||||
|
|
||||||
/** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */
|
|
||||||
var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is like `_.assign` except that it iterates over own and
|
* This method is like `_.assign` except that it iterates over own and
|
||||||
@@ -41,13 +32,7 @@ define(['./_assignValue', './_copyObject', './_createAssigner', './isArrayLike',
|
|||||||
* // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
|
* // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
|
||||||
*/
|
*/
|
||||||
var assignIn = createAssigner(function(object, source) {
|
var assignIn = createAssigner(function(object, source) {
|
||||||
if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) {
|
copyObject(source, keysIn(source), object);
|
||||||
copyObject(source, keysIn(source), object);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
for (var key in source) {
|
|
||||||
assignValue(object, key, source[key]);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return assignIn;
|
return assignIn;
|
||||||
|
|||||||
@@ -5,6 +5,9 @@ define(['./_baseClone', './_baseConforms'], function(baseClone, baseConforms) {
|
|||||||
* the corresponding property values of a given object, returning `true` if
|
* the corresponding property values of a given object, returning `true` if
|
||||||
* all predicates return truthy, else `false`.
|
* all predicates return truthy, else `false`.
|
||||||
*
|
*
|
||||||
|
* **Note:** The created function is equivalent to `_.conformsTo` with
|
||||||
|
* `source` partially applied.
|
||||||
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
* @since 4.0.0
|
* @since 4.0.0
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
define(['./_baseConformsTo', './keys'], function(baseConformsTo, keys) {
|
define(['./_baseConformsTo', './keys'], function(baseConformsTo, keys) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if `object` conforms to `source` by invoking the predicate properties
|
* Checks if `object` conforms to `source` by invoking the predicate
|
||||||
* of `source` with the corresponding property values of `object`. This method
|
* properties of `source` with the corresponding property values of `object`.
|
||||||
* is equivalent to a `_.conforms` function when `source` is partially applied.
|
*
|
||||||
|
* **Note:** This method is equivalent to `_.conforms` when `source` is
|
||||||
|
* partially applied.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
|
|||||||
18
debounce.js
18
debounce.js
@@ -15,14 +15,18 @@ define(['./isObject', './now', './toNumber'], function(isObject, now, toNumber)
|
|||||||
* milliseconds have elapsed since the last time the debounced function was
|
* milliseconds have elapsed since the last time the debounced function was
|
||||||
* invoked. The debounced function comes with a `cancel` method to cancel
|
* invoked. The debounced function comes with a `cancel` method to cancel
|
||||||
* delayed `func` invocations and a `flush` method to immediately invoke them.
|
* delayed `func` invocations and a `flush` method to immediately invoke them.
|
||||||
* Provide an options object to indicate whether `func` should be invoked on
|
* Provide `options` to indicate whether `func` should be invoked on the
|
||||||
* the leading and/or trailing edge of the `wait` timeout. The `func` is invoked
|
* leading and/or trailing edge of the `wait` timeout. The `func` is invoked
|
||||||
* with the last arguments provided to the debounced function. Subsequent calls
|
* with the last arguments provided to the debounced function. Subsequent
|
||||||
* to the debounced function return the result of the last `func` invocation.
|
* calls to the debounced function return the result of the last `func`
|
||||||
|
* invocation.
|
||||||
*
|
*
|
||||||
* **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
|
* **Note:** If `leading` and `trailing` options are `true`, `func` is
|
||||||
* on the trailing edge of the timeout only if the debounced function is
|
* invoked on the trailing edge of the timeout only if the debounced function
|
||||||
* invoked more than once during the `wait` timeout.
|
* is invoked more than once during the `wait` timeout.
|
||||||
|
*
|
||||||
|
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
|
||||||
|
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
|
||||||
*
|
*
|
||||||
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
|
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
|
||||||
* for details over the differences between `_.debounce` and `_.throttle`.
|
* for details over the differences between `_.debounce` and `_.throttle`.
|
||||||
|
|||||||
11
deburr.js
11
deburr.js
@@ -1,7 +1,7 @@
|
|||||||
define(['./_deburrLetter', './toString'], function(deburrLetter, toString) {
|
define(['./_deburrLetter', './toString'], function(deburrLetter, toString) {
|
||||||
|
|
||||||
/** Used to match latin-1 supplementary letters (excluding mathematical operators). */
|
/** Used to match Latin Unicode letters (excluding mathematical operators). */
|
||||||
var reLatin1 = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g;
|
var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
|
||||||
|
|
||||||
/** Used to compose unicode character classes. */
|
/** Used to compose unicode character classes. */
|
||||||
var rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23',
|
var rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23',
|
||||||
@@ -18,8 +18,9 @@ define(['./_deburrLetter', './toString'], function(deburrLetter, toString) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Deburrs `string` by converting
|
* Deburrs `string` by converting
|
||||||
* [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
|
* [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
|
||||||
* to basic latin letters and removing
|
* and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
|
||||||
|
* letters to basic Latin letters and removing
|
||||||
* [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
|
* [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
@@ -35,7 +36,7 @@ define(['./_deburrLetter', './toString'], function(deburrLetter, toString) {
|
|||||||
*/
|
*/
|
||||||
function deburr(string) {
|
function deburr(string) {
|
||||||
string = toString(string);
|
string = toString(string);
|
||||||
return string && string.replace(reLatin1, deburrLetter).replace(reComboMark, '');
|
return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
return deburr;
|
return deburr;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ define(['./_baseDifference', './_baseFlatten', './_baseRest', './isArrayLikeObje
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an array of `array` values not included in the other given arrays
|
* Creates an array of `array` values not included in the other given arrays
|
||||||
* using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
|
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
||||||
* for equality comparisons. The order of result values is determined by the
|
* for equality comparisons. The order of result values is determined by the
|
||||||
* order they occur in the first array.
|
* order they occur in the first array.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ define(['./_baseClamp', './_baseToString', './toInteger', './toString'], functio
|
|||||||
* @memberOf _
|
* @memberOf _
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
* @category String
|
* @category String
|
||||||
* @param {string} [string=''] The string to search.
|
* @param {string} [string=''] The string to inspect.
|
||||||
* @param {string} [target] The string to search for.
|
* @param {string} [target] The string to search for.
|
||||||
* @param {number} [position=string.length] The position to search up to.
|
* @param {number} [position=string.length] The position to search up to.
|
||||||
* @returns {boolean} Returns `true` if `string` ends with `target`,
|
* @returns {boolean} Returns `true` if `string` ends with `target`,
|
||||||
|
|||||||
2
eq.js
2
eq.js
@@ -2,7 +2,7 @@ define([], function() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Performs a
|
* Performs a
|
||||||
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
|
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
||||||
* comparison between two values to determine if they are equivalent.
|
* comparison between two values to determine if they are equivalent.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ define(['./toString'], function(toString) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to match `RegExp`
|
* Used to match `RegExp`
|
||||||
* [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns).
|
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
||||||
*/
|
*/
|
||||||
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
|
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
|
||||||
reHasRegExpChar = RegExp(reRegExpChar.source);
|
reHasRegExpChar = RegExp(reRegExpChar.source);
|
||||||
|
|||||||
5
every.js
5
every.js
@@ -8,6 +8,11 @@ define(['./_arrayEvery', './_baseEvery', './_baseIteratee', './isArray', './_isI
|
|||||||
* Iteration is stopped once `predicate` returns falsey. The predicate is
|
* Iteration is stopped once `predicate` returns falsey. The predicate is
|
||||||
* invoked with three arguments: (value, index|key, collection).
|
* invoked with three arguments: (value, index|key, collection).
|
||||||
*
|
*
|
||||||
|
* **Note:** This method returns `true` for
|
||||||
|
* [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
|
||||||
|
* [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
|
||||||
|
* elements of empty collections.
|
||||||
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
* @since 0.1.0
|
* @since 0.1.0
|
||||||
|
|||||||
2
find.js
2
find.js
@@ -9,7 +9,7 @@ define(['./_createFind', './findIndex'], function(createFind, findIndex) {
|
|||||||
* @memberOf _
|
* @memberOf _
|
||||||
* @since 0.1.0
|
* @since 0.1.0
|
||||||
* @category Collection
|
* @category Collection
|
||||||
* @param {Array|Object} collection The collection to search.
|
* @param {Array|Object} collection The collection to inspect.
|
||||||
* @param {Function} [predicate=_.identity]
|
* @param {Function} [predicate=_.identity]
|
||||||
* The function invoked per iteration.
|
* The function invoked per iteration.
|
||||||
* @param {number} [fromIndex=0] The index to search from.
|
* @param {number} [fromIndex=0] The index to search from.
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ define(['./_baseFindIndex', './_baseIteratee', './toInteger'], function(baseFind
|
|||||||
* @memberOf _
|
* @memberOf _
|
||||||
* @since 1.1.0
|
* @since 1.1.0
|
||||||
* @category Array
|
* @category Array
|
||||||
* @param {Array} array The array to search.
|
* @param {Array} array The array to inspect.
|
||||||
* @param {Function} [predicate=_.identity]
|
* @param {Function} [predicate=_.identity]
|
||||||
* The function invoked per iteration.
|
* The function invoked per iteration.
|
||||||
* @param {number} [fromIndex=0] The index to search from.
|
* @param {number} [fromIndex=0] The index to search from.
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ define(['./_baseFindKey', './_baseForOwn', './_baseIteratee'], function(baseFind
|
|||||||
* @memberOf _
|
* @memberOf _
|
||||||
* @since 1.1.0
|
* @since 1.1.0
|
||||||
* @category Object
|
* @category Object
|
||||||
* @param {Object} object The object to search.
|
* @param {Object} object The object to inspect.
|
||||||
* @param {Function} [predicate=_.identity] The function invoked per iteration.
|
* @param {Function} [predicate=_.identity] The function invoked per iteration.
|
||||||
* @returns {string|undefined} Returns the key of the matched element,
|
* @returns {string|undefined} Returns the key of the matched element,
|
||||||
* else `undefined`.
|
* else `undefined`.
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ define(['./_createFind', './findLastIndex'], function(createFind, findLastIndex)
|
|||||||
* @memberOf _
|
* @memberOf _
|
||||||
* @since 2.0.0
|
* @since 2.0.0
|
||||||
* @category Collection
|
* @category Collection
|
||||||
* @param {Array|Object} collection The collection to search.
|
* @param {Array|Object} collection The collection to inspect.
|
||||||
* @param {Function} [predicate=_.identity]
|
* @param {Function} [predicate=_.identity]
|
||||||
* The function invoked per iteration.
|
* The function invoked per iteration.
|
||||||
* @param {number} [fromIndex=collection.length-1] The index to search from.
|
* @param {number} [fromIndex=collection.length-1] The index to search from.
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ define(['./_baseFindIndex', './_baseIteratee', './toInteger'], function(baseFind
|
|||||||
* @memberOf _
|
* @memberOf _
|
||||||
* @since 2.0.0
|
* @since 2.0.0
|
||||||
* @category Array
|
* @category Array
|
||||||
* @param {Array} array The array to search.
|
* @param {Array} array The array to inspect.
|
||||||
* @param {Function} [predicate=_.identity]
|
* @param {Function} [predicate=_.identity]
|
||||||
* The function invoked per iteration.
|
* The function invoked per iteration.
|
||||||
* @param {number} [fromIndex=array.length-1] The index to search from.
|
* @param {number} [fromIndex=array.length-1] The index to search from.
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ define(['./_baseFindKey', './_baseForOwnRight', './_baseIteratee'], function(bas
|
|||||||
* @memberOf _
|
* @memberOf _
|
||||||
* @since 2.0.0
|
* @since 2.0.0
|
||||||
* @category Object
|
* @category Object
|
||||||
* @param {Object} object The object to search.
|
* @param {Object} object The object to inspect.
|
||||||
* @param {Function} [predicate=_.identity] The function invoked per iteration.
|
* @param {Function} [predicate=_.identity] The function invoked per iteration.
|
||||||
* @returns {string|undefined} Returns the key of the matched element,
|
* @returns {string|undefined} Returns the key of the matched element,
|
||||||
* else `undefined`.
|
* else `undefined`.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
define(['./_baseInRange', './toNumber'], function(baseInRange, toNumber) {
|
define(['./_baseInRange', './toFinite', './toNumber'], function(baseInRange, toFinite, toNumber) {
|
||||||
|
|
||||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||||
var undefined;
|
var undefined;
|
||||||
@@ -42,12 +42,12 @@ define(['./_baseInRange', './toNumber'], function(baseInRange, toNumber) {
|
|||||||
* // => true
|
* // => true
|
||||||
*/
|
*/
|
||||||
function inRange(number, start, end) {
|
function inRange(number, start, end) {
|
||||||
start = toNumber(start) || 0;
|
start = toFinite(start);
|
||||||
if (end === undefined) {
|
if (end === undefined) {
|
||||||
end = start;
|
end = start;
|
||||||
start = 0;
|
start = 0;
|
||||||
} else {
|
} else {
|
||||||
end = toNumber(end) || 0;
|
end = toFinite(end);
|
||||||
}
|
}
|
||||||
number = toNumber(number);
|
number = toNumber(number);
|
||||||
return baseInRange(number, start, end);
|
return baseInRange(number, start, end);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ define(['./_baseIndexOf', './isArrayLike', './isString', './toInteger', './value
|
|||||||
/**
|
/**
|
||||||
* Checks if `value` is in `collection`. If `collection` is a string, it's
|
* Checks if `value` is in `collection`. If `collection` is a string, it's
|
||||||
* checked for a substring of `value`, otherwise
|
* checked for a substring of `value`, otherwise
|
||||||
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
|
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
||||||
* is used for equality comparisons. If `fromIndex` is negative, it's used as
|
* is used for equality comparisons. If `fromIndex` is negative, it's used as
|
||||||
* the offset from the end of `collection`.
|
* the offset from the end of `collection`.
|
||||||
*
|
*
|
||||||
@@ -14,7 +14,7 @@ define(['./_baseIndexOf', './isArrayLike', './isString', './toInteger', './value
|
|||||||
* @memberOf _
|
* @memberOf _
|
||||||
* @since 0.1.0
|
* @since 0.1.0
|
||||||
* @category Collection
|
* @category Collection
|
||||||
* @param {Array|Object|string} collection The collection to search.
|
* @param {Array|Object|string} collection The collection to inspect.
|
||||||
* @param {*} value The value to search for.
|
* @param {*} value The value to search for.
|
||||||
* @param {number} [fromIndex=0] The index to search from.
|
* @param {number} [fromIndex=0] The index to search from.
|
||||||
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
|
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ define(['./_baseIndexOf', './toInteger'], function(baseIndexOf, toInteger) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the index at which the first occurrence of `value` is found in `array`
|
* Gets the index at which the first occurrence of `value` is found in `array`
|
||||||
* using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
|
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
||||||
* for equality comparisons. If `fromIndex` is negative, it's used as the
|
* for equality comparisons. If `fromIndex` is negative, it's used as the
|
||||||
* offset from the end of `array`.
|
* offset from the end of `array`.
|
||||||
*
|
*
|
||||||
@@ -13,7 +13,7 @@ define(['./_baseIndexOf', './toInteger'], function(baseIndexOf, toInteger) {
|
|||||||
* @memberOf _
|
* @memberOf _
|
||||||
* @since 0.1.0
|
* @since 0.1.0
|
||||||
* @category Array
|
* @category Array
|
||||||
* @param {Array} array The array to search.
|
* @param {Array} array The array to inspect.
|
||||||
* @param {*} value The value to search for.
|
* @param {*} value The value to search for.
|
||||||
* @param {number} [fromIndex=0] The index to search from.
|
* @param {number} [fromIndex=0] The index to search from.
|
||||||
* @returns {number} Returns the index of the matched value, else `-1`.
|
* @returns {number} Returns the index of the matched value, else `-1`.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
define(['./dropRight'], function(dropRight) {
|
define(['./_baseSlice'], function(baseSlice) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets all but the last element of `array`.
|
* Gets all but the last element of `array`.
|
||||||
@@ -15,7 +15,8 @@ define(['./dropRight'], function(dropRight) {
|
|||||||
* // => [1, 2]
|
* // => [1, 2]
|
||||||
*/
|
*/
|
||||||
function initial(array) {
|
function initial(array) {
|
||||||
return dropRight(array, 1);
|
var length = array ? array.length : 0;
|
||||||
|
return length ? baseSlice(array, 0, -1) : [];
|
||||||
}
|
}
|
||||||
|
|
||||||
return initial;
|
return initial;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ define(['./_arrayMap', './_baseIntersection', './_baseRest', './_castArrayLikeOb
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an array of unique values that are included in all given arrays
|
* Creates an array of unique values that are included in all given arrays
|
||||||
* using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
|
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
||||||
* for equality comparisons. The order of result values is determined by the
|
* for equality comparisons. The order of result values is determined by the
|
||||||
* order they occur in the first array.
|
* order they occur in the first array.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ define(['./isArrayLikeObject'], function(isArrayLikeObject) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to resolve the
|
* Used to resolve the
|
||||||
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
||||||
* of values.
|
* of values.
|
||||||
*/
|
*/
|
||||||
var objectToString = objectProto.toString;
|
var objectToString = objectProto.toString;
|
||||||
@@ -38,7 +38,7 @@ define(['./isArrayLikeObject'], function(isArrayLikeObject) {
|
|||||||
* // => false
|
* // => false
|
||||||
*/
|
*/
|
||||||
function isArguments(value) {
|
function isArguments(value) {
|
||||||
// Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode.
|
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
|
||||||
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
|
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
|
||||||
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
|
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
define(['./_getLength', './isFunction', './isLength'], function(getLength, isFunction, isLength) {
|
define(['./isFunction', './isLength'], function(isFunction, isLength) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if `value` is array-like. A value is considered array-like if it's
|
* Checks if `value` is array-like. A value is considered array-like if it's
|
||||||
@@ -26,7 +26,7 @@ define(['./_getLength', './isFunction', './isLength'], function(getLength, isFun
|
|||||||
* // => false
|
* // => false
|
||||||
*/
|
*/
|
||||||
function isArrayLike(value) {
|
function isArrayLike(value) {
|
||||||
return value != null && isLength(getLength(value)) && !isFunction(value);
|
return value != null && isLength(value.length) && !isFunction(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
return isArrayLike;
|
return isArrayLike;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ define(['./isObjectLike'], function(isObjectLike) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to resolve the
|
* Used to resolve the
|
||||||
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
||||||
* of values.
|
* of values.
|
||||||
*/
|
*/
|
||||||
var objectToString = objectProto.toString;
|
var objectToString = objectProto.toString;
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
define(['./_freeGlobal', './_root', './stubFalse'], function(freeGlobal, root, stubFalse) {
|
define(['./_root', './stubFalse'], function(root, stubFalse) {
|
||||||
|
|
||||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||||
var undefined;
|
var undefined;
|
||||||
|
|
||||||
/** Detect free variable `exports`. */
|
/** Detect free variable `exports`. */
|
||||||
var freeExports = freeGlobal && typeof exports == 'object' && exports;
|
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
|
||||||
|
|
||||||
/** Detect free variable `module`. */
|
/** Detect free variable `module`. */
|
||||||
var freeModule = freeExports && typeof module == 'object' && module;
|
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
|
||||||
|
|
||||||
/** Detect the popular CommonJS extension `module.exports`. */
|
/** Detect the popular CommonJS extension `module.exports`. */
|
||||||
var moduleExports = freeModule && freeModule.exports === freeExports;
|
var moduleExports = freeModule && freeModule.exports === freeExports;
|
||||||
|
|||||||
@@ -8,8 +8,7 @@ define(['./isObjectLike', './isPlainObject'], function(isObjectLike, isPlainObje
|
|||||||
* @since 0.1.0
|
* @since 0.1.0
|
||||||
* @category Lang
|
* @category Lang
|
||||||
* @param {*} value The value to check.
|
* @param {*} value The value to check.
|
||||||
* @returns {boolean} Returns `true` if `value` is a DOM element,
|
* @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
|
||||||
* else `false`.
|
|
||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
* _.isElement(document.body);
|
* _.isElement(document.body);
|
||||||
|
|||||||
19
isEmpty.js
19
isEmpty.js
@@ -1,4 +1,4 @@
|
|||||||
define(['./_getTag', './isArguments', './isArray', './isArrayLike', './isBuffer', './isFunction', './isObjectLike', './isString', './keys'], function(getTag, isArguments, isArray, isArrayLike, isBuffer, isFunction, isObjectLike, isString, keys) {
|
define(['./_getTag', './isArguments', './isArray', './isArrayLike', './isBuffer', './_isPrototype', './_nativeKeys'], function(getTag, isArguments, isArray, isArrayLike, isBuffer, isPrototype, nativeKeys) {
|
||||||
|
|
||||||
/** `Object#toString` result references. */
|
/** `Object#toString` result references. */
|
||||||
var mapTag = '[object Map]',
|
var mapTag = '[object Map]',
|
||||||
@@ -51,22 +51,23 @@ define(['./_getTag', './isArguments', './isArray', './isArrayLike', './isBuffer'
|
|||||||
*/
|
*/
|
||||||
function isEmpty(value) {
|
function isEmpty(value) {
|
||||||
if (isArrayLike(value) &&
|
if (isArrayLike(value) &&
|
||||||
(isArray(value) || isString(value) || isFunction(value.splice) ||
|
(isArray(value) || typeof value == 'string' ||
|
||||||
isArguments(value) || isBuffer(value))) {
|
typeof value.splice == 'function' || isBuffer(value) || isArguments(value))) {
|
||||||
return !value.length;
|
return !value.length;
|
||||||
}
|
}
|
||||||
if (isObjectLike(value)) {
|
var tag = getTag(value);
|
||||||
var tag = getTag(value);
|
if (tag == mapTag || tag == setTag) {
|
||||||
if (tag == mapTag || tag == setTag) {
|
return !value.size;
|
||||||
return !value.size;
|
}
|
||||||
}
|
if (nonEnumShadows || isPrototype(value)) {
|
||||||
|
return !nativeKeys(value).length;
|
||||||
}
|
}
|
||||||
for (var key in value) {
|
for (var key in value) {
|
||||||
if (hasOwnProperty.call(value, key)) {
|
if (hasOwnProperty.call(value, key)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return !(nonEnumShadows && keys(value).length);
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return isEmpty;
|
return isEmpty;
|
||||||
|
|||||||
@@ -16,8 +16,7 @@ define(['./_baseIsEqual'], function(baseIsEqual) {
|
|||||||
* @category Lang
|
* @category Lang
|
||||||
* @param {*} value The value to compare.
|
* @param {*} value The value to compare.
|
||||||
* @param {*} other The other value to compare.
|
* @param {*} other The other value to compare.
|
||||||
* @returns {boolean} Returns `true` if the values are equivalent,
|
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
||||||
* else `false`.
|
|
||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
* var object = { 'a': 1 };
|
* var object = { 'a': 1 };
|
||||||
|
|||||||
@@ -16,8 +16,7 @@ define(['./_baseIsEqual'], function(baseIsEqual) {
|
|||||||
* @param {*} value The value to compare.
|
* @param {*} value The value to compare.
|
||||||
* @param {*} other The other value to compare.
|
* @param {*} other The other value to compare.
|
||||||
* @param {Function} [customizer] The function to customize comparisons.
|
* @param {Function} [customizer] The function to customize comparisons.
|
||||||
* @returns {boolean} Returns `true` if the values are equivalent,
|
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
||||||
* else `false`.
|
|
||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
* function isGreeting(value) {
|
* function isGreeting(value) {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ define(['./isObjectLike'], function(isObjectLike) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to resolve the
|
* Used to resolve the
|
||||||
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
||||||
* of values.
|
* of values.
|
||||||
*/
|
*/
|
||||||
var objectToString = objectProto.toString;
|
var objectToString = objectProto.toString;
|
||||||
@@ -22,8 +22,7 @@ define(['./isObjectLike'], function(isObjectLike) {
|
|||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
* @category Lang
|
* @category Lang
|
||||||
* @param {*} value The value to check.
|
* @param {*} value The value to check.
|
||||||
* @returns {boolean} Returns `true` if `value` is an error object,
|
* @returns {boolean} Returns `true` if `value` is an error object, else `false`.
|
||||||
* else `false`.
|
|
||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
* _.isError(new Error);
|
* _.isError(new Error);
|
||||||
|
|||||||
@@ -14,8 +14,7 @@ define(['./_root'], function(root) {
|
|||||||
* @since 0.1.0
|
* @since 0.1.0
|
||||||
* @category Lang
|
* @category Lang
|
||||||
* @param {*} value The value to check.
|
* @param {*} value The value to check.
|
||||||
* @returns {boolean} Returns `true` if `value` is a finite number,
|
* @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
|
||||||
* else `false`.
|
|
||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
* _.isFinite(3);
|
* _.isFinite(3);
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ define(['./isObject'], function(isObject) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to resolve the
|
* Used to resolve the
|
||||||
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
||||||
* of values.
|
* of values.
|
||||||
*/
|
*/
|
||||||
var objectToString = objectProto.toString;
|
var objectToString = objectProto.toString;
|
||||||
@@ -33,8 +33,7 @@ define(['./isObject'], function(isObject) {
|
|||||||
*/
|
*/
|
||||||
function isFunction(value) {
|
function isFunction(value) {
|
||||||
// The use of `Object#toString` avoids issues with the `typeof` operator
|
// The use of `Object#toString` avoids issues with the `typeof` operator
|
||||||
// in Safari 8 which returns 'object' for typed array and weak map constructors,
|
// in Safari 8-9 which returns 'object' for typed array and other constructors.
|
||||||
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
|
|
||||||
var tag = isObject(value) ? objectToString.call(value) : '';
|
var tag = isObject(value) ? objectToString.call(value) : '';
|
||||||
return tag == funcTag || tag == genTag;
|
return tag == funcTag || tag == genTag;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,16 +6,15 @@ define([], function() {
|
|||||||
/**
|
/**
|
||||||
* Checks if `value` is a valid array-like length.
|
* Checks if `value` is a valid array-like length.
|
||||||
*
|
*
|
||||||
* **Note:** This function is loosely based on
|
* **Note:** This method is loosely based on
|
||||||
* [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
|
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
* @since 4.0.0
|
* @since 4.0.0
|
||||||
* @category Lang
|
* @category Lang
|
||||||
* @param {*} value The value to check.
|
* @param {*} value The value to check.
|
||||||
* @returns {boolean} Returns `true` if `value` is a valid length,
|
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
|
||||||
* else `false`.
|
|
||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
* _.isLength(3);
|
* _.isLength(3);
|
||||||
|
|||||||
10
isMatch.js
10
isMatch.js
@@ -2,10 +2,14 @@ define(['./_baseIsMatch', './_getMatchData'], function(baseIsMatch, getMatchData
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Performs a partial deep comparison between `object` and `source` to
|
* Performs a partial deep comparison between `object` and `source` to
|
||||||
* determine if `object` contains equivalent property values. This method is
|
* determine if `object` contains equivalent property values.
|
||||||
* equivalent to a `_.matches` function when `source` is partially applied.
|
|
||||||
*
|
*
|
||||||
* **Note:** This method supports comparing the same values as `_.isEqual`.
|
* **Note:** This method is equivalent to `_.matches` when `source` is
|
||||||
|
* partially applied.
|
||||||
|
*
|
||||||
|
* Partial comparisons will match empty array and empty object `source`
|
||||||
|
* values against any array or object value, respectively. See `_.isEqual`
|
||||||
|
* for a list of supported value comparisons.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ define(['./isObjectLike'], function(isObjectLike) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to resolve the
|
* Used to resolve the
|
||||||
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
||||||
* of values.
|
* of values.
|
||||||
*/
|
*/
|
||||||
var objectToString = objectProto.toString;
|
var objectToString = objectProto.toString;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ define([], function() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if `value` is the
|
* Checks if `value` is the
|
||||||
* [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types)
|
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
||||||
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
|
|||||||
@@ -4,10 +4,11 @@ define(['./_getPrototype', './_isHostObject', './isObjectLike'], function(getPro
|
|||||||
var objectTag = '[object Object]';
|
var objectTag = '[object Object]';
|
||||||
|
|
||||||
/** Used for built-in method references. */
|
/** Used for built-in method references. */
|
||||||
var objectProto = Object.prototype;
|
var funcProto = Function.prototype,
|
||||||
|
objectProto = Object.prototype;
|
||||||
|
|
||||||
/** Used to resolve the decompiled source of functions. */
|
/** Used to resolve the decompiled source of functions. */
|
||||||
var funcToString = Function.prototype.toString;
|
var funcToString = funcProto.toString;
|
||||||
|
|
||||||
/** Used to check objects for own properties. */
|
/** Used to check objects for own properties. */
|
||||||
var hasOwnProperty = objectProto.hasOwnProperty;
|
var hasOwnProperty = objectProto.hasOwnProperty;
|
||||||
@@ -17,7 +18,7 @@ define(['./_getPrototype', './_isHostObject', './isObjectLike'], function(getPro
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to resolve the
|
* Used to resolve the
|
||||||
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
||||||
* of values.
|
* of values.
|
||||||
*/
|
*/
|
||||||
var objectToString = objectProto.toString;
|
var objectToString = objectProto.toString;
|
||||||
@@ -31,8 +32,7 @@ define(['./_getPrototype', './_isHostObject', './isObjectLike'], function(getPro
|
|||||||
* @since 0.8.0
|
* @since 0.8.0
|
||||||
* @category Lang
|
* @category Lang
|
||||||
* @param {*} value The value to check.
|
* @param {*} value The value to check.
|
||||||
* @returns {boolean} Returns `true` if `value` is a plain object,
|
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
|
||||||
* else `false`.
|
|
||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
* function Foo() {
|
* function Foo() {
|
||||||
|
|||||||
@@ -15,8 +15,7 @@ define(['./isInteger'], function(isInteger) {
|
|||||||
* @since 4.0.0
|
* @since 4.0.0
|
||||||
* @category Lang
|
* @category Lang
|
||||||
* @param {*} value The value to check.
|
* @param {*} value The value to check.
|
||||||
* @returns {boolean} Returns `true` if `value` is a safe integer,
|
* @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
|
||||||
* else `false`.
|
|
||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
* _.isSafeInteger(3);
|
* _.isSafeInteger(3);
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ define(['./isArray', './isObjectLike'], function(isArray, isObjectLike) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to resolve the
|
* Used to resolve the
|
||||||
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
||||||
* of values.
|
* of values.
|
||||||
*/
|
*/
|
||||||
var objectToString = objectProto.toString;
|
var objectToString = objectProto.toString;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ define(['./isObjectLike'], function(isObjectLike) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to resolve the
|
* Used to resolve the
|
||||||
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
||||||
* of values.
|
* of values.
|
||||||
*/
|
*/
|
||||||
var objectToString = objectProto.toString;
|
var objectToString = objectProto.toString;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ define(['./isObjectLike'], function(isObjectLike) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to resolve the
|
* Used to resolve the
|
||||||
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
||||||
* of values.
|
* of values.
|
||||||
*/
|
*/
|
||||||
var objectToString = objectProto.toString;
|
var objectToString = objectProto.toString;
|
||||||
|
|||||||
22
keys.js
22
keys.js
@@ -1,10 +1,10 @@
|
|||||||
define(['./_baseHas', './_baseKeys', './_indexKeys', './isArrayLike', './_isIndex', './_isPrototype'], function(baseHas, baseKeys, indexKeys, isArrayLike, isIndex, isPrototype) {
|
define(['./_arrayLikeKeys', './_baseKeys', './isArrayLike'], function(arrayLikeKeys, baseKeys, isArrayLike) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an array of the own enumerable property names of `object`.
|
* Creates an array of the own enumerable property names of `object`.
|
||||||
*
|
*
|
||||||
* **Note:** Non-object values are coerced to objects. See the
|
* **Note:** Non-object values are coerced to objects. See the
|
||||||
* [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)
|
* [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
|
||||||
* for more details.
|
* for more details.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
@@ -29,23 +29,7 @@ define(['./_baseHas', './_baseKeys', './_indexKeys', './isArrayLike', './_isInde
|
|||||||
* // => ['0', '1']
|
* // => ['0', '1']
|
||||||
*/
|
*/
|
||||||
function keys(object) {
|
function keys(object) {
|
||||||
var isProto = isPrototype(object);
|
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
|
||||||
if (!(isProto || isArrayLike(object))) {
|
|
||||||
return baseKeys(object);
|
|
||||||
}
|
|
||||||
var indexes = indexKeys(object),
|
|
||||||
skipIndexes = !!indexes,
|
|
||||||
result = indexes || [],
|
|
||||||
length = result.length;
|
|
||||||
|
|
||||||
for (var key in object) {
|
|
||||||
if (baseHas(object, key) &&
|
|
||||||
!(skipIndexes && (key == 'length' || isIndex(key, length))) &&
|
|
||||||
!(isProto && key == 'constructor')) {
|
|
||||||
result.push(key);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return keys;
|
return keys;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user