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

Function once

test/parallel/test-http-max-http-headers.js:16–24  ·  view source on GitHub ↗
(cb)

Source from the content-addressed store, hash-verified

14// Verify that we cannot receive more than 16KB of headers.
15
16function once(cb) {
17 let called = false;
18 return () => {
19 if (!called) {
20 called = true;
21 cb();
22 }
23 };
24}
25
26function finished(client, callback) {
27 ['abort', 'error', 'end'].forEach((e) => {

Calls 1

cbFunction · 0.70

Tested by 5

testFunction · 0.56
testFunction · 0.56
testFunction · 0.56
testFunction · 0.56
testFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…