( string: string, length: number = MAX_PREVIEW_STRING_LENGTH, )
| 914 | const MAX_PREVIEW_STRING_LENGTH = 50; |
| 915 | |
| 916 | function truncateForDisplay( |
| 917 | string: string, |
| 918 | length: number = MAX_PREVIEW_STRING_LENGTH, |
| 919 | ) { |
| 920 | if (string.length > length) { |
| 921 | return string.slice(0, length) + '…'; |
| 922 | } else { |
| 923 | return string; |
| 924 | } |
| 925 | } |
| 926 | |
| 927 | // Attempts to mimic Chrome's inline preview for values. |
| 928 | // For example, the following value... |
no outgoing calls
no test coverage detected