Skip to main content
Version: v0.0.3

Function: approvalOf()

approvalOf(outcome): ResponseApproval

Map a ResponseOutcome to its fail-safe ResponseApproval. Total and one-directional: only an outright approval is "affirmative"; denials are "negative"; everything else (replace/validated/unknown) is "indeterminate".

Parameters

outcome

ResponseOutcome

The detected response outcome.

Returns

ResponseApproval

The coarse approval classification.

Example

approvalOf("denied"); // "negative"
approvalOf("approvedWithChanges"); // "affirmative"
approvalOf("unknown"); // "indeterminate"