geojson-precision
Advanced tools
Comparing version 0.2.3 to 0.3.0
@@ -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 @@ |
{ | ||
"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"); | ||
} | ||
}); | ||
}); |
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
6587377
796
88