runtime validation

Checking real data with JavaScript code while the program runs, so values from outside are proven correct before they are trusted.

In more detail

Types are erased, so they cannot check a network response, a file or user input. At each boundary, take the data as unknown, check its shape with type guards or a schema library, and only then give it a precise type. Everything inside the boundary can then rely on the types.

Related terms

Taught in

References