Produces reports with one set of options. Construct once, reuse for every caught object.

Constructors

Properties

ctx: Ctx
options: CorjOptions

Methods

  • Records are per call. A caught object may re-enter this maker, so the previous list is restored.

    Type Parameters

    • T

    Parameters

    • produce: (() => T)
        • (): T
        • Returns T

    Returns T

  • The fingerprint alone: discovery and node fields, without as_json, the context or the limiter. Building no as_json means a caught object whose .toCorjAsJson() or getters change it as they run can fingerprint differently here than it does inside a report.

    requireStack returns a fingerprint only when fingerprintParts names stack and the root's stack still carries frames once it has been read and redacted; anything else is undefined, because a hash of the caught value's own text is one a reader who can guess that text can confirm.

    Parameters

    • caught: unknown
    • Optional options: {
          requireStack?: boolean;
      }
      • Optional requireStack?: boolean

    Returns undefined | string

  • The bounded JSON form of any value, under this maker's inspection and redact options. A named root such as "$context" starts a separate document, so a rule written for one never reaches another.

    Parameters

    • value: unknown
    • options: {
          maxSize?: null | number;
          root?: string;
      } = {}
      • Optional maxSize?: null | number
      • Optional root?: string

    Returns CorjJsonView

  • This maker's redact policy applied to one string a consumer emits itself, such as a log line of its own. Without a policy it is the identity.

    Parameters

    • text: string
    • where: {
          path?: string;
          reportKey?: CorjReportKey;
          sourceProperty?: string;
      } = {}
      • Optional path?: string
      • Optional reportKey?: CorjReportKey
      • Optional sourceProperty?: string

    Returns string