摘要:
import type only imports declarations to be used for type annotations and declarations. It always gets fully erased, so there’s no remnant of it at ru 阅读全文
摘要:
function isError(err: any): err is Error { return err instanceof Error; } try { somethingRisky() } catch(err: unknown) { if (isError(err)) { console.l 阅读全文
摘要:
In some ways // @ts-expect-error can act as a suppression comment, similar to // @ts-ignore. The difference is that // @ts-ignore will do nothing if t 阅读全文