Options
All
  • Public
  • Public/Protected
  • All
Menu

External module commander.api

Index

Functions

Const ByLength

  • ByLength(a: any[], b: number): boolean
  • Helper for {@link IfValidate} function

    Parameters

    • a: any[]

      first argument

    • b: number

      second argument

    Returns boolean

Const ByMatchSome

  • ByMatchSome(a: any[], b: any[]): boolean
  • Helper for {@link IfValidate} function

    Parameters

    • a: any[]

      first argument

    • b: any[]

      second argument

    Returns boolean

Const SaveIf

Const SeperateArgumentApi

  • SeperateArgumentApi(a: any[]): object
  • This will seperate argument to args and options. You can use this function on the top of action function.

    Parameters

    • a: any[]

      argument from action function

    Returns object

    • args: string[]
    • options: object
      • [key: string]: any

Const Throw

  • Throw(e: Throwable, message?: undefined | string): void

Const ThrowIf

  • ThrowIf(e?: Throwable, option?: undefined | object): void
  • This will check is exception exist, and throw + exit command

    Parameters

    • Optional e: Throwable

      exception to be throw if exist

    • Optional option: undefined | object

    Returns void

Const ValidList

  • ValidList(args: any[], validFn: function, expected: any): Exception | undefined
  • Check argument is validate

    Parameters

    • args: any[]

      arguments from action function

    • validFn: function

      validate function see more on this file

        • (a: any[], b: any): boolean
        • Parameters

          • a: any[]
          • b: any

          Returns boolean

    • expected: any

      expected result

    Returns Exception | undefined

    exception if error occurred, this method can be use with {@link WillThrow}

Generated using TypeDoc