MCPcopy Create free account
hub / github.com/OpenHands/OpenHands / once

Function once

scripts/proxy-utils.mjs:38–45  ·  view source on GitHub ↗
(fn)

Source from the content-addressed store, hash-verified

36}
37
38function once(fn) {
39 let called = false;
40 return (...args) => {
41 if (called) return;
42 called = true;
43 fn(...args);
44 };
45}
46
47function writeProxyError(res, message) {
48 if (res.destroyed) return;

Callers 7

proxyHttpFunction · 0.85
proxyWebSocketFunction · 0.85
dev-safe.test.tsFile · 0.85
stopChildFunction · 0.85
ingress.test.tsFile · 0.85

Calls

no outgoing calls

Tested by 1

stopChildFunction · 0.68