/* * Helper to set primary route if needed */ const setPrimaryRoute = (routes = []) => { // If we dont have a primary then set one if (!_.some(routes, 'primary')) { const firstUpstream = _.find(routes, {type: 'upstream'}); firstUpstream.primary = true; } // Return return routes; }
/* * Helper to find the ports we need for the proxy */ const findProxyPorts = (lando, status) => lando.Promise.try(() => { if (_.some(_.values(status))) { return scanPorts(lando, status).then(ports => _.merge(lando.config.proxyCurrentPorts, ports)); } else { return lando.engine.list() .filter(container => container.name === lando.config.proxyContainer) .then(containers => _.isEmpty(containers) ? scanPorts(lando) : lando.config.proxyLastPorts); }; })
// Make sure we have a lando bridge network // We do this here so we can take advantage of docker up assurancs in engine.js // and to make sure it covers all non-app services lando.events.on('pre-engine-start', 3, () => { // Let's get a list of network return lando.engine.getNetworks() // Try to find our net .then(networks => _.some(networks, network => network.Name === lando.config.networkBridge)) // Create if needed and set our network version number .then(exists => { if (!exists) { return lando.engine.createNetwork(lando.config.networkBridge).then(() => { lando.cache.set('versions', _.merge({}, lando.versions, {networking: 2}), {persist: true}); lando.versions = lando.cache.get('versions'); }); } }); });
); const hacktoberFestLabels = _.some( event.labels, label => label.name.toLowerCase() === 'hacktoberfest'
_.each(userPermissionIds, permissionId => { if (_.some(permissions, { id: permissionId }) === false) { throw new Error('Permission must be valid.'); } });
matchesLabel(pr) { if (this.label.values.length > 0) { const result = _.some(this.label.values, (_label) => { return _.flatMap(pr.labels.nodes, (label) => label.name).includes(_label) }) return (this.label.inclusion ? result : !result) } else { return true } }
spendClassic(txouts, solvers) { if (_.some(solvers, solver => solver.solvesSegwit())) return this.spendSegwit(txouts, solvers); if (solvers.length !== this.inputs.length || txouts.length !== solvers.length) throw new Error("The number of solvers must be equal to the number of utxos"); _.forEach(_.zip(_.range(solvers.length), txouts, solvers), list => this.spendSingle(list[0], list[1], list[2]) ); return this.toImmutable(); }
function isObjectMatch(obj) { return _.some(obj, (value, key) => { if (!isStringMatch(key)) return false; if (typeof value === 'boolean') return value; if (typeof value === 'string') return isStringMatch(value); if (value instanceof Array) return isArrayMatch(value); return false; }); }
_.some(config.get('auth.excludeAuthPaths'), function(pattern) { return path.match(new RegExp(pattern.endpoint, 'g')) && (!pattern.method || pattern.method === method); })
function hasFailures(modules) { return _.some(modules, (mod) => { return mod.error && !mod.flaky; }); }
const checkSegwit = function (solvers) { var segwit = false; if (_.some(solvers, solver => solver.solvesSegwit())) { segwit = true; } return segwit; }
function isArrayMatch(arr) { return _.some(arr, (item) => { if (typeof item === 'boolean') return item; if (typeof item === 'string') return isStringMatch(item); if (typeof item === 'object') return isObjectMatch(item); return false; }); }
_.some(Fixtures.courseTypes, function (value) { return val == value; })
_.some(Fixtures.departments, function (value) { return val == value; })
_.each(userPermissionIds, permissionId => { if (_.some(permissions, { id: permissionId }) === false) { throw new Error('Permission must be valid.'); } });