@hestia-earth/schema-validation 31.3.0 → 31.4.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/package.json
CHANGED
package/validate.js
CHANGED
|
@@ -73,8 +73,8 @@ var validateSchemaType = function (schemas, content) {
|
|
|
73
73
|
return true;
|
|
74
74
|
};
|
|
75
75
|
var schemaData = function (_a) {
|
|
76
|
-
var required = _a.required;
|
|
77
|
-
return (__assign({}, ((required === null || required === void 0 ? void 0 : required.length) ? { required: required } : {})));
|
|
76
|
+
var required = _a.required, properties = _a.properties;
|
|
77
|
+
return (__assign(__assign({}, ((required === null || required === void 0 ? void 0 : required.length) ? { required: required } : {})), (properties ? { properties: properties } : {})));
|
|
78
78
|
};
|
|
79
79
|
// using `verbose: true` includes data which we don't need
|
|
80
80
|
var cleanErrors = function (errors) {
|
|
@@ -41,8 +41,8 @@ var validate = function (_schema, value, _parentSchema, dataPath) {
|
|
|
41
41
|
};
|
|
42
42
|
})
|
|
43
43
|
.filter(Boolean);
|
|
44
|
-
// only return the first
|
|
45
|
-
exports.validate.errors = errors.slice(0,
|
|
44
|
+
// only return the first 10 errors to limit the memory footprint
|
|
45
|
+
exports.validate.errors = errors.slice(0, 10);
|
|
46
46
|
return errors.length === 0;
|
|
47
47
|
};
|
|
48
48
|
exports.validate = validate;
|
|
@@ -18,8 +18,8 @@ var validate = function (_schema, value, _parentSchema, dataPath) {
|
|
|
18
18
|
};
|
|
19
19
|
})
|
|
20
20
|
.filter(Boolean);
|
|
21
|
-
// only return the first
|
|
22
|
-
exports.validate.errors = errors.slice(0,
|
|
21
|
+
// only return the first 10 errors to limit the memory footprint
|
|
22
|
+
exports.validate.errors = errors.slice(0, 10);
|
|
23
23
|
return errors.length === 0;
|
|
24
24
|
};
|
|
25
25
|
exports.validate = validate;
|