Skip to content

Releases: okikio/undent

undent@0.2.1

21 Feb 09:36

Choose a tag to compare

Changes

Fixed

  • Regex cache now has a bounded size, preventing unbounded memory growth in
    long-running processes that process many distinct strings.

Docs

  • Corrected output comments in README examples for undent, align(), and
    trim modes — several expected outputs were wrong or incomplete.
  • Added before/after examples for core indent stripping and trim modes to make
    the behavior immediately clear without reading prose.

Details

undent@0.2.0

21 Feb 06:05

Choose a tag to compare

Changes

Added

  • Package is now published to npm as @okikio/undent. Node.js and Bun users can install directly with npm install @okikio/undent in addition to the existing npx jsr add @okikio/undent path. The package ships both CJS (require) and ESM (import) builds with full TypeScript declarations.

Changed

  • Memory regression tests now use a two-phase growth-rate check instead of a single before/after snapshot, catching leaks that one-time initialization overhead (JIT compilation, WeakMap warming) would previously mask.

Details

undent@0.1.1

21 Feb 02:18

Choose a tag to compare

Changes

🐛 fix docs on jsr (995e17a)

Details

undent@0.1.0

21 Feb 01:51

Choose a tag to compare

Initial release

  • Tagged template dedenting — use undent as a template tag to strip source-code indentation from multi-line template literals. Interpolated values pass through untouched.
  • Plain string dedenting.string() method and standalone dedentString() for strings without template structure (SQL files, config snippets, runtime-built text).
  • Multi-line value alignmentalign() pads subsequent lines of an interpolated value to match the insertion column. embed() strips a value's own indentation first, then aligns.
  • Configurable trimming — strip all leading/trailing blank lines (default), strip one, keep everything, or control each side independently.
  • Two indent strategies"common" (minimum indent across all lines) and "first" (first content line sets the reference). Pre-built outdent export for first-line behavior.
  • Instance composition.with(options) derives new instances without mutation. createUndent(options) builds from scratch.
  • Newline preservation\n, \r\n, and \r sequences pass through byte-for-byte. Optional newline setting normalizes segment newlines.
  • Indent anchors${undent.indent} sets an explicit zero-indent reference for deeply nested templates.
  • Utility exportssplitLines, rejoinLines, columnOffset, newlineLengthAt, alignText, resolveOptions, and DEFAULTS for building custom pipelines.
  • Caching — per-call-site segment cache for zero-cost repeated calls. Bounded caches for embed() and alignment memoization.

Details