Narrows an unknown value to an AnyJson if it is type-compatible, or returns undefined otherwise.
unknown
AnyJson
undefined
See also caveats noted in isAnyJson.
The value to test.
Optional
The error message to use if value is not type-compatible.
value
UnexpectedValueTypeError If the value was not a JSON value type.
Narrows an
unknown
value to anAnyJson
if it is type-compatible, or returnsundefined
otherwise.See also caveats noted in isAnyJson.