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

geojson-precision

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

geojson-precision - npm Package Compare versions

Comparing version 0.2.3 to 0.3.0

6

index.js

@@ -62,2 +62,6 @@ (function() {

if (!t) {
return t;
}
switch (t.type) {

@@ -78,3 +82,3 @@ case "Feature":

default :
throw new Error("GeoJSON object is invalid");
return t;
}

@@ -81,0 +85,0 @@

2

package.json
{
"name": "geojson-precision",
"version": "0.2.3",
"version": "0.3.0",
"description": "Remove meaningless precision from GeoJSON",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -13,2 +13,3 @@ # geojson-precision

###.parse(*geojson*, *precision*)

@@ -87,2 +88,2 @@

## License
CC0
CC0

@@ -302,2 +302,8 @@ exports.featurePoint = {

]
};
};
exports.baddy_null = null;
exports.baddy_undefined;
exports.empty = [];
exports.baddy_object = {"aKey": "aValue"};

@@ -148,1 +148,49 @@ var assert = require("assert"),

});
describe("null value", function() {
it("should return the same null value", function(done) {
var parsed = gp(tg.baddy_null, 4);
if (typeof(parsed) === "object") {
done();
} else {
throw new Error("null value incorrectly returned");
}
});
});
describe("undefined value", function() {
it("should return the same thing value", function(done) {
var parsed = gp(tg.baddy_undefined, 5);
if (typeof(parsed) === "undefined") {
done()
} else {
throw new Error("Undefined value incorrectly returned");
}
});
});
describe("empty array", function() {
it("should return the same thing value", function(done) {
var parsed = gp(tg.empty, 5);
if (Array.isArray(parsed)) {
done();
} else {
throw new Error("Empty array incorrectly returned");
}
});
});
describe("bad object", function() {
it("should return the same thing value", function(done) {
var parsed = gp(tg.baddy_object, 5);
if (typeof(parsed) === "object") {
done();
} else {
throw new Error("Bad object incorrectly returned");
}
});
});
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