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

When using an opaque type the result type is wrong #87

Open
valkum opened this issue Feb 18, 2022 · 1 comment
Open

When using an opaque type the result type is wrong #87

valkum opened this issue Feb 18, 2022 · 1 comment

Comments

@valkum
Copy link

valkum commented Feb 18, 2022

When using type-fest Opaque or any other readonly symbol tag to get an opaque type, the result

type O = Opaque<string, "O">
type X = {partner_id: O};

ReturnType<typeof camelcaseKeys<X>>>

// Expected
// D: {partnerId: O}

// Actual
// D: {partnerId: {char_at, .....}}

It seems all functions for strings are also added to the return type instead of passing along the opaque type if it is a primitive.

@sindresorhus
Copy link
Owner

// @g-plane

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

2 participants