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

objectMap has bad return type #45

Closed
s3xysteak opened this issue Jun 24, 2024 · 1 comment · Fixed by #46
Closed

objectMap has bad return type #45

s3xysteak opened this issue Jun 24, 2024 · 1 comment · Fixed by #46

Comments

@s3xysteak
Copy link
Contributor

export function objectMap<K extends string, V, NK = K, NV = V>(obj: Record<K, V>, fn: (key: K, value: V) => [NK, NV] | undefined): Record<K, V> {

The return type of objectMap may be Record<NK, NV> instead of Record<K, V>

@antfu
Copy link
Owner

antfu commented Jun 25, 2024

Nice catch, would you like to send a quick PR to fix it? Thanks

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

Successfully merging a pull request may close this issue.

2 participants