var data = _.reject(res.data, function (authority) { var admin = _.find(authority.authorities, function (authority) { return authority === 100000;
var data = res.data; var newRoles= _.reject(data, function (role) { return _.find(role.authorities, function (authority) { return authority === 100000;
$http.get('/api/authorities') .then(function (res) { var data = _.reject(res.data, { code: 100000 });
$scope.$on('socket:command:deleted', function(e, data) { $scope.pendingCommands = _.reject($scope.pendingCommands, function(cmd) { return cmd.id === data.id; }); });
static get fillable () { return _.reject(_.keys(this.fields), v => { return ['_id'].includes(v) || v.includes('.') }) }
_.flow([ _.trim, text => _.split(text, ' '), words => _.reject(words, _.isEmpty), words => _.join(words, ' ') ])
removeTag(tag, event) { event.preventDefault(); this.setState({ tags: _.reject(this.state.tags, t => (t === tag)) }); }
this.query(function(qb) { _.forEach(params.where, (where, key) => { qb.where(key, where[0].symbol, where[0].value); }); if (params.sort) { qb.orderBy(params.sort.key, params.sort.order); } if (params.start) { qb.offset(params.start); } if (params.limit) { qb.limit(params.limit); } }).fetchAll({ withRelated: populate || _.keys(_.groupBy(_.reject(this.associations, { autoPopulate: false }), 'alias')) })
Reflux.createStore({ listenables: [Actions], getImages: function(topicId) { return Api.get('topics/' + topicId) .then(function(json){ this.images = _.reject(json.data, function(image) { return image.is_album }); this.triggerChange(); }.bind(this)); }, triggerChange: function() { this.trigger('change', this.images); } })
io.on('connection', function(socket) { socket.on('online user', function(user) { user.socket_id = socket.id; var foundUser = _.find(users, {id: user.id}); if (foundUser) { foundUser.socket_id = socket.id; } else { users.push(user); } io.emit('online users list', users); }); socket.on('chat message', function(msg, toUserID, from) { var toUser = _.find(users, {id: toUserID}); socket.to(toUser.socket_id).emit('chat message', msg, from); }); socket.on('disconnect', function() { users = _.reject(users, {socket_id: socket.id}); }); });
let fetchActivationBytesFromDevices = () => { if (typeof regeditList !== 'function') { return Promise.reject(new Error(`Optional dependency \`regedit\` is not installed. Try reinstalling ${pkg.name} without ignoring \`optionalDependencies\`.`)) } return regeditList(AudibleDevicesKey).then((result) => { let entries = _.map(result[AudibleDevicesKey].values, (n) => { return extractBytes(n.value) }) entries = _.reject(entries, (n) => { return n.toUpperCase() === 'FFFFFFFF' }) if (entries.length > 0) return entries throw new Error('Could not find any Audible Activation Bytes!') }) }
// Remove previous relationship asynchronously if it exists. virtualFields.push( models[details.model || details.collection] .findOne({ id : recordId }) .populate(_.keys(_.groupBy(_.reject(models[details.model || details.collection].associations, {autoPopulate: false}), 'alias')).join(' ')) .then(record => { if (record && _.isObject(record[details.via]) && record[details.via][current] !== value[current]) { return this.manageRelations(details.model || details.collection, { id: record[details.via][Model.primaryKey] || record[details.via].id, values: { [current]: null }, parseRelationships: false }); } return Promise.resolve(); }) );
/** * Converts `funcNames` into a chunked list string representation. * * @private * @param {string[]} funcNames The function names. * @returns {string} Returns the function list string. */ function toFuncList(funcNames) { let chunks = _.chunk(funcNames.slice().sort(), 5); let lastChunk = _.last(chunks); const lastName = lastChunk ? lastChunk.pop() : undefined; chunks = _.reject(chunks, _.isEmpty); lastChunk = _.last(chunks); let result = '`' + _.map(chunks, chunk => chunk.join('`, `') + '`').join(',\n`'); if (lastName == null) { return result; } if (_.size(chunks) > 1 || _.size(lastChunk) > 1) { result += ','; } result += ' &'; result += _.size(lastChunk) < 5 ? ' ' : '\n'; return result + '`' + lastName + '`'; }
this.query(function(qb) { Object.keys(params.where).forEach((key) => { const where = params.where[key]; if (Array.isArray(where.value) && where.symbol !== 'IN' && where.symbol !== 'NOT IN') { for (const value in where.value) { qb[value ? 'where' : 'orWhere'](key, where.symbol, where.value[value]); } } else { qb.where(key, where.symbol, where.value); } }); if (params.sort) { qb.orderBy(params.sort.key, params.sort.order); } if (params.start) { qb.offset(params.start); } if (params.limit) { qb.limit(params.limit); } }).fetchAll({ withRelated: populate || _.keys(_.groupBy(_.reject(this.associations, { autoPopulate: false }), 'alias')) })
function removeTodo(id) { todos = _.reject(todos, {id: id}); }