Browse Source

Replace publicsuffixlist with psl

master
Leo Lamprecht 8 years ago
parent
commit
cf5b9ad125
No known key found for this signature in database GPG Key ID: B08517883D5E0E10
  1. 7
      lib/alias.js
  2. 2
      package.json

7
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)

2
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",

Loading…
Cancel
Save