Add fp/placeholder module.

This commit is contained in:
John-David Dalton
2016-04-02 10:57:29 -07:00
parent 2b58525816
commit 012bff97e0
4 changed files with 13 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
var mapping = require('./_mapping'), var mapping = require('./_mapping'),
mutateMap = mapping.mutate, mutateMap = mapping.mutate,
fallbackHolder = {}; fallbackHolder = require('./placeholder');
/** /**
* The base implementation of `convert` which accepts a `util` object of methods * The base implementation of `convert` which accepts a `util` object of methods

6
fp/placeholder.js Normal file
View File

@@ -0,0 +1,6 @@
/**
* The default argument placeholder value for methods.
*
* @type {Object}
*/
module.exports = {};

View File

@@ -97,8 +97,7 @@ function build(target) {
_.each([mapping.aliasToReal, mapping.remap], function(data) { _.each([mapping.aliasToReal, mapping.remap], function(data) {
_.forOwn(data, function(realName, alias) { _.forOwn(data, function(realName, alias) {
var modulePath = path.join(target, alias + '.js'); var modulePath = path.join(target, alias + '.js');
if (!_.startsWith(alias, '_') && if (!_.includes(modulePaths, modulePath)) {
!_.includes(modulePaths, modulePath)) {
modulePaths.push(modulePath); modulePaths.push(modulePath);
} }
}); });

View File

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