UNPKG

async-validate

Version:

Asynchronous validation for node and the browser

17 lines (12 loc) 270 B
var data = { foo: {id: 'foo'}, bar: {id: 'bar'} } // mock model class (vars) function Model() {} function findUserById(id, cb) { // normally find in a database return cb(null, data[id]); } Model.prototype.findUserById = findUserById; module.exports = Model;