requireRef()function
requireRef(str: string, caller: AnyCaller = requireRef): string
| Param | Type | |
|---|---|---|
str | string | The string to convert. required |
caller | AnyCaller | Function to attribute a thrown error to (defaults to requireRef itself). Defaults to requireRef |
| Return | |
|---|---|
string | The ref. |
| Throws | |
|---|---|
RequiredError | If conversion resulted in an empty string. |
Convert a string to a unique ref e.g. abc123, or throw RequiredError if conversion resulted in an empty string.
Examples
requireRef("Hello World!") // "helloworld"