| 291 | |
| 292 | // check that text is not LABEL or FALLBACK and ensure text ends with punctuation mark |
| 293 | function _descriptionText(text) { |
| 294 | if (text === 'label' || text === 'fallback') { |
| 295 | throw new Error('description should not be LABEL or FALLBACK'); |
| 296 | } |
| 297 | //if string does not end with '.' |
| 298 | if ( |
| 299 | !text.endsWith('.') && |
| 300 | !text.endsWith(';') && |
| 301 | !text.endsWith(',') && |
| 302 | !text.endsWith('?') && |
| 303 | !text.endsWith('!') |
| 304 | ) { |
| 305 | //add '.' to the end of string |
| 306 | text = text + '.'; |
| 307 | } |
| 308 | return text; |
| 309 | } |
| 310 | |
| 311 | /* |
| 312 | * Helper functions for describe() |