Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "helpers"

Index

Type aliases

SimpleCompletedAction

SimpleCompletedAction: function

Describes a simple 'completed' action.

param

The occurred error.

param

The result.

Type declaration

    • (err?: any, result?: TResult): void
    • Parameters

      • Optional err: any
      • Optional result: TResult

      Returns void

Variables

nextHtmlDocId

nextHtmlDocId: number = -1

Functions

asArray

  • asArray<T>(val: T | T[]): T[]
  • Returns a value as array.

    Type parameters

    • T

    Parameters

    • val: T | T[]

      The value.

    Returns T[]

    The value as array.

cloneObject

  • cloneObject<T>(val: T): T
  • Clones an object / value deep.

    Type parameters

    • T

    Parameters

    • val: T

      The value / object to clone.

    Returns T

    The cloned value / object.

compareValues

  • compareValues<T>(x: T, y: T): number
  • Compares two values for a sort operation.

    Type parameters

    • T

    Parameters

    • x: T

      The left value.

    • y: T

      The right value.

    Returns number

    The "sort value".

configJobsToQuickPicks

createSimplePromiseCompletedAction

  • createSimplePromiseCompletedAction<TResult>(resolve: function, reject?: function): SimpleCompletedAction
  • Creates a simple 'completed' callback for a promise.

    Type parameters

    • TResult

    Parameters

    • resolve: function

      The 'succeeded' callback.

        • (value?: TResult | PromiseLike<TResult>): void
        • Parameters

          • Optional value: TResult | PromiseLike<TResult>

          Returns void

    • Optional reject: function

      The 'error' callback.

        • (reason: any): void
        • Parameters

          • reason: any

          Returns void

    Returns SimpleCompletedAction

    The created action.

distinctArray

  • distinctArray<T>(arr: T[]): T[]
  • Removes duplicate entries from an array.

    Type parameters

    • T

    Parameters

    • arr: T[]

      The input array.

    Returns T[]

    The filtered array.

getUrlParam

  • getUrlParam(params: Object, name: string): string
  • Returns the value from a "parameter" object.

    Parameters

    • params: Object

      The object.

    • name: string

      The name of the parameter.

    Returns string

    The value of the parameter (if found).

isEmptyString

  • isEmptyString(val: any): boolean
  • Checks if the string representation of a value is empty or contains whitespaces only.

    Parameters

    • val: any

      The value to check.

    Returns boolean

    Is empty or not.

isNullOrUndefined

  • isNullOrUndefined(val: any): boolean
  • Checks if a value is (null) or (undefined).

    Parameters

    • val: any

      The value to check.

    Returns boolean

    Is (null)/(undefined) or not.

loadModuleSync

  • loadModuleSync<TModule>(file: string, useCache?: boolean): TModule
  • Loads a module.

    Type parameters

    Parameters

    • file: string

      The path of the module's file.

    • Default value useCache: boolean = false

      Use cache or not.

    Returns TModule

    The loaded module.

log

  • log(msg: any): void
  • Logs a message.

    Parameters

    • msg: any

      The message to log.

    Returns void

normalizeString

  • normalizeString(val: any, normalizer?: function): string
  • Normalizes a value as string so that is comparable.

    Parameters

    • val: any

      The value to convert.

    • Optional normalizer: function
        • (str: string): string
        • Parameters

          • str: string

          Returns string

    Returns string

    The normalized value.

open

  • open(target: string, opts?: OpenOptions): PromiseLike<ChildProcess>
  • Opens a target.

    Parameters

    • target: string

      The target to open.

    • Optional opts: OpenOptions

    Returns PromiseLike<ChildProcess>

openHtmlDocument

  • openHtmlDocument(storage: Document[], html: string, title?: string, id?: any): Thenable<any>
  • Opens a HTML document in a new tab for a document storage.

    Parameters

    • storage: Document[]

      The storage to open for.

    • html: string

      The HTML document (source code).

    • Optional title: string
    • Optional id: any

    Returns Thenable<any>

    The promise.

removeDocuments

  • Removes documents from a storage.

    Parameters

    Returns Document[]

    The removed documents.

requireModule

  • requireModule(id: string): any
  • Loads a module from the extension context.

    Parameters

    • id: string

      The ID / path of the module.

    Returns any

    The loaded module.

toBooleanSafe

  • toBooleanSafe(val: any, defaultValue?: any): boolean
  • Converts a value to a boolean.

    Parameters

    • val: any

      The value to convert.

    • Default value defaultValue: any = false

      The value to return if 'val' is (null) or (undefined).

    Returns boolean

    The converted value.

toStringSafe

  • toStringSafe(str: any, defValue?: any): string
  • Converts a value to a string that is NOT (null) or (undefined).

    Parameters

    • str: any

      The input value.

    • Default value defValue: any = ""

      The default value.

    Returns string

    The output value.

tryDispose

  • tryDispose(obj: Disposable): boolean
  • Tries to dispose an object.

    Parameters

    • obj: Disposable

      The object to dispose.

    Returns boolean

    Operation was successful or not.

uriParamsToObject

  • uriParamsToObject(uri: Uri): Object
  • Extracts the query parameters of an URI to an object.

    Parameters

    • uri: Uri

      The URI.

    Returns Object

    The parameters of the URI as object.

Generated using TypeDoc