A functionally oriented utility library for LiveScript with curried functions for lists, objects, strings, numbers, and function composition.
89
Utilities for summarizing and trimming ordered collections while handling empty inputs gracefully.
["prologue", "chapter", "epilogue"], return { start: "prologue", end: "epilogue" }. @test[], return { start: undefined, end: undefined }. @test[1, 2, 3, 4], return [2, 3]. @test["solo"], return []. @test["north", "east", "south", "west"] and index -1, return "west". @test["north", "east", "south", "west"] and index 2, return "south". @test[], return true; given ["item"], return false. @test@generates
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;Functional utilities for positional list access, slicing, and emptiness checks.
Install with Tessl CLI
npx tessl i tessl/npm-prelude-lsdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10