Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Util

A utility class for random stuff.

Hierarchy

  • Util

Index

Methods

Static assertHasProperties

  • assertHasProperties(obj?: any, ...expectedProperties: any[]): boolean
  • Parameters

    • Optional obj: any
    • Rest ...expectedProperties: any[]

    Returns boolean

Static isDateObject

  • isDateObject(date: any): any
  • Whether or not the passed object is already a date. (Either a [[Moment]] object, or a JavaScript [[Date]] object.)

    Parameters

    • date: any

    Returns any

Static isEmpty

  • isEmpty(...values: any[]): boolean
  • Whether a string is empty.

    Parameters

    • Rest ...values: any[]

    Returns boolean

Static setDateProperties

  • setDateProperties(target: any, source: any, ...props: any[]): void
  • Iterate over a set of (optional) properties on the source object, and apply them to the target converting them to @Moment objects in the process.

    Parameters

    • target: any
    • source: any
    • Rest ...props: any[]

    Returns void

Static setProperties

  • setProperties(target: any, source: any, ...props: any[]): void
  • Iterate over a set of (optional) properties on the source object, and apply them to the target.

    Parameters

    • target: any
    • source: any
    • Rest ...props: any[]

    Returns void

Static toDateString

  • toDateString(date: Date | Moment | number): string
  • Create a date string from any form of date (JavaScript [[Date]], [[Moment]], or epoch). Dates in Twitarr.js will always be converted internally to UTC before stringifying to avoid time zone issues.

    Parameters

    • date: Date | Moment | number

    Returns string

Static toMoment

  • toMoment(date: Date | Moment | string | number): Moment
  • Create a [[Moment]] from any form of date (JavaScript [[Date]], [[Moment]], or epoch). [[Moment]] dates in Twitarr.js will always be converted internally to UTC to avoid time zone issues.

    Parameters

    • date: Date | Moment | string | number

    Returns Moment

Generated using TypeDoc