Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@planet/importer

Package Overview
Dependencies
Maintainers
7
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@planet/importer - npm Package Compare versions

Comparing version 1.2.2 to 1.2.3

__tests__/data/bad-epsg-spec.json

37

__tests__/lib/import.test.js

@@ -413,1 +413,38 @@ import fs from 'fs';

});
describe('testing bad geojson format', () => {
/* These are a collection of geojson files that are
* technically broken but are allowed out in the wild.
*/
it('imports a geojson file with "EPSG:4326"', done => {
const geojson = new File({
path: './__tests__/data/bad-epsg-spec.json',
type: 'binary/data',
});
importer([geojson])
.then(collection => {
expect(collection.features.length).toBe(1);
done();
})
.catch(err => {
done(err);
});
});
it('evil feature only file', done => {
const geojson = new File({
path: './__tests__/data/geometry-only.geojson',
type: 'binary/data',
});
importer([geojson])
.then(collection => {
expect(collection.features.length).toBe(1);
done();
})
.catch(err => {
done(err);
});
});
});

@@ -133,2 +133,11 @@ "use strict";

return json;
} else if (json.type === 'Polygon' || json.type === 'MultiPolygon') {
return {
type: 'FeatureColletion',
features: [{
type: 'Feature',
properties: {},
geometry: json
}]
};
} else {

@@ -135,0 +144,0 @@ throw new Error(ERRORS.CORRUPT);

2

package.json
{
"name": "@planet/importer",
"public": true,
"version": "1.2.2",
"version": "1.2.3",
"description": "Client-side geometry import library",

@@ -6,0 +6,0 @@ "main": "dist/lib/import.js",

@@ -141,2 +141,13 @@ /**

return json;
} else if (json.type === 'Polygon' || json.type === 'MultiPolygon') {
return {
type: 'FeatureColletion',
features: [
{
type: 'Feature',
properties: {},
geometry: json,
},
],
};
} else {

@@ -143,0 +154,0 @@ throw new Error(ERRORS.CORRUPT);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc