Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Update dependencies #142

Merged
merged 7 commits into from
May 6, 2019
Merged

Update dependencies #142

merged 7 commits into from
May 6, 2019

Conversation

honzajavorek
Copy link
Contributor

@honzajavorek honzajavorek commented May 2, 2019

Parked until @artem-zakharchenko drops Node 6 here. Closes #125.

When updating media-typer, I had to do something similar to this apiaryio/api-elements.js#205. I did not upgrade Cucumber as it proved to be a rabbit hole - documented under #116.

@artem-zakharchenko
Copy link
Contributor

Dropping of NodeJS version 6 covered in #143

@honzajavorek
Copy link
Contributor Author

@artem-zakharchenko Please look at the changes I made because of media-typer, whether they make sense to you. Thanks 🙏

(parsed.type === 'application' && parsed.subtype === 'json')
|| parsed.suffix === 'json'
);
} catch (e) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We shouldn't silence an error. Can we log it to console?

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 error gets thrown in case the value is not a valid media type. The only reponsibility of the function is to assess whether the value is JSON-related or not, so I think this is a valid approach.

The contentType value is basically a user input, it can be any kind of rubbish, and it is not Gavel's problem if it's invalid media type as far as it matches real/expected response.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added an explanatory comment in 519965b so it doesn't trigger a red flag when someone reads it


return isJson;
try {
const { type } = contentTypeModule.parse(`${contentType}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

The only thing that troubles me is too many things sharing what seems the same namespace.
Perhaps, contentType argument is not really a proper content type? Or a rawContentType..?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, you're right basically I just hotfixed it. I'll try to make it nicer :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I renamed the variables in 519965b

@honzajavorek honzajavorek merged commit 01cf9da into master May 6, 2019
@honzajavorek honzajavorek deleted the honzajavorek/update-deps branch May 6, 2019 12:30
@ApiaryBot
Copy link
Collaborator

🎉 This PR is included in version 3.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

Update all dependencies
3 participants