MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / makeStat

Function makeStat

packages/cli/src/utils/renderArgs.test.ts:38–48  ·  view source on GitHub ↗

* Build a stat adapter from a path → kind map. Throws ENOENT for any * path not in the map, matching `statSync` behaviour.

(entries: Record<string, "file" | "directory">)

Source from the content-addressed store, hash-verified

36 * path not in the map, matching `statSync` behaviour.
37 */
38function makeStat(entries: Record<string, "file" | "directory">): (path: string) => Stats {
39 return (path) => {
40 const kind = entries[path];
41 if (!kind) {
42 const err = new Error(`ENOENT: no such file or directory, stat '${path}'`);
43 (err as NodeJS.ErrnoException).code = "ENOENT";
44 throw err;
45 }
46 return fakeStats(kind);
47 };
48}
49
50describe("parseBrowserTimeoutMsArg", () => {
51 it("returns undefined when the flag is absent", () => {

Callers 1

renderArgs.test.tsFile · 0.85

Calls 1

fakeStatsFunction · 0.85

Tested by

no test coverage detected