Home Reference Source
public class | source

common

Extends:

lib/utils.js~utils → common

Static Method Summary

Static Public Methods
public static

b64decode(str: string): *

public static

b64encode(str: string): *

public static

Escape special characters using HTML entities

public static

Remove HTML entities from string

public static

mergeHash(obj1: Object, obj2: Object): *

Merge two objects recursively

public static

Template string beautifier

public static

quote(s: *, html: boolean): *

Escape and quote a string

public static

Remove duplicate items from a list

public static

Remove quotes and escape sequence from string

Static Public Methods

public static b64decode(str: string): * source

Unicode safe b64 decoding https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#The_Unicode_Problem

Params:

NameTypeAttributeDescription
str string

Return:

*

public static b64encode(str: string): * source

Unicode safe b64 encoding https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#The_Unicode_Problem

Params:

NameTypeAttributeDescription
str string

Return:

*

public static htmlEscape(str: string): string source

Escape special characters using HTML entities

Params:

NameTypeAttributeDescription
str string

Return:

string

public static htmlUnescape(str: string): string source

Remove HTML entities from string

Params:

NameTypeAttributeDescription
str string

Return:

string

public static mergeHash(obj1: Object, obj2: Object): * source

Merge two objects recursively

Params:

NameTypeAttributeDescription
obj1 Object
obj2 Object

Return:

*

public static mockup(obj: Object): string source

Template string beautifier

Params:

NameTypeAttributeDescription
obj Object

Return:

string

public static quote(s: *, html: boolean): * source

Escape and quote a string

Params:

NameTypeAttributeDescription
s *

String to be quoted

html boolean

Identifies whether the string must be HTML safe

Return:

*

public static uniqueList(list: Array): Array source

Remove duplicate items from a list

Params:

NameTypeAttributeDescription
list Array

Return:

Array

public static unquote(s: string): string source

Remove quotes and escape sequence from string

Params:

NameTypeAttributeDescription
s string

Return:

string