Options
All
  • Public
  • Public/Protected
  • All
Menu
     

Class FRMT

A robust, printf-style String formatter. (see: printf)

Hierarchy

  • FRMT

Callable

  • Creates an instance of FRMT.

    Parameters

    • nests: FMTemplate[]

      A collection of inner templates that the primary template will reference

    • debug: boolean

      If true, output debug information to the console

    Returns FRMT

Index

Constructors

constructor

  • Creates an instance of FRMT.

    Parameters

    • nests: FMTemplate[]

      A collection of inner templates that the primary template will reference

    • debug: boolean

      If true, output debug information to the console

    Returns FRMT

Accessors

Private MODS

  • The format modifiers.

    Returns FRMTMods

Private OPTNS

  • The format Options

    Returns FRMTOpts

Private FNTS

  • The format Font-styling.

    Returns FRMTFonts

Private TYPS

  • The format Types

    Returns FRMTTypes

Private REG

  • get REG(): RGX
  • The RGX strategy.

    Returns RGX

Private Nstr

  • get Nstr(): RegExp
  • ...

    Returns RegExp

Private Idxr

  • get Idxr(): RegExp
  • ...

    Returns RegExp

Private Each

  • get Each(): RegExp
  • ...

    Returns RegExp

Private Pair

  • get Pair(): RegExp
  • ...

    Returns RegExp

Private List

  • get List(): RegExp
  • ...

    Returns RegExp

Private Norm

  • get Norm(): RegExp
  • ...

    Returns RegExp

Private Keys

  • get Keys(): RegExp
  • ...

    Returns RegExp

Private PItr

  • get PItr(): RegExp
  • ...

    Returns RegExp

Private Opts

  • get Opts(): RegExp
  • ...

    Returns RegExp

Private OptO

  • get OptO(): RegExp
  • ...

    Returns RegExp

Private Pads

  • get Pads(): RegExp
  • ...

    Returns RegExp

Private Typs

  • get Typs(): RegExp
  • ...

    Returns RegExp

Private IDX

  • get IDX(): any
  • ...

    Returns any

Private PADS

  • get PADS(): any
  • ...

    Returns any

Private FLTR

  • get FLTR(): any
  • ...

    Returns any

Find

  • get Find(): object
  • ...

    Returns object

    • Obj: function
      • Finds the next Object literal to insert into the template

        Parameters

        • cnts: FMCounts

          The FMCounts object

        • grps: FMGroups

          The FMGroups object

        • strict: boolean

          The FMStrict flag

        • _typ: FMType

          The FMtype flag

        Returns DCT | Imm.Map

        The next Object literal

    • Lst: function
      • Finds the next Array list to insert into the template

        Parameters

        • cnts: FMCounts

          The FMCounts object

        • grps: FMGroups

          The FMGroups object

        • strict: boolean

          The FMStrict flag

        • _typ: FMType

          The FMtype flag

        Returns any

        The next Array list

    • Nrm: function
      • Finds & formats the next String|Number to insert into the template. This is the end of all template variables.

        Parameters

        • mch: string | number

          A value to replace or format; if applicable

        • cnts: FMCounts

          The FMCounts object

        • grps: FMGroups

          The FMGroups object

        • strict: boolean

          The FMStrict flag

        • typ: FMType

          The FMtype flag

        Returns string

        The formatted String

    • Key: function
      • Finds the next set of named variable to insert into the template

        Parameters

        • txt: string

          The name variable String

        • mch: string | number

          The full name template variable

        • grps: FMGroups

          The FMGroups object for named variables

        • strict: boolean

          The FMStrict flag

        • _typ: FMType

          The FMtype flag

        Returns FMKeyVal

        The formatted String

Methods

LOGS

  • LOGS(): void
  • ...

    Returns void

Private Options

  • Registers valid format options.

    Parameters

    Returns FRMTStruct

Private Types

  • Types(typs: any): string
  • Parameters

    • typs: any

    Returns string

Private Paddings

  • Paddings(pads: any): string
  • Parameters

    • pads: any

    Returns string

Private Replace

  • Replace(text: any, opt: any): string
  • Parameters

    • text: any
    • opt: any

    Returns string

Private Empty

  • Empty(val: any): string
  • Parameters

    • val: any

    Returns string

Private Case

  • Case(text: any, cases: any): string
  • Parameters

    • text: any
    • cases: any

    Returns string

Private Font

  • Font(text: any, font: any): string
  • Parameters

    • text: any
    • font: any

    Returns string

Private Close

  • Close(text: any, pfx: any, sfx: any, key: any): string
  • Parameters

    • text: any
    • pfx: any
    • sfx: any
    • key: any

    Returns string

Private KVs

  • KVs(ArgS: any): string
  • Parameters

    • ArgS: any

    Returns string

Private Nest

  • Nest(key: any): string
  • Parameters

    • key: any

    Returns string

Private Delimit

  • Delimit(res: any, opts: any, pads: any): string
  • Parameters

    • res: any
    • opts: any
    • pads: any

    Returns string

Private Finalize

  • Finalize(text: any, opts: any, pad: any, key: any): string
  • Parameters

    • text: any
    • opts: any
    • pad: any
    • key: any

    Returns string

_

  • Formats a String with a printf-style template and given arguments.

    Parameters

    • template: FMTemplate

      A printf-style template ()

    • Rest ...VARS: any[]

      The values to inster into the template. The last argument can be an Object.<string,any> for named variable.

    Returns string

    The formatted String

ie

  • ie(): void
  • Prints an example.

    Returns void