| 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 |