Hyperlinkv0.8.0-beta.28

Encoding

Encoding.isEncodingErrorconsteffect/Encoding.ts:107
(u: unknown): u is EncodingError

Checks whether a value is an EncodingError.

When to use

Use to narrow an unknown value before handling it as an EncodingError from encoding or decoding code.

Details

Returns true when the value carries the EncodingErrorTypeId marker and narrows the value to EncodingError.

export const isEncodingError = (u: unknown): u is EncodingError => hasProperty(u, EncodingErrorTypeId)