jsdomain-parser 1.0.7 → 1.0.8

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.
@@ -9856,6 +9856,7 @@ const parseTld = (url, options = {}) => {
9856
9856
  }
9857
9857
  }
9858
9858
 
9859
+ // handle case where hostname is an IP address
9859
9860
  const isIP = /^\d{1,3}(\.\d{1,3}){3}$/.test(hostname);
9860
9861
 
9861
9862
  if (detected.length == 0 && !isIP) {
@@ -9930,7 +9931,7 @@ function parse(url, options = {}) {
9930
9931
  url: urlData,
9931
9932
  };
9932
9933
  } catch (e) {
9933
- throw new Error(`Invalid URL: ${e}`);
9934
+ throw new Error(`Invalid URL: ${e.message}`);
9934
9935
  }
9935
9936
  }
9936
9937