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

Group cannot be used with mapValues due to Partial return type #351

Open
osdiab opened this issue Sep 12, 2023 · 0 comments
Open

Group cannot be used with mapValues due to Partial return type #351

osdiab opened this issue Sep 12, 2023 · 0 comments

Comments

@osdiab
Copy link

osdiab commented Sep 12, 2023

Hello, not sure what an elegant solution would be, but I'm finding that I cannot do mapValues(group(...)) because mapValues demands a Record<Key, Value> whereas group() returns a Partial<Record<Key, Value>>. maybe the mapValues() function type signature can be broadened a bit to allow for partial records?

https://www.typescriptlang.org/play?noUncheckedIndexedAccess=true&allowUnreachableCode=true&allowUnusedLabels=true&noUnusedLocals=true&noUnusedParameters=true&exactOptionalPropertyTypes=true&noFallthroughCasesInSwitch=true&noImplicitOverride=true&noPropertyAccessFromIndexSignature=true&useUnknownInCatchVariables=true&suppressImplicitAnyIndexErrors=true&allowSyntheticDefaultImports=true#code/JYWwDg9gTgLgBAbzgcyhArmANHEBDMANTwBt0BTAZzgF84AzNEOAIijwBM9KALFgbgBQgmAE8w5OMTKSAvKzws4AH1YAjJapYBjFoO0QAdpXgA3UhUoAuKRfIBtALpx5T-UZNwwabVUrkOaUsXXAIgqgAKVAwwCPMZShxTFwA+OFMASiS7VLgAAwAJYDgAEgR4iho8jP4gA

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