Bump to v4.2.1.

This commit is contained in:
John-David Dalton
2016-02-03 01:09:45 -08:00
parent 24a4285b70
commit d8bc95999f
16 changed files with 67 additions and 38 deletions

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