mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 01:17:50 +00:00
Rename mapping rekey to rename.
This commit is contained in:
@@ -211,7 +211,7 @@ function baseConvert(util, name, func) {
|
|||||||
var pairs = [];
|
var pairs = [];
|
||||||
each(mapping.caps, function(cap) {
|
each(mapping.caps, function(cap) {
|
||||||
each(mapping.aryMethod[cap], function(key) {
|
each(mapping.aryMethod[cap], function(key) {
|
||||||
var func = _[mapping.rekey[key] || key];
|
var func = _[mapping.rename[key] || key];
|
||||||
if (func) {
|
if (func) {
|
||||||
pairs.push([key, wrap(key, func)]);
|
pairs.push([key, wrap(key, func)]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -208,8 +208,8 @@ exports.realToAlias = (function() {
|
|||||||
return result;
|
return result;
|
||||||
}());
|
}());
|
||||||
|
|
||||||
/** Used to map keys to other keys. */
|
/** Used to map method names to other names. */
|
||||||
exports.rekey = {
|
exports.rename = {
|
||||||
'curryN': 'curry',
|
'curryN': 'curry',
|
||||||
'curryRightN': 'curryRight',
|
'curryRightN': 'curryRight',
|
||||||
'getOr': 'get'
|
'getOr': 'get'
|
||||||
|
|||||||
@@ -49,8 +49,8 @@ function isThru(funcName) {
|
|||||||
|
|
||||||
function getTemplate(moduleName) {
|
function getTemplate(moduleName) {
|
||||||
var data = {
|
var data = {
|
||||||
'key': mapping.key,
|
'name': _.result(mapping.aliasToReal, moduleName, moduleName),
|
||||||
'name': _.result(mapping.aliasToReal, moduleName, moduleName)
|
'rename': mapping.rename
|
||||||
};
|
};
|
||||||
|
|
||||||
if (isAlias(moduleName)) {
|
if (isAlias(moduleName)) {
|
||||||
@@ -91,7 +91,7 @@ function build(target) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Add FP alias and remapped module paths.
|
// Add FP alias and remapped module paths.
|
||||||
_.each([mapping.aliasToReal, mapping.key], function(data) {
|
_.each([mapping.aliasToReal, mapping.rename], function(data) {
|
||||||
_.forOwn(data, function(realName, alias) {
|
_.forOwn(data, function(realName, alias) {
|
||||||
modulePaths.push(path.join(target, alias + '.js'));
|
modulePaths.push(path.join(target, alias + '.js'));
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
var convert = require('./convert');
|
var convert = require('./convert');
|
||||||
module.exports = convert('<%= name %>', require('../<%= _.result(key, name, name) %>'));
|
module.exports = convert('<%= name %>', require('../<%= _.result(rename, name, name) %>'));
|
||||||
|
|||||||
@@ -96,7 +96,7 @@
|
|||||||
var aryCap = index + 1;
|
var aryCap = index + 1;
|
||||||
|
|
||||||
var methodNames = _.filter(mapping.aryMethod[aryCap], function(methodName) {
|
var methodNames = _.filter(mapping.aryMethod[aryCap], function(methodName) {
|
||||||
var key = _.result(mapping.rekey, methodName, methodName),
|
var key = _.result(mapping.rename, methodName, methodName),
|
||||||
arity = _[key].length;
|
arity = _[key].length;
|
||||||
|
|
||||||
return arity != 0 && arity < aryCap;
|
return arity != 0 && arity < aryCap;
|
||||||
|
|||||||
Reference in New Issue
Block a user