MCPcopy Create free account
hub / github.com/nodejs/node / onlookup

Function onlookup

lib/internal/dns/promises.js:86–97  ·  view source on GitHub ↗
(err, addresses)

Source from the content-addressed store, hash-verified

84} = require('internal/perf/observe');
85
86function onlookup(err, addresses) {
87 if (err) {
88 this.reject(new DNSException(err, 'getaddrinfo', this.hostname));
89 return;
90 }
91
92 const family = this.family || isIP(addresses[0]);
93 this.resolve({ address: addresses[0], family });
94 if (this[kPerfHooksDnsLookupContext] && hasObserver('dns')) {
95 stopPerf(this, kPerfHooksDnsLookupContext, { detail: { addresses } });
96 }
97}
98
99function onlookupall(err, addresses) {
100 if (err) {

Callers

nothing calls this directly

Calls 5

isIPFunction · 0.85
hasObserverFunction · 0.85
stopPerfFunction · 0.85
rejectMethod · 0.80
resolveMethod · 0.45

Tested by

no test coverage detected