1 Star 0 Fork 0

Sunny / type-challenges

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.zh-CN.md 1.94 KB
一键复制 编辑 原始数据 按行查看 历史
antfu 提交于 2023-06-13 00:04 . chore: update index

获得必需的属性 困难 #utils #infer

by Zheeeng @zheeeng

接受挑战    English 日本語

实现高级工具类型 GetRequired<T>,该类型保留所有必需的属性

例如

type I = GetRequired<{ foo: number, bar?: string }> // expected to be { foo: number }

返回首页 分享你的解答 查看解答

相关挑战

59・获得可选属性
1
https://gitee.com/ztes/type-challenges.git
git@gitee.com:ztes/type-challenges.git
ztes
type-challenges
type-challenges
main

搜索帮助