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 +6 -2
- package/dist/jsdomain-parser.cjs.js +2 -1
- package/dist/jsdomain-parser.cjs.min.js +1 -1
- package/dist/jsdomain-parser.esm.js +2 -1
- package/dist/jsdomain-parser.esm.min.js +1 -1
- package/dist/{jsdomain-parser.js → jsdomain-parser.umd.js} +8 -6
- package/dist/jsdomain-parser.umd.min.js +1 -0
- package/example/example.html +3 -3
- package/package.json +1 -1
- package/rollup.config.js +7 -7
- package/dist/jsdomain-parser.min.js +0 -1
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
'
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.jsDomainParser = {}));
|
|
5
|
+
})(this, (function (exports) { 'use strict';
|
|
3
6
|
|
|
4
7
|
const parseUrl = (url) => {
|
|
5
8
|
if (!url) throw new Error("Invalid domain name");
|
|
@@ -9859,6 +9862,7 @@ var DomainParser = (function (exports) {
|
|
|
9859
9862
|
}
|
|
9860
9863
|
}
|
|
9861
9864
|
|
|
9865
|
+
// handle case where hostname is an IP address
|
|
9862
9866
|
const isIP = /^\d{1,3}(\.\d{1,3}){3}$/.test(hostname);
|
|
9863
9867
|
|
|
9864
9868
|
if (detected.length == 0 && !isIP) {
|
|
@@ -9933,7 +9937,7 @@ var DomainParser = (function (exports) {
|
|
|
9933
9937
|
url: urlData,
|
|
9934
9938
|
};
|
|
9935
9939
|
} catch (e) {
|
|
9936
|
-
throw new Error(`Invalid URL: ${e}`);
|
|
9940
|
+
throw new Error(`Invalid URL: ${e.message}`);
|
|
9937
9941
|
}
|
|
9938
9942
|
}
|
|
9939
9943
|
|
|
@@ -9949,6 +9953,4 @@ var DomainParser = (function (exports) {
|
|
|
9949
9953
|
|
|
9950
9954
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
9951
9955
|
|
|
9952
|
-
|
|
9953
|
-
|
|
9954
|
-
})({});
|
|
9956
|
+
}));
|