`ReadonlyMap` lacks documentation for `forEach`, `get`, `has` and `size`

Open Beginner friendly
#63,710 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
90/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Quiet
Tech stack
typescript
Domain
documentation

Research direction

Open lib.es2015.collection.d.ts and compare the documented members of Map<K, V> with forEach, get, has and size on ReadonlyMap<K, V>. Check the ReadonlySet documentation change from #63481/#63483 for consistency. Done means editor hovers show descriptions for all four ReadonlyMap members matching the corresponding Map documentation.

Written by the indexing model from the issue text.

Description

Domain: lib.d.ts Possible Improvement
⚙ Compilation target

ES2015+

⚙ Library

lib.es2015.collection.d.ts

Missing / Incorrect Definition

ReadonlyMap<K, V> lacks documentation for forEach, get, has and size.

Hovering these members in an editor shows no description, unlike the corresponding members of Map<K, V>. The documentation should ideally be copied from regular Map<K, V> for consistency, exactly as was done for ReadonlySet<T> in #63481 (fixed by #63483).

Note: the ReadonlyMap members declared in lib.es2015.iterable.d.ts (entries, keys, values and [Symbol.iterator]) are already documented; only the four members declared in lib.es2015.collection.d.ts lack documentation.

Sample Code
declare const m: ReadonlyMap<string, number>;

// Hover any of these: no documentation is shown
m.get("a");
m.has("a");
m.size;
m.forEach(v => console.log(v));
Documentation Link

No response

Dominant language
Go
Stars
111k
Forks
14.4k
Avg merge
1d 15h
Merged PRs (30d)
106

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/TypeScript

All issues in microsoft/TypeScript

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.