mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 00:57:48 +00:00
Bump to v4.3.0.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# lodash.split v4.2.1
|
||||
# lodash.split v4.3.0
|
||||
|
||||
The [lodash](https://lodash.com/) method `_.split` exported as a [Node.js](https://nodejs.org/) module.
|
||||
|
||||
@@ -15,4 +15,4 @@ In Node.js:
|
||||
var split = require('lodash.split');
|
||||
```
|
||||
|
||||
See the [documentation](https://lodash.com/docs#split) or [package source](https://github.com/lodash/lodash/blob/4.2.1-npm-packages/lodash.split) for more details.
|
||||
See the [documentation](https://lodash.com/docs#split) or [package source](https://github.com/lodash/lodash/blob/4.3.0-npm-packages/lodash.split) for more details.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* lodash 4.2.1 (Custom Build) <https://lodash.com/>
|
||||
* lodash (Custom Build) <https://lodash.com/>
|
||||
* Build: `lodash modularize exports="npm" -o ./`
|
||||
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
||||
* Released under MIT license <https://lodash.com/license>
|
||||
@@ -7,6 +7,7 @@
|
||||
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||||
*/
|
||||
var baseSlice = require('lodash._baseslice'),
|
||||
baseToString = require('lodash._basetostring'),
|
||||
toString = require('lodash.tostring');
|
||||
|
||||
/** Used as references for various `Number` constants. */
|
||||
@@ -52,20 +53,6 @@ var reComplexSymbol = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq,
|
||||
/** 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 + ']');
|
||||
|
||||
/**
|
||||
* Checks if `value` is a valid array-like index.
|
||||
*
|
||||
* @private
|
||||
* @param {*} value The value to check.
|
||||
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
|
||||
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
|
||||
*/
|
||||
function isIndex(value, length) {
|
||||
value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
|
||||
length = length == null ? MAX_SAFE_INTEGER : length;
|
||||
return value > -1 && value % 1 == 0 && value < length;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts `string` to an array.
|
||||
*
|
||||
@@ -96,7 +83,7 @@ var nativeSplit = stringProto.split;
|
||||
*
|
||||
* @private
|
||||
* @param {string} key The key of the property to get.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @returns {Function} Returns the new accessor function.
|
||||
*/
|
||||
function baseProperty(key) {
|
||||
return function(object) {
|
||||
@@ -132,6 +119,21 @@ function castSlice(array, start, end) {
|
||||
*/
|
||||
var getLength = baseProperty('length');
|
||||
|
||||
/**
|
||||
* Checks if `value` is a valid array-like index.
|
||||
*
|
||||
* @private
|
||||
* @param {*} value The value to check.
|
||||
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
|
||||
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
|
||||
*/
|
||||
function isIndex(value, length) {
|
||||
length = length == null ? MAX_SAFE_INTEGER : length;
|
||||
return !!length &&
|
||||
(typeof value == 'number' || reIsUint.test(value)) &&
|
||||
(value > -1 && value % 1 == 0 && value < length);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the given arguments are from an iteratee call.
|
||||
*
|
||||
@@ -344,7 +346,7 @@ function isRegExp(value) {
|
||||
* @param {string} [string=''] The string to split.
|
||||
* @param {RegExp|string} separator The separator pattern to split by.
|
||||
* @param {number} [limit] The length to truncate results to.
|
||||
* @returns {Array} Returns the new array of string segments.
|
||||
* @returns {Array} Returns the string segments.
|
||||
* @example
|
||||
*
|
||||
* _.split('a-b-c', '-', 2);
|
||||
@@ -363,7 +365,7 @@ function split(string, separator, limit) {
|
||||
typeof separator == 'string' ||
|
||||
(separator != null && !isRegExp(separator))
|
||||
)) {
|
||||
separator += '';
|
||||
separator = baseToString(separator);
|
||||
if (separator == '' && reHasComplexSymbol.test(string)) {
|
||||
return castSlice(stringToArray(string), 0, limit);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "lodash.split",
|
||||
"version": "4.2.1",
|
||||
"version": "4.3.0",
|
||||
"description": "The lodash method `_.split` exported as a module.",
|
||||
"homepage": "https://lodash.com/",
|
||||
"icon": "https://lodash.com/icon.svg",
|
||||
@@ -16,6 +16,7 @@
|
||||
"scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" },
|
||||
"dependencies": {
|
||||
"lodash._baseslice": "~4.0.0",
|
||||
"lodash._basetostring": "~4.12.0",
|
||||
"lodash.tostring": "^4.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user