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.
package/README.md CHANGED
@@ -16,12 +16,16 @@ JS Domain Parser is a lightweight JavaScript library designed to parse and extra
16
16
  npm install jsdomain-parser
17
17
  ```
18
18
 
19
- Or include it directly in your project:
19
+ ---
20
+
21
+ or you can include `jsdomain-parser` directly in your project by adding the following `<script>` tag to your HTML file:
20
22
 
21
23
  ```html
22
- <script src="./dist/jsdomain-parser.min.js"></script>
24
+ <script src="./dist/jsdomain-parser.umd.min.js"></script>
23
25
  ```
24
26
 
27
+ This will expose the `jsDomainParser` global object in the browser.
28
+
25
29
  ## Usage
26
30
 
27
31
  ### Example 1: Basic Parsing
@@ -9860,6 +9860,7 @@ const parseTld = (url, options = {}) => {
9860
9860
  }
9861
9861
  }
9862
9862
 
9863
+ // handle case where hostname is an IP address
9863
9864
  const isIP = /^\d{1,3}(\.\d{1,3}){3}$/.test(hostname);
9864
9865
 
9865
9866
  if (detected.length == 0 && !isIP) {
@@ -9934,7 +9935,7 @@ function parse(url, options = {}) {
9934
9935
  url: urlData,
9935
9936
  };
9936
9937
  } catch (e) {
9937
- throw new Error(`Invalid URL: ${e}`);
9938
+ throw new Error(`Invalid URL: ${e.message}`);
9938
9939
  }
9939
9940
  }
9940
9941