Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

O.P.Pick β€” issue with multiple nested picks from a single object #215

Closed
mesqueeb opened this issue Mar 6, 2021 · 1 comment
Closed

Comments

@mesqueeb
Copy link
Contributor

mesqueeb commented Mar 6, 2021

🐞 Bug Report

Describe the bug

For this signature:

function pick<T extends Record<string, any>, K extends string> (obj: T, keys: F.AutoPath<T, K>[]): O.P.Pick<T, S.Split<K, '.'>>

this works:
image

however, adding a second key breaks the nested pick:
image

Reproduce the bug

// REPL or a link to your repository if applicable.
// A *self-contained* demonstration of the problem.

Is it possible to use TS Toolbelt in the typescript TS Playground? If so it's easy for me to replicate this.
Otherwise I can set up a branch on my package if you like.

Possible Solution

I'm not sure!

@millsp
Copy link
Owner

millsp commented Mar 6, 2021

Yes, it works in the playground. AutoPath cannot work on arrays like this, the inference won't work. Please, set a playground up and I'll look what I can do.

@millsp millsp closed this as completed Mar 6, 2021
Repository owner locked and limited conversation to collaborators Mar 6, 2021
Repository owner unlocked this conversation Mar 7, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants