(err: unknown)
| 1695 | } |
| 1696 | |
| 1697 | export const getErrorString = (err: unknown) => { |
| 1698 | if (!err) { |
| 1699 | return undefined |
| 1700 | } |
| 1701 | if (typeof err === 'string') { |
| 1702 | return err // works, `e` narrowed to string |
| 1703 | } else if (err instanceof Error) { |
| 1704 | return err.message // works, `e` narrowed to Error |
| 1705 | } |
| 1706 | } |
| 1707 | |
| 1708 | export function truncateString(field: string, truncateSizeInBytes: number): string { |
| 1709 | try { |
no outgoing calls
no test coverage detected
searching dependent graphs…