MCPcopy Index your code
hub / github.com/nodejs/node / cleanText

Function cleanText

test/fixtures/snapshot/typescript.js:141587–141596  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

141585 }
141586 }
141587 function cleanText(text) {
141588 // Truncate to maximum amount of characters as we don't want to do a big replace operation.
141589 text = text.length > maxLength ? text.substring(0, maxLength) + "..." : text;
141590 // Replaces ECMAScript line terminators and removes the trailing `\` from each line:
141591 // \n - Line Feed
141592 // \r - Carriage Return
141593 // \u2028 - Line separator
141594 // \u2029 - Paragraph separator
141595 return text.replace(/\\?(\r?\n|\r|\u2028|\u2029)/g, "");
141596 }
141597 })(NavigationBar = ts.NavigationBar || (ts.NavigationBar = {}));
141598})(ts || (ts = {}));
141599/* @internal */

Callers 3

nodeTextFunction · 0.85
getItemNameFunction · 0.85
getFunctionOrClassNameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected