Skip to content

API Reference

Browse the complete API documentation for @wollybeard/kit.

Arr

Array utilities for working with readonly and mutable arrays.

Err

Error handling utilities for robust error management.

Fn

Function utilities for functional programming patterns.

Html

HTML utility functions for escaping and working with HTML content.

Json

JSON utilities with Effect Schema integration.

Num

Numeric types and utilities with branded types for mathematical constraints.

Obj

Object utilities for working with plain JavaScript objects.

This module provides utilities for working with unions of object types, solving common TypeScript limitations when dealing with union types:

  • keyof (A | B) returns only common keys (intersection), not all keys (union) - (A | B)['key'] returns any for keys not in all members - No built-in way to merge union members while preserving value unions per key

These utilities use distributive conditional types to properly handle each union member separately, then combine the results.

Prom

Promise utilities for asynchronous operations.

Rec

Record utilities for working with plain JavaScript objects as dictionaries.

Str

String utilities for text manipulation and analysis.

Provides tools for generating markdown, TSDoc/JSDoc, and TypeScript code. Includes safe JSDoc generation with escaping, builder API, and structured tag helpers.

  • Nat
  • Text - Multi-line text formatting and layout utilities.

Provides functions specifically for working with multi-line strings treated as text content: - Line operations: Split into lines, join lines, map transformations per line - Indentation: Add/remove indentation, strip common leading whitespace - Alignment: Pad text, span to width, fit to exact width - Block formatting: Format blocks with prefixes, styled borders

Use Text for: Operations that treat strings as multi-line content with visual layout (indentation, padding for tables, line-by-line transformations).

Use root Str for: Primitive string operations (split, join, replace, match, trim) that work on strings as atomic values.

  • Tpl
  • Visual - Visual-aware string utilities that handle ANSI escape codes and grapheme clusters.

These functions measure and manipulate strings based on their visual appearance, not raw character count. Useful for terminal output, tables, and formatted text.

Test

Enhanced test utilities for table-driven testing with Vitest.

  • Test - Enhanced test utilities for table-driven testing with Vitest.

Provides builder API and type-safe utilities for parameterized tests with built-in support for todo, skip, and only cases.

Ts

TypeScript type utilities and type-level programming helpers.

  • Kind - Higher-kinded type utilities for type-level programming. Provides type-level functions and utilities for simulating higher-kinded types in TypeScript.
  • Relation
  • SENTINEL - Utilities for working with the SENTINEL type.
  • SimpleSignature - Utilities for working with the __simpleSignature phantom type pattern. Allows complex generic functions to provide simpler signatures for type inference.
  • Test - Type-level assertion utilities for testing type correctness. Provides compile-time type checking and assertions for tests.
  • Union - Utilities for working with union types at the type level.
  • VariancePhantom - Phantom type helpers for controlling type variance (covariance, contravariance, invariance, bivariance).

Value

General value utilities for common JavaScript values and patterns.

Paka

Paka Documentation Extractor