MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / sparseArchive

Function sparseArchive

__tests__/resolution-file-read.test.ts:34–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

32 });
33
34 function sparseArchive(): string {
35 const relative = 'node_modules/example/react_native_openharmony.har';
36 const archive = path.join(root, relative);
37 fs.mkdirSync(path.dirname(archive), { recursive: true });
38 const fd = fs.openSync(archive, 'w');
39 try {
40 fs.writeSync(fd, Buffer.from([0x1f, 0x8b]));
41 fs.ftruncateSync(fd, 2 * 1024 * 1024);
42 } finally {
43 fs.closeSync(fd);
44 }
45 return relative;
46 }
47
48 it('reads normal source files', () => {
49 fs.writeFileSync(path.join(root, 'small.ts'), 'export const answer = 42;\n');

Callers 1

Calls 3

fromMethod · 0.80
joinMethod · 0.45
openSyncMethod · 0.45

Tested by

no test coverage detected