Skip to content

Issue when using object with Object.entries and Object.values #40

Closed
@ehoogeveen-medweb

Description

@ehoogeveen-medweb

TS Playground

As shown above, this overload included in better-typescript-lib cause an issue when applied to an object without a specified key or value type. The overload seems to match too eagerly, returning a type with never instead of falling through to the more generic call signatures.

Here's one way to fix it, although I don't know if it's the best fix: TS Playground

The same fix seems to work for Object.entries as well.

Note: This issue is unrelated to #31 (but maybe worth mentioning there)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions