From cf5b9ad12527a65df8f6fe523ad767474cad98ec Mon Sep 17 00:00:00 2001 From: Leo Lamprecht Date: Mon, 12 Dec 2016 18:31:29 +0100 Subject: [PATCH] Replace publicsuffixlist with psl --- lib/alias.js | 7 ++----- package.json | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/alias.js b/lib/alias.js index c4ba92f..29c9034 100644 --- a/lib/alias.js +++ b/lib/alias.js @@ -1,5 +1,5 @@ // Packages -import PublicSuffixList from 'publicsuffixlist' +import publicSuffixList from 'psl' import chalk from 'chalk' // Ours @@ -10,9 +10,6 @@ import {DOMAIN_VERIFICATION_ERROR} from './errors' import Now from './' const domainRegex = /^((?=[a-z0-9-]{1,63}\.)(xn--)?[a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,63}$/ -const psl = new PublicSuffixList() - -psl.initializeSync() export default class Alias extends Now { @@ -125,7 +122,7 @@ export default class Alias extends Now { console.log(`> ${chalk.bold(chalk.underline(alias))} is a custom domain.`) console.log(`> Verifying the DNS settings for ${chalk.bold(chalk.underline(alias))} (see ${chalk.underline('https://zeit.world')} for help)`) - const _domain = psl.domain(alias) + const _domain = publicSuffixList.parse(alias).domain const _domainInfo = await this.getDomain(_domain) const domainInfo = _domainInfo && !_domainInfo.error ? _domainInfo : undefined const {domain, nameservers} = domainInfo ? {domain: _domain} : await this.getNameservers(alias) diff --git a/package.json b/package.json index 1601276..1c51437 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "node-fetch": "1.6.3", "node-version": "1.0.0", "progress": "1.1.8", - "publicsuffixlist": "0.2.71", + "psl": "1.1.15", "resumer": "0.0.0", "semver-compare": "1.0.0", "socket.io-client": "1.7.1",