Skip to content

True Myth / maybe / toJSON

Function: toJSON()

toJSON<T>(maybe): MaybeJSON<unknown>

Create an Object representation of a Maybe instance.

Useful for serialization. JSON.stringify() uses it.

Type Parameters

T

T

Parameters

maybe

Maybe<T>

The value to convert to JSON

Returns

MaybeJSON<unknown>

The JSON representation of the Maybe