Function: reduce()
reduce(
node):Reduction
Reduce a parsed UCUM unit to its canonical Reduction - a linear scalar×dimension form, or
an opaque special form for expressions involving a non-linear special unit.
Parameters
node
The AST from parseUcum.
Returns
The reduced form.
Example
import { parseUcum, reduce } from "@cosyte/terminology";
const parsed = parseUcum("N");
if (parsed.ok) {
const r = reduce(parsed.node);
r.kind; // => "linear" (1000 × g·m·s⁻²)
}