// Fix pullable/local services for lagoon things app.events.on('pre-rebuild', 9, () => { _.forEach(_.get(app, 'config.services', {}), (config, name) => { if (_.has(config, 'lagoon.build')) { _.remove(app.opts.pullable, item => item === name); app.opts.local.push(name); } }); });
/** * Remove endpoints by node ID * * @param {String} nodeID * @memberof EndpointList */ removeByNodeID(nodeID) { _.remove(this.endpoints, ep => { if (ep.id == nodeID) { ep.destroy(); return true; } }); this.setLocalEndpoints(); }
/* * Helper to handle dynamic services * * Set SERVICE from answers and strip out that noise from the rest of * stuff, check answers/argv for --service or -s, validate and then remove */ const handleDynamic = (config, options = {}, answers = {}) => { if (_.startsWith(config.service, ':')) { const answer = answers[config.service.split(':')[1]]; // Remove dynamic service option from argv _.remove(process.argv, arg => _.includes(getDynamicKeys(answer, answers).concat(answer), arg)); // Return updated config return _.merge({}, config, {service: answers[config.service.split(':')[1]]}); } else { return config; } }
/** * Remove all endpoints by nodeID * * @param {String} nodeID * @memberof ServiceCatalog */ removeAllByNodeID(nodeID) { _.remove(this.services, service => { if (service.node.id == nodeID) { this.registry.actions.removeByService(service); this.registry.events.removeByService(service); return true; } }); }
_.remove(contentCategoryList, function (cate) { return removeArr.indexOf(cate._id) >= 0 })
this.log.silly('process %s had output', id, {stdout, stderr}); _.remove(this.running, proc => proc.id === id); return (code !== 0) ? Promise.reject(new Error(stderr)) : Promise.resolve(stdout); });
/** * Remove all endpoints by service * * @param {ServiceItem} service * @memberof EndpointList */ removeByService(service) { _.remove(this.endpoints, ep => { if (ep.service == service) { ep.destroy(); return true; } }); this.setLocalEndpoints(); }
handleTogglePermission(data){ let self = this; let index = _.findIndex(self.state.permissionMap, function (role) { return role.role_id == data.role; }); let currentPermissions = self.state.permissionMap[index].permission_ids; if(!data.yes){ //removing permission from state let removePermissions = _.remove(currentPermissions, function (pid) { return (pid == data.permission); }); let newPermissions = _.difference(currentPermissions, removePermissions); let newPermissionMap = self.state.permissionMap; newPermissionMap[index].permission_ids = newPermissions; self.setState({changed: true, permissionMap: newPermissionMap}); }else{ //adding permission to state let newPermissions = _.concat(currentPermissions, data.permission); let newPermissionMap = self.state.permissionMap; newPermissionMap[index].permission_ids = newPermissions; self.setState({changed: true, permissionMap: newPermissionMap}); } }
_.remove(scope.media, function(medium) { return medium.active });
delProduct (product) { // remove product and emit event var pLink = typeof product === 'object' ? product.link : product _.remove(this.products, function(p) { return p.link === pLink }) debug('Product removed:', pLink) this.emit('remove', product) }
deny(group, actions) { const rights = this.permissions[group] || []; this._trimActions(actions) .forEach(actions, action => { _.remove(rights, (r) => _.eq(r, action)); }); this.permissions[group] = _.uniq(rights); }
_checkConsoleTransport() { const consoleTypeFirstIndex = _.findIndex(this.transportConfig, function(n) { return n.type && n.type.toLocaleLowerCase() === "console"; }); if(consoleTypeFirstIndex === -1) { this.transportConfig.push(defaultLogger); } else { _.remove(this.transportConfig, function(n, index) { return n.type && n.type === "console" && index !== consoleTypeFirstIndex; }); } }
modalSuccess(token) { if (this.state.currentModalToken === token) { this.state.currentModalToken = null; this.state.currentModal = null; } _.remove(this.state.asyncInProgress, {token}); }
var onUserDisconnect = function (userId){ var currentUser = getUser(userId); var userName = currentUser.displayText; var message = chatObj.createMessage(' left the chat.', 'info', currentUser.displayText); //sign the user off _.remove(users, function(userIn){return userIn.id == userId;}); io.emit('user-logged-off', message, users.length); }
_.remove(todoHashes, todo => { if (todo.index + 1000 < index) { return true } if (hash.includes(_.repeat(todo.char, 5))) { validHashes.push(todo.index) return true } return false })