Skip to main content
Version: v0.0.5

Function: profileTolerated()

profileTolerated(disposition, intendedWarnings, warningsUnderProfile): boolean

Evaluate whether a profiled parse tolerated a quirk as its disposition declares. Shared across the formats so the "suppressed vs re-badged" logic lives in exactly one place.

Parameters

disposition

QuirkProfileDisposition

The quirk's declared profile disposition.

intendedWarnings

readonly string[]

The bare-parse intended code(s).

warningsUnderProfile

readonly string[]

The code(s) the parser emitted with the profile active.

Returns

boolean

true iff the profile handled the quirk correctly for its disposition.

Example

import { profileTolerated } from "@cosyte/synth";
profileTolerated("suppressed", ["UNKNOWN_SEGMENT"], []); // true - the profile suppressed it