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
Build a small utility that composes functions while reshaping the arguments they receive. Callers should be able to flip composition order, remap inputs for individual steps, append defaults, and cap how many arguments reach sensitive steps.
[add, square, toTag] where add(a, b) sums two numbers, square(n) squares a number, and toTag(n) returns #${n}, composeShaped(steps) runs them left-to-right so pipeline(2, 3) yields "#25" @testcomposeShaped([toTag, square, add], { direction: "rtl" }), the same three functions run right-to-left so pipeline(2, 3) still produces "#25" because addition happens first even though it is listed last @testshapeArgs(formatName, { fromOriginal: [1, 0], append: [" Jr."] }) wraps a formatter so invoking the shaped version with ("Ada", "Lovelace") produces "Lovelace, Ada Jr."; combining it with a final uppercasing step via composeShaped results in "LOVELACE, ADA JR." @test(a, b) => a - b with shapeArgs and maxArgs: 2 ensures a composed pipeline ignores extra inputs, so composeShaped([shapedSubtract])(10, 3, 99) returns 7 @test@generates
/**
* Returns a function that remaps invocation arguments before calling `handler`.
* - fromOriginal: positions (0-based) pulled from the incoming args in that order.
* - append: values appended to the remapped list before calling the handler.
* - maxArgs: caps how many arguments reach the handler after remapping/appending.
*/
export function shapeArgs(
handler,
options?: { fromOriginal?: number[]; append?: any[]; maxArgs?: number }
): (...args: any[]) => any;
/**
* Composes the provided steps into a single callable.
* - direction: "ltr" (default) runs steps in array order; "rtl" runs them from right to left.
* - The first executed step receives the original call arguments; each subsequent step receives the previous result.
*/
export function composeShaped(
steps: Array<(...args: any[]) => any>,
options?: { direction?: "ltr" | "rtl" }
): (...args: any[]) => any;Utility helpers for function composition, argument remapping, and arity control.
@satisfied-by
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