Skip to content

toJson

Converts a given value to a JSON string.

Import:

import { toJson } from '@mnaoumov/typescript-lib/object-utils';

Signature:

function toJson(value: unknown, options: Partial<ToJsonOptions>): string

Parameters:

Parameter Type Description
value unknown The value to be converted to JSON. This can be of any type.
options Partial<ToJsonOptions> Options for customizing the JSON conversion process.

Returns: string — The JSON string representation of the input value.


Links to this page: