Skip to content

Commit d63fcc8

Browse files
committed
Remove lazy intializer
code is sync
1 parent 9d3745b commit d63fcc8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/metascraper/src/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ const loadHTML = require('./load-html')
99
const getData = require('./get-data')
1010

1111
module.exports = rules => {
12-
const lazyloader = loadRules(rules)
12+
const loadedRules = loadRules(rules)
1313
return async ({ url, html, rules: inlineRules } = {}) => {
14-
const loadedRules = await lazyloader
1514
if (!isUrl(url)) throw new TypeError('You need to provide a valid url.')
16-
if (isEmpty(html)) { throw new TypeError('You need to provide a valid HTML markup.') }
15+
if (isEmpty(html)) {
16+
throw new TypeError('You need to provide a valid HTML markup.')
17+
}
1718
return getData({
1819
url,
1920
htmlDom: loadHTML(html),

0 commit comments

Comments
 (0)