摘要:
Implement the advanced util type RequiredKeys<T>, which picks all the required keys into a union. For example type Result = RequiredKeys<{ foo: number 阅读全文
摘要:
Implement the advanced util type GetOptional<T>, which remains all the optional fields For example type I = GetOptional<{ foo: number, bar?: string }> 阅读全文
摘要:
Implement the advanced util type GetRequired<T>, which remains all the required fields For example type I = GetRequired<{ foo: number, bar?: string }> 阅读全文
摘要:
Implement the advanced util type UnionToIntersection<U> For example type I = Union2Intersection<'foo' | 42 | true> // expected to be 'foo' & 42 & true 阅读全文
摘要:
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 阅读全文
摘要:
So what is a nake type? Example: type UnionToIntersection<T> = (T extends any ? (x: T) => any : never) //... We check Tin a sub-type condition, T exte 阅读全文
摘要:
Implement Replace<S, From, To> which replace the string From with To once in the given string S For example type replaced = Replace<'types are fun!', 阅读全文
摘要:
TypeScript 4.0 is recommended in this challenge Currying is the technique of converting a function that takes multiple arguments into a sequence of fu 阅读全文
摘要:
Implement a simpiled version of a Vue-like typing support. By providing a function name SimpleVue (similar to Vue.extend or defineComponent), it shoul 阅读全文