MCPcopy
hub / github.com/Kong/insomnia / getInsomniaFileName

Function getInsomniaFileName

packages/insomnia/src/sync/git/git-vcs.ts:106–118  ·  view source on GitHub ↗
(blob: void | Uint8Array | undefined)

Source from the content-addressed store, hash-verified

104export const GIT_INSOMNIA_DIR = path.join(GIT_CLONE_DIR, GIT_INSOMNIA_DIR_NAME); // .insomnia
105
106function 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
120interface BaseOpts {
121 dir: string;

Callers 1

filesStatusMethod · 0.85

Calls 2

parseFunction · 0.85
toStringMethod · 0.45

Tested by

no test coverage detected