@volter/browser-substrate 0.1.112 → 0.1.113

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18016,11 +18016,25 @@ function nodeLibBinding(name) {
18016
18016
  });
18017
18017
  return __table$1[name];
18018
18018
  }
18019
+ function literalFamily(hostname2) {
18020
+ const bare = hostname2.startsWith("[") && hostname2.endsWith("]") ? hostname2.slice(1, -1) : hostname2;
18021
+ if (/^(25[0-5]|2[0-4]\d|1?\d?\d)(\.(25[0-5]|2[0-4]\d|1?\d?\d)){3}$/.test(bare)) return 4;
18022
+ const host = bare.split("%")[0];
18023
+ if (host.includes(":") && /^[0-9a-fA-F:.]+$/.test(host)) return 6;
18024
+ return 0;
18025
+ }
18019
18026
  function lookup(hostname2, optionsOrCallback, callback) {
18020
18027
  const cb2 = typeof optionsOrCallback === "function" ? optionsOrCallback : callback;
18021
18028
  const options = typeof optionsOrCallback === "object" ? optionsOrCallback : {};
18022
18029
  setImmediate(() => {
18023
- if (hostname2 === "localhost" || hostname2 === "127.0.0.1") {
18030
+ const family = literalFamily(hostname2);
18031
+ if (family) {
18032
+ const address = hostname2.startsWith("[") && hostname2.endsWith("]") ? hostname2.slice(1, -1) : hostname2;
18033
+ if (options.all) cb2(null, [{ address, family }]);
18034
+ else cb2(null, address, family);
18035
+ return;
18036
+ }
18037
+ if (hostname2 === "localhost") {
18024
18038
  if (options.all) {
18025
18039
  cb2(null, [{ address: "127.0.0.1", family: 4 }]);
18026
18040
  } else {