⚠️ This is pre-release documentation for v3. For stable docs, visit v2.
Skip to content

@tmlmt/cooklang-parser / Unit

Interface: Unit

Represents a unit used to describe quantities

Extended by

Properties

integerProtected?

optional integerProtected?: 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).


name

name: string


unitOrder?

optional unitOrder?: "quantity-first" | "unit-first"

Controls whether the unit is rendered before or after the numeric quantity. Populated automatically by resolveUnit when the alias is listed in unitFirstAliases. Can also be set directly on a custom Unit object as an override.