or run

npx @tessl/cli init
Log in

Version

Files

docs

function-utilities.mdindex.mdlist-operations.mdmathematical-operations.mdobject-operations.mdstring-processing.md
tile.json

task.mdevals/scenario-7/

Boundary Navigator

Utilities for summarizing and trimming ordered collections while handling empty inputs gracefully.

Capabilities

Summarize bookends

  • Given ["prologue", "chapter", "epilogue"], return { start: "prologue", end: "epilogue" }. @test
  • Given [], return { start: undefined, end: undefined }. @test

Trim outer elements

  • Given [1, 2, 3, 4], return [2, 3]. @test
  • Given ["solo"], return []. @test

Positional lookup

  • Given ["north", "east", "south", "west"] and index -1, return "west". @test
  • Given ["north", "east", "south", "west"] and index 2, return "south". @test

Emptiness detection

  • Given [], return true; given ["item"], return false. @test

Implementation

@generates

API

export function bookendSummary<T>(items: T[]): { start?: T; end?: T };
export function trimOuter<T>(items: T[]): T[];
export function pickAt<T>(items: T[], index: number): T | undefined;
export function isEmptyCollection<T>(items: T[]): boolean;

Dependencies { .dependencies }

prelude.ls { .dependency }

Functional utilities for positional list access, slicing, and emptiness checks.