@hestia-earth/schema-convert 7.6.5 → 7.6.6

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.
Files changed (2) hide show
  1. package/json.js +4 -4
  2. package/package.json +1 -1
package/json.js CHANGED
@@ -209,7 +209,7 @@ var propertyTypeToValue = {
209
209
  Array.isArray(items.type) ?
210
210
  propertyTypeToValue.auto(val, schemas, items, _i) :
211
211
  propertyTypeToValue[items.type](val, schemas, items, _i)) : val; }))
212
- .filter(function (val) { return !utils_1.isEmpty(val); });
212
+ .filter(function (val) { return !isEmptyValue(val, schemas); });
213
213
  },
214
214
  // try to determine the type automatically
215
215
  auto: function (value, schemas, _d, _i) {
@@ -288,15 +288,15 @@ var isEmptyValueType = (_a = {},
288
288
  _a.BlankNode = function (value, schemas) {
289
289
  return Object.values(value).filter(function (value) { return !utils_1.isEmpty(value); }).length <= schemaMinKeys(schemas, value);
290
290
  },
291
- _a.array = function (value, schemas) { return value.every(function (val) { return isEmptyValue(val, schemas); }); },
291
+ _a.array = function (value) { return value.filter(function (v) { return !utils_1.isEmpty(v); }).length === 0; },
292
292
  _a.object = function (value, schemas) {
293
293
  return Array.isArray(value) ?
294
- isEmptyValueType.array(value, schemas) :
294
+ isEmptyValueType.array(value) :
295
295
  (value['@type'] || value.type) === schema_1.SchemaType.Term ?
296
296
  isEmptyValueType[schema_1.SchemaType.Term](value) :
297
297
  schema_1.isBlankNode(value) ?
298
298
  isEmptyValueType.BlankNode(value, schemas) :
299
- false;
299
+ Object.keys(value).length === 0;
300
300
  },
301
301
  _a);
302
302
  var isEmptyValue = function (value, schemas) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hestia-earth/schema-convert",
3
- "version": "7.6.5",
3
+ "version": "7.6.6",
4
4
  "description": "Hestia Schema Converters",
5
5
  "main": "index.js",
6
6
  "typings": "index.d.ts",