geojson-polygon-self-intersections 1.2.0 → 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.
- package/index.js +7 -3
- package/package.json +1 -1
- package/.npmignore +0 -27
package/index.js
CHANGED
|
@@ -13,7 +13,7 @@ var merge = function(){
|
|
|
13
13
|
});
|
|
14
14
|
return output;
|
|
15
15
|
};
|
|
16
|
-
defaults = {
|
|
16
|
+
var defaults = {
|
|
17
17
|
useSpatialIndex: true,
|
|
18
18
|
epsilon: 0,
|
|
19
19
|
reportVertexOnVertex: false,
|
|
@@ -22,10 +22,14 @@ defaults = {
|
|
|
22
22
|
|
|
23
23
|
module.exports = function(feature, filterFn, options0) {
|
|
24
24
|
var options;
|
|
25
|
-
if(
|
|
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
package/.npmignore
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# Logs
|
|
2
|
-
logs
|
|
3
|
-
*.log
|
|
4
|
-
|
|
5
|
-
# Runtime data
|
|
6
|
-
pids
|
|
7
|
-
*.pid
|
|
8
|
-
*.seed
|
|
9
|
-
|
|
10
|
-
# Directory for instrumented libs generated by jscoverage/JSCover
|
|
11
|
-
lib-cov
|
|
12
|
-
|
|
13
|
-
# Coverage directory used by tools like istanbul
|
|
14
|
-
coverage
|
|
15
|
-
|
|
16
|
-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
|
|
17
|
-
.grunt
|
|
18
|
-
|
|
19
|
-
# Compiled binary addons (http://nodejs.org/api/addons.html)
|
|
20
|
-
build/Release
|
|
21
|
-
|
|
22
|
-
# Dependency directory
|
|
23
|
-
# Deployed apps should consider commenting this line out:
|
|
24
|
-
# see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git
|
|
25
|
-
node_modules
|
|
26
|
-
|
|
27
|
-
.DS_Store
|