Saxonberg Server API
    Preparing search index...
    Index

    Constructors

    Methods

    • Read the tag-tables YAML and register each declared (unit, scaleName) table with Quantity. Idempotent — calling twice with the same file re-registers the same tables.

      Boot path: AppBootstrap calls this after SeederManager.run so the tables are available before any code that hits tag() / parse(tagString) runs (the marshallers, the propagation walks, controllers).

      Tests can pass an explicit path to load fixture files.

      Parameters

      • OptionalyamlPath: string

      Returns TagTableLoadResult

    • Re-read the YAML and apply the diff to the live registry at (unit, scaleName) granularity:

      • Pairs present in the new file get re-registered (replacing any prior table).
      • Pairs present in the registry but absent from the new file get cleared.

      Removing a unit's default scale promotes the next remaining scale to default automatically (see Quantity._clearTagTable's contract).

      Existing Quantity instances see new tags on their next tag() call — there's no caching layer to invalidate.

      Parameters

      • OptionalyamlPath: string

      Returns TagTableLoadResult

    • Resolve a natural-language unit token ('cups', 'litre', 'mL') to its canonical Unit, or null when unrecognized. Case- insensitive; singular and plural both resolve. The single unit-word lexicon for the formal :{N unit} parser and the natural-language measure desugar — no free-floating recognizer module.

      Parameters

      • token: string

      Returns Unit | null