ROUTMIO_DEV

TOOLS

DDL GeneratorDDL → ERDDummy Data GeneratorRegex TesterJSON FormatterBase64 ConverterTimestamp ConverterCron BuilderMeeting Minutes

DATABASE

LANGUAGE

TypeScript Type Guards

10 functions

typeoftypeof value === 'string' | 'number' | ...

Returns a string indicating the type of the operand.

instanceofvalue instanceof ClassName

Tests whether the prototype property of a constructor appears anywhere in the prototype chain of an object.

in operator'key' in object

Returns true if the specified property is in the specified object.

Array.isArrayArray.isArray(value): boolean

Determines whether the passed value is an Array.

Number.isFiniteNumber.isFinite(value): boolean

Determines whether the passed value is a finite number.

Number.isIntegerNumber.isInteger(value): boolean

Determines whether the passed value is an integer.

Number.isNaNNumber.isNaN(value): boolean

Determines whether the passed value is NaN.

satisfiesvalue satisfies Type

Validates that an expression matches some type while keeping the inferred type. (TS 4.9+)

as constconst obj = { ... } as const

Asserts that an object or array literal's values are treated as literal types.

type predicatefunction isT(v: unknown): v is T { ... }

A user-defined type guard function that narrows the type of its argument.

Terms of ServicePrivacy PolicyContactIcons by Flaticon