mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 07:47:49 +00:00
Fix fp alias assignments.
This commit is contained in:
@@ -189,19 +189,26 @@ function baseConvert(util, name, func) {
|
||||
// Iterate over methods for the current ary cap.
|
||||
var pairs = [];
|
||||
each(mapping.caps, function(cap) {
|
||||
each(mapping.aryMethodMap[cap], function(name) {
|
||||
var func = _[mapping.keyMap[name] || name];
|
||||
each(mapping.aryMethodMap[cap], function(key) {
|
||||
var func = _[mapping.keyMap[key] || key];
|
||||
if (func) {
|
||||
// Wrap the lodash method and its aliases.
|
||||
var wrapped = wrap(name, func);
|
||||
pairs.push([name, wrapped]);
|
||||
each(mapping.aliasMap[name] || [], function(alias) { pairs.push([alias, wrapped]); });
|
||||
pairs.push([key, wrap(key, func)]);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Assign to `_` leaving `_.prototype` unchanged to allow chaining.
|
||||
each(pairs, function(pair) { _[pair[0]] = pair[1]; });
|
||||
each(pairs, function(pair) {
|
||||
_[pair[0]] = pair[1];
|
||||
});
|
||||
|
||||
// Wrap the lodash method and its aliases.
|
||||
each(keys(_), function(key) {
|
||||
each(mapping.aliasMap[key] || [], function(alias) {
|
||||
_[alias] = _[key];
|
||||
});
|
||||
});
|
||||
|
||||
return _;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user