Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: async/await #34

Merged
merged 4 commits into from Jan 4, 2020
Merged

refactor: async/await #34

merged 4 commits into from Jan 4, 2020

Conversation

curbengh
Copy link
Contributor

@curbengh curbengh commented Dec 22, 2019

Closes #31

BREAKING CHANGE: Drops Node 8
got v10 requires Node 10

@coveralls
Copy link

coveralls commented Dec 22, 2019

Coverage Status

Coverage decreased (-8.6%) to 91.379% when pulling 39d9baf on curbengh:async into 42468d5 on hexojs:master.

@curbengh
Copy link
Contributor Author

curbengh commented Dec 22, 2019

Unit test for alias option and atom feed to be done in another PR.
I haven't test this PR yet.

date: item.date,
tags: item.categories,
excerpt: tomd.turndown(item.description || ''),
content: tomd.turndown(item.content || item.description || '')
Copy link
Contributor Author

@curbengh curbengh Dec 22, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plan to implement a feature to request from the post's url if item.content is absent, in a separate PR.

}

if (feed) {
for (const item of feed.items) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the loop here can be utilized to limit new posts (#9), to do in future PR.

@curbengh
Copy link
Contributor Author

curbengh commented Jan 1, 2020

Tested with a dummy rss2.xml.

@curbengh curbengh requested a review from a team January 1, 2020 07:02
lib/migrator.js Outdated Show resolved Hide resolved
if (/^http(s)?:\/\//i.test(source)) {
stream = request(source);
input = await got(source, { resolveBodyOnly: true, retry: 0 });
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

retry is disabled to pass the unit test (in local machine with slow connection).
The got options can be exposed to config in a separate PR.

BREAKING CHANGE: Drops Node 8
- necessary to support got v10
Copy link
Member

@SukkaW SukkaW left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Native async/await
3 participants