Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ArgsUtil

Hierarchy

  • ArgsUtil

Index

Methods

Static decodeParam

  • decodeParam(str: string): { decoded: string; error: any }
  • Decodes string such as \u2014 to —

    description

    Parameters are read from files with a BUILD_INCLDDE comment. Since the content is read from a file any inline javascript escapes are not automatically converted. This method does such conversions. Unescaps any \\ to \ escaped colons.

     
    For Example:
    // BUILD_INCLDDE(./somfile.txt)[text?before=\n&padleft=# \u2014]

    This method decodes the unicode, line breaks and other JavaScript encodings. This converts \n into an acutal new line and \u2014 into an em dash.

    Parameters

    • str: string

      string to decode

    Returns { decoded: string; error: any }

    • decoded: string
    • error: any

Static splitArgsAnd

  • splitArgsAnd(str: string, removeFromStart?: boolean): string[]
  • Split a & delimited string into an array. Escape chars for & is \&

    summary

    If removeFromStart = true and ? or & is present at start of str then ? and & are remove from start of str.

    Parameters

    • str: string

      String of arguments to split

    • Default value removeFromStart: boolean = true

      determines if delimiter should be removed from start of str if present

    Returns string[]

    If str is empty the empty string array is returned; Otherwise a string array of arguments is returned.

Static splitArgsComma

  • splitArgsComma(str: string): string[]
  • Split a comma-delimited string into an array. Escape chars for , is \,

    Parameters

    • str: string

      String of arguments to split

    Returns string[]

    If str is empty the empty string array is returned; Otherwise a string array of arguments is returned.

Static splitArgsEq

  • splitArgsEq(str: string): string[]
  • Split a &-delimited string into an array. Escape chars for = is \=

    Parameters

    • str: string

      String of arguments to split

    Returns string[]

    If str is empty the empty string array is returned; Otherwise a string array of arguments is returned.

Generated using TypeDoc