上一页 1 ··· 31 32 33 34 35 36 37 38 39 ··· 494 下一页
摘要: export const isAsyncFunction = (fn: Function) => fn[Symbol.toStringTag] 'AsyncFunction'; // isAsyncFunction(() => {}) // false // isAsyncFunction(() = 阅读全文
posted @ 2024-09-15 01:52 Zhentiw 阅读(18) 评论(0) 推荐(0)
摘要: type BanType<T, E> = T extends E ? never : T; type BanDate<T> = BanType<T, Date>; function log<T>(x: BanDate<T>) { console.log() } log(new Date()) // 阅读全文
posted @ 2024-09-09 14:55 Zhentiw 阅读(20) 评论(0) 推荐(0)
摘要: .callmethod exits on any function, which will refer to Function.prototype.call for example: console.log.call Function.prototype.call // call Also it m 阅读全文
posted @ 2024-09-09 14:52 Zhentiw 阅读(22) 评论(0) 推荐(0)
摘要: const requestFullscreenProps = [ "requestFullScreen", "webkitRequestFullScreen", "mozRequestFullScreen", "msRequestFullScreen", ] as const; const exit 阅读全文
posted @ 2024-09-09 14:39 Zhentiw 阅读(28) 评论(0) 推荐(0)
摘要: The difference between document.body and document.documentElement: document.body returns the <body> elementdocument.documentElement returns the <html> 阅读全文
posted @ 2024-09-09 14:09 Zhentiw 阅读(17) 评论(0) 推荐(0)
摘要: Consider this Result type: type Result<TResult, TError> = | { success: true; data: TResult; } | { success: false; error: TError; }; The Result type ha 阅读全文
posted @ 2024-09-06 15:03 Zhentiw 阅读(28) 评论(0) 推荐(0)
摘要: Node.js on Containers So now what if we wanted to run a container that has Node.js in it? The default Ubuntu container doesn't have Node.js installed. 阅读全文
posted @ 2024-09-06 14:45 Zhentiw 阅读(29) 评论(0) 推荐(0)
摘要: So it's much easier to do what we did with Docker. Run this command: docker run --interactive --tty alpine:3.19.1 # or, to be shorter: docker run -it 阅读全文
posted @ 2024-09-06 14:34 Zhentiw 阅读(18) 评论(0) 推荐(0)
摘要: Consider this package.json file: { "name": "exercise", "version": "1.0.0", "main": "index.js", "scripts": { "dev": "run-p dev:*", "dev:client": "tsc - 阅读全文
posted @ 2024-09-04 14:41 Zhentiw 阅读(36) 评论(0) 推荐(0)
摘要: A long-awaited feature is smart incremental builds for TypeScript projects. In 3.0 you can use the --build flag with tsc. This is effectively a new en 阅读全文
posted @ 2024-09-03 21:28 Zhentiw 阅读(87) 评论(0) 推荐(0)
上一页 1 ··· 31 32 33 34 35 36 37 38 39 ··· 494 下一页