base-cli-process
Version:
Normalizers for common argv commands handled by the base-cli plugin. Also pre-processes the given object with base-cli-schema before calling `.process()`
19 lines (14 loc) • 362 B
JavaScript
;
var debug = require('./debug');
var utils = require('./utils');
module.exports = function(app, prop) {
return function(val, key, config, next) {
debug.field(key, val);
if (utils.isString(val)) {
val = config[key] = [utils.stripQuotes(val)];
}
var obj = {};
obj[prop] = val;
app.config.process(obj, next);
}
};