(origin, opts, cb)
| 11924 | return function Intercept(opts, handler) { |
| 11925 | const { dumpMaxSize = defaultMaxSize } = opts; |
| 11926 | const dumpHandler = new DumpHandler( |
| 11927 | { maxSize: dumpMaxSize }, |
| 11928 | handler |
| 11929 | ); |
| 11930 | return dispatch(opts, dumpHandler); |
| 11931 | }; |
| 11932 | }; |
| 11933 | } |
| 11934 | module.exports = createDumpInterceptor; |
| 11935 | } |
| 11936 | }); |
| 11937 | |
| 11938 | // |
| 11939 | var require_dns = __commonJS({ |
| 11940 | ""(exports, module) { |
| 11941 | "use strict"; |
| 11942 | var { isIP } = __require("net"); |
| 11943 | var { lookup } = __require("dns"); |
| 11944 | var DecoratorHandler = require_decorator_handler(); |
| 11945 | var { InvalidArgumentError, InformationalError } = require_errors(); |
| 11946 | var maxInt = Math.pow(2, 31) - 1; |
| 11947 | var _maxTTL, _maxItems, _records, _defaultLookup, defaultLookup_fn, _defaultPick, defaultPick_fn; |
| 11948 | var DNSInstance = class { |
| 11949 | constructor(opts) { |
| 11950 | __privateAdd(this, _defaultLookup); |
| 11951 | __privateAdd(this, _defaultPick); |
| 11952 | __privateAdd(this, _maxTTL, 0); |
| 11953 | __privateAdd(this, _maxItems, 0); |
| 11954 | __privateAdd(this, _records, /* @__PURE__ */ new Map()); |
| 11955 | __publicField(this, "dualStack", true); |
| 11956 | __publicField(this, "affinity", null); |
| 11957 | __publicField(this, "lookup", null); |
| 11958 | __publicField(this, "pick", null); |
| 11959 | var _a, _b; |
| 11960 | __privateSet(this, _maxTTL, opts.maxTTL); |
| 11961 | __privateSet(this, _maxItems, opts.maxItems); |
| 11962 | this.dualStack = opts.dualStack; |
| 11963 | this.affinity = opts.affinity; |
| 11964 | this.lookup = (_a = opts.lookup) != null ? _a : __privateMethod(this, _defaultLookup, defaultLookup_fn); |
| 11965 | this.pick = (_b = opts.pick) != null ? _b : __privateMethod(this, _defaultPick, defaultPick_fn); |
| 11966 | } |
| 11967 | get full() { |
| 11968 | return __privateGet(this, _records).size === __privateGet(this, _maxItems); |
| 11969 | } |
| 11970 | runLookup(origin, opts, cb) { |
| 11971 | const ips = __privateGet(this, _records).get(origin.hostname); |
| 11972 | if (ips == null && this.full) { |
| 11973 | cb(null, origin.origin); |
| 11974 | return; |
| 11975 | } |
| 11976 | const newOpts = __spreadProps(__spreadValues({ |
| 11977 | affinity: this.affinity, |
| 11978 | dualStack: this.dualStack, |
| 11979 | lookup: this.lookup, |
| 11980 | pick: this.pick |
| 11981 | }, opts.dns), { |
| 11982 | maxTTL: __privateGet(this, _maxTTL), |
| 11983 | maxItems: __privateGet(this, _maxItems) |
no test coverage detected