Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "util"

Index

Type aliases

NormalizationSetting

NormalizationSetting: "always" | "never" | "platform"

ProgressHandle

ProgressHandle: vscode.Progress<ProgressReport>

Functions

_killTree

  • _killTree(pid: number): Promise<void>
  • Parameters

    • pid: number

    Returns Promise<void>

chain

  • chain<T>(...iter: Iterable<T>[]): Iterable<T>
  • Type parameters

    • T

    Parameters

    • Rest ...iter: Iterable<T>[]

    Returns Iterable<T>

cmakeify

  • cmakeify(value: string | number | true | false | string[]): CMakeValue

compare

compareVersions

dropNulls

  • dropNulls<T>(items: (undefined | null | T)[]): T[]
  • Type parameters

    • T

    Parameters

    • items: (undefined | null | T)[]

    Returns T[]

escapeStringForRegex

  • escapeStringForRegex(str: string): string
  • Escape a string so it can be used as a regular expression

    Parameters

    • str: string

    Returns string

find

  • find<T>(iter: Iterable<T>, predicate: function): T | undefined
  • Type parameters

    • T

    Parameters

    • iter: Iterable<T>
    • predicate: function
        • (value: T): boolean
        • Parameters

          • value: T

          Returns boolean

    Returns T | undefined

flatMap

  • flatMap<In, Out>(rng: Iterable<In>, fn: function): Iterable<Out>
  • Type parameters

    • In

    • Out

    Parameters

    • rng: Iterable<In>
    • fn: function
        • (item: In): Iterable<Out>
        • Parameters

          • item: In

          Returns Iterable<Out>

    Returns Iterable<Out>

heavyNormalizePath

  • heavyNormalizePath(p: string): string
  • Parameters

    • p: string

    Returns string

isMultiConfGenerator

  • isMultiConfGenerator(gen: string): boolean
  • Parameters

    • gen: string

    Returns boolean

isTruthy

  • isTruthy(value: undefined | null | string | number | true | false): boolean
  • Check if a value is "truthy" according to CMake's own language rules

    Parameters

    • value: undefined | null | string | number | true | false

      The value to check

    Returns boolean

lexicographicalCompare

  • lexicographicalCompare(a: Iterable<string>, b: Iterable<string>): number
  • Parameters

    • a: Iterable<string>
    • b: Iterable<string>

    Returns number

lightNormalizePath

  • lightNormalizePath(p: string): string
  • Parameters

    • p: string

    Returns string

map

  • map<In, Out>(iter: Iterable<In>, proj: function): Iterable<Out>
  • Map an iterable by some projection function

    Type parameters

    • In

    • Out

    Parameters

    • iter: Iterable<In>

      An iterable to map

    • proj: function

      The projection function

        • (arg: In): Out
        • Parameters

          • arg: In

          Returns Out

    Returns Iterable<Out>

mergeEnvironment

normalizeEnvironmentVarname

  • normalizeEnvironmentVarname(varname: string): string
  • Parameters

    • varname: string

    Returns string

normalizePath

  • Completely normalize/canonicalize a path. Using path.normalize isn't sufficient. We want convert all paths to use POSIX separators, remove redundant separators, and sometimes normalize the case of the path.

    Parameters

    Returns string

    The normalized path

objectPairs

  • objectPairs<V>(obj: object): [string, V][]
  • Generate an array of key-value pairs from an object using getOwnPropertyNames

    Type parameters

    • V

    Parameters

    • obj: object

      The object to iterate

      • [key: string]: V

    Returns [string, V][]

parseCompileDefinition

  • parseCompileDefinition(str: string): [string, string | null]
  • Parameters

    • str: string

    Returns [string, string | null]

parseVersion

  • parseVersion(str: string): Version

platformNormalizePath

  • platformNormalizePath(p: string): string
  • Parameters

    • p: string

    Returns string

platformPathCompare

  • platformPathCompare(a: string, b: string): Ordering

platformPathEquivalent

  • platformPathEquivalent(a: string, b: string): boolean
  • Parameters

    • a: string
    • b: string

    Returns boolean

product

  • product<T>(arrays: T[][]): T[][]
  • Type parameters

    • T

    Parameters

    • arrays: T[][]

    Returns T[][]

randint

  • randint(min: number, max: number): number
  • Generate a random integral value.

    Parameters

    • min: number

      Minimum value

    • max: number

      Maximum value

    Returns number

reduce

  • reduce<In, Out>(iter: Iterable<In>, init: Out, mapper: function): Out
  • Type parameters

    • In

    • Out

    Parameters

    • iter: Iterable<In>
    • init: Out
    • mapper: function
        • (acc: Out, el: In): Out
        • Parameters

          • acc: Out
          • el: In

          Returns Out

    Returns Out

removeAllPatterns

  • removeAllPatterns(str: string, patterns: string[]): string
  • Remove all occurrences of a list of strings from a string.

    Parameters

    • str: string

      The input string

    • patterns: string[]

      Strings to remove from str

    Returns string

    The modified string

replaceAll

  • replaceAll(str: string, needle: string, what: string): string
  • Replace all occurrences of needle in str with what

    Parameters

    • str: string

      The input string

    • needle: string

      The search string

    • what: string

      The value to insert in place of needle

    Returns string

    The modified string

resolvePath

  • resolvePath(inpath: string, base: string): string
  • Parameters

    • inpath: string
    • base: string

    Returns string

setContextValue

  • setContextValue(key: string, value: any): Thenable<void>
  • Parameters

    • key: string
    • value: any

    Returns Thenable<void>

splitCommandLine

  • splitCommandLine(cmd: string): string[]
  • Parameters

    • cmd: string

    Returns string[]

splitPath

  • splitPath(p: string): string[]
  • Split a path into its elements.

    Parameters

    • p: string

      The path to split

    Returns string[]

termProc

  • termProc(child: ChildProcess): Promise<boolean>
  • Parameters

    • child: ChildProcess

    Returns Promise<boolean>

thisExtension

  • thisExtension(): Extension<any>

thisExtensionPackage

thisExtensionPath

  • thisExtensionPath(): string

versionEquals

  • versionEquals(lhs: Version | string, rhs: Version | string): boolean

versionGreater

  • versionGreater(lhs: Version | string, rhs: Version | string): boolean

versionLess

versionToString

  • versionToString(ver: Version): string

Generated using TypeDoc