parse-ingredient
Version:
Recipe ingredient parser with support for mixed numbers and vulgar fractions
50 lines (49 loc) • 1.54 kB
TypeScript
import { ParseIngredientOptions, UnitOfMeasureDefinitions } from "./types";
/**
* Default options for {@link parseIngredient}.
*/
export declare const defaultOptions: Required<ParseIngredientOptions>;
/**
* List of "for" equivalents (for upcoming i18n support).
*/
export declare const fors: readonly ["For"];
/**
* Regex to capture "for" equivalents (for upcoming i18n support).
*/
export declare const forsRegEx: RegExp;
/**
* List of range separators (for upcoming i18n support).
*/
export declare const rangeSeparatorWords: readonly ["or", "to"];
/**
* Regex to capture range separators (for upcoming i18n support).
*/
export declare const rangeSeparatorRegEx: RegExp;
/**
* Regex to capture the first word of a description, to see if it's a unit of measure.
*/
export declare const firstWordRegEx: RegExp;
/**
* Regex to capture trailing quantity and unit of measure.
*/
export declare const trailingQuantityRegEx: RegExp;
/**
* List of "of" equivalents (for upcoming i18n support).
*/
export declare const ofs: readonly ["of"];
/**
* Regex to capture "of" equivalents at the beginning of a string (for upcoming i18n support).
*/
export declare const ofRegEx: RegExp;
/**
* List of "from" equivalents (for upcoming i18n support).
*/
export declare const froms: readonly ["from", "of"];
/**
* Regex to capture "from" equivalents at the end of a string (for upcoming i18n support).
*/
export declare const fromRegEx: RegExp;
/**
* Default unit of measure specifications.
*/
export declare const unitsOfMeasure: UnitOfMeasureDefinitions;