首页
AI Coding
NEW
沸点
课程
直播
活动
AI刷题
APP
插件
搜索历史
清空
创作者中心
写文章
发沸点
写笔记
写代码
草稿箱
创作灵感
查看更多
会员
登录
注册
Type Challenges
黄蘑菇
创建于2024-12-18
订阅专栏
[TypeScript] Type Challenges
暂无订阅
共62篇文章
创建于2024-12-18
订阅专栏
默认顺序
默认顺序
最早发布
最新发布
[TypeScript] Type Challenges #4182 - Fibonacci Sequence
题目描述 Implement a generic Fibonacci takes an number T and returns it's corresponding Fibonacci number
[TypeScript] Type Challenges #4179 - Flip
题目描述 Implement the type of just-flip-object. Examples: No need to support nested objects and values
[TypeScript] Type Challenges #3326 - BEM style string
题目描述 The Block, Element, Modifier methodology (BEM) is a popular naming convention for classes in CS
[TypeScript] Type Challenges #3196 - Flip Arguments
题目描述 Implement the type version of lodash's _.flip. Type FlipArguments<T> requires function type T a
[TypeScript] Type Challenges #3192 - Reverse
题目描述 Implement the type version of Array.reverse For example: 题解 条件类型 T extends [infer Head, ...infe
[TypeScript] Type Challenges #3188 - Tuple to Nested Object
题目描述 Given a tuple type T that only contains string type, and a type U, build an object recursively.
[TypeScript] Type Challenges #3062 - Shift
题目描述 Implement the type version of Array.shift For example 题解 条件类型: T extends [unknown, ...infer Tai
[TypeScript] Type Challenges #2946 - ObjectEntries
题目描述 Implement the type version of Object.entries For example 题解 条件类型 泛型参数: T:目标对象 P = keyof T:默认为T的
[TypeScript] Type Challenges #2852 - OmitByType
题目描述 From T, pick a set of properties whose type are not assignable to U. For Example 题解 条件类型 遍历T的每个
[TypeScript] Type Challenges #2793 - Mutable
题目描述 实现一个通用的类型Mutable<T>,使类型T的全部属性可变(非只读)。 例如: 题解 映射类型 类型约束: T extends Record<string, any>:确保T是一个对象类
[TypeScript] Type Challenges #2759 - RequiredByKeys
题目描述 实现一个通用的RequiredByKeys<T, K>,它接收两个类型参数T和K。 K指定应设为必选的T的属性集。当没有提供K时,它就和普通的Required<T>一样使所有的属性成为必选的
[TypeScript] Type Challenges #2757 - PartialByKeys
题目描述 实现一个通用的PartialByKeys<T, K>,它接收两个类型参数T和K。 K指定应设置为可选的T的属性集。当没有提供K时,它就和普通的Partial<T>一样使所有属性都是可选的。
[TypeScript] Type Challenges #2693 - EndsWith
题目描述 实现EndsWith<T, U>,接收两个string类型参数,然后判断T是否以U结尾,根据结果返回true或false 例如: 题解 条件类型 条件判断: T extends ${stri
[TypeScript] Type Challenges #2688 - StartsWith
题目描述 实现StartsWith<T, U>,接收两个string类型参数,然后判断T是否以U开头,根据结果返回true或false 例如: 题解 条件类型 条件判断: T extends ${U}
[TypeScript] Type Challenges #2595 - PickByType
题目描述 From T, pick a set of properties whose type are assignable to U. For Example 题解 映射类型和条件类型 遍历T的每
[TypeScript] Type Challenges #2257 - MinusOne
题目描述 给定一个正整数作为类型的参数,要求返回的类型是该数字减 1。 例如: 题解 方案一 解释 1.ParseInt<T>: 将字符串类型的数字转换为数字类型 如果T是一个数字字符串,返回对应的数
[TypeScript] Type Challenges #2070 - Drop Char
题目描述 从字符串中剔除指定字符。 例如: 题解 条件类型 条件判断: T extends ${infer Left}${C}${infer Right},如果T包含C,则将T拆分为三部分: Left
[TypeScript] Type Challenges #1978 - Percentage Parser
题目描述 实现类型 PercentageParser。根据规则 /^(\+|\-)?(\d*)?(\%)?$/ 匹配类型 T。 匹配的结果由三部分组成,分别是:[正负号, 数字, 单位],如果没有匹配
[TypeScript] Type Challenges #1367 - Remove Index Signature
题目描述 Implement RemoveIndexSignature<T> , exclude the index signature from object types. For example:
[TypeScript] Type Challenges #1130 - ReplaceKeys
题目描述 Implement a type ReplaceKeys, that replace keys in union types, if some type has not this key,
下一页