MCPcopy Create free account
hub / github.com/Snapchat/Valdi / create

Function create

valdi/vscode_debugger/src/common/hash/index.ts:20–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18});
19
20const create = () => {
21 if (instance) {
22 return instance;
23 }
24
25 instance = fork(join(__dirname, 'hash.bundle.js'), [], { env: {}, silent: true, execArgv: [] });
26 instance.setMaxListeners(Infinity);
27 instance.addListener('message', raw => {
28 const msg = raw as HashResponse<HashRequest>;
29 const deferred = deferredMap[msg.id];
30 delete deferredMap[msg.id];
31 deferred?.resolve(msg);
32 });
33
34 return instance;
35};
36
37const send = <T extends HashRequest>(req: T): Promise<HashResponse<T>> => {
38 const cp = create();

Callers 15

sendFunction · 0.70
startThreadMethod · 0.50
chunk-vendors.jsFile · 0.50
TESTFunction · 0.50
RuntimeWrapperMethod · 0.50
TESTMethod · 0.50
RequestManagerMockMethod · 0.50
runParallelFunction · 0.50
RuntimeWrapperMethod · 0.50
TESTFunction · 0.50

Calls 2

addListenerMethod · 0.65
resolveMethod · 0.65

Tested by 15

TESTFunction · 0.40
RuntimeWrapperMethod · 0.40
TESTMethod · 0.40
RequestManagerMockMethod · 0.40
runParallelFunction · 0.40
RuntimeWrapperMethod · 0.40
TESTFunction · 0.40
TESTFunction · 0.40
TESTFunction · 0.40
TEST_FFunction · 0.40