@hestia-earth/schema-convert
Advanced tools
Comparing version 7.7.0 to 7.7.1
41
json.js
@@ -113,2 +113,24 @@ "use strict"; | ||
var nonEmptyCell = function (value) { return !isEmptyCell(value); }; | ||
var isEmptyValueType = (_a = { | ||
undefined: function () { return true; }, | ||
number: function (value) { return isNaN(value); } | ||
}, | ||
_a[schema_1.SchemaType.Term] = function (value) { return !(value['@id'] || value.id || value.name); }, | ||
_a.BlankNode = function (value, schemas) { | ||
return Object.values(value).filter(function (value) { return !utils_1.isEmpty(value); }).length <= schemaMinKeys(schemas, value); | ||
}, | ||
_a.array = function (value) { return value.filter(function (v) { return !utils_1.isEmpty(v); }).length === 0; }, | ||
_a.object = function (value, schemas) { | ||
return Array.isArray(value) ? | ||
isEmptyValueType.array(value) : | ||
(value['@type'] || value.type) === schema_1.SchemaType.Term ? | ||
isEmptyValueType[schema_1.SchemaType.Term](value) : | ||
schema_1.isBlankNode(value) ? | ||
isEmptyValueType.BlankNode(value, schemas) : | ||
Object.keys(value).length === 0; | ||
}, | ||
_a); | ||
var isEmptyValue = function (value, schemas) { | ||
return (typeof value) in isEmptyValueType ? isEmptyValueType[typeof value](value, schemas) : isEmptyCell(value); | ||
}; | ||
var compileFullKey = function (key1, key2) { | ||
@@ -287,21 +309,2 @@ // handle arrays | ||
}; | ||
var isEmptyValueType = (_a = {}, | ||
_a[schema_1.SchemaType.Term] = function (value) { return !(value['@id'] || value.id || value.name); }, | ||
_a.BlankNode = function (value, schemas) { | ||
return Object.values(value).filter(function (value) { return !utils_1.isEmpty(value); }).length <= schemaMinKeys(schemas, value); | ||
}, | ||
_a.array = function (value) { return value.filter(function (v) { return !utils_1.isEmpty(v); }).length === 0; }, | ||
_a.object = function (value, schemas) { | ||
return Array.isArray(value) ? | ||
isEmptyValueType.array(value) : | ||
(value['@type'] || value.type) === schema_1.SchemaType.Term ? | ||
isEmptyValueType[schema_1.SchemaType.Term](value) : | ||
schema_1.isBlankNode(value) ? | ||
isEmptyValueType.BlankNode(value, schemas) : | ||
Object.keys(value).length === 0; | ||
}, | ||
_a); | ||
var isEmptyValue = function (value, schemas) { | ||
return (typeof value) in isEmptyValueType ? isEmptyValueType[typeof value](value, schemas) : isEmptyCell(value); | ||
}; | ||
var mapContent = function (schemas, schema, ignoreInternal) { return function (json) { | ||
@@ -308,0 +311,0 @@ return Object.keys(json) |
{ | ||
"name": "@hestia-earth/schema-convert", | ||
"version": "7.7.0", | ||
"version": "7.7.1", | ||
"description": "Hestia Schema Converters", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
47637
1002