Skip to content

Glossary: Building APIs with Node.js

as (type assertion)

Also written: type assertion, as unknown as, cast

A TypeScript way to tell the compiler a value's type. It checks nothing at run time, so it can't replace validation.

Where the book teaches it

Related terms

ValidationRoute generic