findUnit Method

Find a unit by its display label, optionally filtering by schema name, phenomenon, and unit system.

findUnit(unitLabel: string, schemaName?: string, phenomenon?: string, unitSystem?: string): Promise<UnitProps>

@returns The matching UnitProps, or a BadUnit if no match is found.

Parameter Type Description
unitLabel string The display label to search for (case-insensitive).
schemaName string Optional schema name filter. Returns BadUnit if provided and not "Units".
phenomenon string Optional phenomenon filter (e.g. "Units.LENGTH").
unitSystem string Optional unit system filter (e.g. "Units.METRIC").

Returns - Promise<UnitProps>

The matching UnitProps, or a BadUnit if no match is found.

Defined in

Last Updated: 08 July, 2026