MCPcopy
hub / github.com/processing/p5.js / _descriptionText

Function _descriptionText

src/accessibility/describe.js:293–309  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

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()

Callers 1

describeFunction · 0.85

Calls

no outgoing calls

Tested by 1

describeFunction · 0.68