CorjOptions: {
    childrenSources: readonly string[];
    makeReportId: ((context) => string);
    maxChildren: number;
    maxDepth: number;
    maxReportSize: number | null;
    metadata: CorjMetadata;
    omitExpectedValues: boolean;
    onError: CorjErrorHandler;
    reportSizeUnit: CorjReportSizeUnit;
    stackFormat: CorjStackFormat;
}

Type declaration

  • childrenSources: readonly string[]

    Properties to collect children from. Arrays contribute one child per element. Defaults to ["cause", "errors"].

  • makeReportId: ((context) => string)

    Produces the id of a node. Called once per discovered node.

  • maxChildren: number

    Most child reports in one report. Defaults to 100.

  • maxDepth: number

    Deepest level of nested errors to report; 1 reports caught.cause but not caught.cause.cause. Defaults to 5.

  • maxReportSize: number | null

    Size limit of the compact JSON of the whole report, children included. Defaults to 100000; null disables it.

  • metadata: CorjMetadata

    Which of v and $schema to add to the root. Defaults to v only.

  • omitExpectedValues: boolean

    Leave out fields holding their expected value, see CORJ_EXPECTED_VALUES. Defaults to true.

  • onError: CorjErrorHandler

    Called when something throws while the report is produced. Defaults to console.warn.

  • reportSizeUnit: CorjReportSizeUnit

    Unit of maxReportSize. Defaults to UTF-8 bytes; utf16-code-units counts json.length.

  • stackFormat: CorjStackFormat

    Store stack as stack.split('\n') (lines, the default) or as the raw string.