UNPKG

base-config-schema

Version:

Schema for the base-config plugin, used for normalizing config values before passing them to config.process().

19 lines (14 loc) 414 B
'use strict'; var normalize = require('../normalize'); var debug = require('../debug'); var utils = require('../utils'); module.exports = function(app, options) { return function(val, key, config, schema) { if (!val || utils.isEmpty(val)) return null; debug.field(key, val); if (typeof val === 'string') { val = val.split(','); } return normalize(val, key, config, schema); }; };