Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
fetchAll: (collectionIdentity, collection, criteria) => {
const filters = _.omit(helpers.handleFilters(criteria), value => {
return _.isUndefined(value) || _.isNumber(value) ? _.isNull(value) : _.isEmpty(value);
});
return collection.forge()
.query(filters)
.fetchAll({withRelated: helpers.getAssociationsByIdentity(collectionIdentity)})
.then(data => data.toJSON() || data);
},