Rename fp mapping rename to remap.

This commit is contained in:
John-David Dalton
2016-02-14 23:47:03 -08:00
parent aae02af265
commit c163659713
5 changed files with 6 additions and 6 deletions

View File

@@ -254,7 +254,7 @@ function baseConvert(util, name, func, options) {
var pairs = [];
each(mapping.caps, function(cap) {
each(mapping.aryMethod[cap], function(key) {
var func = _[mapping.rename[key] || key];
var func = _[mapping.remap[key] || key];
if (func) {
pairs.push([key, wrap(key, func)]);
}

View File

@@ -203,7 +203,7 @@ exports.realToAlias = (function() {
}());
/** Used to map method names to other names. */
exports.rename = {
exports.remap = {
'curryN': 'curry',
'curryRightN': 'curryRight',
'getOr': 'get',

View File

@@ -59,7 +59,7 @@ function isThru(funcName) {
function getTemplate(moduleName) {
var data = {
'name': _.result(mapping.aliasToReal, moduleName, moduleName),
'rename': mapping.rename
'mapping': mapping
};
if (isAlias(moduleName)) {
@@ -98,7 +98,7 @@ function build(target) {
});
// Add FP alias and remapped module paths.
_.each([mapping.aliasToReal, mapping.rename], function(data) {
_.each([mapping.aliasToReal, mapping.remap], function(data) {
_.forOwn(data, function(realName, alias) {
if (!_.startsWith(alias, '_')) {
modulePaths.push(path.join(target, alias + '.js'));

View File

@@ -1,2 +1,2 @@
var convert = require('./convert');
module.exports = convert('<%= name %>', require('../<%= _.result(rename, name, name) %>'));
module.exports = convert('<%= name %>', require('../<%= _.result(mapping.remap, name, name) %>'));

View File

@@ -291,7 +291,7 @@
var aryCap = index + 1;
var methodNames = _.filter(mapping.aryMethod[aryCap], function(methodName) {
var key = _.result(mapping.rename, methodName, methodName),
var key = _.result(mapping.remap, methodName, methodName),
arity = _[key].length;
return arity != 0 && arity < aryCap;