Options
All
  • Public
  • Public/Protected
  • All
Menu

Houses utility methods

module

Utils

Index

Variables

Private boness

boness: RegExp = /bo'ness/i

Matches Bo'Ness post town corner case

constant

Private containsAmpersand

containsAmpersand: RegExp = /\w+&\w+/

Matches post towns containing ampersand

constant

Private exclusion

exclusion: RegExp = /^(of|le|upon|on|the)$/

Post town joiner words which do not result in subsequent capitalization

constant

Private joiner

joiner: RegExp = /-/

Matches post town joining characters. E.g. '-'

constant

Private joinerWord

joinerWord: RegExp = /^(in|de|under|upon|y|on|over|the|by)$/

Post town joiner words that require subsequent capitalisation

constant

Functions

Private addClass

  • addClass(elem: HTMLElement, className: string): HTMLElement
  • Adds CSS class to element

    Parameters

    • elem: HTMLElement
    • className: string

    Returns HTMLElement

Private capitalizeWords

  • capitalizeWords(word: string): string
  • Capitalize word save the exceptions found on exclusion list

    Parameters

    • word: string

    Returns string

Private checkExceptions

  • checkExceptions(word: string): string
  • Single instance cases

    Parameters

    • word: string

    Returns string

Private checkJoins

  • checkJoins(word: string): string
  • Check for names connected with hyphens

    Parameters

    • word: string

    Returns string

Private create

  • create(elemType: string, options: any): HTMLElement
  • Utility method to generate a HTMLElement

    Parameters

    • elemType: string
    • options: any

    Returns HTMLElement

Private removeClass

  • removeClass(elem: HTMLElement, className: string): HTMLElement
  • Removes CSS class to element

    Parameters

    • elem: HTMLElement
    • className: string

    Returns HTMLElement

Private removeOrganisation

  • Mutates an address object to remove an organisation name from address line and shift up other lines as necessary

    Parameters

    Returns AddressFields

Private titleizePostTown

  • titleizePostTown(postTown: string): string
  • Converts a post town string to appropriate title case

    Parameters

    • postTown: string

    Returns string

Private toArray

  • toArray(elem: string | string[]): string[]
  • Converts a comma separate string to an array

    Parameters

    • elem: string | string[]

    Returns string[]