isUnitName Function

Type guard verifying a string is a known canonical built-in unit name.

Returns true only for unit names shipped in the bundled built-in canonical unit set. Use this at system boundaries (e.g. when ingesting unit names from JSON config, iModel metadata, user input, or other dynamic sources) before calling UnitConversions.getConversion, convert, or isCompatible. Narrows the input type to UnitName so subsequent calls type-check without casts.

isUnitName(value: string): value is UnitName

Parameter Type Description
value string  

Returns - value is UnitName

Defined in

Last Updated: 27 May, 2026