-
-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add desktop google analytics ids, not wired in
- Loading branch information
Showing
9 changed files
with
193 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
<!-- Generated by documentation.js. Update this documentation by updating the source code. --> | ||
|
||
## utils/StringUtils | ||
|
||
Utilities functions related to string manipulation | ||
|
||
## format | ||
|
||
Format a string by replacing placeholder symbols with passed in arguments. | ||
|
||
Example: var formatted = StringUtils.format("Hello {0}", "World"); | ||
|
||
### Parameters | ||
|
||
* `str` **[string][1]** The base string | ||
|
||
Returns **[string][1]** Formatted string | ||
|
||
## getLines | ||
|
||
Splits the text by new line characters and returns an array of lines | ||
|
||
### Parameters | ||
|
||
* `text` **[string][1]** | ||
|
||
Returns **[Array][2]<[string][1]>** lines | ||
|
||
## offsetToLineNum | ||
|
||
Returns a line number corresponding to an offset in some text. The text can | ||
be specified as a single string or as an array of strings that correspond to | ||
the lines of the string. | ||
|
||
Specify the text in lines when repeatedly calling the function on the same | ||
text in a loop. Use getLines() to divide the text into lines, then repeatedly call | ||
this function to compute a line number from the offset. | ||
|
||
### Parameters | ||
|
||
* `textOrLines` **([string][1] | [Array][2]<[string][1]>)** string or array of lines from which | ||
to compute the line number from the offset | ||
* `offset` **[number][3]** | ||
|
||
Returns **[number][3]** line number | ||
|
||
## startsWith | ||
|
||
Returns true if the given string starts with the given prefix. | ||
|
||
### Parameters | ||
|
||
* `str` **[String][1]** | ||
* `prefix` **[String][1]** | ||
|
||
Returns **[Boolean][4]** | ||
|
||
## endsWith | ||
|
||
Returns true if the given string ends with the given suffix. | ||
|
||
### Parameters | ||
|
||
* `str` **[string][1]** | ||
* `suffix` **[string][1]** | ||
|
||
## breakableUrl | ||
|
||
Return an escaped path or URL string that can be broken near path separators. | ||
|
||
### Parameters | ||
|
||
* `url` **[string][1]** the path or URL to format | ||
|
||
Returns **[string][1]** the formatted path or URL | ||
|
||
## prettyPrintBytes | ||
|
||
Converts number of bytes into human readable format. | ||
If param bytes is negative it returns the number without any changes. | ||
|
||
### Parameters | ||
|
||
* `bytes` **[number][3]** Number of bytes to convert | ||
* `precision` **[number][3]** Number of digits after the decimal separator | ||
|
||
Returns **[string][1]** | ||
|
||
## truncate | ||
|
||
Truncate text to specified length. | ||
|
||
### Parameters | ||
|
||
* `str` **[string][1]** Text to be truncated. | ||
* `len` **[number][3]** Length to which text should be truncated | ||
|
||
Returns **[string][1]?** Returns truncated text only if it was changed | ||
|
||
## hashCode | ||
|
||
Computes a 32bit hash from the given string | ||
Taken from [http://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript-jquery][5] | ||
|
||
### Parameters | ||
|
||
* `str` **[string][1]** The string for which hash is to be computed | ||
|
||
Returns **[number][3]** The 32-bit hash | ||
|
||
## randomString | ||
|
||
Generates a random nonce string of the specified length. | ||
|
||
!!!Should not be used for crypto secure workflows.!!! | ||
|
||
### Parameters | ||
|
||
* `stringLength` **[number][3]** The length of the nonce in bytes. | ||
|
||
Returns **[string][1]** The randomly generated nonce. | ||
|
||
[1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String | ||
|
||
[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array | ||
|
||
[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number | ||
|
||
[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean | ||
|
||
[5]: http://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript-jquery |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters