Skip to content

ToJsonOptions

Options for toJson.

Import:

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

Signature:

export interface ToJsonOptions

Properties

PropertyTypeDescription
functionHandlingModeFunctionHandlingModeSpecifies how functions should be handled in the JSON output.
maxDepthnumberSpecifies the maximum depth of nested objects to include in the JSON output. Use -1 for no limit.
shouldCatchToJSONErrorsbooleanSpecifies whether to catch errors in toJSON() and replace them with a placeholder.
shouldHandleCircularReferencesbooleanSpecifies whether to handle circular references in the JSON output.
shouldHandleErrorsbooleanSpecifies whether to handle errors in the JSON output.
shouldHandleUndefinedbooleanSpecifies whether to handle undefined values in the JSON output.
shouldSortKeysbooleanSpecifies whether to sort the keys of the JSON output.
spacenumber | stringSpecifies the indentation of the JSON output. This can be a number of spaces or a string.
tokenSubstitutionsPartial<TokenSubstitutions>Specifies the substitutions to use in the JSON output.

Links to this page: