@hestia-earth/schema-convert 8.1.0 → 8.2.0

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 +13 -8
  2. package/package.json +1 -1
package/json.js CHANGED
@@ -158,7 +158,10 @@ var schemaNotFoundError = function (schema) { return exports.throwCSVError({
158
158
  }); };
159
159
  var computeSuggestions = function (_a, key) {
160
160
  var properties = _a.properties;
161
- var allKeys = Object.keys(properties);
161
+ var internal = internalProperties({ properties: properties });
162
+ var allKeys = Object.keys(properties).filter(function (k) { return !__spread([
163
+ '@type', 'type'
164
+ ], internal).includes(k); });
162
165
  return allKeys.filter(function (v) { return levenshtein.get(v, key) <= 3; });
163
166
  };
164
167
  var propertyNotFoundError = function (schema, key, value) { return exports.throwCSVError({
@@ -228,13 +231,15 @@ var propertyTypeToValue = {
228
231
  },
229
232
  integer: function (value) { return isEmptyCell(value) ? undefined : +value; },
230
233
  boolean: function (value) {
231
- return isEmptyCell(value) ?
232
- undefined :
233
- utils_1.isBoolean(value) ?
234
- value.toLowerCase() === 'true' :
235
- (function () {
236
- throw new Error('failed to parse boolean, expected true or false');
237
- })();
234
+ return isEmptyCell(value)
235
+ ? undefined
236
+ : utils_1.isBoolean(value)
237
+ ? value.toLowerCase() === 'true'
238
+ : utils_1.isNumber(value)
239
+ ? +value === 1 // handle setting 1 or 1.0 as true
240
+ : (function () {
241
+ throw new Error('failed to parse boolean, expected true or false');
242
+ })();
238
243
  },
239
244
  object: function (value, schemas, _a, _i) {
240
245
  var $ref = _a.$ref, required = _a.required;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hestia-earth/schema-convert",
3
- "version": "8.1.0",
3
+ "version": "8.2.0",
4
4
  "description": "Hestia Schema Converters",
5
5
  "main": "index.js",
6
6
  "typings": "index.d.ts",