Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
3e3b61cc73 | |||
ecb009dedb | |||
6e8beac2dd | |||
9160a1bd56 |
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartwhois",
|
"name": "@pushrocks/smartwhois",
|
||||||
"version": "1.0.2",
|
"version": "1.0.4",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "a package for dealing with whois requests",
|
"description": "a package for dealing with whois requests",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
|
@ -13,4 +13,10 @@ tap.test('should get whois info for domain', async () => {
|
|||||||
console.log(whoisInfo);
|
console.log(whoisInfo);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
tap.test('should check for a valid tld', async () => {
|
||||||
|
const comIsValid = await testSmartWhois.isValidTld('.com');
|
||||||
|
console.log(comIsValid);
|
||||||
|
expect(comIsValid).toBeTrue();
|
||||||
|
})
|
||||||
|
|
||||||
tap.start();
|
tap.start();
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@pushrocks/smartwhois',
|
name: '@pushrocks/smartwhois',
|
||||||
version: '1.0.2',
|
version: '1.0.4',
|
||||||
description: 'a package for dealing with whois requests'
|
description: 'a package for dealing with whois requests'
|
||||||
}
|
}
|
||||||
|
@ -21,5 +21,13 @@ export class SmartWhois {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async isValidTld(tldArg: string): Promise<boolean> {
|
||||||
|
const allTlds = await plugins.whoiser.allTlds();
|
||||||
|
const sanatizedTld = tldArg.startsWith('.')
|
||||||
|
? tldArg.replace('.', '').toUpperCase()
|
||||||
|
: tldArg.toUpperCase();
|
||||||
|
return allTlds.includes(sanatizedTld);
|
||||||
|
}
|
||||||
|
|
||||||
public async getWhoisForIp(ipArg: string) {}
|
public async getWhoisForIp(ipArg: string) {}
|
||||||
}
|
}
|
Reference in New Issue
Block a user