Skip to content

types are wrong for using plain arrays instead of iterable #1884

Open
@antonkulaga

Description

@antonkulaga

I am having trouble with using OrderedMap(someArray) in typescript. Typical errors are like:

 Overload 1 of 2, '(collection?: Iterable<[string, number]> | undefined): OrderedMap<string, number>', gave the following error.
        Argument of type '(string | number)[][]' is not assignable to parameter of type 'Iterable<[string, number]>'.

This types of problems are valid for all arrays I tried, including Array<Array>.
While working in pure JS and sometimes with typescript in the browser it provides type errors for typescript on nodejs because OrderedMap does not have an overload for arrays. Please, improve type-script types in immutable js!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions