The lodash method kebabCase exported as a standalone Node.js module for converting strings to kebab-case format
Overall
score
68%
Evaluation — 68%
↑ 1.08xAgent success when using this tile
Produce a utility that summarizes order collections for reporting.
totalCount: 3, totalRevenue: 250, and byStatus equal to { delivered: 2, pending: 1 }. @test2024-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. @testtopCustomers 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{ 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@generates
/**
* 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);Provides collection iteration, filtering, and aggregation utilities.
Install with Tessl CLI
npx tessl i tessl/npm-lodash-kebabcasedocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10