@hestia-earth/schema-convert
Advanced tools
Comparing version 7.7.1 to 7.8.0
@@ -197,6 +197,9 @@ "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`. | ||
* | ||
* @param value The value mapped as a Ref | ||
*/ | ||
var schemaRefValue = function (value) { return typeof value === 'object' ? value : ({ name: value }); }; | ||
var schemaRefValue = function (value, schemaType) { | ||
return typeof value === 'object' ? value : schemaType === schema_1.SchemaType.Term ? { name: value } : { id: value }; | ||
}; | ||
exports.cleanStringValue = function (value) { return (value.match(/^[\d]+\.[\d]+\.[\d]+$/) === null ? value.replace(/\.0$/, '') : value).trim(); }; | ||
@@ -252,3 +255,3 @@ var propertyTypeToValue = { | ||
var schema = schemaType ? schemas[schemaType] : undefined; | ||
var data = schema ? mapContent(schemas, schema, _i)(schemaRefValue(value)) : safeParseJSON(value); | ||
var data = schema ? mapContent(schemas, schema, _i)(schemaRefValue(value, schemaType)) : safeParseJSON(value); | ||
return utils_1.isEmpty(data) ? {} : (schema ? extendDataFromSchema(data, schema, schemaType, _i) : data); | ||
@@ -255,0 +258,0 @@ } |
{ | ||
"name": "@hestia-earth/schema-convert", | ||
"version": "7.7.1", | ||
"version": "7.8.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
47765
1005