const composeEntries = (editor, entries: Entry[]): Element[] => { return Arr.bind(Arr.groupBy(entries, isIndented), (entries) => { const groupIsIndented = Arr.head(entries).map(isIndented).getOr(false); return groupIsIndented ? indentedComposer(editor, entries) : outdentedComposer(editor, entries); }); }
_(services) .groupBy('platformsh.type') .map((service, type) => _.merge({}, {type}, { services: _.flatten(_.map(service, s => parsedRelationships[s.name])), })) .value()
groupBy(withHooks, item => { const separator = item.name.startsWith('post') ? 'post' : 'pre'; if (item.name.startsWith('post') || item.name.startsWith('pre')) { return item.name.split(separator)[1]; } return item.name; })
const generateModelsLinks = models => { const [collectionTypes, singleTypes] = chain(models) .groupBy('schema.kind') .map((value, key) => ({ name: key, links: value })) .sortBy('name') .value(); return { collectionTypesSectionLinks: generateLinks(get(collectionTypes, 'links', [])), singleTypesSectionLinks: generateLinks(get(singleTypes, 'links', [])), }; }
groupBy( this.props.notes, ( { timestamp } ) => { const time = new Date( timestamp ); return findIndex( timeGroups, ( [ after, before ] ) => before < time && time <= after ); } )
compile(cubes, errorReporter) { super.compile(cubes, errorReporter); const validCubes = this.cubeList.filter(cube => this.cubeValidator.isCubeValid(cube)); this.evaluatedCubes = R.fromPairs(validCubes.map(v => [v.name, v])); this.byFileName = R.groupBy(v => v.fileName, validCubes); this.primaryKeys = R.fromPairs(validCubes.map((v) => { const primaryKeyNameToSymbol = R.compose(R.find(d => d[1].primaryKey), R.toPairs)(v.dimensions || {}); return [ v.name, primaryKeyNameToSymbol && primaryKeyNameToSymbol[0] ]; })); }
$.each(apiByGroup, function(index, entries) { apiByGroupAndName[index] = _.groupBy(entries, function(entry) { return entry.name; }); });
_(apps) .map(app => app.relationships || []) .flatten() .thru(relationships => relationships[0]) .map((relationship, alias) => ({ alias, service: relationship.split(':')[0], endpoint: relationship.split(':')[1], creds: _.get(open, alias, {}), })) .groupBy('service') .value()
const formatPermissionsLayout = (layout, groupByKey) => { return chain(layout) .groupBy(groupByKey) .map((item, itemName) => ({ category: itemName, subCategories: chain(item) .groupBy('subCategory') .map((actions, subCategoryName) => ({ subCategory: subCategoryName, actions })) .value(), })) .value(); }
// Helper to sort tokens const sortTokens = (...sources) => _(_.flatten([...sources])) .sortBy('date') .groupBy('user') .map(tokens => _.last(tokens)) .value()
const formatPermissionsLayout = (layout, groupByKey) => { return chain(layout) .groupBy(groupByKey) .map((item, itemName) => ({ category: itemName, subCategories: chain(item) .groupBy('subCategory') .map((actions, subCategoryName) => ({ subCategory: subCategoryName, actions })) .value(), })) .value(); }
_(_.flatten([...sources])) .sortBy('date') .groupBy('email') .map(tokens => _.last(tokens)) .value()
_(_.flatten([...sources])) .sortBy('date') .groupBy('email') .map(tokens => _.last(tokens)) .value()
const generateModelsLinks = models => { const [collectionTypes, singleTypes] = chain(models) .groupBy('schema.kind') .map((value, key) => ({ name: key, links: value })) .sortBy('name') .value(); return { collectionTypesSectionLinks: generateLinks(get(collectionTypes, 'links', [])), singleTypesSectionLinks: generateLinks(get(singleTypes, 'links', [])), }; }