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-9/

Configurable Template Renderer

Create a utility that compiles and renders text templates with adjustable delimiters, imports, and variable naming to produce safe strings.

Capabilities

Renders with default settings

  • Interpolates placeholders in "Hello <%= name %>!" with { name: "Ada" } to produce "Hello Ada!" @test
  • Escapes HTML entities when using escape placeholders, turning { script: "<script>" } into "Safe: <script>" from template "Safe: <%- script %>" @test

Per-call delimiter overrides

  • Rendering with interpolation markers "{{ name }}" and evaluation markers "{{= price * tax }}" using per-call overrides produces correct totals while leaving the base settings unchanged @test

Imports available in templates

  • When base settings include helpers like upper and format, templates can call them directly, e.g. "Hi <%= upper(user.name) %>!" using data { user: { name: "ada" } } yields "Hi ADA!" @test

Custom variable naming

  • Using a custom variable name (e.g., "ctx") makes <%= ctx.greeting %> resolve data without relying on an implicit scope, and should still work when data includes keys that shadow reserved words @test

Implementation

@generates

API

export type DelimiterSet = {
  interpolate?: string;
  escape?: string;
  evaluate?: string;
};

export type RenderSettings = {
  delimiters?: DelimiterSet;
  imports?: Record<string, unknown>;
  variable?: string;
};

export type TemplateRenderer = {
  render(template: string, data?: Record<string, unknown>, overrides?: RenderSettings): string;
  setBaseSettings(updates: RenderSettings): void;
};

export function createTemplateRenderer(baseSettings?: RenderSettings): TemplateRenderer;

Dependencies { .dependencies }

lodash { .dependency }

Provides string templating with configurable delimiters, escaping, evaluation blocks, imports, and default settings control.

Install with Tessl CLI

npx tessl i tessl/npm-lodash-kebabcase

tile.json