* Returns created identifier. * @param {string} str the string converted to identifier * @returns {string} created identifier
(str)
| 119 | * @returns {string} created identifier |
| 120 | */ |
| 121 | static toIdentifier(str) { |
| 122 | if (typeof str !== "string") return ""; |
| 123 | return str |
| 124 | .replace(IDENTIFIER_NAME_REPLACE_REGEX, "_$1") |
| 125 | .replace(IDENTIFIER_ALPHA_NUMERIC_NAME_REPLACE_REGEX, "_"); |
| 126 | } |
| 127 | |
| 128 | /** |
| 129 | * Returns a commented version of string. |
no test coverage detected