Skip to content

toJson

Converts a given value to a JSON string.

Import:

import { toJson } from 'obsidian-dev-utils/object-utils';

Signature:

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

Parameters:

ParameterTypeDescription
valueunknownThe value to be converted to JSON. This can be of any type.
optionsPartial<ToJsonOptions>Options for customizing the JSON conversion process.

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


Links to this page: