Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ConnectionUtils

A set of utility functions to process connection parameters

Hierarchy

  • ConnectionUtils

Index

Methods

Static composeUri

  • composeUri(options: ConfigParams, defaultProtocol: string, defaultPort: number): string
  • Composes URI from config parameters. The result URI will be in the following form: protocol://username@password@host1:port1,host2:port2,...?param1=abc&param2=xyz&...

    Parameters

    • options: ConfigParams

      configuration parameters

    • defaultProtocol: string

      a default protocol

    • defaultPort: number

      a default port

    Returns string

    a composed URI

Static concat

  • concat(options1: ConfigParams, options2: ConfigParams, ...keys: string[]): ConfigParams
  • Concatinates two options by combining duplicated properties into comma-separated list

    Parameters

    • options1: ConfigParams

      first options to merge

    • options2: ConfigParams

      second options to merge

    • Rest ...keys: string[]

      when define it limits only to specific keys

    Returns ConfigParams

Static exclude

  • exclude(options: ConfigParams, ...keys: string[]): ConfigParams
  • Excludes specified keys from the config parameters.

    Parameters

    • options: ConfigParams

      configuration parameters to be processed.

    • Rest ...keys: string[]

      a list of keys to be excluded.

    Returns ConfigParams

    a processed config parameters.

Static include

  • include(options: ConfigParams, ...keys: string[]): ConfigParams
  • Includes specified keys from the config parameters.

    Parameters

    • options: ConfigParams

      configuration parameters to be processed.

    • Rest ...keys: string[]

      a list of keys to be included.

    Returns ConfigParams

    a processed config parameters.

Static parseUri

  • parseUri(uri: string, defaultProtocol: string, defaultPort: number): ConfigParams
  • Parses URI into config parameters. The URI shall be in the following form: protocol://username@password@host1:port1,host2:port2,...?param1=abc&param2=xyz&...

    Parameters

    • uri: string

      the URI to be parsed

    • defaultProtocol: string

      a default protocol

    • defaultPort: number

      a default port

    Returns ConfigParams

    a configuration parameters with URI elements

Generated using TypeDoc