tldts-experimental 7.3.1 → 7.4.0
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/dist/cjs/index.js +9 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/es6/index.js +8 -0
- package/dist/es6/index.js.map +1 -1
- package/dist/es6/tsconfig.bundle.tsbuildinfo +1 -1
- package/dist/index.cjs.min.js +1 -1
- package/dist/index.cjs.min.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.esm.min.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/index.ts +12 -0
- package/package.json +4 -4
package/dist/cjs/index.js
CHANGED
|
@@ -1193,6 +1193,14 @@ function getDomain(url, options) {
|
|
|
1193
1193
|
/*@__INLINE__*/ resetResult(RESULT);
|
|
1194
1194
|
return parseImpl(url, 3 /* FLAG.DOMAIN */, suffixLookup, options, RESULT).domain;
|
|
1195
1195
|
}
|
|
1196
|
+
function getFullDomain(url, options) {
|
|
1197
|
+
/*@__INLINE__*/ resetResult(RESULT);
|
|
1198
|
+
const result = parseImpl(url, 3 /* FLAG.DOMAIN */, suffixLookup, options, RESULT);
|
|
1199
|
+
// The hostname *is* the full domain (subdomain + domain) whenever a
|
|
1200
|
+
// registrable domain exists; gate on `domain` so non-registrable inputs
|
|
1201
|
+
// (IPs, suffix-less or invalid hostnames) return `null` like `getDomain`.
|
|
1202
|
+
return result.domain === null ? null : result.hostname;
|
|
1203
|
+
}
|
|
1196
1204
|
function getSubdomain(url, options) {
|
|
1197
1205
|
/*@__INLINE__*/ resetResult(RESULT);
|
|
1198
1206
|
return parseImpl(url, 4 /* FLAG.SUB_DOMAIN */, suffixLookup, options, RESULT)
|
|
@@ -1206,6 +1214,7 @@ function getDomainWithoutSuffix(url, options) {
|
|
|
1206
1214
|
|
|
1207
1215
|
exports.getDomain = getDomain;
|
|
1208
1216
|
exports.getDomainWithoutSuffix = getDomainWithoutSuffix;
|
|
1217
|
+
exports.getFullDomain = getFullDomain;
|
|
1209
1218
|
exports.getHostname = getHostname;
|
|
1210
1219
|
exports.getPublicSuffix = getPublicSuffix;
|
|
1211
1220
|
exports.getSubdomain = getSubdomain;
|