[Post-7.0] Improve readability of `Array.from` / `TypedArray.from` `mapFn` parameters
还没有人认领这个 Issue。
评估
- 难度
- 1/5
- 预计耗时
- 1 小时以内
- 新手友好度
- 88/100
- Issue 类型
- 重构
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- tooling
调研方向
从 internal/bundled/libs/lib.es2015.iterable.d.ts#L107 开始,找到 Array.from 和 TypedArray.from 的 mapFn 声明。将它们的参数命名与链接的 MDN 描述进行比较,然后确认这两个声明都使用了描述性的元素名称和索引名称,同时不改变它们的类型或行为。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Go
- 星标
- 111k
- 派生
- 14.4k
- 平均合并
- 1 天 15 小时
- 30 天内合并 PR
- 106
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/TypeScript 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 88/100
microsoft/TypeScript#64322 · 2 条评论 · 1 个 reaction · 已指派 2 人 ·
-
Possible Improvement
难度 2/5 1-3 小时 新手友好度 78/100
microsoft/TypeScript#64278 · 1 条评论 · 1 个 reaction ·
-
Docs
难度 2/5 1-3 小时 新手友好度 70/100
microsoft/TypeScript#64118 · 1 条评论 ·
-
难度 1/5 1 小时以内 新手友好度 88/100
microsoft/TypeScript#64094 ·
-
Docs
难度 2/5 1-3 小时 新手友好度 76/100
microsoft/TypeScript#63959 · 5 条评论 ·
查看 microsoft/TypeScript 的全部 Issue
相似的 Issue
-
kind/bug needs-triage
难度 1/5 1 小时以内 新手友好度 72/100
matrixorigin/matrixone#29223 ·
-
needs-acceptance wg/data-plane-networking
难度 2/5 1-3 小时 新手友好度 78/100
vllm-project/semantic-router#4024 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
-
bug
难度 2/5 1-3 小时 新手友好度 86/100
alexgorbatchev/dotfiles#107 ·
-
难度 1/5 1 小时以内 新手友好度 84/100