上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 464 下一页
摘要: For the following code: const objOfFunctions = { string: (input: string) => input.toUpperCase(), number: (input: number) => input.toFixed(2), boolean: 阅读全文
posted @ 2024-08-07 17:53 Zhentiw 阅读(6) 评论(0) 推荐(0) 编辑
摘要: import { expect, it, vitest } from 'vitest'; const logId = (obj: { id: string }) => { console.log(obj.id); }; const logName = (obj: { name: string }) 阅读全文
posted @ 2024-08-06 19:56 Zhentiw 阅读(5) 评论(0) 推荐(0) 编辑
摘要: Make those pass: import { Equal, Expect } from "@total-typescript/helpers"; type Event = "click" | "hover" | "scroll"; type CallbackType = unknown; co 阅读全文
posted @ 2024-08-06 15:13 Zhentiw 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2024-08-02 15:23 Zhentiw 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2024-08-02 14:51 Zhentiw 阅读(6) 评论(0) 推荐(0) 编辑
摘要: type BaseTable = { [colName: string]: string | number | boolean; } type Columns<Tables extends { [tableName: string]: BaseTable }> = { [K in keyof Tab 阅读全文
posted @ 2024-08-02 14:50 Zhentiw 阅读(3) 评论(0) 推荐(0) 编辑
摘要: class QueryBuilder { private fields: string[] = [] private wheres: Record<string, string> = {} private table: string = "" select(...columns: string[]) 阅读全文
posted @ 2024-08-02 14:19 Zhentiw 阅读(4) 评论(0) 推荐(0) 编辑
摘要: import { expect, it, vitest } from 'vitest'; interface User { id: number; name: string; } function printUser(user: User) { Object.keys(user).forEach(( 阅读全文
posted @ 2024-08-01 15:12 Zhentiw 阅读(4) 评论(0) 推荐(0) 编辑
摘要: interface User { id: number; name: string; } const users = [ { name: 'Waqas', }, { name: 'Zain', }, ]; const usersWithIds: User[] = users.map((user, i 阅读全文
posted @ 2024-08-01 14:46 Zhentiw 阅读(9) 评论(0) 推荐(0) 编辑
摘要: import { flushSync } from 'react-dom' import { createRoot } from 'react-dom/client' let hookIndex = 0 const states: Array<[any, (newState: any) => voi 阅读全文
posted @ 2024-07-31 14:37 Zhentiw 阅读(2) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 464 下一页