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

O.pick types the values as unknown #89

Open
apademide opened this issue Feb 5, 2025 · 0 comments
Open

O.pick types the values as unknown #89

apademide opened this issue Feb 5, 2025 · 0 comments
Labels
🐛 – Bug: Medium Something isn't working. The sooner the fix the better.

Comments

@apademide
Copy link
Member

apademide commented Feb 5, 2025

type Source = {
  name: string
  age: number
  email: string
  birthday: Date
}

const editableSourceKeys = ["name", "email"] as const;

const source: Source = {
  name: "John Doe",
  age: 30,
  email: "[email protected]",
  birthday: new Date()
}

const editableSource = O.pick(source, editableSourceKeys);

editableSource.name // unknown instead of string
@apademide apademide added the 🐛 – Bug: Medium Something isn't working. The sooner the fix the better. label Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 – Bug: Medium Something isn't working. The sooner the fix the better.
Projects
None yet
Development

No branches or pull requests

1 participant