UNPKG

@sap/xsodata

Version:

Expose data from a HANA database as OData V2 service with help of .xsodata files.

24 lines (17 loc) 586 B
'use strict'; var async = require('async'); module.exports = function applyChecks(checks, context, callback) { var checksForKind = checks[context.oData.kind]; if (!checksForKind) { //no checks for odata.kind defined return callback(null, context); } var 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); }); };