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 json escape option #3506

Merged
merged 8 commits into from Aug 5, 2017
Merged

Add json escape option #3506

merged 8 commits into from Aug 5, 2017

Conversation

@g-k
Copy link
Contributor

@g-k g-k commented May 31, 2017

refs: hapijs/hoek#204

Adds the json.escape option to call hoek.escapeJSON on the JSON output. It's disabled by default.

There's probably a better place and name for this option.

API.md Outdated
- `replacer` - the replacer function or array. Defaults to no action.
- `space` - number of spaces to indent nested object keys. Defaults to no indentation.
- `suffix` - string suffix added after conversion to JSON string. Defaults to no suffix.
- `escape` - calls [`Hoek.jsonEscape`](https://github.com/hapijs/hoek/blob/master/API.md#escapejsonstring) after conversion to JSON string. Defaults to not escaping.
Copy link
Contributor

@AdriVanHoudt AdriVanHoudt Jun 1, 2017

I would go with "defaults to false."

package.json Outdated
@@ -26,7 +26,7 @@
"catbox-memory": "2.x.x",
"cryptiles": "3.x.x",
"heavy": "4.x.x",
"hoek": "4.x.x",
"hoek": "git+https://git@github.com/hapijs/hoek.git",
Copy link
Contributor

@AdriVanHoudt AdriVanHoudt Jun 1, 2017

This should be a legit version, maybe ask @nlf to do a release of hoek?

@@ -800,6 +800,26 @@ describe('Response', () => {
});
});

describe('escape()', () => {
Copy link
Contributor

@AdriVanHoudt AdriVanHoudt Jun 1, 2017

Add a test with a success case as well for .escape()

@AdriVanHoudt
Copy link
Contributor

@AdriVanHoudt AdriVanHoudt commented Jun 1, 2017

Also CI is failing since, I think, hapi uses a shrinkwrap that causes it to install hoek@4 and not the latest version you told it to in the package.json. A new version of hoek would solve this.

@hueniverse
Copy link
Contributor

@hueniverse hueniverse commented Jul 17, 2017

@g-k you still have some open comments above (beside the missing hoek version).

@hueniverse hueniverse self-assigned this Aug 5, 2017
@hueniverse hueniverse added this to the 16.5.3 milestone Aug 5, 2017
@hueniverse hueniverse merged commit 8d1e4e6 into hapijs:master Aug 5, 2017
1 of 2 checks passed
@lock
Copy link

@lock lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants