Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Util

A utility class for random stuff.

Hierarchy

  • Util

Index

Methods

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 isNodeId

  • isNodeId(id: any): boolean
  • Whether or not the passed object is a valid node identifier (either a number, or a foreignSource:foreignId tuple)

    Parameters

    • id: any

    Returns boolean

Static isNumber

  • isNumber(value: any): boolean
  • Whether or not the passed object is a number.

    Parameters

    • value: any

    Returns boolean

Static isNumberString

  • isNumberString(value: any): boolean
  • Whether or not the passed object is a numeric string.

    Parameters

    • value: any

    Returns boolean

Static sort

  • sort(obj: any[], ...props: any[]): any[]
  • Sort an array of objects based on one or more sort properties.

    Parameters

    • obj: any[]
    • Rest ...props: any[]

    Returns any[]

Static toDateString

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

    Parameters

    • date: Date | Moment | number

    Returns string

Static toIPAddress

  • toIPAddress(addr?: string): any
  • Convert an IP address string to an [[Address4]] or [[Address6]] object.

    Parameters

    • Optional addr: string

    Returns any

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 OpenNMS.js will always be converted internally to UTC to avoid time zone issues.

    Parameters

    • date: Date | Moment | string | number

    Returns Moment

Static toNumber

  • toNumber(from: any): number | undefined
  • Convert the given value to a number, or undefined if it cannot be converted.

    Parameters

    • from: any

    Returns number | undefined

Generated using TypeDoc