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;
}
* Flag transferring utility
*/
exports.transferFlags = require('./transferFlags');
/*!
* Deep equal utility
*/
exports.eql = require('deep-eql');
/*!
* Deep path info
*/
exports.getPathInfo = pathval.getPathInfo;
/*!
* Check if a property exists
*/
exports.hasProperty = pathval.hasProperty;
/*!
* Function name
*/
exports.getName = require('get-func-name');
/*!
* add Property
*/
return function keyCheck(res, body, next) {
var value = pathval.getPathValue(body, keyParam);
var notUndefined = typeof value !== 'undefined';
next(assert(notUndefined, true, 'Key - ' + keyParam));
};
};
return function value(res, body, next) {
next(assert(pathval.getPathValue(body, key), val, 'Value - ' + key));
};
};
* Deep equal utility
*/
exports.eql = require('deep-eql');
/*!
* Deep path info
*/
exports.getPathInfo = pathval.getPathInfo;
/*!
* Check if a property exists
*/
exports.hasProperty = pathval.hasProperty;
/*!
* Function name
*/
exports.getName = require('get-func-name');
/*!
* add Property
*/
exports.addProperty = require('./addProperty');
/*!
* add Method
*/
this._allExceptItems = options.allExcept.map(function(item) {
var parts = pathval.parse(item).map(function extractPart(part) {
return part.i !== undefined ? part.i : part.p;
});
return JSON.stringify(parts);
});
}