Compare commits

..

1 Commits

Author SHA1 Message Date
John-David Dalton
d8bc95999f Bump to v4.2.1. 2016-02-03 01:09:45 -08:00
16 changed files with 67 additions and 38 deletions

View File

@@ -1,4 +1,4 @@
# lodash v4.2.0
# lodash v4.2.1
The [lodash](https://lodash.com/) library exported as [Node.js](https://nodejs.org/) modules.
@@ -28,7 +28,7 @@ var chunk = require('lodash/chunk');
var extend = require('lodash/fp/extend');
```
See the [package source](https://github.com/lodash/lodash/tree/4.2.0-npm) for more details.
See the [package source](https://github.com/lodash/lodash/tree/4.2.1-npm) for more details.
**Note:**<br>
Dont assign values to the [special variable](http://nodejs.org/api/repl.html#repl_repl_features) `_` when in the REPL.<br>

View File

@@ -44,7 +44,9 @@ var BIND_FLAG = 1,
var bind = rest(function(func, thisArg, partials) {
var bitmask = BIND_FLAG;
if (partials.length) {
var holders = replaceHolders(partials, bind.placeholder);
var placeholder = bind.placeholder,
holders = replaceHolders(partials, placeholder);
bitmask |= PARTIAL_FLAG;
}
return createWrapper(func, bitmask, thisArg, partials, holders);

View File

@@ -54,7 +54,9 @@ var BIND_FLAG = 1,
var bindKey = rest(function(object, key, partials) {
var bitmask = BIND_FLAG | BIND_KEY_FLAG;
if (partials.length) {
var holders = replaceHolders(partials, bindKey.placeholder);
var placeholder = bindKey.placeholder,
holders = replaceHolders(partials, placeholder);
bitmask |= PARTIAL_FLAG;
}
return createWrapper(key, bitmask, object, partials, holders);

View File

@@ -1,6 +1,6 @@
/**
* @license
* lodash 4.2.0 (Custom Build) <https://lodash.com/>
* lodash 4.2.1 (Custom Build) <https://lodash.com/>
* Build: `lodash core -o ./dist/lodash.core.js`
* Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
@@ -13,7 +13,7 @@
var undefined;
/** Used as the semantic version number. */
var VERSION = '4.2.0';
var VERSION = '4.2.1';
/** Used to compose bitmasks for wrapper metadata. */
var BIND_FLAG = 1,

View File

@@ -19,7 +19,7 @@ var nativeMax = Math.max;
* to the debounced function return the result of the last `func` invocation.
*
* **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
* on the trailing edge of the timeout only if the the debounced function is
* on the trailing edge of the timeout only if the debounced function is
* invoked more than once during the `wait` timeout.
*
* See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)

View File

@@ -30,7 +30,7 @@ function baseConvert(util, name, func) {
'iteratee': util.iteratee,
'keys': util.keys,
'rearg': util.rearg,
'rest': util.rest
'spread': util.spread
};
var ary = _.ary,
@@ -156,14 +156,15 @@ function baseConvert(util, name, func) {
if (wrapper) {
return wrapper(func);
}
var wrapped = func;
if (mutateMap.array[name]) {
func = immutWrap(func, cloneArray);
wrapped = immutWrap(func, cloneArray);
}
else if (mutateMap.object[name]) {
func = immutWrap(func, createCloner(func));
wrapped = immutWrap(func, createCloner(func));
}
else if (mutateMap.set[name]) {
func = immutWrap(func, cloneDeep);
wrapped = immutWrap(func, cloneDeep);
}
var result;
each(mapping.caps, function(cap) {
@@ -174,8 +175,8 @@ function baseConvert(util, name, func) {
spreadStart = mapping.methodSpread[name];
result = spreadStart === undefined
? ary(func, cap)
: spread(func, spreadStart);
? ary(wrapped, cap)
: spread(wrapped, spreadStart);
if (cap > 1 && !mapping.skipRearg[name]) {
result = rearg(result, mapping.methodRearg[name] || mapping.aryRearg[cap]);
@@ -196,7 +197,7 @@ function baseConvert(util, name, func) {
result || (result = func);
if (mapping.placeholder[name]) {
result.placeholder = placeholder;
func.placeholder = result.placeholder = placeholder;
}
return result;
};
@@ -204,8 +205,8 @@ function baseConvert(util, name, func) {
if (!isLib) {
return wrap(name, func);
}
// Add placeholder alias.
_.__ = placeholder;
// Add placeholder.
_.placeholder = placeholder;
// Iterate over methods for the current ary cap.
var pairs = [];

View File

@@ -1,5 +1,6 @@
/** Used to map aliases to their real names. */
exports.aliasToReal = {
'__': 'placeholder',
'all': 'some',
'allPass': 'overEvery',
'apply': 'spread',
@@ -60,9 +61,9 @@ exports.aryMethod = {
'repeat', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex',
'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy',
'split', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight', 'takeRightWhile',
'takeWhile', 'tap', 'throttle', 'thru', 'times', 'truncate', 'union', 'uniqBy',
'uniqWith', 'unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject',
'zipObjectDeep'
'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars', 'trimCharsEnd',
'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith', 'unset',
'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject', 'zipObjectDeep'
],
3: [
'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith',
@@ -212,11 +213,15 @@ exports.realToAlias = (function() {
exports.rename = {
'curryN': 'curry',
'curryRightN': 'curryRight',
'getOr': 'get'
'getOr': 'get',
'trimChars': 'trim',
'trimCharsEnd': 'trimEnd',
'trimCharsStart': 'trimStart'
};
/** Used to track methods that skip `_.rearg`. */
exports.skipRearg = {
'add': true,
'assign': true,
'assignIn': true,
'concat': true,
@@ -228,6 +233,7 @@ exports.skipRearg = {
'random': true,
'range': true,
'rangeRight': true,
'subtract': true,
'zip': true,
'zipObject': true
};

2
fp/trimChars.js Normal file
View File

@@ -0,0 +1,2 @@
var convert = require('./convert');
module.exports = convert('trimChars', require('../trim'));

2
fp/trimCharsEnd.js Normal file
View File

@@ -0,0 +1,2 @@
var convert = require('./convert');
module.exports = convert('trimCharsEnd', require('../trimEnd'));

2
fp/trimCharsStart.js Normal file
View File

@@ -0,0 +1,2 @@
var convert = require('./convert');
module.exports = convert('trimCharsStart', require('../trimStart'));

View File

@@ -1,6 +1,6 @@
/**
* @license
* lodash 4.2.0 (Custom Build) <https://lodash.com/>
* lodash 4.2.1 (Custom Build) <https://lodash.com/>
* Build: `lodash -d -o ./foo/lodash.js`
* Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
@@ -13,7 +13,7 @@
var undefined;
/** Used as the semantic version number. */
var VERSION = '4.2.0';
var VERSION = '4.2.1';
/** Used to compose bitmasks for wrapper metadata. */
var BIND_FLAG = 1,
@@ -4123,7 +4123,7 @@
index = length,
args = Array(length),
fn = (this && this !== root && this instanceof wrapper) ? Ctor : func,
placeholder = wrapper.placeholder;
placeholder = lodash.placeholder || wrapper.placeholder;
while (index--) {
args[index] = arguments[index];
@@ -4239,7 +4239,7 @@
args = composeArgsRight(args, partialsRight, holdersRight);
}
if (isCurry || isCurryRight) {
var placeholder = wrapper.placeholder,
var placeholder = lodash.placeholder || wrapper.placeholder,
argsHolders = replaceHolders(args, placeholder);
length -= argsHolders.length;
@@ -6129,7 +6129,7 @@
/**
* This method is like `_.pullAll` except that it accepts `iteratee` which is
* invoked for each element of `array` and `values` to to generate the criterion
* invoked for each element of `array` and `values` to generate the criterion
* by which uniqueness is computed. The iteratee is invoked with one argument: (value).
*
* **Note:** Unlike `_.differenceBy`, this method mutates `array`.
@@ -8346,7 +8346,9 @@
var bind = rest(function(func, thisArg, partials) {
var bitmask = BIND_FLAG;
if (partials.length) {
var holders = replaceHolders(partials, bind.placeholder);
var placeholder = lodash.placeholder || bind.placeholder,
holders = replaceHolders(partials, placeholder);
bitmask |= PARTIAL_FLAG;
}
return createWrapper(func, bitmask, thisArg, partials, holders);
@@ -8399,7 +8401,9 @@
var bindKey = rest(function(object, key, partials) {
var bitmask = BIND_FLAG | BIND_KEY_FLAG;
if (partials.length) {
var holders = replaceHolders(partials, bindKey.placeholder);
var placeholder = lodash.placeholder || bindKey.placeholder,
holders = replaceHolders(partials, placeholder);
bitmask |= PARTIAL_FLAG;
}
return createWrapper(key, bitmask, object, partials, holders);
@@ -8448,7 +8452,7 @@
function curry(func, arity, guard) {
arity = guard ? undefined : arity;
var result = createWrapper(func, CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
result.placeholder = curry.placeholder;
result.placeholder = lodash.placeholder || curry.placeholder;
return result;
}
@@ -8492,7 +8496,7 @@
function curryRight(func, arity, guard) {
arity = guard ? undefined : arity;
var result = createWrapper(func, CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
result.placeholder = curryRight.placeholder;
result.placeholder = lodash.placeholder || curryRight.placeholder;
return result;
}
@@ -8507,7 +8511,7 @@
* to the debounced function return the result of the last `func` invocation.
*
* **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
* on the trailing edge of the timeout only if the the debounced function is
* on the trailing edge of the timeout only if the debounced function is
* invoked more than once during the `wait` timeout.
*
* See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
@@ -8914,7 +8918,9 @@
* // => 'hi fred'
*/
var partial = rest(function(func, partials) {
var holders = replaceHolders(partials, partial.placeholder);
var placeholder = lodash.placeholder || partial.placeholder,
holders = replaceHolders(partials, placeholder);
return createWrapper(func, PARTIAL_FLAG, undefined, partials, holders);
});
@@ -8950,7 +8956,9 @@
* // => 'hello fred'
*/
var partialRight = rest(function(func, partials) {
var holders = replaceHolders(partials, partialRight.placeholder);
var placeholder = lodash.placeholder || partialRight.placeholder,
holders = replaceHolders(partials, placeholder);
return createWrapper(func, PARTIAL_RIGHT_FLAG, undefined, partials, holders);
});
@@ -9089,7 +9097,7 @@
* result of the last `func` invocation.
*
* **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
* on the trailing edge of the timeout only if the the throttled function is
* on the trailing edge of the timeout only if the throttled function is
* invoked more than once during the `wait` timeout.
*
* See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)

View File

@@ -1,6 +1,6 @@
{
"name": "lodash",
"version": "4.2.0",
"version": "4.2.1",
"description": "Lodash modular utilities.",
"homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg",

View File

@@ -38,7 +38,9 @@ var PARTIAL_FLAG = 32;
* // => 'hi fred'
*/
var partial = rest(function(func, partials) {
var holders = replaceHolders(partials, partial.placeholder);
var placeholder = partial.placeholder,
holders = replaceHolders(partials, placeholder);
return createWrapper(func, PARTIAL_FLAG, undefined, partials, holders);
});

View File

@@ -37,7 +37,9 @@ var PARTIAL_RIGHT_FLAG = 64;
* // => 'hello fred'
*/
var partialRight = rest(function(func, partials) {
var holders = replaceHolders(partials, partialRight.placeholder);
var placeholder = partialRight.placeholder,
holders = replaceHolders(partials, placeholder);
return createWrapper(func, PARTIAL_RIGHT_FLAG, undefined, partials, holders);
});

View File

@@ -3,7 +3,7 @@ var baseIteratee = require('./_baseIteratee'),
/**
* This method is like `_.pullAll` except that it accepts `iteratee` which is
* invoked for each element of `array` and `values` to to generate the criterion
* invoked for each element of `array` and `values` to generate the criterion
* by which uniqueness is computed. The iteratee is invoked with one argument: (value).
*
* **Note:** Unlike `_.differenceBy`, this method mutates `array`.

View File

@@ -15,7 +15,7 @@ var FUNC_ERROR_TEXT = 'Expected a function';
* result of the last `func` invocation.
*
* **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
* on the trailing edge of the timeout only if the the throttled function is
* on the trailing edge of the timeout only if the throttled function is
* invoked more than once during the `wait` timeout.
*
* See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)