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

Method enableNetConnect

deps/undici/src/lib/mock/mock-agent.js:107–119  ·  view source on GitHub ↗
(matcher)

Source from the content-addressed store, hash-verified

105 }
106
107 enableNetConnect (matcher) {
108 if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) {
109 if (Array.isArray(this[kNetConnect])) {
110 this[kNetConnect].push(matcher)
111 } else {
112 this[kNetConnect] = [matcher]
113 }
114 } else if (typeof matcher === 'undefined') {
115 this[kNetConnect] = true
116 } else {
117 throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.')
118 }
119 }
120
121 disableNetConnect () {
122 this[kNetConnect] = false

Callers 2

whoami.jsFile · 0.80
tnockFunction · 0.80

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected