Complete API documentation for @neabyte/textshift.
- TextTransform - Text case conversions, normalization, and reversal with Unicode support.
- JsonFormatter - JSON minification, beautification, and recursive key/value sorting.
| 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 } |
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'
}