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

Add optional support for jsonReviver #1299

Merged
merged 2 commits into from Dec 9, 2014
Merged

Add optional support for jsonReviver #1299

merged 2 commits into from Dec 9, 2014

Conversation

poislagarde
Copy link
Contributor

Allows the use of a reviver function when parsing the response body as JSON

Allows the use of a reviver function when parsing the response body as JSON
@nylen
Copy link
Member

nylen commented Dec 8, 2014

Thanks for including tests.

What is a potential use case for this change?

Can we get jsonReviver documented on a separate line to make it clearer? How about this text?

`jsonReviver` - a [reviver function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) that will be passed to `JSON.parse()` when parsing a JSON response body.

@poislagarde
Copy link
Contributor Author

@nylen thanks for commenting!

Potential use cases I can think of are reviving date string as Date objects, setting prototypes, and transforming values in general.

I think your text is clearer, thank you!

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 98821ed on rodati:master into * on request:master*.

@nylen
Copy link
Member

nylen commented Dec 9, 2014

👍 thanks for contributing.

nylen added a commit that referenced this pull request Dec 9, 2014
Add optional support for jsonReviver
@nylen nylen merged commit 6f6e398 into request:master Dec 9, 2014
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.

None yet

3 participants