* Escape the property if it's not a valid JavaScript identifer * @param {string} name
(name)
| 168 | * @param {string} name |
| 169 | */ |
| 170 | function escapePropertyName(name) { |
| 171 | if (JS_KEYWORDS.includes(name) || !name.match(SAFE_IDENTIFER)) { |
| 172 | return printSpecObject(name); |
| 173 | } |
| 174 | return name; |
| 175 | } |
| 176 | |
| 177 | /** |
| 178 | * Escape a string to be used as a block comment |
no test coverage detected