摘要:
For the following code: const objOfFunctions = { string: (input: string) => input.toUpperCase(), number: (input: number) => input.toFixed(2), boolean: 阅读全文
摘要:
import { expect, it, vitest } from 'vitest'; const logId = (obj: { id: string }) => { console.log(obj.id); }; const logName = (obj: { name: string }) 阅读全文
摘要:
Make those pass: import { Equal, Expect } from "@total-typescript/helpers"; type Event = "click" | "hover" | "scroll"; type CallbackType = unknown; co 阅读全文
摘要:
max-content https://developer.mozilla.org/en-US/docs/Web/CSS/max-content The max-content sizing keyword represents the maximum intrinsic size of the c 阅读全文
摘要:
function pipe<A, B>(fn: (a: A) => B) { function run(a: A) { return fn(a) } run.pipe = <C, >(fn2: (b: B) => C) => pipe((a: A) => fn2(fn(a))) return run 阅读全文
摘要:
type BaseTable = { [colName: string]: string | number | boolean; } type Columns<Tables extends { [tableName: string]: BaseTable }> = { [K in keyof Tab 阅读全文
摘要:
class QueryBuilder { private fields: string[] = [] private wheres: Record<string, string> = {} private table: string = "" select(...columns: string[]) 阅读全文
摘要:
import { expect, it, vitest } from 'vitest'; interface User { id: number; name: string; } function printUser(user: User) { Object.keys(user).forEach(( 阅读全文
摘要:
interface User { id: number; name: string; } const users = [ { name: 'Waqas', }, { name: 'Zain', }, ]; const usersWithIds: User[] = users.map((user, i 阅读全文
摘要:
import { flushSync } from 'react-dom' import { createRoot } from 'react-dom/client' let hookIndex = 0 const states: Array<[any, (newState: any) => voi 阅读全文