Type Alias: UcumValidation
UcumValidation = {
canonical:string;valid:true; } | {code:"TERM_UCUM_INVALID";reason:string;valid:false; }
The result of validateUcum: a valid unit with its canonical descriptor, or a typed invalid carrying the stable TERM_UCUM_INVALID diagnostic and a value-free reason.
Union Members
Type Literal
{ canonical: string; valid: true; }
canonical
readonlycanonical:string
A stable, normalized descriptor of the unit's canonical form - equal iff the units are the same (see ucumEqual). Note: this is a comparison/debug descriptor, not guaranteed to be a re-parseable UCUM expression (UCUM cannot express arbitrary numeric factors as literals).
valid
readonlyvalid:true
The expression is a well-formed UCUM unit over known atoms.
Type Literal
{ code: "TERM_UCUM_INVALID"; reason: string; valid: false; }
code
readonlycode:"TERM_UCUM_INVALID"
The stable diagnostic code - never a guessed "nearest" unit (the never-fabricate rule).
reason
readonlyreason:string
A value-free structural reason (a grammar fault or an unknown atom; never PHI).
valid
readonlyvalid:false
The expression is not a valid UCUM unit.