Skip to content

Object.entries generic definition #20322

Closed
@ccorcos

Description

@ccorcos

TypeScript Version: 2.6.2

Currently Object.entries isn't well typed and doesn't account for a union of strings as the keys of an object.

 interface Object {
  entries<X extends string,Y>(o: { [key in X]: Y }): [X, Y][];
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    DeclinedThe issue was declined as something which matches the TypeScript vision

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions