/** * Get all groups for event * * @param {String} eventName * @returns Array<String> * @memberof EventCatalog */ getGroups(eventName) { return _.uniq(this.events.filter(list => utils.match(eventName, list.name)).map(item => item.group)); }
_.debounce(function() { console.log("\x1b[2J"); console.log("\x1b[0;0H"); console.log(kleur.yellow().bold("\nRegistry: "), kleur.grey("Time:"), kleur.grey(humanize(process.uptime() * 1000))); console.log(kleur.yellow().bold( "========")); const nodeIDs = _.uniq([].concat( Object.keys(this.workerRegistry), this.broker.registry.nodes.toArray().map(node => node.id) )) .filter(nodeID => nodeID != this.broker.nodeID) .sort((a, b) => Number(a.replace(/[^\d]/g, "")) - Number(b.replace(/[^\d]/g, ""))); nodeIDs.forEach(nodeID => this.printWorkerRegistry(nodeID, this.workerRegistry[nodeID], nodeIDs)); }, 250)
_.mergeWith(old, ...fresh, (s, f) => { if (_.isArray(s)) return _.uniq(s.concat(f)); })
_.forEach(_.uniq(_.map(build, 'id')), container => { build.unshift({ id: container, cmd: '/helpers/user-perms.sh --silent', compose: app.compose, project: app.project, opts: { mode: 'attach', prestart, user: 'root', services: [container.split('_')[1]], }, }); });
/** * Merge `settings` property in schema * * @static * @param {Object} src Source schema property * @param {Object} target Target schema property * * @returns {Object} Merged schema */ static mergeSchemaSettings(src, target) { if ((target && target.$secureSettings) || (src && src.$secureSettings)) { const srcSS = src && src.$secureSettings ? src.$secureSettings : []; const targetSS = target && target.$secureSettings ? target.$secureSettings : []; if (!target) target = {}; target.$secureSettings = _.uniq([].concat(srcSS, targetSS)); } return _.defaultsDeep(src, target); }
// Add proxy URLS to our app info _.forEach(['post-start', 'post-init'], event => { app.events.on(event, () => { // Get last known ports const ports = lando.cache.get(lando.config.proxyCache); // Map to protocol and add portz // @TODO: do something more meaningful below like logging?, obviously starting to not GAS if (ports) { _(app.info) .filter(service => _.has(app, `config.proxy.${service.service}`)) .flatMap(s => s.urls = _.uniq(s.urls.concat(utils.parse2Info( app.config.proxy[s.service], ports, _.get(s, 'hasCerts', false) )))) .value(); } }); });
function saveHistory(event, cmds = []) { if(noAccessToHistory || historySize === 0 || !_.isArray(cmds) || cmds.length === 0 ) { return; } // remove adjacent duplicates history = _.uniq(history.concat(cmds), true); // trim history updateHistorySize(null, historySize); // rewrite fs.writeFile(HISTORY_FILE, JSON.stringify(history), (err) => { if(err) { noAccessToHistory = true; console.error(`Failed to write history file ${err.message}`); } }); }
const nets = _.uniq(networks).concat(['bridge', 'host', 'none', lando.config.networkBridge]); if (_.has(lando, 'config.proxyNet')) nets.push(lando.config.proxyNet); return nets;
const eventCommands = utils.events2Runz(cmds, app, data); if (!_.isEmpty(eventCommands)) { _.forEach(_.uniq(_.map(eventCommands, 'id')), container => { eventCommands.unshift({ id: container,
removeArr = _.uniq(removeArr);
serviceNames = [serviceNames]; serviceNames = _.uniq(_.compact(serviceNames.map(x => { if (utils.isPlainObject(x) && x.name) return this.ServiceFactory.getVersionedFullName(x.name, x.version);
async create(createArticleDto: EditArticleDto, userID: number) { const tagIDs = _.uniq(createArticleDto.tags); const tags: Tag[] = tagIDs.map(tagID => { const tag = new Tag();
const categoryIDs = []; const insertTags = []; const tagIDs = _.uniq(editArticleDto.tags); tagIDs.map(tagID => { insertTags.push(`(${articleID}, ${tagID})`);