上一页 1 ··· 95 96 97 98 99 100 101 102 103 ··· 496 下一页
摘要: https://github.com/kentcdodds/react-testing-library-course/commit/1148e920b8d055d9ca9ef1c372e233d2e950ff1f User-event: https://testing-library.com/doc 阅读全文
posted @ 2022-10-30 21:06 Zhentiw 阅读(83) 评论(0) 推荐(0)
摘要: Zod Example: number: import { expect, it } from "vitest"; import { z } from "zod"; const numberParser = z.number(); export const toString = (num: unkn 阅读全文
posted @ 2022-10-30 17:40 Zhentiw 阅读(164) 评论(0) 推荐(0)
摘要: Sometimes we want to limit the range of numbers... For examples. type result = NumberRange<2 , 9> // | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 /* _____________ 阅读全文
posted @ 2022-10-30 17:05 Zhentiw 阅读(57) 评论(0) 推荐(0)
摘要: Construct a tuple with a given length. For example type result = ConstructTuple<2> // expect to be [unknown, unkonwn] /* _____________ Your Code Here 阅读全文
posted @ 2022-10-30 16:39 Zhentiw 阅读(34) 评论(0) 推荐(0)
摘要: Implement MapTypes<T, R> which will transform types in object T to different types defined by type R which has the following structure type StringToNu 阅读全文
posted @ 2022-10-29 16:32 Zhentiw 阅读(32) 评论(0) 推荐(0)
摘要: Implement the type version of Lodash.uniq, Unique takes an Array T, returns the Array T without repeated values. type Res = Unique<[1, 1, 2, 2, 3, 3]> 阅读全文
posted @ 2022-10-29 16:10 Zhentiw 阅读(32) 评论(0) 推荐(0)
摘要: Implement the built-in Parameters generic without using it. For example: const foo = (arg1: string, arg2: number): void => {} type FunctionParamsType 阅读全文
posted @ 2022-10-29 03:16 Zhentiw 阅读(31) 评论(0) 推荐(0)
摘要: Implement the type version of Array.unshift For example: type Result = Unshift<[1, 2], 0> // [0, 1, 2,] /* _____________ Your Code Here _____________ 阅读全文
posted @ 2022-10-29 03:12 Zhentiw 阅读(33) 评论(0) 推荐(0)
摘要: Implement the generic version of Array.push For example: type Result = Push<[1, 2], '3'> // [1, 2, '3'] /* _____________ Your Code Here _____________ 阅读全文
posted @ 2022-10-29 03:09 Zhentiw 阅读(29) 评论(0) 推荐(0)
摘要: Implement the type version of Array.lastIndexOf, LastIndexOf<T, U> takes an Array T, any U and returns the index of the last U in Array T For example: 阅读全文
posted @ 2022-10-28 15:43 Zhentiw 阅读(33) 评论(0) 推荐(0)
上一页 1 ··· 95 96 97 98 99 100 101 102 103 ··· 496 下一页