Reference·JavaScript · @sascom/commonjsJavaScript

parseQuantityList

Function in @sascom/commonjs.

API catalogue · @sascom/commonjs · Function

TypeScript#
function parseQuantityList

Members#

Member Kind Description
parseQuantityList Method Parses several quantities, separated by "; " or ", " (a comma followed by a space), or each led by a label. An error's index points into the whole text.

parseQuantityList#

TypeScript#
parseQuantityList(text: string, options?: QuantityListOptions): QuantityParseError | { items: (ParsedQuantity & { label: string | null })[]; ok: true }

Parses several quantities, separated by "; " or ", " (a comma followed by a space), or each led by a label. An error's index points into the whole text.

Parameters#

Name Type Description
text string
options QuantityListOptions