Skip to content
public-library›Rules›TypeScript›Narrow unknown values before use

Narrow unknown values before use

HIGH#typescript Sign in to star Narrow unknown values before use, 0 stars

Sign in to star rules

Star this rule if you find it useful.

Type data whose shape has not been established as unknown, then validate it at runtime before reading its properties or assigning it to a narrower type.

In the full rule