(value: unknown)
| 67 | const maxLogErrorLength = 500; |
| 68 | |
| 69 | const toLogString = (value: unknown): string | undefined => { |
| 70 | if (typeof value === 'string' && value.trim().length > 0) { |
| 71 | return value.slice(0, maxLogErrorLength); |
| 72 | } |
| 73 | |
| 74 | if (typeof value === 'number' || typeof value === 'boolean') { |
| 75 | return String(value); |
| 76 | } |
| 77 | |
| 78 | return undefined; |
| 79 | }; |
| 80 | |
| 81 | /** |
| 82 | * An error in a shape that survives `JSON.stringify`. `Error` keeps its |
no outgoing calls
no test coverage detected