Currently, the mapFn argument of Array.from() is typed as (v: T, k: number) => U.
However, when this information is displayed in an IDE tooltip, it is difficult to grasp what values are passed to v and k.
To improve clarity, I propose changing the type definition to (element: T, index: number) => U, following the description of the same method in MDN Web Docs. The same applies to TypedArray.from().
Supplementary Information:
- The target file is
internal/bundled/libs/lib.es2015.iterable.d.ts#L107.
- These changes are not intended to fix differences between 6.0 and 7.0, and according to
CONTRIBUTING.md, the Pull Request should be submitted after the 7.0 release. I plan to submit a Pull Request for this once 7.0 is released.
Currently, the
mapFnargument ofArray.from()is typed as(v: T, k: number) => U.However, when this information is displayed in an IDE tooltip, it is difficult to grasp what values are passed to
vandk.To improve clarity, I propose changing the type definition to
(element: T, index: number) => U, following the description of the same method in MDN Web Docs. The same applies to TypedArray.from().Supplementary Information:
internal/bundled/libs/lib.es2015.iterable.d.ts#L107.CONTRIBUTING.md, the Pull Request should be submitted after the 7.0 release. I plan to submit a Pull Request for this once 7.0 is released.