@hestia-earth/schema-convert 9.7.0 → 9.7.1

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 +19 -5
  2. package/package.json +1 -1
package/json.js CHANGED
@@ -336,8 +336,12 @@ var propertyTypeToValue = {
336
336
  var result;
337
337
  try {
338
338
  result = {
339
- type: 'Feature',
340
- geometry: wkt_1.wktToGeoJSON(value)
339
+ type: 'FeatureCollection',
340
+ features: [{
341
+ type: 'Feature',
342
+ properties: {},
343
+ geometry: wkt_1.wktToGeoJSON(value)
344
+ }]
341
345
  };
342
346
  }
343
347
  catch (e1) {
@@ -345,10 +349,20 @@ var propertyTypeToValue = {
345
349
  var data = JSON.parse(value);
346
350
  return result = ['Polygon', 'MultiPolygon'].includes(data.type)
347
351
  ? {
348
- type: 'Feature',
349
- geometry: data
352
+ type: 'FeatureCollection',
353
+ features: [{
354
+ type: 'Feature',
355
+ properties: {},
356
+ geometry: data
357
+ }]
350
358
  }
351
- : data;
359
+ : ['Feature'].includes(data.type)
360
+ ? {
361
+ type: 'FeatureCollection',
362
+ features: [__assign(__assign({}, data), { properties: {} // make sure they are set or it is invalid
363
+ })]
364
+ }
365
+ : data;
352
366
  }
353
367
  catch (e2) { }
354
368
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hestia-earth/schema-convert",
3
- "version": "9.7.0",
3
+ "version": "9.7.1",
4
4
  "description": "Hestia Schema Converters",
5
5
  "main": "index.js",
6
6
  "typings": "index.d.ts",