Skip to main content
Version: v0.0.3

Function: setDefaultCcdaProfile()

setDefaultCcdaProfile(profile): void

Register a process-scoped default profile that parseCcda(raw) applies when no explicit profile option is passed. Pass null (or undefined) to clear. An explicit parseCcda(raw, { profile }) always wins; { profile: null } opts out of the default for a single call.

Test hygiene: the only mutable module-scoped state here, tests that call this MUST clear it in teardown or default-profile bleed infects later tests.

Parameters

profile

CcdaProfile | null

Returns

void

Example

import { setDefaultCcdaProfile, ccdaProfiles, parseCcda } from "@cosyte/ccda";
setDefaultCcdaProfile(ccdaProfiles.legacyR11);
const doc = parseCcda(xml); // uses legacyR11
setDefaultCcdaProfile(null); // clear