Μετάβαση στο περιεχόμενο

behaviorDiagnostic

Αυτό το περιεχόμενο δεν είναι ακόμη διαθέσιμο στη γλώσσα σου.

behaviorDiagnostic(context, behaviorName, violation): PipelineBehaviorDiagnostic[]

Defined in: packages/pipeline/src/interfaces/pipeline-behavior-contract.interface.ts:74

The one diagnostic a contract validator returns for a violation, named after the handler under validation.

Pick<PipelineBehaviorValidationContext, "handlerName">

string

The behavior that reports it, such as CacheBehavior.name.

Pick<PipelineBehaviorDiagnostic, "message" | "fix">

PipelineBehaviorDiagnostic[]

validate: (context) =>
  context.effectiveOptions?.key
    ? undefined
    : behaviorDiagnostic(context, CacheBehavior.name, {
        message: 'Active CacheBehavior requires an explicit `key` factory',
        fix: 'Provide a key factory in the cache({ key }) entry.',
      }),