Skip to content

O.pick types the values as unknown #89

@apademide

Description

@apademide
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: "abc@abc.com",
  birthday: new Date()
}

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

editableSource.name // unknown instead of string

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions