@sap/xsodata
Version:
Expose data from a HANA database as OData V2 service with help of .xsodata files.
25 lines (18 loc) • 600 B
JavaScript
;
const async = require('async');
module.exports = function applyChecks(checks, context, callback) {
const checksForKind = checks[context.oData.kind];
if (!checksForKind) {
//no checks for odata.kind defined
return callback(null, context);
}
const contextBoundChecks = checksForKind.map(function (check) {
return check.bind(null, context);
});
async.series(contextBoundChecks, function onApplyChecksDone(err) {
if (err) {
return callback(err, context);
}
return callback(null, context);
});
};