Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "utils/primitive/primitive.utils"

Index

Variables

Const defaultArray

defaultArray: any[] = []

Const defaultBoolean

defaultBoolean: false = false

Const defaultNumber

defaultNumber: 0 = 0

Const defaultObject

defaultObject: object

Type declaration

Const defaultString

defaultString: "" = ""

Functions

getBoolean

  • getBoolean(value: any, defaultValue?: boolean): boolean
  • Get a boolean from any given input.

    Optionally, choose the default value if the input value is undefined or null.

    Parameters

    • value: any
    • Default value defaultValue: boolean = defaultBoolean

    Returns boolean

getNumber

  • getNumber(value: any, defaultValue?: number | null): number | null
  • Get a number from any given input.

    Optionally, choose the default value if the input value is undefined or null.

    Parameters

    • value: any
    • Default value defaultValue: number | null = defaultNumber

    Returns number | null

getObject

  • getObject(value: any, defaultValue?: any): any
  • Get an object from any given input.

    Optionally, choose the default value if the input value is undefined or null.

    Parameters

    • value: any
    • Default value defaultValue: any = defaultObject

    Returns any

getString

  • getString(value: any, defaultValue?: string | null): string | null
  • Get a string from any given input.

    Optionally, choose the default value if the input value is undefined or null.

    Parameters

    • value: any
    • Default value defaultValue: string | null = defaultString

    Returns string | null

getValueOrDefault

  • getValueOrDefault(value: any, defaultValue?: any): any
  • Get a value if it is defined, or else get the default value.

    Optionally, choose the default value if the input value is undefined or null.

    Parameters

    • value: any
    • Default value defaultValue: any = null

    Returns any

getValueOrNull

  • getValueOrNull(value: any): any

isFunction

  • isFunction(value: any): boolean

Generated using TypeDoc