上一页 1 ··· 95 96 97 98 99 100 101 102 103 ··· 499 下一页
摘要: Implement a type that adds a new field to the interface. The type takes the three arguments. The output should be an object with the new field. For ex 阅读全文
posted @ 2022-11-12 17:02 Zhentiw 阅读(22) 评论(0) 推荐(0)
摘要: import { z } from "zod"; export enum SUBTYPE { ABORT = "abort", START = "start", UPLOAD = "upload", LOADING = "loading", } export const TYPE = "print" 阅读全文
posted @ 2022-11-11 20:42 Zhentiw 阅读(49) 评论(0) 推荐(0)
摘要: Implement CapitalizeWords<T> which converts the first letter of each word of a string to uppercase and leaves the rest as-is. For example type capital 阅读全文
posted @ 2022-11-11 15:51 Zhentiw 阅读(35) 评论(0) 推荐(0)
摘要: Implement the advanced util type OptionalKeys<T>, which picks all the optional keys into a union. /* _____________ Your Code Here _____________ */ typ 阅读全文
posted @ 2022-11-11 00:11 Zhentiw 阅读(40) 评论(0) 推荐(0)
摘要: Implement the advanced util type RequiredKeys<T>, which picks all the required keys into a union. For example type Result = RequiredKeys<{ foo: number 阅读全文
posted @ 2022-11-11 00:07 Zhentiw 阅读(49) 评论(0) 推荐(0)
摘要: Implement the advanced util type GetOptional<T>, which remains all the optional fields For example type I = GetOptional<{ foo: number, bar?: string }> 阅读全文
posted @ 2022-11-10 22:03 Zhentiw 阅读(39) 评论(0) 推荐(0)
摘要: Implement the advanced util type GetRequired<T>, which remains all the required fields For example type I = GetRequired<{ foo: number, bar?: string }> 阅读全文
posted @ 2022-11-10 21:57 Zhentiw 阅读(43) 评论(0) 推荐(0)
摘要: type PathParams<S extends string> = S extends `/${string}/:${infer Param}/${infer REST}` ? Param | PathParams<`/${REST}`> : S extends `${string}/:${in 阅读全文
posted @ 2022-11-09 22:28 Zhentiw 阅读(30) 评论(0) 推荐(0)
摘要: Implement the advanced util type UnionToIntersection<U> For example type I = Union2Intersection<'foo' | 42 | true> // expected to be 'foo' & 42 & true 阅读全文
posted @ 2022-11-09 17:22 Zhentiw 阅读(58) 评论(0) 推荐(0)
摘要: Co-Variance: declare let b: string declare let c: string | number c = b // ✅ // string is a sub-type of string | number // all elements of string appe 阅读全文
posted @ 2022-11-09 17:18 Zhentiw 阅读(59) 评论(0) 推荐(0)
上一页 1 ··· 95 96 97 98 99 100 101 102 103 ··· 499 下一页