Skip to main content
Version: v0.0.3

Function: wrapEmitterWithProfile()

wrapEmitterWithProfile(next, profile): (warning) => void

Wrap a downstream warning sink so every warning first passes through profile's tolerance transform. Returned unchanged (next) when profile is undefined, so the no-profile path pays nothing.

Parameters

next

(warning) => void

profile

CcdaProfile | undefined

Returns

(warning) => void

Example

import { wrapEmitterWithProfile } from "@cosyte/ccda";
const emit = wrapEmitterWithProfile(baseEmit, activeProfile);