UNPKG

444 BJavaScriptView Raw
1'use strict';
2
3var utils = require('./utils');
4
5module.exports = function(app) {
6 return function(val, key, config, schema) {
7 app.debug('command > %s: "%j"', key, val);
8 if (typeof val === 'undefined') {
9 schema.omit(key);
10 return;
11 }
12
13 if (utils.typeOf(val) === 'object') {
14 return utils.stringify(val);
15 }
16
17 if (typeof val === 'string') {
18 return val;
19 }
20
21 schema.omit(key);
22 return;
23 };
24};
25