摘要:
题目 中文 实现 lodash 中_.flip方法的类型版本 FlipArguments<T>类型接收泛型参数 T 并返回一个函数类型, 且此函数类型有和 T 相同的返回类型但其参数的顺序是倒过来的 English Implement the type version of lodash's _.f 阅读全文
摘要:
题目 中文 给定一个只包含字符串类型的元组类型T和一个类型 U, 递归地构建一个对象. English Given a tuple type T that only contains string type, and a type U, build an object recursively. ty 阅读全文
摘要:
题目 中文 实现EndsWith<T, U>,接收两个 string 类型参数,然后判断T是否以U结尾,根据结果返回true或false 例如: type a = EndsWith<'abc', 'bc'>; // expected to be false type b = EndsWith<'ab 阅读全文
摘要:
题目 中文 实现StartsWith<T, U>,接收两个 string 类型参数,然后判断T是否以U开头,根据结果返回true或false 例如: type a = StartsWith<'abc', 'ac'>; // expected to be false type b = StartsWi 阅读全文
摘要:
题目 中文 给定一个正整数作为类型的参数,要求返回的类型是该数字减 1。 例如: type Zero = MinusOne<1>; // 0 type FiftyFour = MinusOne<55>; // 54 English Given a number (always positive) a 阅读全文
摘要:
题目 中文 从字符串中剔除指定字符。 例如: type Butterfly = DropChar<' b u t t e r f l y ! ', ' '>; // 'butterfly!' English Drop a specified char from a string. For examp 阅读全文
摘要:
题目 中文 实现一个以 T 作为泛型参数的 IsNever类型. 如果 T 是never, 返回 true, 否则返回 false. 示例: type A = IsNever<never>; // expected to be true type B = IsNever<undefined>; // 阅读全文
摘要:
题目 中文 实现一个将接收到的 String 参数转换为一个字母 Union 的类型。 例如 type Test = '123'; type Result = StringToUnion<Test>; // expected to be "1" | "2" | "3" English Impleme 阅读全文