Socket
Socket
Sign inDemoInstall

lodash-es

Package Overview
Dependencies
Maintainers
3
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lodash-es - npm Package Compare versions

Comparing version 4.14.2 to 4.15.0

_asciiSize.js

2

_arrayIncludes.js

@@ -8,3 +8,3 @@ import baseIndexOf from './_baseIndexOf.js';

* @private
* @param {Array} [array] The array to search.
* @param {Array} [array] The array to inspect.
* @param {*} target The value to search for.

@@ -11,0 +11,0 @@ * @returns {boolean} Returns `true` if `target` is found, else `false`.

@@ -5,3 +5,3 @@ /**

* @private
* @param {Array} [array] The array to search.
* @param {Array} [array] The array to inspect.
* @param {*} target The value to search for.

@@ -8,0 +8,0 @@ * @param {Function} comparator The comparator invoked per element.

@@ -5,3 +5,2 @@ import baseTimes from './_baseTimes.js';

import isIndex from './_isIndex.js';
import isString from './isString.js';

@@ -23,3 +22,5 @@ /** Used for built-in method references. */

function arrayLikeKeys(value, inherited) {
var result = (isArray(value) || isString(value) || isArguments(value))
// 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)

@@ -26,0 +27,0 @@ : [];

@@ -7,3 +7,3 @@ import eq from './eq.js';

* @private
* @param {Array} array The array to search.
* @param {Array} array The array to inspect.
* @param {*} key The key to search for.

@@ -10,0 +10,0 @@ * @returns {number} Returns the index of the matched value, else `-1`.

@@ -6,3 +6,3 @@ /**

* @private
* @param {Array} array The array to search.
* @param {Array} array The array to inspect.
* @param {Function} predicate The function invoked per iteration.

@@ -9,0 +9,0 @@ * @param {number} fromIndex The index to search from.

@@ -7,3 +7,3 @@ /**

* @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.

@@ -10,0 +10,0 @@ * @param {Function} eachFunc The function to iterate over `collection`.

@@ -8,3 +8,3 @@ import baseFindIndex from './_baseFindIndex.js';

* @private
* @param {Array} array The array to search.
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.

@@ -11,0 +11,0 @@ * @param {number} fromIndex The index to search from.

@@ -5,3 +5,3 @@ /**

* @private
* @param {Array} array The array to search.
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.

@@ -8,0 +8,0 @@ * @param {number} fromIndex The index to search from.

@@ -17,6 +17,7 @@ import isFunction from './isFunction.js';

/** 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. */
var funcToString = Function.prototype.toString;
var funcToString = funcProto.toString;

@@ -23,0 +24,0 @@ /** Used to check objects for own properties. */

@@ -12,3 +12,3 @@ import assignValue from './_assignValue.js';

* @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.

@@ -15,0 +15,0 @@ * @param {*} value The value to set.

@@ -8,3 +8,3 @@ import baseGet from './_baseGet.js';

* @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.

@@ -11,0 +11,0 @@ * @param {Function} updater The function to produce the updated value.

import castSlice from './_castSlice.js';
import reHasComplexSymbol from './_reHasComplexSymbol.js';
import hasUnicode from './_hasUnicode.js';
import stringToArray from './_stringToArray.js';

@@ -17,3 +17,3 @@ import toString from './toString.js';

var strSymbols = reHasComplexSymbol.test(string)
var strSymbols = hasUnicode(string)
? stringToArray(string)

@@ -20,0 +20,0 @@ : undefined;

import baseRepeat from './_baseRepeat.js';
import baseToString from './_baseToString.js';
import castSlice from './_castSlice.js';
import reHasComplexSymbol from './_reHasComplexSymbol.js';
import hasUnicode from './_hasUnicode.js';
import stringSize from './_stringSize.js';

@@ -28,3 +28,3 @@ import stringToArray from './_stringToArray.js';

var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
return reHasComplexSymbol.test(chars)
return hasUnicode(chars)
? castSlice(stringToArray(result), 0, length).join('')

@@ -31,0 +31,0 @@ : result.slice(0, length);

import basePropertyOf from './_basePropertyOf.js';
/** Used to map latin-1 supplementary letters to basic latin letters. */
/** Used to map Latin Unicode letters to basic Latin letters. */
var deburredLetters = {
// Latin-1 Supplement block.
'\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',

@@ -11,4 +12,4 @@ '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',

'\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
'\xcC': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
'\xeC': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
'\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
'\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
'\xd1': 'N', '\xf1': 'n',

@@ -22,7 +23,44 @@ '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',

'\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.
*

@@ -29,0 +67,0 @@ * @private

@@ -45,3 +45,3 @@ import DataView from './_DataView.js';

// 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) ||

@@ -48,0 +48,0 @@ (Map && getTag(new Map) != mapTag) ||

@@ -7,3 +7,2 @@ import castPath from './_castPath.js';

import isLength from './isLength.js';
import isString from './isString.js';
import toKey from './_toKey.js';

@@ -39,5 +38,5 @@

return !!length && isLength(length) && isIndex(key, length) &&
(isArray(object) || isString(object) || isArguments(object));
(isArray(object) || isArguments(object));
}
export default hasPath;

@@ -1,29 +0,5 @@

import reHasComplexSymbol from './_reHasComplexSymbol.js';
import asciiSize from './_asciiSize.js';
import hasUnicode from './_hasUnicode.js';
import unicodeSize from './_unicodeSize.js';
/** 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');
/**

@@ -37,12 +13,7 @@ * Gets the number of symbols in `string`.

function stringSize(string) {
if (!(string && reHasComplexSymbol.test(string))) {
return string.length;
}
var result = reComplexSymbol.lastIndex = 0;
while (reComplexSymbol.test(string)) {
result++;
}
return result;
return hasUnicode(string)
? unicodeSize(string)
: asciiSize(string);
}
export default stringSize;

@@ -1,27 +0,5 @@

/** Used to compose unicode character classes. */
var rsAstralRange = '\\ud800-\\udfff',
rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23',
rsComboSymbolsRange = '\\u20d0-\\u20f0',
rsVarRange = '\\ufe0e\\ufe0f';
import asciiToArray from './_asciiToArray.js';
import hasUnicode from './_hasUnicode.js';
import unicodeToArray from './_unicodeToArray.js';
/** 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');
/**

@@ -35,5 +13,7 @@ * Converts `string` to an array.

function stringToArray(string) {
return string.match(reComplexSymbol);
return hasUnicode(string)
? unicodeToArray(string)
: asciiToArray(string);
}
export default stringToArray;

@@ -0,3 +1,6 @@

/** Used for built-in method references. */
var funcProto = Function.prototype;
/** Used to resolve the decompiled source of functions. */
var funcToString = Function.prototype.toString;
var funcToString = funcProto.toString;

@@ -4,0 +7,0 @@ /**

import deburrLetter from './_deburrLetter.js';
import toString from './toString.js';
/** Used to match latin-1 supplementary letters (excluding mathematical operators). */
var reLatin1 = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g;
/** Used to match Latin Unicode letters (excluding mathematical operators). */
var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;

@@ -22,4 +22,5 @@ /** Used to compose unicode character classes. */

* Deburrs `string` by converting
* [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
* to basic latin letters and removing
* [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
* 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).

@@ -40,5 +41,5 @@ *

string = toString(string);
return string && string.replace(reLatin1, deburrLetter).replace(reComboMark, '');
return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
}
export default deburr;

@@ -13,3 +13,3 @@ import baseClamp from './_baseClamp.js';

* @category String
* @param {string} [string=''] The string to search.
* @param {string} [string=''] The string to inspect.
* @param {string} [target] The string to search for.

@@ -16,0 +16,0 @@ * @param {number} [position=string.length] The position to search up to.

@@ -13,3 +13,3 @@ import createFind from './_createFind.js';

* @category Collection
* @param {Array|Object} collection The collection to search.
* @param {Array|Object} collection The collection to inspect.
* @param {Function} [predicate=_.identity]

@@ -16,0 +16,0 @@ * The function invoked per iteration.

@@ -16,3 +16,3 @@ import baseFindIndex from './_baseFindIndex.js';

* @category Array
* @param {Array} array The array to search.
* @param {Array} array The array to inspect.
* @param {Function} [predicate=_.identity]

@@ -19,0 +19,0 @@ * The function invoked per iteration.

@@ -13,3 +13,3 @@ import baseFindKey from './_baseFindKey.js';

* @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.

@@ -16,0 +16,0 @@ * @returns {string|undefined} Returns the key of the matched element,

@@ -12,3 +12,3 @@ import createFind from './_createFind.js';

* @category Collection
* @param {Array|Object} collection The collection to search.
* @param {Array|Object} collection The collection to inspect.
* @param {Function} [predicate=_.identity]

@@ -15,0 +15,0 @@ * The function invoked per iteration.

@@ -17,3 +17,3 @@ import baseFindIndex from './_baseFindIndex.js';

* @category Array
* @param {Array} array The array to search.
* @param {Array} array The array to inspect.
* @param {Function} [predicate=_.identity]

@@ -20,0 +20,0 @@ * The function invoked per iteration.

@@ -13,3 +13,3 @@ import baseFindKey from './_baseFindKey.js';

* @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.

@@ -16,0 +16,0 @@ * @returns {string|undefined} Returns the key of the matched element,

@@ -21,3 +21,3 @@ import baseIndexOf from './_baseIndexOf.js';

* @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.

@@ -24,0 +24,0 @@ * @param {number} [fromIndex=0] The index to search from.

@@ -17,3 +17,3 @@ import baseIndexOf from './_baseIndexOf.js';

* @category Array
* @param {Array} array The array to search.
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.

@@ -20,0 +20,0 @@ * @param {number} [fromIndex=0] The index to search from.

@@ -41,3 +41,3 @@ import isArrayLikeObject from './isArrayLikeObject.js';

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') &&

@@ -44,0 +44,0 @@ (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);

@@ -6,6 +6,3 @@ import getTag from './_getTag.js';

import isBuffer from './isBuffer.js';
import isFunction from './isFunction.js';
import isObjectLike from './isObjectLike.js';
import isPrototype from './_isPrototype.js';
import isString from './isString.js';
import nativeKeys from './_nativeKeys.js';

@@ -64,22 +61,21 @@

if (isArrayLike(value) &&
(isArray(value) || isString(value) || isFunction(value.splice) ||
isArguments(value) || isBuffer(value))) {
(isArray(value) || typeof value == 'string' ||
typeof value.splice == 'function' || isBuffer(value) || isArguments(value))) {
return !value.length;
}
if (isObjectLike(value)) {
var tag = getTag(value);
if (tag == mapTag || tag == setTag) {
return !value.size;
}
var tag = getTag(value);
if (tag == mapTag || tag == setTag) {
return !value.size;
}
var isProto = isPrototype(value);
if (nonEnumShadows || isPrototype(value)) {
return !nativeKeys(value).length;
}
for (var key in value) {
if (hasOwnProperty.call(value, key) &&
!(isProto && key == 'constructor')) {
if (hasOwnProperty.call(value, key)) {
return false;
}
}
return !(nonEnumShadows && nativeKeys(value).length);
return true;
}
export default isEmpty;

@@ -36,4 +36,3 @@ import isObject from './isObject.js';

// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8 which returns 'object' for typed array and weak map constructors,
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
// in Safari 8-9 which returns 'object' for typed array and other constructors.
var tag = isObject(value) ? objectToString.call(value) : '';

@@ -40,0 +39,0 @@ return tag == funcTag || tag == genTag;

@@ -9,6 +9,7 @@ import getPrototype from './_getPrototype.js';

/** 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. */
var funcToString = Function.prototype.toString;
var funcToString = funcProto.toString;

@@ -15,0 +16,0 @@ /** Used to check objects for own properties. */

@@ -17,3 +17,3 @@ import baseFindIndex from './_baseFindIndex.js';

* @category Array
* @param {Array} array The array to search.
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.

@@ -20,0 +20,0 @@ * @param {number} [fromIndex=array.length-1] The index to search from.

@@ -48,3 +48,3 @@ /**

/** Used as the semantic version number. */
var VERSION = '4.14.2';
var VERSION = '4.15.0';

@@ -51,0 +51,0 @@ /** Used to compose bitmasks for function metadata. */

{
"name": "lodash-es",
"version": "4.14.2",
"version": "4.15.0",
"description": "Lodash exported as ES modules.",

@@ -5,0 +5,0 @@ "keywords": "es6, modules, stdlib, util",

@@ -1,2 +0,2 @@

# lodash-es v4.14.2
# lodash-es v4.15.0

@@ -10,2 +10,2 @@ The [Lodash](https://lodash.com/) library exported as [ES](http://www.ecma-international.org/ecma-262/6.0/) modules.

See the [package source](https://github.com/lodash/lodash/tree/4.14.2-es) for more details.
See the [package source](https://github.com/lodash/lodash/tree/4.15.0-es) for more details.
import toString from './toString.js';
/** Used for built-in method references. */
var stringProto = String.prototype;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeReplace = stringProto.replace;
/**

@@ -32,5 +26,5 @@ * Replaces matches for `pattern` in `string` with `replacement`.

return args.length < 3 ? string : nativeReplace.call(string, args[1], args[2]);
return args.length < 3 ? string : string.replace(args[1], args[2]);
}
export default replace;
import baseKeys from './_baseKeys.js';
import getTag from './_getTag.js';
import isArrayLike from './isArrayLike.js';
import isObjectLike from './isObjectLike.js';
import isString from './isString.js';

@@ -20,3 +19,3 @@ import stringSize from './_stringSize.js';

* @category Collection
* @param {Array|Object} collection The collection to inspect.
* @param {Array|Object|string} collection The collection to inspect.
* @returns {number} Returns the collection size.

@@ -39,10 +38,7 @@ * @example

if (isArrayLike(collection)) {
var result = collection.length;
return (result && isString(collection)) ? stringSize(collection) : result;
return isString(collection) ? stringSize(collection) : collection.length;
}
if (isObjectLike(collection)) {
var tag = getTag(collection);
if (tag == mapTag || tag == setTag) {
return collection.size;
}
var tag = getTag(collection);
if (tag == mapTag || tag == setTag) {
return collection.size;
}

@@ -49,0 +45,0 @@ return baseKeys(collection).length;

@@ -12,3 +12,3 @@ import baseSortedIndex from './_baseSortedIndex.js';

* @category Array
* @param {Array} array The array to search.
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.

@@ -15,0 +15,0 @@ * @returns {number} Returns the index of the matched value, else `-1`.

@@ -12,3 +12,3 @@ import baseSortedIndex from './_baseSortedIndex.js';

* @category Array
* @param {Array} array The array to search.
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.

@@ -15,0 +15,0 @@ * @returns {number} Returns the index of the matched value, else `-1`.

import baseToString from './_baseToString.js';
import castSlice from './_castSlice.js';
import hasUnicode from './_hasUnicode.js';
import isIterateeCall from './_isIterateeCall.js';
import isRegExp from './isRegExp.js';
import reHasComplexSymbol from './_reHasComplexSymbol.js';
import stringToArray from './_stringToArray.js';

@@ -12,8 +12,2 @@ import toString from './toString.js';

/** Used for built-in method references. */
var stringProto = String.prototype;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeSplit = stringProto.split;
/**

@@ -52,9 +46,9 @@ * Splits `string` by `separator`.

separator = baseToString(separator);
if (separator == '' && reHasComplexSymbol.test(string)) {
if (!separator && hasUnicode(string)) {
return castSlice(stringToArray(string), 0, limit);
}
}
return nativeSplit.call(string, separator, limit);
return string.split(separator, limit);
}
export default split;

@@ -13,3 +13,3 @@ import baseClamp from './_baseClamp.js';

* @category String
* @param {string} [string=''] The string to search.
* @param {string} [string=''] The string to inspect.
* @param {string} [target] The string to search for.

@@ -16,0 +16,0 @@ * @param {number} [position=0] The position to search from.

@@ -1,2 +0,1 @@

import isFunction from './isFunction.js';
import isObject from './isObject.js';

@@ -54,3 +53,3 @@ import isSymbol from './isSymbol.js';

if (isObject(value)) {
var other = isFunction(value.valueOf) ? value.valueOf() : value;
var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
value = isObject(other) ? (other + '') : other;

@@ -57,0 +56,0 @@ }

import baseToString from './_baseToString.js';
import castSlice from './_castSlice.js';
import hasUnicode from './_hasUnicode.js';
import isObject from './isObject.js';
import isRegExp from './isRegExp.js';
import reHasComplexSymbol from './_reHasComplexSymbol.js';
import stringSize from './_stringSize.js';

@@ -67,3 +67,3 @@ import stringToArray from './_stringToArray.js';

var strLength = string.length;
if (reHasComplexSymbol.test(string)) {
if (hasUnicode(string)) {
var strSymbols = stringToArray(string);

@@ -70,0 +70,0 @@ strLength = strSymbols.length;

@@ -0,60 +1,6 @@

import asciiWords from './_asciiWords.js';
import hasUnicodeWord from './_hasUnicodeWord.js';
import toString from './toString.js';
import unicodeWords from './_unicodeWords.js';
/** Used to match non-compound words composed of alphanumeric characters. */
var reBasicWord = /[a-zA-Z0-9]+/g;
/** 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 reComplexWord = RegExp([
rsUpper + '?' + rsLower + '+' + rsOptLowerContr + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
rsUpperMisc + '+' + rsOptUpperContr + '(?=' + [rsBreak, rsUpper + rsLowerMisc, '$'].join('|') + ')',
rsUpper + '?' + rsLowerMisc + '+' + rsOptLowerContr,
rsUpper + '+' + rsOptUpperContr,
rsDigits,
rsEmoji
].join('|'), 'g');
/** Used to detect strings that need a more robust regexp to match words. */
var reHasComplexWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
/**

@@ -84,3 +30,3 @@ * Splits `string` into an array of its words.

if (pattern === undefined) {
pattern = reHasComplexWord.test(string) ? reComplexWord : reBasicWord;
return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
}

@@ -87,0 +33,0 @@ return string.match(pattern) || [];

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc