Skip to main content

Module fmt

Module fmt 

Source
Expand description

Canonical formatter — a port of the reference implementation’s fmt.ts (ROADMAP Phase 4; §2.1/D1): LF, 4-space indentation, no tabs, normalized intra-line spacing. The original line structure is preserved — §2.9 makes newlines separators, so where a construct breaks lines is the author’s statement — and the formatter re-derives indentation and token spacing deterministically, which makes it idempotent by construction.

Functions§

format
u16len
a JavaScript string’s length: UTF-16 code units