base-config-schema
Version:
Schema for the base-config plugin, used for normalizing config values before passing them to config.process().
19 lines (15 loc) • 370 B
JavaScript
;
var utils = require('../utils');
module.exports = function(app, base, options) {
return function(val, key, config, next) {
if (!val || utils.isEmpty(val)) return null;
if (utils.isObject(val)) {
val = utils.stringify(val);
}
val = utils.arrayify(val);
if (val.length === 0) {
val = ['*'];
}
return val;
};
};