Methods
(static) bin2Hex(bin) → {String}
Bin to hex, like 0x7F
- Source:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
bin | 
            
            
            
                
Buffer
            
             | 
            
            
            
Returns:
- Type:
 - 
        
String 
(static) camelCase(str) → {String}
Convert a string to camel case, 'fooBar'
- Source:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
str | 
            
            
            
                
String
            
             | 
            
            
            
Returns:
- Type:
 - 
        
String 
(static) compile(str, settingsopt) → {Template}
- Source:
 
Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
str | 
            
            
            
                
String
            
             | 
            
                ||
settings | 
            
            
            
                
Object
            
             | 
            
                
                
                    <optional> | 
            
            
            
                 Template settings, https://lodash.com/docs/4.17.15#template  | 
        
Returns:
- Type:
 - 
        
Template 
(static) dropIfEndsWith(str, ending) → {String}
Drop a right part of a string if it ends with ending
- Source:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
str | 
            
            
            
                
String
            
             | 
            
            
            |
ending | 
            
            
            
                
String
            
             | 
            
            
            
Returns:
- Type:
 - 
        
String 
(static) ensureEndsWith(str, ending) → {String}
Ensure a string ends with ending
- Source:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
str | 
            
            
            
                
String
            
             | 
            
            
            |
ending | 
            
            
            
                
String
            
             | 
            
            
            
Returns:
- Type:
 - 
        
String 
(static) ensureStartsWith(str, starting) → {String}
Ensure a string starts with starting
- Source:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
str | 
            
            
            
                
String
            
             | 
            
            
            |
starting | 
            
            
            
                
String
            
             | 
            
            
            
Returns:
- Type:
 - 
        
String 
(static) isQuoted(s) → {boolean}
Check a string if it is quoted with " or '
- Source:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
s | 
            
            
            
                
String
            
             | 
            
            
            
Returns:
- Type:
 - 
        
boolean 
(static) isWrappedWith(s, q) → {boolean}
Check a string if it is started and ended with a given sub-string
- Source:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
s | 
            
            
            
                
String
            
             | 
            
            
            
                 String to check  | 
        
q | 
            
            
            
                
String
            
             | 
            
            
            
                 Sub-srting  | 
        
Returns:
- Type:
 - 
        
boolean 
(static) kebabCase(str) → {String}
Convert a string to kebab case, 'foo-bar'
- Source:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
str | 
            
            
            
                
String
            
             | 
            
            
            
Returns:
- Type:
 - 
        
String 
(static) pascalCase(str) → {String}
Convert a string to pascal case, 'fooBar'
- Source:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
str | 
            
            
            
                
String
            
             | 
            
            
            
Returns:
- Type:
 - 
        
String 
(static) quote(str, quoteCharopt) → {String}
Quote a string.
Parameters:
| Name | Type | Attributes | Default | Description | 
|---|---|---|---|---|
str | 
            
            
            
                
String
            
             | 
            
                |||
quoteChar | 
            
            
            
                
String
            
             | 
            
                
                
                    <optional> | 
            
            
                ' | 
Returns:
- Type:
 - 
        
String 
(static) replaceAll(str, search, replacement)
Replace all occurance of "search" with "replacement" in a string. 3.5x faster than String.replaceAll
- Source:
 - See:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
str | 
            
            
            
                
String
            
             | 
            
            
            |
search | 
            
            
            
                
String
            
             | 
            
            
            |
replacement | 
            
            
            
                
String
            
             | 
            
            
            
(static) snakeCase(str) → {String}
Convert a string to snake case, 'foo_bar'
- Source:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
str | 
            
            
            
                
String
            
             | 
            
            
            
Returns:
- Type:
 - 
        
String 
(static) template(str, values, settingsopt) → {String}
Interpolate values
- Source:
 
Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
str | 
            
            
            
                
String
            
             | 
            
                ||
values | 
            
            
            
                
Object
            
             | 
            
                ||
settings | 
            
            
            
                
Object
            
             | 
            
                
                
                    <optional> | 
            
            
            
                 Template settings, https://lodash.com/docs/4.17.15#template  | 
        
Returns:
- Type:
 - 
        
String 
(static) unquote(str, unescapeopt, quoteSetopt) → {String}
Unquote a string
- Source:
 
Parameters:
| Name | Type | Attributes | Default | Description | 
|---|---|---|---|---|
str | 
            
            
            
                
String
            
             | 
            
                |||
unescape | 
            
            
            
                
boolean
            
             | 
            
                
                
                    <optional> | 
            
            
                false | 
                 True to unescape slashed quote, default false  | 
        
quoteSet | 
            
            
            
                
Set
|
Array
            
             | 
            
                
                
                    <optional> | 
            
            
                
                 Set of chars  | 
        
Returns:
- Type:
 - 
        
String 
(static) unwrap(str, startTokenopt, endTokenopt) → {String}
Unwrap a string
Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
str | 
            
            
            
                
String
            
             | 
            
                ||
startToken | 
            
            
            
                
String
            
             | 
            
                
                
                    <optional> | 
            
            
            
                 Start token, default "  | 
        
endToken | 
            
            
            
                
String
            
             | 
            
                
                
                    <optional> | 
            
            
            
                 End token, default "  | 
        
Returns:
- Type:
 - 
        
String 
(static) urlAppendQuery(url, query) → {String}
Merge the query parameters into given url.
- Source:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
url | 
            
            
            
                
String
            
             | 
            
            
            
                 Original url.  | 
        
query | 
            
            
            
                
Object
            
             | 
            
            
            
                 Key-value pairs query object to be merged into the url.  | 
        
Returns:
- Type:
 - 
        
String 
(static) urlJoin(base, extraPath, …more) → {String}
Join base url and the extra url path.
- Source:
 
Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
base | 
            
            
            
                
String
            
             | 
            
                ||
extraPath | 
            
            
            
                
String
            
             | 
            
                ||
more | 
            
            
            
                
any
            
             | 
            
                
                
                
                
                    <repeatable> | 
            
            
            
                 More path  | 
        
Returns:
- Type:
 - 
        
String 
(static) urlObjectToQueryString(obj) → {String}
Stringify an object into url query string.
- Source:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
obj | 
            
            
            
                
Object
            
             | 
            
            
            
Returns:
- Type:
 - 
        
String 
(static) urlQueryStringToObject(qs) → {Object}
Parse query string into key-value pairs.
- Source:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
qs | 
            
            
            
                
String
            
             | 
            
            
            
Returns:
- Type:
 - 
        
Object