Narrows an unknown value to a string if it is type-compatible, or returns undefined otherwise.
unknown
string
undefined
The value to test.
Narrows an unknown value to a string if it is type-compatible, or returns the provided default otherwise.
The default to return if value was undefined or of the incorrect type.
value
Narrows an
unknown
value to astring
if it is type-compatible, or returnsundefined
otherwise.