getRef()function
getRef(str: string): string | undefined
| Param | Type | |
|---|---|---|
str | string | The string to convert. required |
| Return | |
|---|---|
string | undefined | The ref, or undefined if conversion resulted in an empty string. |
Convert a string to a unique ref e.g. abc123, or return undefined if conversion resulted in an empty string.
Examples
getRef("Hello World!") // "helloworld"