Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 1.02 KB

File metadata and controls

30 lines (21 loc) · 1.02 KB

Documentation

Complete API documentation for @neabyte/textshift.

Modules

  1. TextTransform - Text case conversions, normalization, and reversal with Unicode support.
  2. JsonFormatter - JSON minification, beautification, and recursive key/value sorting.

Quick Reference

Export Purpose Usage
TextTransform Text transformation class TextTransform.uppercase('hello')
JsonFormatter JSON formatting class JsonFormatter.beautify('{"a":1}')
TextshiftResult Unified result type { data?: string, error?: string }

Result Type

All methods return TextshiftResult. Exactly one of data or error is set, never both.

const result = TextTransform.uppercase('hello')

if (result.error) {
  console.error(result.error)
} else {
  console.log(result.data) // 'HELLO'
}