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

Function query

lib/internal/dns/callback_resolver.js:55–84  ·  view source on GitHub ↗
(name, /* options, */ callback)

Source from the content-addressed store, hash-verified

53
54function resolver(bindingName) {
55 function query(name, /* options, */ callback) {
56 let options;
57 if (arguments.length > 2) {
58 options = callback;
59 callback = arguments[2];
60 }
61
62 validateString(name, 'name');
63 validateFunction(callback, 'callback');
64
65 const req = new QueryReqWrap();
66 req.bindingName = bindingName;
67 req.callback = callback;
68 req.hostname = name;
69 req.oncomplete = onresolve;
70 req.ttl = !!(options?.ttl);
71 const err = this._handle[bindingName](req, name);
72 if (err) throw new DNSException(err, bindingName, name);
73 if (hasObserver('dns')) {
74 startPerf(req, kPerfHooksDnsLookupResolveContext, {
75 type: 'dns',
76 name: bindingName,
77 detail: {
78 host: name,
79 ttl: req.ttl,
80 },
81 });
82 }
83 return req;
84 }
85 ObjectDefineProperty(query, 'name', { __proto__: null, value: bindingName });
86 return query;
87}

Callers

nothing calls this directly

Calls 2

hasObserverFunction · 0.85
startPerfFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…