2017-12-14 06:48:32 +00:00
|
|
|
//const tldEnum = require('tld-enum');
|
|
|
|
const tldEnum = require('../formats/js/tld-enum');
|
|
|
|
|
|
|
|
console.log("There are " + tldEnum.tldList.length + " IANA TLDs");
|
|
|
|
|
|
|
|
let tldCheck;
|
|
|
|
|
|
|
|
tldCheck = "com";
|
|
|
|
console.log("Is '" + tldCheck + "' a real TLD?");
|
2017-12-14 07:07:52 +00:00
|
|
|
if (tldEnum.tldList.indexOf(tldCheck.toLowerCase()) != -1) {
|
2017-12-14 06:48:32 +00:00
|
|
|
console.log(" yes");
|
|
|
|
} else {
|
|
|
|
console.log(" no");
|
|
|
|
}
|
|
|
|
|
|
|
|
tldCheck = "somethingWeird";
|
|
|
|
console.log("Is '" + tldCheck + "' a real TLD?");
|
2017-12-14 07:07:52 +00:00
|
|
|
if (tldEnum.tldList.indexOf(tldCheck.toLowerCase()) != -1) {
|
2017-12-14 06:48:32 +00:00
|
|
|
console.log(" yes");
|
|
|
|
} else {
|
|
|
|
console.log(" no");
|
|
|
|
}
|