UNPKG

sails-permissions-sequelize

Version:

Sequelize version of : Comprehensive user permissions and entitlements system for sails.js and Waterline. Supports user authentication with passport.js, role-based permissioning, object ownership, and row-level security.

22 lines (19 loc) 594 B
var baseCallback = require('./baseCallback'), baseFindIndex = require('./baseFindIndex'); /** * Creates a `_.findIndex` or `_.findLastIndex` function. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new find function. */ function createFindIndex(fromRight) { return function(array, predicate, thisArg) { if (!(array && array.length)) { return -1; } predicate = baseCallback(predicate, thisArg, 3); return baseFindIndex(array, predicate, fromRight); }; } module.exports = createFindIndex;