摘要:
The builder pattern is a design pattern commonly used in OOP. It is used to create complex objects step by step throught a series of methods, each of 阅读全文
摘要:
file1: import { expect, it } from "vitest"; /** * Here, we've actually got _multiple_ problem files! * Make sure to to check problem.2.ts too. */ decl 阅读全文
摘要:
We have the following code: class Form<TValues> { error?: string; constructor( public values: TValues, private validate: (values: TValues) => string | 阅读全文
摘要:
import { it } from 'vitest'; import { Equal, Expect } from '../helpers/type-utils'; export const isDivElement = (element: unknown): element is HTMLDiv 阅读全文
摘要:
// You'll need to use function overloads to figure this out! function useData<T>(params: { fetchData: () => Promise<T>; initialData?: T }): { getData: 阅读全文
摘要:
In this exercise, we're going to look at a really interesting property of branded types when they're used with index signatures. Here we have our User 阅读全文