Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace Utils

Index

Type aliases

ArgType<T>: Result<T, possibleOutput>

Wrapper type taking Ok(T) or Err(possibleOutput) e.g Result<T, possibleOutput

Type parameters

  • T

Functions

  • parseBool(arg: string, onFailure?: possibleOutput<string>, regexes?: { noRegex: RegExp; yesRegex: RegExp }): ArgType<boolean>
  • Parameters

    • arg: string

      command arguments

    • onFailure: possibleOutput<string> = ...

      If cannot parse arg into boolean.

    • regexes: { noRegex: RegExp; yesRegex: RegExp } = ...
      • noRegex: RegExp
      • yesRegex: RegExp

    Returns ArgType<boolean>

    attemps to parse args as a boolean

  • toArr(arg: string, sep?: string): ArgType<string[]>

Generated using TypeDoc