mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 07:47:49 +00:00
Apply let/const transform.
This commit is contained in:
@@ -2,6 +2,6 @@ import getNative from './_getNative.js';
|
||||
import root from './_root.js';
|
||||
|
||||
/* Built-in method references that are verified to be native. */
|
||||
var DataView = getNative(root, 'DataView');
|
||||
const DataView = getNative(root, 'DataView');
|
||||
|
||||
export default DataView;
|
||||
|
||||
6
_Hash.js
6
_Hash.js
@@ -12,12 +12,12 @@ import hashSet from './_hashSet.js';
|
||||
* @param {Array} [entries] The key-value pairs to cache.
|
||||
*/
|
||||
function Hash(entries) {
|
||||
var index = -1,
|
||||
length = entries == null ? 0 : entries.length;
|
||||
let index = -1;
|
||||
const length = entries == null ? 0 : entries.length;
|
||||
|
||||
this.clear();
|
||||
while (++index < length) {
|
||||
var entry = entries[index];
|
||||
const entry = entries[index];
|
||||
this.set(entry[0], entry[1]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
* @returns {Function} Returns `accumulator`.
|
||||
*/
|
||||
function arrayAggregator(array, setter, iteratee, accumulator) {
|
||||
var index = -1,
|
||||
length = array == null ? 0 : array.length;
|
||||
let index = -1;
|
||||
const length = array == null ? 0 : array.length;
|
||||
|
||||
while (++index < length) {
|
||||
var value = array[index];
|
||||
const value = array[index];
|
||||
setter(accumulator, value, iteratee(value), array);
|
||||
}
|
||||
return accumulator;
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
* @returns {Array} Returns `array`.
|
||||
*/
|
||||
function arrayEach(array, iteratee) {
|
||||
var index = -1,
|
||||
length = array == null ? 0 : array.length;
|
||||
let index = -1;
|
||||
const length = array == null ? 0 : array.length;
|
||||
|
||||
while (++index < length) {
|
||||
if (iteratee(array[index], index, array) === false) {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* @returns {Array} Returns `array`.
|
||||
*/
|
||||
function arrayEachRight(array, iteratee) {
|
||||
var length = array == null ? 0 : array.length;
|
||||
let length = array == null ? 0 : array.length;
|
||||
|
||||
while (length--) {
|
||||
if (iteratee(array[length], length, array) === false) {
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
* else `false`.
|
||||
*/
|
||||
function arrayEvery(array, predicate) {
|
||||
var index = -1,
|
||||
length = array == null ? 0 : array.length;
|
||||
let index = -1;
|
||||
const length = array == null ? 0 : array.length;
|
||||
|
||||
while (++index < length) {
|
||||
if (!predicate(array[index], index, array)) {
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
* @returns {Array} Returns the new filtered array.
|
||||
*/
|
||||
function arrayFilter(array, predicate) {
|
||||
var index = -1,
|
||||
length = array == null ? 0 : array.length,
|
||||
resIndex = 0,
|
||||
result = [];
|
||||
let index = -1;
|
||||
let resIndex = 0;
|
||||
const length = array == null ? 0 : array.length;
|
||||
const result = [];
|
||||
|
||||
while (++index < length) {
|
||||
var value = array[index];
|
||||
const value = array[index];
|
||||
if (predicate(value, index, array)) {
|
||||
result[resIndex++] = value;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import baseIndexOf from './_baseIndexOf.js';
|
||||
* @returns {boolean} Returns `true` if `target` is found, else `false`.
|
||||
*/
|
||||
function arrayIncludes(array, value) {
|
||||
var length = array == null ? 0 : array.length;
|
||||
const length = array == null ? 0 : array.length;
|
||||
return !!length && baseIndexOf(array, value, 0) > -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
* @returns {boolean} Returns `true` if `target` is found, else `false`.
|
||||
*/
|
||||
function arrayIncludesWith(array, value, comparator) {
|
||||
var index = -1,
|
||||
length = array == null ? 0 : array.length;
|
||||
let index = -1;
|
||||
const length = array == null ? 0 : array.length;
|
||||
|
||||
while (++index < length) {
|
||||
if (comparator(value, array[index])) {
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
* @returns {Array} Returns the new mapped array.
|
||||
*/
|
||||
function arrayMap(array, iteratee) {
|
||||
var index = -1,
|
||||
length = array == null ? 0 : array.length,
|
||||
result = Array(length);
|
||||
let index = -1;
|
||||
const length = array == null ? 0 : array.length;
|
||||
const result = Array(length);
|
||||
|
||||
while (++index < length) {
|
||||
result[index] = iteratee(array[index], index, array);
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
* @returns {Array} Returns `array`.
|
||||
*/
|
||||
function arrayPush(array, values) {
|
||||
var index = -1,
|
||||
length = values.length,
|
||||
offset = array.length;
|
||||
let index = -1;
|
||||
const length = values.length;
|
||||
const offset = array.length;
|
||||
|
||||
while (++index < length) {
|
||||
array[offset + index] = values[index];
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
* @returns {*} Returns the accumulated value.
|
||||
*/
|
||||
function arrayReduce(array, iteratee, accumulator, initAccum) {
|
||||
var index = -1,
|
||||
length = array == null ? 0 : array.length;
|
||||
let index = -1;
|
||||
const length = array == null ? 0 : array.length;
|
||||
|
||||
if (initAccum && length) {
|
||||
accumulator = array[++index];
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
* @returns {*} Returns the accumulated value.
|
||||
*/
|
||||
function arrayReduceRight(array, iteratee, accumulator, initAccum) {
|
||||
var length = array == null ? 0 : array.length;
|
||||
let length = array == null ? 0 : array.length;
|
||||
if (initAccum && length) {
|
||||
accumulator = array[--length];
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import baseRandom from './_baseRandom.js';
|
||||
* @returns {*} Returns the random element.
|
||||
*/
|
||||
function arraySample(array) {
|
||||
var length = array.length;
|
||||
const length = array.length;
|
||||
return length ? array[baseRandom(0, length - 1)] : undefined;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
* else `false`.
|
||||
*/
|
||||
function arraySome(array, predicate) {
|
||||
var index = -1,
|
||||
length = array == null ? 0 : array.length;
|
||||
let index = -1;
|
||||
const length = array == null ? 0 : array.length;
|
||||
|
||||
while (++index < length) {
|
||||
if (predicate(array[index], index, array)) {
|
||||
|
||||
@@ -7,6 +7,6 @@ import baseProperty from './_baseProperty.js';
|
||||
* @param {string} string The string inspect.
|
||||
* @returns {number} Returns the string size.
|
||||
*/
|
||||
var asciiSize = baseProperty('length');
|
||||
const asciiSize = baseProperty('length');
|
||||
|
||||
export default asciiSize;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/** Used to match words composed of alphanumeric characters. */
|
||||
var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
|
||||
const reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
|
||||
|
||||
/**
|
||||
* Splits an ASCII `string` into an array of its words.
|
||||
|
||||
@@ -2,10 +2,10 @@ import baseAssignValue from './_baseAssignValue.js';
|
||||
import eq from './eq.js';
|
||||
|
||||
/** Used for built-in method references. */
|
||||
var objectProto = Object.prototype;
|
||||
const objectProto = Object.prototype;
|
||||
|
||||
/** Used to check objects for own properties. */
|
||||
var hasOwnProperty = objectProto.hasOwnProperty;
|
||||
const hasOwnProperty = objectProto.hasOwnProperty;
|
||||
|
||||
/**
|
||||
* Assigns `value` to `key` of `object` if the existing value is not equivalent
|
||||
@@ -18,7 +18,7 @@ var hasOwnProperty = objectProto.hasOwnProperty;
|
||||
* @param {*} value The value to assign.
|
||||
*/
|
||||
function assignValue(object, key, value) {
|
||||
var objValue = object[key];
|
||||
const objValue = object[key];
|
||||
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
|
||||
(value === undefined && !(key in object))) {
|
||||
baseAssignValue(object, key, value);
|
||||
|
||||
@@ -9,7 +9,7 @@ import eq from './eq.js';
|
||||
* @returns {number} Returns the index of the matched value, else `-1`.
|
||||
*/
|
||||
function assocIndexOf(array, key) {
|
||||
var length = array.length;
|
||||
let length = array.length;
|
||||
while (length--) {
|
||||
if (eq(array[length][0], key)) {
|
||||
return length;
|
||||
|
||||
@@ -9,10 +9,10 @@ import get from './get.js';
|
||||
* @returns {Array} Returns the picked elements.
|
||||
*/
|
||||
function baseAt(object, paths) {
|
||||
var index = -1,
|
||||
length = paths.length,
|
||||
result = Array(length),
|
||||
skip = object == null;
|
||||
let index = -1;
|
||||
const length = paths.length;
|
||||
const result = Array(length);
|
||||
const skip = object == null;
|
||||
|
||||
while (++index < length) {
|
||||
result[index] = skip ? undefined : get(object, paths[index]);
|
||||
|
||||
@@ -7,15 +7,15 @@
|
||||
* @returns {boolean} Returns `true` if `object` conforms, else `false`.
|
||||
*/
|
||||
function baseConformsTo(object, source, props) {
|
||||
var length = props.length;
|
||||
let length = props.length;
|
||||
if (object == null) {
|
||||
return !length;
|
||||
}
|
||||
object = Object(object);
|
||||
while (length--) {
|
||||
var key = props[length],
|
||||
predicate = source[key],
|
||||
value = object[key];
|
||||
const key = props[length];
|
||||
const predicate = source[key];
|
||||
const value = object[key];
|
||||
|
||||
if ((value === undefined && !(key in object)) || !predicate(value)) {
|
||||
return false;
|
||||
|
||||
@@ -21,7 +21,7 @@ const baseCreate = (() => {
|
||||
return objectCreate(proto);
|
||||
}
|
||||
object.prototype = proto;
|
||||
var result = new object;
|
||||
const result = new object;
|
||||
object.prototype = undefined;
|
||||
return result;
|
||||
};
|
||||
|
||||
@@ -9,6 +9,6 @@ import createBaseEach from './_createBaseEach.js';
|
||||
* @param {Function} iteratee The function invoked per iteration.
|
||||
* @returns {Array|Object} Returns `collection`.
|
||||
*/
|
||||
var baseEach = createBaseEach(baseForOwn);
|
||||
const baseEach = createBaseEach(baseForOwn);
|
||||
|
||||
export default baseEach;
|
||||
|
||||
@@ -9,6 +9,6 @@ import createBaseEach from './_createBaseEach.js';
|
||||
* @param {Function} iteratee The function invoked per iteration.
|
||||
* @returns {Array|Object} Returns `collection`.
|
||||
*/
|
||||
var baseEachRight = createBaseEach(baseForOwnRight, true);
|
||||
const baseEachRight = createBaseEach(baseForOwnRight, true);
|
||||
|
||||
export default baseEachRight;
|
||||
|
||||
@@ -11,12 +11,12 @@ import isSymbol from './isSymbol.js';
|
||||
* @returns {*} Returns the extremum value.
|
||||
*/
|
||||
function baseExtremum(array, iteratee, comparator) {
|
||||
var index = -1,
|
||||
length = array.length;
|
||||
let index = -1;
|
||||
const length = array.length;
|
||||
|
||||
while (++index < length) {
|
||||
var value = array[index],
|
||||
current = iteratee(value);
|
||||
const value = array[index];
|
||||
const current = iteratee(value);
|
||||
|
||||
if (current != null && (computed === undefined
|
||||
? (current === current && !isSymbol(current))
|
||||
|
||||
@@ -12,7 +12,7 @@ import toLength from './toLength.js';
|
||||
* @returns {Array} Returns `array`.
|
||||
*/
|
||||
function baseFill(array, value, start, end) {
|
||||
var length = array.length;
|
||||
const length = array.length;
|
||||
|
||||
start = toInteger(start);
|
||||
if (start < 0) {
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
* @returns {number} Returns the index of the matched value, else `-1`.
|
||||
*/
|
||||
function baseFindIndex(array, predicate, fromIndex, fromRight) {
|
||||
var length = array.length,
|
||||
index = fromIndex + (fromRight ? 1 : -1);
|
||||
const length = array.length;
|
||||
let index = fromIndex + (fromRight ? 1 : -1);
|
||||
|
||||
while ((fromRight ? index-- : ++index < length)) {
|
||||
if (predicate(array[index], index, array)) {
|
||||
|
||||
@@ -13,14 +13,14 @@ import isFlattenable from './_isFlattenable.js';
|
||||
* @returns {Array} Returns the new flattened array.
|
||||
*/
|
||||
function baseFlatten(array, depth, predicate, isStrict, result) {
|
||||
var index = -1,
|
||||
length = array.length;
|
||||
let index = -1;
|
||||
const length = array.length;
|
||||
|
||||
predicate || (predicate = isFlattenable);
|
||||
result || (result = []);
|
||||
|
||||
while (++index < length) {
|
||||
var value = array[index];
|
||||
const value = array[index];
|
||||
if (depth > 0 && predicate(value)) {
|
||||
if (depth > 1) {
|
||||
// Recursively flatten arrays (susceptible to call stack limits).
|
||||
|
||||
@@ -11,6 +11,6 @@ import createBaseFor from './_createBaseFor.js';
|
||||
* @param {Function} keysFunc The function to get the keys of `object`.
|
||||
* @returns {Object} Returns `object`.
|
||||
*/
|
||||
var baseFor = createBaseFor();
|
||||
const baseFor = createBaseFor();
|
||||
|
||||
export default baseFor;
|
||||
|
||||
@@ -10,6 +10,6 @@ import createBaseFor from './_createBaseFor.js';
|
||||
* @param {Function} keysFunc The function to get the keys of `object`.
|
||||
* @returns {Object} Returns `object`.
|
||||
*/
|
||||
var baseForRight = createBaseFor(true);
|
||||
const baseForRight = createBaseFor(true);
|
||||
|
||||
export default baseForRight;
|
||||
|
||||
@@ -12,8 +12,8 @@ import toKey from './_toKey.js';
|
||||
function baseGet(object, path) {
|
||||
path = castPath(path, object);
|
||||
|
||||
var index = 0,
|
||||
length = path.length;
|
||||
let index = 0;
|
||||
const length = path.length;
|
||||
|
||||
while (object != null && index < length) {
|
||||
object = object[toKey(path[index++])];
|
||||
|
||||
@@ -13,7 +13,7 @@ import isArray from './isArray.js';
|
||||
* @returns {Array} Returns the array of property names and symbols.
|
||||
*/
|
||||
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
|
||||
var result = keysFunc(object);
|
||||
const result = keysFunc(object);
|
||||
return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
|
||||
}
|
||||
|
||||
|
||||
@@ -3,11 +3,11 @@ import getRawTag from './_getRawTag.js';
|
||||
import objectToString from './_objectToString.js';
|
||||
|
||||
/** `Object#toString` result references. */
|
||||
var nullTag = '[object Null]',
|
||||
undefinedTag = '[object Undefined]';
|
||||
const nullTag = '[object Null]';
|
||||
const undefinedTag = '[object Undefined]';
|
||||
|
||||
/** Built-in value references. */
|
||||
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
|
||||
const symToStringTag = Symbol ? Symbol.toStringTag : undefined;
|
||||
|
||||
/**
|
||||
* The base implementation of `getTag` without fallbacks for buggy environments.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/** Used for built-in method references. */
|
||||
var objectProto = Object.prototype;
|
||||
const objectProto = Object.prototype;
|
||||
|
||||
/** Used to check objects for own properties. */
|
||||
var hasOwnProperty = objectProto.hasOwnProperty;
|
||||
const hasOwnProperty = objectProto.hasOwnProperty;
|
||||
|
||||
/**
|
||||
* The base implementation of `_.has` without support for deep paths.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Built-in method references for those with the same name as other `lodash` methods. */
|
||||
var nativeMax = Math.max,
|
||||
nativeMin = Math.min;
|
||||
const nativeMax = Math.max;
|
||||
const nativeMin = Math.min;
|
||||
|
||||
/**
|
||||
* The base implementation of `_.inRange` which doesn't coerce arguments.
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
* @returns {number} Returns the index of the matched value, else `-1`.
|
||||
*/
|
||||
function baseIndexOfWith(array, value, fromIndex, comparator) {
|
||||
var index = fromIndex - 1,
|
||||
length = array.length;
|
||||
let index = fromIndex - 1;
|
||||
const length = array.length;
|
||||
|
||||
while (++index < length) {
|
||||
if (comparator(array[index], value)) {
|
||||
|
||||
@@ -17,7 +17,7 @@ import toKey from './_toKey.js';
|
||||
function baseInvoke(object, path, args) {
|
||||
path = castPath(path, object);
|
||||
object = parent(object, path);
|
||||
var func = object == null ? object : object[toKey(last(path))];
|
||||
const func = object == null ? object : object[toKey(last(path))];
|
||||
return func == null ? undefined : apply(func, object, args);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import baseGetTag from './_baseGetTag.js';
|
||||
import isObjectLike from './isObjectLike.js';
|
||||
|
||||
/** `Object#toString` result references. */
|
||||
var argsTag = '[object Arguments]';
|
||||
const argsTag = '[object Arguments]';
|
||||
|
||||
/**
|
||||
* The base implementation of `_.isArguments`.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import baseGetTag from './_baseGetTag.js';
|
||||
import isObjectLike from './isObjectLike.js';
|
||||
|
||||
var arrayBufferTag = '[object ArrayBuffer]';
|
||||
const arrayBufferTag = '[object ArrayBuffer]';
|
||||
|
||||
/**
|
||||
* The base implementation of `_.isArrayBuffer` without Node.js optimizations.
|
||||
|
||||
@@ -2,7 +2,7 @@ import baseGetTag from './_baseGetTag.js';
|
||||
import isObjectLike from './isObjectLike.js';
|
||||
|
||||
/** `Object#toString` result references. */
|
||||
var dateTag = '[object Date]';
|
||||
const dateTag = '[object Date]';
|
||||
|
||||
/**
|
||||
* The base implementation of `_.isDate` without Node.js optimizations.
|
||||
|
||||
@@ -2,7 +2,7 @@ import getTag from './_getTag.js';
|
||||
import isObjectLike from './isObjectLike.js';
|
||||
|
||||
/** `Object#toString` result references. */
|
||||
var mapTag = '[object Map]';
|
||||
const mapTag = '[object Map]';
|
||||
|
||||
/**
|
||||
* The base implementation of `_.isMap` without Node.js optimizations.
|
||||
|
||||
@@ -2,7 +2,7 @@ import baseGetTag from './_baseGetTag.js';
|
||||
import isObjectLike from './isObjectLike.js';
|
||||
|
||||
/** `Object#toString` result references. */
|
||||
var regexpTag = '[object RegExp]';
|
||||
const regexpTag = '[object RegExp]';
|
||||
|
||||
/**
|
||||
* The base implementation of `_.isRegExp` without Node.js optimizations.
|
||||
|
||||
@@ -2,7 +2,7 @@ import getTag from './_getTag.js';
|
||||
import isObjectLike from './isObjectLike.js';
|
||||
|
||||
/** `Object#toString` result references. */
|
||||
var setTag = '[object Set]';
|
||||
const setTag = '[object Set]';
|
||||
|
||||
/**
|
||||
* The base implementation of `_.isSet` without Node.js optimizations.
|
||||
|
||||
@@ -2,10 +2,10 @@ import isPrototype from './_isPrototype.js';
|
||||
import nativeKeys from './_nativeKeys.js';
|
||||
|
||||
/** Used for built-in method references. */
|
||||
var objectProto = Object.prototype;
|
||||
const objectProto = Object.prototype;
|
||||
|
||||
/** Used to check objects for own properties. */
|
||||
var hasOwnProperty = objectProto.hasOwnProperty;
|
||||
const hasOwnProperty = objectProto.hasOwnProperty;
|
||||
|
||||
/**
|
||||
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
|
||||
@@ -18,8 +18,8 @@ function baseKeys(object) {
|
||||
if (!isPrototype(object)) {
|
||||
return nativeKeys(object);
|
||||
}
|
||||
var result = [];
|
||||
for (var key in Object(object)) {
|
||||
const result = [];
|
||||
for (const key in Object(object)) {
|
||||
if (hasOwnProperty.call(object, key) && key != 'constructor') {
|
||||
result.push(key);
|
||||
}
|
||||
|
||||
@@ -3,10 +3,10 @@ import isPrototype from './_isPrototype.js';
|
||||
import nativeKeysIn from './_nativeKeysIn.js';
|
||||
|
||||
/** Used for built-in method references. */
|
||||
var objectProto = Object.prototype;
|
||||
const objectProto = Object.prototype;
|
||||
|
||||
/** Used to check objects for own properties. */
|
||||
var hasOwnProperty = objectProto.hasOwnProperty;
|
||||
const hasOwnProperty = objectProto.hasOwnProperty;
|
||||
|
||||
/**
|
||||
* The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
|
||||
@@ -19,10 +19,10 @@ function baseKeysIn(object) {
|
||||
if (!isObject(object)) {
|
||||
return nativeKeysIn(object);
|
||||
}
|
||||
var isProto = isPrototype(object),
|
||||
result = [];
|
||||
const isProto = isPrototype(object);
|
||||
const result = [];
|
||||
|
||||
for (var key in object) {
|
||||
for (const key in object) {
|
||||
if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
|
||||
result.push(key);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import matchesStrictComparable from './_matchesStrictComparable.js';
|
||||
* @returns {Function} Returns the new spec function.
|
||||
*/
|
||||
function baseMatches(source) {
|
||||
var matchData = getMatchData(source);
|
||||
const matchData = getMatchData(source);
|
||||
if (matchData.length == 1 && matchData[0][2]) {
|
||||
return matchesStrictComparable(matchData[0][0], matchData[0][1]);
|
||||
}
|
||||
|
||||
@@ -7,8 +7,8 @@ import matchesStrictComparable from './_matchesStrictComparable.js';
|
||||
import toKey from './_toKey.js';
|
||||
|
||||
/** Used to compose bitmasks for value comparisons. */
|
||||
var COMPARE_PARTIAL_FLAG = 1,
|
||||
COMPARE_UNORDERED_FLAG = 2;
|
||||
const COMPARE_PARTIAL_FLAG = 1;
|
||||
const COMPARE_UNORDERED_FLAG = 2;
|
||||
|
||||
/**
|
||||
* The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
|
||||
@@ -23,7 +23,7 @@ function baseMatchesProperty(path, srcValue) {
|
||||
return matchesStrictComparable(toKey(path), srcValue);
|
||||
}
|
||||
return object => {
|
||||
var objValue = get(object, path);
|
||||
const objValue = get(object, path);
|
||||
return (objValue === undefined && objValue === srcValue)
|
||||
? hasIn(object, path)
|
||||
: baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import baseSum from './_baseSum.js';
|
||||
|
||||
/** Used as references for various `Number` constants. */
|
||||
var NAN = 0 / 0;
|
||||
const NAN = 0 / 0;
|
||||
|
||||
/**
|
||||
* The base implementation of `_.mean` and `_.meanBy` without support for
|
||||
@@ -13,7 +13,7 @@ var NAN = 0 / 0;
|
||||
* @returns {number} Returns the mean.
|
||||
*/
|
||||
function baseMean(array, iteratee) {
|
||||
var length = array == null ? 0 : array.length;
|
||||
const length = array == null ? 0 : array.length;
|
||||
return length ? (baseSum(array, iteratee) / length) : NAN;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import isIndex from './_isIndex.js';
|
||||
* @returns {*} Returns the nth element of `array`.
|
||||
*/
|
||||
function baseNth(array, n) {
|
||||
var length = array.length;
|
||||
const length = array.length;
|
||||
if (!length) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -16,11 +16,11 @@ import identity from './identity.js';
|
||||
* @returns {Array} Returns the new sorted array.
|
||||
*/
|
||||
function baseOrderBy(collection, iteratees, orders) {
|
||||
var index = -1;
|
||||
let index = -1;
|
||||
iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee));
|
||||
|
||||
var result = baseMap(collection, (value, key, collection) => {
|
||||
var criteria = arrayMap(iteratees, iteratee => iteratee(value));
|
||||
const result = baseMap(collection, (value, key, collection) => {
|
||||
const criteria = arrayMap(iteratees, iteratee => iteratee(value));
|
||||
return { 'criteria': criteria, 'index': ++index, 'value': value };
|
||||
});
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@ import baseUnset from './_baseUnset.js';
|
||||
import isIndex from './_isIndex.js';
|
||||
|
||||
/** Used for built-in method references. */
|
||||
var arrayProto = Array.prototype;
|
||||
const arrayProto = Array.prototype;
|
||||
|
||||
/** Built-in value references. */
|
||||
var splice = arrayProto.splice;
|
||||
const splice = arrayProto.splice;
|
||||
|
||||
/**
|
||||
* The base implementation of `_.pullAt` without support for individual
|
||||
@@ -17,11 +17,11 @@ var splice = arrayProto.splice;
|
||||
* @returns {Array} Returns `array`.
|
||||
*/
|
||||
function basePullAt(array, indexes) {
|
||||
var length = array ? indexes.length : 0,
|
||||
lastIndex = length - 1;
|
||||
let length = array ? indexes.length : 0;
|
||||
const lastIndex = length - 1;
|
||||
|
||||
while (length--) {
|
||||
var index = indexes[length];
|
||||
const index = indexes[length];
|
||||
if (length == lastIndex || index !== previous) {
|
||||
var previous = index;
|
||||
if (isIndex(index)) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/** Used as references for various `Number` constants. */
|
||||
var MAX_SAFE_INTEGER = 9007199254740991;
|
||||
const MAX_SAFE_INTEGER = 9007199254740991;
|
||||
|
||||
/* Built-in method references for those with the same name as other `lodash` methods. */
|
||||
var nativeFloor = Math.floor;
|
||||
const nativeFloor = Math.floor;
|
||||
|
||||
/**
|
||||
* The base implementation of `_.repeat` which doesn't coerce arguments.
|
||||
@@ -13,7 +13,7 @@ var nativeFloor = Math.floor;
|
||||
* @returns {string} Returns the repeated string.
|
||||
*/
|
||||
function baseRepeat(string, n) {
|
||||
var result = '';
|
||||
let result = '';
|
||||
if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import values from './values.js';
|
||||
* @returns {Array} Returns the random elements.
|
||||
*/
|
||||
function baseSampleSize(collection, n) {
|
||||
var array = values(collection);
|
||||
const array = values(collection);
|
||||
return shuffleSelf(array, baseClamp(n, 0, array.length));
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import metaMap from './_metaMap.js';
|
||||
* @param {*} data The metadata.
|
||||
* @returns {Function} Returns `func`.
|
||||
*/
|
||||
var baseSetData = !metaMap ? identity : (func, data) => {
|
||||
const baseSetData = !metaMap ? identity : (func, data) => {
|
||||
metaMap.set(func, data);
|
||||
return func;
|
||||
};
|
||||
|
||||
@@ -10,7 +10,7 @@ import identity from './identity.js';
|
||||
* @param {Function} string The `toString` result.
|
||||
* @returns {Function} Returns `func`.
|
||||
*/
|
||||
var baseSetToString = !defineProperty ? identity : (func, string) => defineProperty(func, 'toString', {
|
||||
const baseSetToString = !defineProperty ? identity : (func, string) => defineProperty(func, 'toString', {
|
||||
'configurable': true,
|
||||
'enumerable': false,
|
||||
'value': constant(string),
|
||||
|
||||
@@ -10,7 +10,7 @@ import baseEach from './_baseEach.js';
|
||||
* else `false`.
|
||||
*/
|
||||
function baseSome(collection, predicate) {
|
||||
var result;
|
||||
let result;
|
||||
|
||||
baseEach(collection, (value, index, collection) => {
|
||||
result = predicate(value, index, collection);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @returns {Array} Returns `array`.
|
||||
*/
|
||||
function baseSortBy(array, comparer) {
|
||||
var length = array.length;
|
||||
let length = array.length;
|
||||
|
||||
array.sort(comparer);
|
||||
while (length--) {
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
* @returns {number} Returns the sum.
|
||||
*/
|
||||
function baseSum(array, iteratee) {
|
||||
var result,
|
||||
index = -1,
|
||||
length = array.length;
|
||||
let result;
|
||||
let index = -1;
|
||||
const length = array.length;
|
||||
|
||||
while (++index < length) {
|
||||
var current = iteratee(array[index]);
|
||||
const current = iteratee(array[index]);
|
||||
if (current !== undefined) {
|
||||
result = result === undefined ? current : (result + current);
|
||||
}
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
* @returns {Array} Returns the array of results.
|
||||
*/
|
||||
function baseTimes(n, iteratee) {
|
||||
var index = -1,
|
||||
result = Array(n);
|
||||
let index = -1;
|
||||
const result = Array(n);
|
||||
|
||||
while (++index < n) {
|
||||
result[index] = iteratee(index);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import isSymbol from './isSymbol.js';
|
||||
|
||||
/** Used as references for various `Number` constants. */
|
||||
var NAN = 0 / 0;
|
||||
const NAN = 0 / 0;
|
||||
|
||||
/**
|
||||
* The base implementation of `_.toNumber` which doesn't ensure correct
|
||||
|
||||
@@ -12,8 +12,8 @@ import baseSlice from './_baseSlice.js';
|
||||
* @returns {Array} Returns the slice of `array`.
|
||||
*/
|
||||
function baseWhile(array, predicate, isDrop, fromRight) {
|
||||
var length = array.length,
|
||||
index = fromRight ? length : -1;
|
||||
const length = array.length;
|
||||
let index = fromRight ? length : -1;
|
||||
|
||||
while ((fromRight ? index-- : ++index < length) &&
|
||||
predicate(array[index], index, array)) {}
|
||||
|
||||
@@ -13,7 +13,7 @@ import arrayReduce from './_arrayReduce.js';
|
||||
* @returns {*} Returns the resolved value.
|
||||
*/
|
||||
function baseWrapperValue(value, actions) {
|
||||
var result = value;
|
||||
let result = value;
|
||||
if (result instanceof LazyWrapper) {
|
||||
result = result.value();
|
||||
}
|
||||
|
||||
10
_baseXor.js
10
_baseXor.js
@@ -13,16 +13,16 @@ import baseUniq from './_baseUniq.js';
|
||||
* @returns {Array} Returns the new array of values.
|
||||
*/
|
||||
function baseXor(arrays, iteratee, comparator) {
|
||||
var length = arrays.length;
|
||||
const length = arrays.length;
|
||||
if (length < 2) {
|
||||
return length ? baseUniq(arrays[0]) : [];
|
||||
}
|
||||
var index = -1,
|
||||
result = Array(length);
|
||||
let index = -1;
|
||||
const result = Array(length);
|
||||
|
||||
while (++index < length) {
|
||||
var array = arrays[index],
|
||||
othIndex = -1;
|
||||
const array = arrays[index];
|
||||
let othIndex = -1;
|
||||
|
||||
while (++othIndex < length) {
|
||||
if (othIndex != index) {
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
* @returns {Object} Returns the new object.
|
||||
*/
|
||||
function baseZipObject(props, values, assignFunc) {
|
||||
var index = -1,
|
||||
length = props.length,
|
||||
valsLength = values.length,
|
||||
result = {};
|
||||
let index = -1;
|
||||
const length = props.length;
|
||||
const valsLength = values.length;
|
||||
const result = {};
|
||||
|
||||
while (++index < length) {
|
||||
var value = index < valsLength ? values[index] : undefined;
|
||||
const value = index < valsLength ? values[index] : undefined;
|
||||
assignFunc(result, props[index], value);
|
||||
}
|
||||
return result;
|
||||
|
||||
@@ -9,6 +9,6 @@ import baseRest from './_baseRest.js';
|
||||
* @param {Function} func The function to apply a rest parameter to.
|
||||
* @returns {Function} Returns the new function.
|
||||
*/
|
||||
var castRest = baseRest;
|
||||
const castRest = baseRest;
|
||||
|
||||
export default castRest;
|
||||
|
||||
@@ -10,7 +10,7 @@ import baseSlice from './_baseSlice.js';
|
||||
* @returns {Array} Returns the cast slice.
|
||||
*/
|
||||
function castSlice(array, start, end) {
|
||||
var length = array.length;
|
||||
const length = array.length;
|
||||
end = end === undefined ? length : end;
|
||||
return (!start && end >= length) ? array : baseSlice(array, start, end);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import baseIndexOf from './_baseIndexOf.js';
|
||||
* @returns {number} Returns the index of the last unmatched string symbol.
|
||||
*/
|
||||
function charsEndIndex(strSymbols, chrSymbols) {
|
||||
var index = strSymbols.length;
|
||||
let index = strSymbols.length;
|
||||
|
||||
while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
|
||||
return index;
|
||||
|
||||
@@ -10,11 +10,11 @@ import baseIndexOf from './_baseIndexOf.js';
|
||||
* @returns {number} Returns the index of the first unmatched string symbol.
|
||||
*/
|
||||
function charsStartIndex(strSymbols, chrSymbols) {
|
||||
var index = -1,
|
||||
length = strSymbols.length;
|
||||
let index = -1;
|
||||
const length = strSymbols.length;
|
||||
|
||||
while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
|
||||
return index;
|
||||
while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
|
||||
return index;
|
||||
}
|
||||
|
||||
export default charsStartIndex;
|
||||
|
||||
@@ -8,7 +8,7 @@ import Uint8Array from './_Uint8Array.js';
|
||||
* @returns {ArrayBuffer} Returns the cloned array buffer.
|
||||
*/
|
||||
function cloneArrayBuffer(arrayBuffer) {
|
||||
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
|
||||
const result = new arrayBuffer.constructor(arrayBuffer.byteLength);
|
||||
new Uint8Array(result).set(new Uint8Array(arrayBuffer));
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import cloneArrayBuffer from './_cloneArrayBuffer.js';
|
||||
* @returns {Object} Returns the cloned data view.
|
||||
*/
|
||||
function cloneDataView(dataView, isDeep) {
|
||||
var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
|
||||
const buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
|
||||
return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import arrayReduce from './_arrayReduce.js';
|
||||
import mapToArray from './_mapToArray.js';
|
||||
|
||||
/** Used to compose bitmasks for cloning. */
|
||||
var CLONE_DEEP_FLAG = 1;
|
||||
const CLONE_DEEP_FLAG = 1;
|
||||
|
||||
/**
|
||||
* Creates a clone of `map`.
|
||||
@@ -15,7 +15,7 @@ var CLONE_DEEP_FLAG = 1;
|
||||
* @returns {Object} Returns the cloned map.
|
||||
*/
|
||||
function cloneMap(map, isDeep, cloneFunc) {
|
||||
var array = isDeep ? cloneFunc(mapToArray(map), CLONE_DEEP_FLAG) : mapToArray(map);
|
||||
const array = isDeep ? cloneFunc(mapToArray(map), CLONE_DEEP_FLAG) : mapToArray(map);
|
||||
return arrayReduce(array, addMapEntry, new map.constructor);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/** Used to match `RegExp` flags from their coerced string values. */
|
||||
var reFlags = /\w*$/;
|
||||
const reFlags = /\w*$/;
|
||||
|
||||
/**
|
||||
* Creates a clone of `regexp`.
|
||||
@@ -9,7 +9,7 @@ var reFlags = /\w*$/;
|
||||
* @returns {Object} Returns the cloned regexp.
|
||||
*/
|
||||
function cloneRegExp(regexp) {
|
||||
var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
|
||||
const result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
|
||||
result.lastIndex = regexp.lastIndex;
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import arrayReduce from './_arrayReduce.js';
|
||||
import setToArray from './_setToArray.js';
|
||||
|
||||
/** Used to compose bitmasks for cloning. */
|
||||
var CLONE_DEEP_FLAG = 1;
|
||||
const CLONE_DEEP_FLAG = 1;
|
||||
|
||||
/**
|
||||
* Creates a clone of `set`.
|
||||
@@ -15,7 +15,7 @@ var CLONE_DEEP_FLAG = 1;
|
||||
* @returns {Object} Returns the cloned set.
|
||||
*/
|
||||
function cloneSet(set, isDeep, cloneFunc) {
|
||||
var array = isDeep ? cloneFunc(setToArray(set), CLONE_DEEP_FLAG) : setToArray(set);
|
||||
const array = isDeep ? cloneFunc(setToArray(set), CLONE_DEEP_FLAG) : setToArray(set);
|
||||
return arrayReduce(array, addSetEntry, new set.constructor);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import cloneArrayBuffer from './_cloneArrayBuffer.js';
|
||||
* @returns {Object} Returns the cloned typed array.
|
||||
*/
|
||||
function cloneTypedArray(typedArray, isDeep) {
|
||||
var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
|
||||
const buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
|
||||
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
* @returns {Array} Returns `array`.
|
||||
*/
|
||||
function copyArray(source, array) {
|
||||
var index = -1,
|
||||
length = source.length;
|
||||
let index = -1;
|
||||
const length = source.length;
|
||||
|
||||
array || (array = Array(length));
|
||||
while (++index < length) {
|
||||
|
||||
@@ -12,16 +12,16 @@ import baseAssignValue from './_baseAssignValue.js';
|
||||
* @returns {Object} Returns `object`.
|
||||
*/
|
||||
function copyObject(source, props, object, customizer) {
|
||||
var isNew = !object;
|
||||
const isNew = !object;
|
||||
object || (object = {});
|
||||
|
||||
var index = -1,
|
||||
length = props.length;
|
||||
let index = -1;
|
||||
const length = props.length;
|
||||
|
||||
while (++index < length) {
|
||||
var key = props[index];
|
||||
const key = props[index];
|
||||
|
||||
var newValue = customizer
|
||||
let newValue = customizer
|
||||
? customizer(object[key], source[key], key, object, source)
|
||||
: undefined;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import root from './_root.js';
|
||||
|
||||
/** Used to detect overreaching core-js shims. */
|
||||
var coreJsData = root['__core-js_shared__'];
|
||||
const coreJsData = root['__core-js_shared__'];
|
||||
|
||||
export default coreJsData;
|
||||
|
||||
@@ -16,9 +16,9 @@ function createBaseEach(eachFunc, fromRight) {
|
||||
if (!isArrayLike(collection)) {
|
||||
return eachFunc(collection, iteratee);
|
||||
}
|
||||
var length = collection.length,
|
||||
index = fromRight ? length : -1,
|
||||
iterable = Object(collection);
|
||||
const length = collection.length;
|
||||
const iterable = Object(collection);
|
||||
let index = fromRight ? length : -1;
|
||||
|
||||
while ((fromRight ? index-- : ++index < length)) {
|
||||
if (iteratee(iterable[index], index, iterable) === false) {
|
||||
|
||||
@@ -14,15 +14,15 @@ function createCaseFirst(methodName) {
|
||||
return string => {
|
||||
string = toString(string);
|
||||
|
||||
var strSymbols = hasUnicode(string)
|
||||
const strSymbols = hasUnicode(string)
|
||||
? stringToArray(string)
|
||||
: undefined;
|
||||
|
||||
var chr = strSymbols
|
||||
const chr = strSymbols
|
||||
? strSymbols[0]
|
||||
: string.charAt(0);
|
||||
|
||||
var trailing = strSymbols
|
||||
const trailing = strSymbols
|
||||
? castSlice(strSymbols, 1).join('')
|
||||
: string.slice(1);
|
||||
|
||||
|
||||
@@ -3,10 +3,10 @@ import deburr from './deburr.js';
|
||||
import words from './words.js';
|
||||
|
||||
/** Used to compose unicode capture groups. */
|
||||
var rsApos = "['\u2019]";
|
||||
const rsApos = "['\u2019]";
|
||||
|
||||
/** Used to match apostrophes. */
|
||||
var reApos = RegExp(rsApos, 'g');
|
||||
const reApos = RegExp(rsApos, 'g');
|
||||
|
||||
/**
|
||||
* Creates a function like `_.camelCase`.
|
||||
|
||||
@@ -11,13 +11,13 @@ import keys from './keys.js';
|
||||
*/
|
||||
function createFind(findIndexFunc) {
|
||||
return (collection, predicate, fromIndex) => {
|
||||
var iterable = Object(collection);
|
||||
const iterable = Object(collection);
|
||||
if (!isArrayLike(collection)) {
|
||||
var iteratee = baseIteratee(predicate, 3);
|
||||
collection = keys(collection);
|
||||
predicate = key => iteratee(iterable[key], key, iterable);
|
||||
}
|
||||
var index = findIndexFunc(collection, predicate, fromIndex);
|
||||
const index = findIndexFunc(collection, predicate, fromIndex);
|
||||
return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import baseToString from './_baseToString.js';
|
||||
*/
|
||||
function createMathOperation(operator, defaultValue) {
|
||||
return (value, other) => {
|
||||
var result;
|
||||
let result;
|
||||
if (value === undefined && other === undefined) {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ function createOver(arrayFunc) {
|
||||
return flatRest(iteratees => {
|
||||
iteratees = arrayMap(iteratees, baseUnary(baseIteratee));
|
||||
return baseRest(function(args) {
|
||||
var thisArg = this;
|
||||
const thisArg = this;
|
||||
return arrayFunc(iteratees, iteratee => apply(iteratee, thisArg, args));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -6,7 +6,7 @@ import stringSize from './_stringSize.js';
|
||||
import stringToArray from './_stringToArray.js';
|
||||
|
||||
/* Built-in method references for those with the same name as other `lodash` methods. */
|
||||
var nativeCeil = Math.ceil;
|
||||
const nativeCeil = Math.ceil;
|
||||
|
||||
/**
|
||||
* Creates the padding for `string` based on `length`. The `chars` string
|
||||
@@ -20,11 +20,11 @@ var nativeCeil = Math.ceil;
|
||||
function createPadding(length, chars) {
|
||||
chars = chars === undefined ? ' ' : baseToString(chars);
|
||||
|
||||
var charsLength = chars.length;
|
||||
const charsLength = chars.length;
|
||||
if (charsLength < 2) {
|
||||
return charsLength ? baseRepeat(chars, length) : chars;
|
||||
}
|
||||
var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
|
||||
const result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
|
||||
return hasUnicode(chars)
|
||||
? castSlice(stringToArray(result), 0, length).join('')
|
||||
: result.slice(0, length);
|
||||
|
||||
@@ -3,7 +3,7 @@ import noop from './noop.js';
|
||||
import setToArray from './_setToArray.js';
|
||||
|
||||
/** Used as references for various `Number` constants. */
|
||||
var INFINITY = 1 / 0;
|
||||
const INFINITY = 1 / 0;
|
||||
|
||||
/**
|
||||
* Creates a set object of `values`.
|
||||
@@ -12,6 +12,6 @@ var INFINITY = 1 / 0;
|
||||
* @param {Array} values The values to add to the set.
|
||||
* @returns {Object} Returns the new set.
|
||||
*/
|
||||
var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : values => new Set(values);
|
||||
const createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : values => new Set(values);
|
||||
|
||||
export default createSet;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import eq from './eq.js';
|
||||
|
||||
/** Used for built-in method references. */
|
||||
var objectProto = Object.prototype;
|
||||
const objectProto = Object.prototype;
|
||||
|
||||
/** Used to check objects for own properties. */
|
||||
var hasOwnProperty = objectProto.hasOwnProperty;
|
||||
const hasOwnProperty = objectProto.hasOwnProperty;
|
||||
|
||||
/**
|
||||
* Used by `_.defaults` to customize its `_.assignIn` use to assign properties
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import basePropertyOf from './_basePropertyOf.js';
|
||||
|
||||
/** Used to map Latin Unicode letters to basic Latin letters. */
|
||||
var deburredLetters = {
|
||||
const deburredLetters = {
|
||||
// Latin-1 Supplement block.
|
||||
'\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
|
||||
'\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
|
||||
@@ -66,6 +66,6 @@ var deburredLetters = {
|
||||
* @param {string} letter The matched letter to deburr.
|
||||
* @returns {string} Returns the deburred letter.
|
||||
*/
|
||||
var deburrLetter = basePropertyOf(deburredLetters);
|
||||
const deburrLetter = basePropertyOf(deburredLetters);
|
||||
|
||||
export default deburrLetter;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import getNative from './_getNative.js';
|
||||
|
||||
var defineProperty = ((() => {
|
||||
const defineProperty = ((() => {
|
||||
try {
|
||||
var func = getNative(Object, 'defineProperty');
|
||||
const func = getNative(Object, 'defineProperty');
|
||||
func({}, '', {});
|
||||
return func;
|
||||
} catch (e) {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import basePropertyOf from './_basePropertyOf.js';
|
||||
|
||||
/** Used to map characters to HTML entities. */
|
||||
var htmlEscapes = {
|
||||
const htmlEscapes = {
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
@@ -16,6 +16,6 @@ var htmlEscapes = {
|
||||
* @param {string} chr The matched character to escape.
|
||||
* @returns {string} Returns the escaped character.
|
||||
*/
|
||||
var escapeHtmlChar = basePropertyOf(htmlEscapes);
|
||||
const escapeHtmlChar = basePropertyOf(htmlEscapes);
|
||||
|
||||
export default escapeHtmlChar;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/** Used to escape characters for inclusion in compiled string literals. */
|
||||
var stringEscapes = {
|
||||
const stringEscapes = {
|
||||
'\\': '\\',
|
||||
"'": "'",
|
||||
'\n': 'n',
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/** Detect free variable `global` from Node.js. */
|
||||
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
|
||||
const freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
|
||||
|
||||
export default freeGlobal;
|
||||
|
||||
@@ -8,6 +8,6 @@ import noop from './noop.js';
|
||||
* @param {Function} func The function to query.
|
||||
* @returns {*} Returns the metadata for `func`.
|
||||
*/
|
||||
var getData = !metaMap ? noop : func => metaMap.get(func);
|
||||
const getData = !metaMap ? noop : func => metaMap.get(func);
|
||||
|
||||
export default getData;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* @returns {*} Returns the placeholder value.
|
||||
*/
|
||||
function getHolder(func) {
|
||||
var object = func;
|
||||
const object = func;
|
||||
return object.placeholder;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import isKeyable from './_isKeyable.js';
|
||||
* @returns {*} Returns the map data.
|
||||
*/
|
||||
function getMapData({ __data__ }, key) {
|
||||
var data = __data__;
|
||||
const data = __data__;
|
||||
return isKeyable(key)
|
||||
? data[typeof key == 'string' ? 'string' : 'hash']
|
||||
: data.map;
|
||||
|
||||
@@ -10,7 +10,7 @@ import getValue from './_getValue.js';
|
||||
* @returns {*} Returns the function if it's native, else `undefined`.
|
||||
*/
|
||||
function getNative(object, key) {
|
||||
var value = getValue(object, key);
|
||||
const value = getValue(object, key);
|
||||
return baseIsNative(value) ? value : undefined;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import overArg from './_overArg.js';
|
||||
|
||||
/** Built-in value references. */
|
||||
var getPrototype = overArg(Object.getPrototypeOf, Object);
|
||||
const getPrototype = overArg(Object.getPrototypeOf, Object);
|
||||
|
||||
export default getPrototype;
|
||||
|
||||
@@ -2,13 +2,13 @@ import arrayFilter from './_arrayFilter.js';
|
||||
import stubArray from './stubArray.js';
|
||||
|
||||
/** Used for built-in method references. */
|
||||
var objectProto = Object.prototype;
|
||||
const objectProto = Object.prototype;
|
||||
|
||||
/** Built-in value references. */
|
||||
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
||||
const propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
||||
|
||||
/* Built-in method references for those with the same name as other `lodash` methods. */
|
||||
var nativeGetSymbols = Object.getOwnPropertySymbols;
|
||||
const nativeGetSymbols = Object.getOwnPropertySymbols;
|
||||
|
||||
/**
|
||||
* Creates an array of the own enumerable symbols of `object`.
|
||||
@@ -17,7 +17,7 @@ var nativeGetSymbols = Object.getOwnPropertySymbols;
|
||||
* @param {Object} object The object to query.
|
||||
* @returns {Array} Returns the array of symbols.
|
||||
*/
|
||||
var getSymbols = !nativeGetSymbols ? stubArray : object => {
|
||||
const getSymbols = !nativeGetSymbols ? stubArray : object => {
|
||||
if (object == null) {
|
||||
return [];
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import getSymbols from './_getSymbols.js';
|
||||
import stubArray from './stubArray.js';
|
||||
|
||||
/* Built-in method references for those with the same name as other `lodash` methods. */
|
||||
var nativeGetSymbols = Object.getOwnPropertySymbols;
|
||||
const nativeGetSymbols = Object.getOwnPropertySymbols;
|
||||
|
||||
/**
|
||||
* Creates an array of the own and inherited enumerable symbols of `object`.
|
||||
@@ -13,8 +13,8 @@ var nativeGetSymbols = Object.getOwnPropertySymbols;
|
||||
* @param {Object} object The object to query.
|
||||
* @returns {Array} Returns the array of symbols.
|
||||
*/
|
||||
var getSymbolsIn = !nativeGetSymbols ? stubArray : object => {
|
||||
var result = [];
|
||||
const getSymbolsIn = !nativeGetSymbols ? stubArray : object => {
|
||||
const result = [];
|
||||
while (object) {
|
||||
arrayPush(result, getSymbols(object));
|
||||
object = getPrototype(object);
|
||||
|
||||
@@ -17,7 +17,7 @@ import toKey from './_toKey.js';
|
||||
function hasPath(object, path, hasFunc) {
|
||||
path = castPath(path, object);
|
||||
|
||||
var index = -1,
|
||||
let index = -1,
|
||||
length = path.length,
|
||||
result = false;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
||||
*/
|
||||
function hashDelete(key) {
|
||||
var result = this.has(key) && delete this.__data__[key];
|
||||
const result = this.has(key) && delete this.__data__[key];
|
||||
this.size -= result ? 1 : 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user