CorjOptions: {
    childrenSources: readonly string[];
    fingerprintParts: readonly CorjFingerprintPart[] | null;
    inspection: CorjInspection;
    makeReportId: ((context) => string);
    maxChildren: number;
    maxContextSize: number | null;
    maxDepth: number;
    maxReportSize: number | null;
    metadata: CorjMetadata;
    occurrenceIdSources: readonly CorjOccurrenceIdSource[] | null;
    omitExpectedValues: boolean;
    onReportingError: CorjErrorHandler;
    redact: CorjRedactPolicy | null;
    reportSizeUnit: CorjReportSizeUnit;
    stackFormat: CorjStackFormat;
}

Type declaration

  • childrenSources: readonly string[]

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

  • fingerprintParts: readonly CorjFingerprintPart[] | null

    What the fingerprint is hashed from; every part contributes. null or [] omits the field.

  • inspection: CorjInspection

    How much of the caught object may be executed while reporting it. Defaults to "default".

  • 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.

  • maxContextSize: number | null

    Own size cap of the context container, inside maxReportSize. Defaults to 16384; null leaves only the report budget.

  • 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.

  • occurrenceIdSources: readonly CorjOccurrenceIdSource[] | null

    Where occurrence_id comes from: an ordered list, first valid id wins. null or [] omits the field.

  • omitExpectedValues: boolean

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

  • onReportingError: CorjErrorHandler

    Called as (reportingFailure, record) when reporting throws. The first argument is raw and may contain sensitive data; the row is scrubbed and bounded.

  • redact: CorjRedactPolicy | null

    Field selection and redaction applied to everything the report emits. null (the default) applies none.

  • reportSizeUnit: CorjReportSizeUnit

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

  • stackFormat: CorjStackFormat

    Store stack as at most 10,000 lines plus a truncation marker (lines, the default), or as the raw string.