v0.8.0: Template Literal Types for Case Conversions
🎉 Template Literal Types for Case Conversions
This release adds advanced TypeScript template literal types for all case conversion functions, providing compile-time type transformations with zero runtime cost.
✨ What's New
Template Literal Types - Get precise type inference for literal strings:
const endpoint = kebabCase("getUserProfile");
// Type: "get-user-profile" (not just string!)
const column = snakeCase("firstName");
// Type: "first_name"🚀 Key Features
-
All 9 case conversions now support template literal types:
camelCase("hello-world")→ type:"helloWorld"kebabCase("helloWorld")→ type:"hello-world"snakeCase("HelloWorld")→ type:"hello_world"pascalCase("hello-world")→ type:"HelloWorld"constantCase("helloWorld")→ type:"HELLO_WORLD"- And more:
dotCase,pathCase,sentenceCase,titleCase
-
Advanced type-level parsing:
- Proper word boundary detection
- Handles camelCase, PascalCase, ALLCAPS
- Groups consecutive digits correctly
- Processes special characters
-
Zero runtime cost - All transformations happen at compile time
-
Full backward compatibility - Runtime strings still return regular
stringtype -
Enhanced IDE support - Autocomplete shows exact transformed strings
-
No bundle size impact - Remains at 6.01 kB
📦 Installation
npm install [email protected]📚 Documentation
See the README for detailed examples and usage patterns.
Full Changelog: v0.7.0...v0.8.0