Skip to content

Commit

Permalink
build: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Aug 29, 2019
1 parent c5f8e37 commit cde658b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 24 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,20 @@
"request"
],
"dependencies": {
"@metascraper/helpers": "~5.6.1",
"@metascraper/helpers": "~5.6.6",
"cheerio": "~1.0.0-rc.3",
"debug": "~4.1.1",
"got": "~9.6.0",
"he": "~1.2.0",
"html-encode": "~2.1.1",
"lodash": "~4.17.11",
"mem": "~5.1.0",
"lodash": "~4.17.15",
"mem": "~5.1.1",
"mime-types": "~2.1.24",
"p-cancelable": "~2.0.0",
"reachable-url": "~1.2.0",
"reachable-url": "~1.2.1",
"require-one-of": "~1.0.11",
"time-span": "~3.1.0",
"tldts": "~5.3.0",
"tldts": "~5.4.0",
"top-sites": "~1.1.13",
"write-json-file": "~4.2.0"
},
Expand Down
8 changes: 5 additions & 3 deletions scripts/postinstall
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const { compact, reduce, findIndex } = require('lodash')
const writeJsonFile = require('write-json-file')
const topsites = require('top-sites')

const { getDomainWithoutSuffix } = require('../src/tlds')
const { getDomainWithoutSuffix } = require('tldts')

const domains = [
'facebook',
Expand Down Expand Up @@ -42,13 +42,15 @@ const domains = [
const { top, rest } = reduce(
domains,
(acc, domain) => {
const index = findIndex(topsites, ({ rootDomain }) => getDomainWithoutSuffix(rootDomain) === domain)
const index = findIndex(
topsites,
({ rootDomain }) => getDomainWithoutSuffix(rootDomain) === domain
)
if (index !== -1) acc.top[index] = domain
else acc.rest.push(domain)
return acc
},
{ top: new Array(topsites.length), rest: [] }

)

writeJsonFile('./src/auto-domains.json', compact(top).concat(rest))
Expand Down
9 changes: 5 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict'

const { isMediaUrl } = require('@metascraper/helpers')
const { getDomainWithoutSuffix } = require('tldts')
const requireOneOf = require('require-one-of')
const reachableUrl = require('reachable-url')
const PCancelable = require('p-cancelable')
Expand All @@ -11,7 +12,6 @@ const got = require('got')
const mem = require('mem')
const he = require('he')

const { getDomainWithoutSuffix } = require('./tlds')
const autoDomains = require('./auto-domains')
const addHtml = require('./html')

Expand Down Expand Up @@ -70,7 +70,10 @@ const fetch = (url, { toEncode, reflect = false, headers, ...opts }) =>
}
})

const prerender = async (url, { getBrowserless, toEncode, headers, gotOptions, ...opts }) => {
const prerender = async (
url,
{ getBrowserless, toEncode, headers, gotOptions, ...opts }
) => {
let fetchReq
let fetchDataProps = {}
let isFetchRejected = false
Expand Down Expand Up @@ -141,5 +144,3 @@ module.exports = async (
const { url, html, mode } = await getContent(targetUrl, reqMode, opts)
return { url, html, stats: { mode, timing: time() } }
}

module.exports.getDomainWithoutSuffix = getDomainWithoutSuffix
12 changes: 0 additions & 12 deletions src/tlds.js

This file was deleted.

0 comments on commit cde658b

Please sign in to comment.