Skip to content

Commit

Permalink
test else clause in requiredProperty
Browse files Browse the repository at this point in the history
  • Loading branch information
perrygeo committed Jul 7, 2016
1 parent f3d6396 commit fb63157
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 18 deletions.
18 changes: 0 additions & 18 deletions object.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,24 +214,6 @@ function hint(gj, options) {
}
}


function rightHandRule (geometry) {
var rhr = true;
if (geometry.type == 'Polygon') {
rhr = isPolyRHR(geometry.coordinates);
} else if (geometry.type == 'MultiPolygon') {
if (!geometry.coordinates.every(isPolyRHR))
rhr = false;
}
if (!rhr) {
errors.push({
message: 'Polygons and MultiPolygons should follow the right-hand rule',
level: 'warn',
line: geometry.__line__
});
}
}

function rightHandRule (geometry) {
var rhr = true;
if (geometry.type == 'Polygon') {
Expand Down
1 change: 1 addition & 0 deletions test/data/bad/expected_object.geojson
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"type": "Feature", "properties": 123, "geometry": null}
6 changes: 6 additions & 0 deletions test/data/bad/expected_object.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"line": 1,
"message": "\"properties\" property should be object, but is an number instead"
}
]
5 changes: 5 additions & 0 deletions test/data/bad/expected_object.result-object
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[
{
"message": "\"properties\" property should be object, but is an number instead"
}
]

0 comments on commit fb63157

Please sign in to comment.