(blob: void | Uint8Array | undefined)
| 104 | export const GIT_INSOMNIA_DIR = path.join(GIT_CLONE_DIR, GIT_INSOMNIA_DIR_NAME); // .insomnia |
| 105 | |
| 106 | function getInsomniaFileName(blob: void | Uint8Array | undefined): string { |
| 107 | if (!blob) { |
| 108 | return ''; |
| 109 | } |
| 110 | |
| 111 | try { |
| 112 | const parsed = parse(Buffer.from(blob).toString('utf8')); |
| 113 | return parsed?.fileName || parsed?.name || ''; |
| 114 | } catch { |
| 115 | // If the document couldn't be parsed as yaml return an empty string |
| 116 | return ''; |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | interface BaseOpts { |
| 121 | dir: string; |
no test coverage detected