is
The is() function checks that a string matches the TheDate format (date<timestamp><"-" | "+">). It acts as a type guard.
Interactive example
Syntax
typescript
function is(input: string): input is TheDateParameters
input: String to validate.
Return value
true if the string follows the TheDate format, otherwise false. When true, TypeScript narrows input to TheDate.
See also
create- Builds aTheDatefrom native valuesisSafeTimestamp- Checks the timestamp range
