StringUtil
Provides common string utilities.
Static Member Summary
Static Public Members | ||
public static get |
Returns the SafeEntry constructor which is used by |
Static Method Summary
Static Public Methods | ||
public static |
Compares two strings. |
|
public static |
incrementIndent(indentation: number, amount: number): number Increments the indentation amount. |
|
public static |
Creates an indentation string given the indentation amount. |
|
public static |
safeStringObject(string: string, object: object, accessor: string, newLine: number, appendString: string, tagFunction: function): string Provides a way to output a given string value with concatenated data from safely accessing an objects data / entries given an accessor string which describes the entries to walk. |
|
public static |
safeStringsObject(object: object, entries: string | SafeEntry | Array<string | SafeEntry>): string Provides a convenience method producing a block of |
|
public static |
safeStringsPrependObject(origPrepend: *, object: object, entries: string | SafeEntry | Array<string | SafeEntry>): string Provides a convenience method producing a block of |
|
public static |
tagEscapeHTML(literal: Array<string>, values: Array<*>): string Provides a tagged template method to escape HTML elements. |
Static Public Members
Static Public Methods
public static incrementIndent(indentation: number, amount: number): number source
Increments the indentation amount.
public static indent(indentation: number, string: string): string source
Creates an indentation string given the indentation amount.
public static safeStringObject(string: string, object: object, accessor: string, newLine: number, appendString: string, tagFunction: function): string source
Provides a way to output a given string value with concatenated data from safely accessing an objects data /
entries given an accessor string which describes the entries to walk. To access deeper entries into the object
format the accessor string with .
between entries to walk.
Params:
Name | Type | Attribute | Description |
string | string | A string to prepend to the object data received. |
|
object | object | An object to access entry data. |
|
accessor | string | A string describing the entries to access. |
|
newLine | number | (Optional) A number of new line characters to append; default: |
|
appendString | string | (Optional) A string to potentially append; default: |
|
tagFunction | function | (Optional) A template tag function to apply; default: |
public static safeStringsObject(object: object, entries: string | SafeEntry | Array<string | SafeEntry>): string source
Provides a convenience method producing a block of safeStringObject
results.
Params:
Name | Type | Attribute | Description |
object | object | An object to access entry data. |
|
entries | string | SafeEntry | Array<string | SafeEntry> | Multiple arrays or strings. If an entry is not a SafeEntry it will
simply be appended. If the entry is an array then entries in this array
correspond to the following parameters which are forwarded onto
|
public static safeStringsPrependObject(origPrepend: *, object: object, entries: string | SafeEntry | Array<string | SafeEntry>): string source
Provides a convenience method producing a block of safeStringObject
results with the option to prepend a
given string.
Params:
Name | Type | Attribute | Description |
origPrepend | * | An additional value to prepend to all results. |
|
object | object | An object to access entry data. |
|
entries | string | SafeEntry | Array<string | SafeEntry> | Multiple arrays or strings. If an entry is not a SafeEntry it will
simply be appended. If the entry is an array then entries in this array
correspond to the following parameters which are forwarded onto
|