ts-case-convert is a TypeScript utility library designed to transform object keys between common casing conventions such as camelCase, snake_case, and PascalCase. Its core strength lies in its robust TypeScript type preservation, offering precise type inference for converted objects, thereby maintaining code completion and compile-time validation. This feature is particularly valuable in large TypeScript applications that frequently interact with APIs employing diverse casing styles. The library is currently stable at version `2.1.0` and exhibits an active release cadence with frequent patch and minor updates addressing bug fixes and feature enhancements, indicating ongoing maintenance. It intelligently handles complex nested objects, arrays of objects, and correctly preserves primitive types, null, undefined, Date objects, and Uint8Array instances during conversion, preventing unintended data corruption or type inaccuracies.
npm install ts-case-convertVerified import paths — ran on the pinned version, not inferred.
Demonstrates converting a complex object with nested structures, arrays, and special types (Date, null, undefined) from snake_case to camelCase and vice-versa, showcasing accurate type preservation and property access.
Review existing code that relies on `kebab-case` conversion if upgrading from v1.x. Adjust input keys or expect different output for `kebab-case` strings.
Upgrade to `ts-case-convert@2.0.5` or later to ensure `Date` objects are preserved. Upgrade to `ts-case-convert@2.0.2` or later for `Buffer` object preservation.
Upgrade to `ts-case-convert@2.0.1` or later to ensure top-level arrays are correctly typed and returned as arrays.
Upgrade to `ts-case-convert@2.0.4` or later, which switched to `Uint8Array` internally to remove Node.js-specific dependencies and improve browser compatibility.
This is expected behavior in v2.0.0+. Adjust your input data or conversion expectations if relying on the old `kebab-case` handling. If you need the old behavior, you might need to pre-process keys or stick to v1.x.
Upgrade `ts-case-convert` to version `2.0.5` or newer to ensure `Date` objects are properly preserved.
Upgrade `ts-case-convert` to version `2.0.4` or newer. This version replaced `Buffer` with `Uint8Array` for better cross-environment compatibility.
Upgrade `ts-case-convert` to version `2.0.1` or newer.
No dependency data recorded yet.