Skip to content

New HashMap export type creates type problems #442

@timephy

Description

@timephy

Hello! Long time no see.
I've just upgraded past 10.0.0 with this breaking change:

Change how HashMap<K, V> is represented in TypeScript. The resulting bindings ({ [key in K]?: V } instead of { [key: K]: V }) are more accurate and flexible.

This does create problems, because now inside a Object.values(...)/Object.entries(...) the value can be undefined. Which it is definitely not.

Image

Either using HashMap<K, V> or { [key: K]: V }) would prevent this problem.

I cannot quite understand why that decision was made.
But all I ask for is a feature flag to change this please. 🙏🏽
(for me this has created >25 errors in my repo - all wrongfully, because undefined is never the case)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions