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

Feature/encoder decoder #160

Merged
merged 2 commits into from
May 8, 2016

Conversation

martinheidegger
Copy link
Contributor

@martinheidegger martinheidegger commented May 6, 2016

This PR adds a decoder and encoder option for querystrings. These option are important when dealing with servers that process data in a form other than utf8. Namely when trying to send a request to Servers that use shift_jis as method this is an important feature.

Note: I choose to add an option instead of re-using the encode option to only require semver-minor. Also I bumped the limit for the linting because I couldn't figure out how to push this change more elegantly.

@@ -1,4 +1,6 @@
language: node_js
env:
- CXX=g++-4.8
Copy link
Owner

Choose a reason for hiding this comment

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

is this just needed for the iconv dev dep?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes.

@ljharb
Copy link
Owner

ljharb commented May 6, 2016

This looks great! (pending comments) bumping the linter complexity requirements are fine for this.

@martinheidegger
Copy link
Contributor Author

Re-pushed squashed commits that use iconv-lite instead of iconv for tests (non-binary) and added error messages in case decoder or encoder is a non-function value.

});

t.test('throws error with wrong decoder', function (st) {
try {
Copy link
Owner

Choose a reason for hiding this comment

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

instead of try/catch, you can use t.throws(function () { … }, new TypeError('Decoder has to be a function.')) here

@martinheidegger
Copy link
Contributor Author

Pushed squashed commits that changed Error → TypeError and used st.throws instead of an try catch.

@ljharb ljharb modified the milestone: 6.2.0 May 8, 2016
@ljharb ljharb merged commit f91a1e5 into ljharb:master May 8, 2016
@martinheidegger martinheidegger deleted the feature/encoder-decoder branch May 8, 2016 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants