@hestia-earth/schema-convert
Advanced tools
Comparing version 14.1.0 to 14.2.0
13
json.js
@@ -248,8 +248,15 @@ "use strict"; | ||
* If the user provided a non-object where an object was expected, assume it was meant to be the `name` property. | ||
* For non-Terms, we assume it is the `id`. | ||
* For Blank Nodes, we assume it is the `term.name`. | ||
* For non-Term Nodes, we assume it is the `id`. | ||
* | ||
* @param value The value mapped as a Ref | ||
*/ | ||
var schemaRefValue = function (value, schemaType) { | ||
return typeof value === 'object' ? value : schemaType === schema_1.SchemaType.Term ? { name: value } : { id: value }; | ||
var schemaRefValue = function (value, type) { | ||
return typeof value === 'object' | ||
? value | ||
: type === schema_1.SchemaType.Term | ||
? { name: value } | ||
: schema_1.isBlankNode({ type: type }) | ||
? { term: { name: value } } | ||
: { id: value }; | ||
}; | ||
@@ -256,0 +263,0 @@ exports.cleanStringValue = function (value) { return (value.match(/^[\d]+\.[\d]+\.[\d]+$/) === null ? value.replace(/\.0$/, '') : value).trim(); }; |
{ | ||
"name": "@hestia-earth/schema-convert", | ||
"version": "14.1.0", | ||
"version": "14.2.0", | ||
"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
61424
1286