z-schema 3.24.0 → 3.24.1
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 +183 -83
- package/dist/ZSchema-browser.js +11 -2
- package/package.json +1 -1
- package/src/Utils.js +11 -2
package/dist/ZSchema-browser.js
CHANGED
|
@@ -9150,6 +9150,15 @@ exports.jsonSymbol = Symbol.for("z-schema/json");
|
|
|
9150
9150
|
|
|
9151
9151
|
exports.schemaSymbol = Symbol.for("z-schema/schema");
|
|
9152
9152
|
|
|
9153
|
+
/**
|
|
9154
|
+
* @param {object} obj
|
|
9155
|
+
*
|
|
9156
|
+
* @returns {string[]}
|
|
9157
|
+
*/
|
|
9158
|
+
var sortedKeys = exports.sortedKeys = function (obj) {
|
|
9159
|
+
return Object.keys(obj).sort();
|
|
9160
|
+
};
|
|
9161
|
+
|
|
9153
9162
|
/**
|
|
9154
9163
|
*
|
|
9155
9164
|
* @param {string} uri
|
|
@@ -9254,8 +9263,8 @@ exports.areEqual = function areEqual(json1, json2, options) {
|
|
|
9254
9263
|
// both are objects, and:
|
|
9255
9264
|
if (exports.whatIs(json1) === "object" && exports.whatIs(json2) === "object") {
|
|
9256
9265
|
// have the same set of property names; and
|
|
9257
|
-
var keys1 =
|
|
9258
|
-
var keys2 =
|
|
9266
|
+
var keys1 = sortedKeys(json1);
|
|
9267
|
+
var keys2 = sortedKeys(json2);
|
|
9259
9268
|
if (!areEqual(keys1, keys2, { caseInsensitiveComparison: caseInsensitiveComparison })) {
|
|
9260
9269
|
return false;
|
|
9261
9270
|
}
|
package/package.json
CHANGED
package/src/Utils.js
CHANGED
|
@@ -6,6 +6,15 @@ exports.jsonSymbol = Symbol.for("z-schema/json");
|
|
|
6
6
|
|
|
7
7
|
exports.schemaSymbol = Symbol.for("z-schema/schema");
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* @param {object} obj
|
|
11
|
+
*
|
|
12
|
+
* @returns {string[]}
|
|
13
|
+
*/
|
|
14
|
+
var sortedKeys = exports.sortedKeys = function (obj) {
|
|
15
|
+
return Object.keys(obj).sort();
|
|
16
|
+
};
|
|
17
|
+
|
|
9
18
|
/**
|
|
10
19
|
*
|
|
11
20
|
* @param {string} uri
|
|
@@ -110,8 +119,8 @@ exports.areEqual = function areEqual(json1, json2, options) {
|
|
|
110
119
|
// both are objects, and:
|
|
111
120
|
if (exports.whatIs(json1) === "object" && exports.whatIs(json2) === "object") {
|
|
112
121
|
// have the same set of property names; and
|
|
113
|
-
var keys1 =
|
|
114
|
-
var keys2 =
|
|
122
|
+
var keys1 = sortedKeys(json1);
|
|
123
|
+
var keys2 = sortedKeys(json2);
|
|
115
124
|
if (!areEqual(keys1, keys2, { caseInsensitiveComparison: caseInsensitiveComparison })) {
|
|
116
125
|
return false;
|
|
117
126
|
}
|