摘要:
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()) // 阅读全文
摘要:
.callmethod exits on any function, which will refer to Function.prototype.call for example: console.log.call Function.prototype.call // call Also it m 阅读全文
摘要:
The difference between document.body and document.documentElement: document.body returns the <body> elementdocument.documentElement returns the <html> 阅读全文
摘要:
Consider this Result type: type Result<TResult, TError> = | { success: true; data: TResult; } | { success: false; error: TError; }; The Result type ha 阅读全文
摘要:
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. 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文