@tmlmt/cooklang-parser / UnitDefinition
Interface: UnitDefinition
Represents a fully defined unit with conversion and alias information
Extends
Properties
aliases
aliases:
string[]
e.g. ['gram', 'grams']
integerProtected?
optionalintegerProtected:boolean
This property is set to true when the unit is prefixed by an = sign in the cooklang file, e.g. =g Indicates that quantities with this unit should be treated as integers only (no decimal/fractional values).
Inherited from
name
name:
string
Inherited from
system
system:
UnitSystem
toBase
toBase:
number
Conversion factor to the base unit of its type
type
type:
UnitType