Skip to content

Add generic type to collections getters #47235

Closed
@Syjalo

Description

@Syjalo

lib Update Request

Configuration Check

My compilation target is es2021 and my lib is es2021.

Missing / Incorrect Definition

A generic type in get method of collections.

Sample Code

const m = new Map<string, string | number>();
m.set('key', 'value');
conat v = m.get('key') // Map<string, string | number>.get(key: string): string | number | undefined

Request

const m = new Map<string, string | number>();
m.set('key', 'value');
conat v = m.get<string>('key') // Map<string, string | number>.get<string>(key: string): string | undefined

Documentation Link

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/get

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