or run

npx @tessl/cli init
Log in

Version

Files

docs

index.md
tile.json

task.mdevals/scenario-10/

User Activity Analytics

A utility module that processes user activity data and organizes it by various criteria for reporting and analysis purposes.

Capabilities

Group users by status

  • Groups an array of user objects by their 'status' property, returning an object where keys are status values and values are arrays of users with that status @test
  • When given an empty array, returns an empty object @test

Group transactions by date

  • Groups transaction records by the 'date' property, collecting all transactions that occurred on the same date @test

Group items by computed value

  • Groups items using a function that computes the grouping key from each item, such as grouping numbers by their remainder when divided by 3 @test

Implementation

@generates

API

/**
 * Groups collection items by a specified criterion.
 *
 * @param {Array} collection - The collection to group
 * @param {string|Function} criterion - Property name or function to determine grouping
 * @returns {Object} An object with keys as group identifiers and values as arrays of items
 */
function groupByCriterion(collection, criterion) {
  // IMPLEMENTATION HERE
}

module.exports = {
  groupByCriterion
};

Dependencies { .dependencies }

lodash { .dependency }

Provides utility functions for data manipulation and grouping operations.