_(apps) .filter(app => app.closeness !== -1) .orderBy('closeness') .thru(apps => apps[0]) .value()
constructor(id, options = {}, factory) { options = _.merge({}, config, options); // Get route for this service const primaryRoute = _(_.get(options, '_app.platformsh.routes', [])) .map((config, url) => _.merge({}, config, {url})) .filter(route => route.type === 'upstream') .filter(route => route.upstream.split(':')[0] === options.name) .orderBy('primary', ['desc']) .thru(routes => routes[0].url) .value(); // Build the php const php = { image: `docker.registry.platform.sh/php-${options.version}`, volumes: options.volumes, ports: ['80'], environment: { DRUSH_OPTIONS_URI: primaryRoute, }, }; // Add in the php service and push downstream super(id, options, {services: _.set({}, options.name, php)}); }
_(loadCacheFile(config.toolingRouter)) .map(route => _.merge({}, route, { closeness: _.indexOf(pathsToRoot(), route.route), })) .filter(route => route.closeness !== -1) .orderBy('closeness') .thru(routes => routes[0]) .value()
i.map(s => s.match(/(.+?)-(\d+)\[(.+?)]/)) .map(([, data, sector, checksum]) => ({ sector, checksum, chars: require('lodash')(data.replace(/-/g, '')) .countBy() .map((n, c) => ({c, n})) .orderBy(['n', 'c'], ['desc', 'asc']) .take(5) .map('c') .join`` })) .filter(v => v.checksum === v.chars) .reduce((p, v) => p + +v.sector, 0)
_(input.slice(2).map(str => str.match(/(\d+)/g))) .map(([x, y, size, used, avail, percent]) => ({ x: +x, y: +y, size: +size, used: +used, avail: +avail })) .orderBy(['x', 'y'], ['desc', 'asc']) .value()
return _(data).orderBy('tier', ['desc']).uniqBy('name').value()
_(input.slice(2).map(str => str.match(/(\d+)/g))) .map(([x, y, size, used, avail, percent]) => ({ x: +x, y: +y, size: +size, used: +used, avail: +avail })) .orderBy(['x', 'y'], ['desc', 'asc']) .value()