Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return _.mapValues(schema, val =>
(typeof val === 'object') ?
(val.type === 'list') ? _.map(props.get(data, val.path), item => mapSchema(val.schema, item))
: mapSchema(val, data)
: props.get(data, val));
}
return _.mapValues(schema, val =>
(typeof val === 'object') ?
(val.type === 'list') ? _.map(props.get(data, val.path), item => mapSchema(val.schema, item))
: mapSchema(val, data)
: props.get(data, val));
}
exports.testFilter = function(val, stack) {
var pass = true;
for (var si = 0, sl = stack.length; si < sl; si++) {
var filter = stack[si];
var el = filter.path ? pathval.get(val, filter.path) : val
var res = testFilter(el, filter.test);
if (!res) pass = false;
}
return pass;
}