MCPcopy Index your code
hub / github.com/angular/angular / shorten

Function shorten

packages/core/src/hydration/error_handling.ts:486–492  ·  view source on GitHub ↗

* Reduces a string down to a maximum length of characters with ellipsis for readability * * @param input a string input * @param maxLength a maximum length in characters * @returns string

(input: string | null, maxLength = 50)

Source from the content-addressed store, hash-verified

484 * @returns string
485 */
486function shorten(input: string | null, maxLength = 50): string {
487 if (!input) {
488 return '';
489 }
490 input = stripNewlines(input);
491 return input.length > maxLength ? `${input.substring(0, maxLength - 1)}…` : input;
492}

Callers 4

stringifyTNodeAttrsFunction · 0.85
stringifyRNodeAttrsFunction · 0.85
describeRNodeFunction · 0.85
shortRNodeDescriptionFunction · 0.85

Calls 1

stripNewlinesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…