geojson-polygon-self-intersections 1.2.1 → 1.2.2

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/index.js +6 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -22,10 +22,14 @@ var defaults = {
22
22
 
23
23
  module.exports = function(feature, filterFn, options0) {
24
24
  var options;
25
- if("object" === typeof options0){
25
+ if(options0 === undefined){
26
+ options = defaults;
27
+ } else if("object" === typeof options0){
26
28
  options = merge(defaults,options0);
27
- } else {
29
+ } else if("boolean" === typeof options0){
28
30
  options = merge(defaults,{useSpatialIndex:options0});
31
+ } else {
32
+ throw new Error("Unrecognised options argument");
29
33
  }
30
34
 
31
35
  if (feature.geometry.type != "Polygon") throw new Error("The input feature must be a Polygon");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geojson-polygon-self-intersections",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "type": "git",