Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "src/processors"

Index

Functions

matchInterval

  • matchInterval(num: number, interval: string): boolean
  • test a number to match mathematical interval expressions [0,2] - 0 to 2 (including, matches: 0, 1, 2) ]0,3[ - 0 to 3 (excluding, matches: 1, 2) [1] - 1 (matches: 1) [20,] - all numbers ≥20 (matches: 20, 21, 22, ...) [,20] - all numbers ≤20 (matches: 20, 21, 22, ...)

    Parameters

    • num: number

      Number to match.

    • interval: string

      Interval query.

    Returns boolean

    Match or not.

mustacheProcessor

  • mustacheProcessor(text: string, namedValues: any): string
  • Handle mustache templates.

    Parameters

    • text: string

      Input text.

    • namedValues: any

      Named values.

    Returns string

parsePluralInterval

  • parsePluralInterval(phrase: string, count: number): string
  • Splits and parses a phrase for mathematical interval expressions.

    Parameters

    • phrase: string

      Phrase to parse.

    • count: number

      Target count.

    Returns string

    Phrase.

pluralIntervalProcessor

  • pluralIntervalProcessor(text: string, _: any, __: any, count?: number): string
  • Handle plural interval templates.

    Parameters

    • text: string

      Input text.

    • _: any
    • __: any
    • Optional count: number

      Count.

    Returns string

Generated using TypeDoc