joi 11.4.0 → 12.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -26,7 +26,7 @@ Imagine you run facebook and you want visitors to sign up on the website with re
26
26
  This is joi, joi allows you to create *blueprints* or *schemas* for JavaScript objects (an object that stores information) to ensure *validation* of key information.
27
27
 
28
28
  # API
29
- See the detailed [API Reference](https://github.com/hapijs/joi/blob/v11.4.0/API.md).
29
+ See the detailed [API Reference](https://github.com/hapijs/joi/blob/v12.0.0/API.md).
30
30
 
31
31
  # Example
32
32
 
package/lib/errors.js CHANGED
@@ -120,7 +120,7 @@ exports.Err = class {
120
120
 
121
121
  const value = Hoek.reach(this.context, name);
122
122
  const normalized = internals.stringify(value, wrapArrays);
123
- return (isSecure ? Hoek.escapeHtml(normalized) : normalized);
123
+ return (isSecure && this.options.escapeHtml ? Hoek.escapeHtml(normalized) : normalized);
124
124
  });
125
125
  }
126
126
 
package/lib/schemas.js CHANGED
@@ -20,5 +20,6 @@ exports.options = Joi.object({
20
20
  raw: Joi.boolean(),
21
21
  context: Joi.object(),
22
22
  strip: Joi.boolean(),
23
- noDefaults: Joi.boolean()
23
+ noDefaults: Joi.boolean(),
24
+ escapeHtml: Joi.boolean()
24
25
  }).strict();
@@ -25,7 +25,8 @@ internals.defaults = {
25
25
  language: {},
26
26
  presence: 'optional',
27
27
  strip: false,
28
- noDefaults: false
28
+ noDefaults: false,
29
+ escapeHtml: false
29
30
 
30
31
  // context: null
31
32
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "joi",
3
3
  "description": "Object schema validation",
4
- "version": "11.4.0",
4
+ "version": "12.0.0",
5
5
  "homepage": "https://github.com/hapijs/joi",
6
6
  "repository": "git://github.com/hapijs/joi",
7
7
  "main": "lib/index.js",