Home > @skunkteam/types > IntersectionType > maybeStringify
Create a JSON string of the given value, using the type information of the current type. Matches the specs of JSON.stringify.
Signature:
maybeStringify(value: IntersectionOfTypeTuple<Types>): string;| Parameter | Type | Description |
|---|---|---|
| value | IntersectionOfTypeTuple<Types> | a previously validated or constructed value, must conform to this type |
Returns:
string
Only use this method on values that have been validated or constructed by this type. It will use the available type information to efficiently create a stringified version of the value. Unknown (extra) properties of object types are stripped.
Note that this implementation matches the specs of JSON.stringify in that it will throw on a BigInt and will return undefined for other values that are not serializable into JSON.