MCPcopy Index your code
hub / github.com/nodejs/node / once

Function once

lib/internal/util.js:575–585  ·  view source on GitHub ↗
(callback, { preserveReturnValue = false } = kEmptyObject)

Source from the content-addressed store, hash-verified

573}
574
575function once(callback, { preserveReturnValue = false } = kEmptyObject) {
576 let called = false;
577 let returnValue;
578 return function(...args) {
579 if (called) return returnValue;
580 called = true;
581 const result = ReflectApply(callback, this, args);
582 returnValue = preserveReturnValue ? result : undefined;
583 return result;
584 };
585}
586
587let validateUint32;
588

Callers 8

_connectWebsocketMethod · 0.50
runTestFileFunction · 0.50
restartTestFileFunction · 0.50
startFunction · 0.50
pipelineFunction · 0.50
eosFunction · 0.50
eosWebFunction · 0.50
getDirentsFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…