Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type resulting object properties correctly when using change-case/keys #341

Open
dnjstrom opened this issue May 10, 2024 · 0 comments
Open

Comments

@dnjstrom
Copy link

When using change-case/keys I would love for the resulting object to be typed correctly without having to do an explicit cast. Currently all transformations produce unknown.

import { camelCase } from "change-case/keys"
import type { CamelCasedProperties } from 'type-fest';

const snake_cased = { foo_bar: 1 }

// Preferably the cast could be left off on the line below
const camelCased = camelCase(snake_cased) as CamelCasedProperties<typeof snake_cased>

console.log(camelCased.fooBar) // => 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant