From daeb55e99d116d1194bd4e702bb2a0c4b4a9ce66 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Mon, 1 Feb 2016 23:52:26 -0800 Subject: [PATCH] Rename mapping `rekey` to `rename`. --- fp/_baseConvert.js | 2 +- fp/_mapping.js | 4 ++-- lib/fp/build-modules.js | 6 +++--- lib/fp/template/module.jst | 2 +- test/test-fp.js | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/fp/_baseConvert.js b/fp/_baseConvert.js index 253caff18..d85983ca7 100644 --- a/fp/_baseConvert.js +++ b/fp/_baseConvert.js @@ -211,7 +211,7 @@ function baseConvert(util, name, func) { var pairs = []; each(mapping.caps, function(cap) { each(mapping.aryMethod[cap], function(key) { - var func = _[mapping.rekey[key] || key]; + var func = _[mapping.rename[key] || key]; if (func) { pairs.push([key, wrap(key, func)]); } diff --git a/fp/_mapping.js b/fp/_mapping.js index 2cfd21842..3fe602629 100644 --- a/fp/_mapping.js +++ b/fp/_mapping.js @@ -208,8 +208,8 @@ exports.realToAlias = (function() { return result; }()); -/** Used to map keys to other keys. */ -exports.rekey = { +/** Used to map method names to other names. */ +exports.rename = { 'curryN': 'curry', 'curryRightN': 'curryRight', 'getOr': 'get' diff --git a/lib/fp/build-modules.js b/lib/fp/build-modules.js index 02a1bbfd6..65d079d4e 100644 --- a/lib/fp/build-modules.js +++ b/lib/fp/build-modules.js @@ -49,8 +49,8 @@ function isThru(funcName) { function getTemplate(moduleName) { var data = { - 'key': mapping.key, - 'name': _.result(mapping.aliasToReal, moduleName, moduleName) + 'name': _.result(mapping.aliasToReal, moduleName, moduleName), + 'rename': mapping.rename }; if (isAlias(moduleName)) { @@ -91,7 +91,7 @@ function build(target) { }); // 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) { modulePaths.push(path.join(target, alias + '.js')); }); diff --git a/lib/fp/template/module.jst b/lib/fp/template/module.jst index 6a06f2015..da044af5a 100644 --- a/lib/fp/template/module.jst +++ b/lib/fp/template/module.jst @@ -1,2 +1,2 @@ var convert = require('./convert'); -module.exports = convert('<%= name %>', require('../<%= _.result(key, name, name) %>')); +module.exports = convert('<%= name %>', require('../<%= _.result(rename, name, name) %>')); diff --git a/test/test-fp.js b/test/test-fp.js index 472370b8f..88df37117 100644 --- a/test/test-fp.js +++ b/test/test-fp.js @@ -96,7 +96,7 @@ var aryCap = index + 1; 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; return arity != 0 && arity < aryCap;