z-schema 3.20.0 → 3.21.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/dist/ZSchema-browser-min.js +1 -1
- package/dist/ZSchema-browser-min.js.map +1 -1
- package/dist/ZSchema-browser-test.js +336 -212
- package/dist/ZSchema-browser.js +202 -90
- package/package.json +2 -2
- package/src/ZSchema.js +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "z-schema",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.21.0",
|
|
4
4
|
"description": "JSON schema validator",
|
|
5
5
|
"homepage": "https://github.com/zaggino/z-schema",
|
|
6
6
|
"authors": [
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"lodash.get": "^4.0.0",
|
|
62
62
|
"lodash.isequal": "^4.0.0",
|
|
63
|
-
"validator": "^
|
|
63
|
+
"validator": "^10.0.0"
|
|
64
64
|
},
|
|
65
65
|
"optionalDependencies": {
|
|
66
66
|
"commander": "^2.7.1"
|
package/src/ZSchema.js
CHANGED
|
@@ -114,6 +114,7 @@ function normalizeOptions(options) {
|
|
|
114
114
|
function ZSchema(options) {
|
|
115
115
|
this.cache = {};
|
|
116
116
|
this.referenceCache = [];
|
|
117
|
+
this.validateOptions = {};
|
|
117
118
|
|
|
118
119
|
this.options = normalizeOptions(options);
|
|
119
120
|
|
|
@@ -160,6 +161,8 @@ ZSchema.prototype.validate = function (json, schema, options, callback) {
|
|
|
160
161
|
}
|
|
161
162
|
if (!options) { options = {}; }
|
|
162
163
|
|
|
164
|
+
this.validateOptions = options;
|
|
165
|
+
|
|
163
166
|
var whatIs = Utils.whatIs(schema);
|
|
164
167
|
if (whatIs !== "string" && whatIs !== "object") {
|
|
165
168
|
var e = new Error("Invalid .validate call - schema must be an string or object but " + whatIs + " was passed!");
|