CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-lodash-kebabcase

The lodash method kebabCase exported as a standalone Node.js module for converting strings to kebab-case format

Overall
score

68%

Evaluation68%

1.08x

Agent success when using this tile

Overview
Eval results
Files

task.mdevals/scenario-3/

Collection Insights

Produce a utility that summarizes order collections for reporting.

Capabilities

Aggregates order metrics

  • For three orders (two delivered with totals 120 and 80, one pending with total 50), it returns totalCount: 3, totalRevenue: 250, and byStatus equal to { delivered: 2, pending: 1 }. @test

Finds stale pending orders

  • With a cutoff of 2024-02-01, pending orders dated 2024-01-10 and 2023-12-31 are returned in stalePending as ["o-1", "o-4"], while a pending order dated 2024-02-05 is excluded; ordering is oldest first. @test

Ranks top customers

  • From orders where Ada spends 120 and 30, Ken spends 90, and Bea spends 150, topCustomers lists [{ customer: "Bea", total: 150 }, { customer: "Ada", total: 150 }, { customer: "Ken", total: 90 }], sorted by spend descending then name ascending, capped at three entries. @test

Counts item quantities

  • Across two orders containing items { sku: "sku-1", qty: 2 }, { sku: "sku-2", qty: 1 }, { sku: "sku-1", qty: 3 }, and { sku: "sku-3", qty: 4 }, itemCounts is { "sku-1": 5, "sku-2": 1, "sku-3": 4 }. @test

Implementation

@generates

API

/**
 * Summarizes a set of purchase orders.
 * @param {Array<{id:string, customer:string, status:string, total:number, createdAt:string, items:Array<{sku:string, qty:number, price:number}>}>} orders
 * @param {Date|string} cutoff - Threshold; pending orders before this are considered stale.
 * @returns {{
 *   totalCount:number,
 *   totalRevenue:number,
 *   byStatus:Record<string, number>,
 *   stalePending:string[],
 *   topCustomers:Array<{customer:string, total:number}>,
 *   itemCounts:Record<string, number>
 * }}
 */
function analyzeOrders(orders, cutoff);

Dependencies { .dependencies }

lodash { .dependency }

Provides collection iteration, filtering, and aggregation utilities.

Install with Tessl CLI

npx tessl i tessl/npm-lodash-kebabcase

tile.json