glize/utils/string

Methods

(static) capitalize(str) → {string}

Transforms the first character of each word to uppercase; other characters are unaffected.
Source:
See:
Parameters:
Name Type Description
str string The string to be transformed.
Returns:
Type:
string
Returns a transformed string.

(static) hash(str) → {string}

Converts str to hashed string.
Source:
Parameters:
Name Type Description
str string The input string.
Returns:
Type:
string
Returns hashed string.

(static) toCamelCase(str) → {string}

Converts the passed string into a string with the separator denoted by the next word capitalized (aka lower camel case).
Source:
See:
Parameters:
Name Type Description
str string The input string.
Returns:
Type:
string
A string transformed into a string with the separator denoted by the next word capitalized.

(static) toKebabCase(str) → {string}

Converts the given string into a string with a single dash as a separator.
Source:
Parameters:
Name Type Description
str string The input string.
Returns:
Type:
string
Returns a transformed string.

(static) toPascalCase(str) → {string}

Converts the passed string into a string of capitalized words without separators (aka upper camel case).
Source:
See:
Parameters:
Name Type Description
str string The input string.
Returns:
Type:
string
A string transformed into a string of capitalized words without separators.

(static) toQueryString(objnon-null, prefixopt) → {string}

Converts obj to query string.
Source:
Parameters:
Name Type Attributes Description
obj Object The key-value pairs object.
prefix string <optional>
Optional query prefix.
Returns:
Type:
string
Returns query string or empty string if no parameters given.

(static) toSnakeCase(str) → {string}

Converts the given string into a string with a single underscore as a separator.
Source:
See:
Parameters:
Name Type Description
str string The input string.
Returns:
Type:
string
Returns a transformed string.

(static) uuid4() → {string}

Generates a pseudo random UUID (v4).
Source:
Returns:
Type:
string
Returns generated random UUID.