mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 00:27:50 +00:00
Update dependencies and make the underscore build pass more Underscore v1.5.0 unit tests.
Former-commit-id: 31807c11024b44238fcca5ad1682790510371896
This commit is contained in:
41
lodash.js
41
lodash.js
@@ -33,13 +33,26 @@
|
||||
/** Used as the max size of the `arrayPool` and `objectPool` */
|
||||
var maxPoolSize = 40;
|
||||
|
||||
/** Used to detect and test whitespace */
|
||||
var whitespace = (
|
||||
// whitespace
|
||||
' \t\x0B\f\xA0\ufeff' +
|
||||
|
||||
// line terminators
|
||||
'\n\r\u2028\u2029' +
|
||||
|
||||
// unicode category "Zs" space separators
|
||||
'\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000'
|
||||
);
|
||||
|
||||
/** Used to match empty string literals in compiled template source */
|
||||
var reEmptyStringLeading = /\b__p \+= '';/g,
|
||||
reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
|
||||
reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
|
||||
|
||||
/** Used to match HTML entities */
|
||||
var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g;
|
||||
/** Used to match HTML entities and HTML characters */
|
||||
var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
|
||||
reUnescapedHtml = /[&<>"']/g;
|
||||
|
||||
/**
|
||||
* Used to match ES6 template delimiters
|
||||
@@ -53,29 +66,14 @@
|
||||
/** Used to match "interpolate" template delimiters */
|
||||
var reInterpolate = /<%=([\s\S]+?)%>/g;
|
||||
|
||||
/** Used to detect functions containing a `this` reference */
|
||||
var reThis = (reThis = /\bthis\b/) && reThis.test(runInContext) && reThis;
|
||||
|
||||
/** Used to detect and test whitespace */
|
||||
var whitespace = (
|
||||
// whitespace
|
||||
' \t\x0B\f\xA0\ufeff' +
|
||||
|
||||
// line terminators
|
||||
'\n\r\u2028\u2029' +
|
||||
|
||||
// unicode category "Zs" space separators
|
||||
'\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000'
|
||||
);
|
||||
|
||||
/** Used to match leading whitespace and zeros to be removed */
|
||||
var reLeadingSpacesAndZeros = RegExp('^[' + whitespace + ']*0+(?=.$)');
|
||||
|
||||
/** Used to ensure capturing order of template delimiters */
|
||||
var reNoMatch = /($^)/;
|
||||
|
||||
/** Used to match HTML characters */
|
||||
var reUnescapedHtml = /[&<>"']/g;
|
||||
/** Used to detect functions containing a `this` reference */
|
||||
var reThis = (reThis = /\bthis\b/) && reThis.test(runInContext) && reThis;
|
||||
|
||||
/** Used to match unescaped characters in compiled string literals */
|
||||
var reUnescapedString = /['\n\r\t\u2028\u2029\\]/g;
|
||||
@@ -4484,8 +4482,9 @@
|
||||
* _.unzip([['moe', 30, true], ['larry', 40, false]]);
|
||||
* // => [['moe', 'larry'], [30, 40], [true, false]];
|
||||
*/
|
||||
function unzip(array) {
|
||||
var index = -1,
|
||||
function unzip() {
|
||||
var array = arguments.length > 1 ? arguments : arguments[0],
|
||||
index = -1,
|
||||
length = array ? max(pluck(array, 'length')) : 0,
|
||||
result = Array(length < 0 ? 0 : length);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user