Socket
Socket
Sign inDemoInstall

json-odm

Package Overview
Dependencies
0
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.4 to 0.1.5

3

bin/json.odm.min.js

@@ -1,1 +0,2 @@

"use strict";function JsonOdm(){var t=this;this.sources={},this.selectedSource={},this.addSource=function(e,o,n){"object"==typeof o&&("undefined"==typeof t.sources[e]&&(t.sources[e]=o),n&&(t.selectedSource=o))},this.selectSource=function(e){"undefined"!=typeof t.sources[e]&&(t.selectedSource=t.sources[e])}}var root="undefined"!=typeof window?window:global,odm=new JsonOdm;root.jsonOdm||(root.jsonOdm=odm),"undefined"!=typeof module&&module.exports&&(module.exports=odm),jsonOdm.Util=function(){},jsonOdm.Util.prototype.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)},jsonOdm.Util.prototype.is=function(t,e){e="string"==typeof e?[e]:e;var o=Object.prototype.toString.call(t);o=o.substring(8,o.length-1).toLowerCase();for(var n=0;n<e.length;n++){var r=e[n].toLowerCase();if("array"==r&&this.isArray(t))return!0;if(r==o)return!0;if(typeof t==r)return!0}return!1},jsonOdm.Util.prototype.objectKeys=Object.keys||function(){var t=Object.prototype.hasOwnProperty,e=!{toString:null}.propertyIsEnumerable("toString"),o=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],n=o.length;return function(r){if("object"!=typeof r&&("function"!=typeof r||null===r))throw new TypeError("Object.keys called on non-object");var i,s,u=[];for(i in r)t.call(r,i)&&u.push(i);if(e)for(s=0;n>s;s++)t.call(r,o[s])&&u.push(o[s]);return u}}(),jsonOdm.Util.prototype.branch=function(t,e){function o(){if(arguments&&arguments.length&&this){var t=this[arguments[0]];return t?o.apply(t,Array.prototype.slice.call(arguments,1)):t}return this}return o.apply(t,e)},jsonOdm.Util.prototype.projectElement=function(t,e,o){var n={};for(var r in t)t.hasOwnProperty(r)&&(1==t[r]?n[r]=e[r]:"function"==typeof t[r]?n[r]=t[r](o||e):t[r]instanceof jsonOdm.Query?n[r]=t[r].$$commandQueue[t[r].$$commandQueue.length-1](e):"object"==typeof t[r]&&(n[r]=this.projectElement(t[r],e[r],o||e)));return n},jsonOdm.util=new jsonOdm.Util,jsonOdm.Geo=function(){},jsonOdm.Geo.detectAsGeometry=function(t){if(!t.type)if(jsonOdm.util.isArray(t)&&2==t.length&&!jsonOdm.util.isArray(t[0]))t=new jsonOdm.Geo.Point(t);else if(jsonOdm.util.isArray(t)&&4==t.length&&!jsonOdm.util.isArray(t[0]))t=new jsonOdm.Geo.BoundaryBox(t);else if(jsonOdm.util.isArray(t)&&t.length>=1&&jsonOdm.util.isArray(t[0])&&2==t[0].length&&!jsonOdm.util.isArray(t[0][0]))t=new jsonOdm.Geo.LineString(t);else if(jsonOdm.util.isArray(t)&&t.length>=1&&jsonOdm.util.isArray(t[0])&&t[0].length>=1&&jsonOdm.util.isArray(t[0][0])&&2==t[0][0].length&&!jsonOdm.util.isArray(t[0][0][0]))t=new jsonOdm.Geo.Polygon(t);else{if(!(jsonOdm.util.isArray(t)&&t.length>=1&&jsonOdm.util.isArray(t[0])&&t[0].length>=1&&jsonOdm.util.isArray(t[0][0])&&t[0][0].length>=1&&jsonOdm.util.isArray(t[0][0][0])&&2==t[0][0][0].length)||jsonOdm.util.isArray(t[0][0][0][0]))return!1;t=new jsonOdm.Geo.MultiPolygon(t)}return t},jsonOdm.Geo.FeatureCollection=function(t,e){this.type="FeatureCollection",this.features=t||[],e&&(this.bbox=e)},jsonOdm.Geo.Feature=function(t,e,o,n){this.geometry=t||{},e&&(this.properties=e),o&&(this.bbox=o),n&&(this.id=n)},jsonOdm.Geo.BoundaryBox=function(t){var e=Object.create(Array.prototype);return e=Array.apply(e)||e,jsonOdm.util.isArray(t)?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3]):(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e},jsonOdm.Geo.BoundaryBox.within=function(t,e){return jsonOdm.util.isArray(t)&&4==t.length?jsonOdm.Geo.Polygon.within(new jsonOdm.Geo.Polygon([[[t[0],t[1]],[t[2],t[1]],[t[2],t[3]],[t[0],t[3]],[t[0],t[1]]]]),e):!1},jsonOdm.Geo.Point=function(t,e){this.type="Point",this.coordinates=t,e&&(this.bbox=e)},jsonOdm.Geo.Point.within=function(t,e){var o,n;if(!t.coordinates)return!1;if("Point"==e.type)return e.coordinates[0]==t.coordinates[0]&&e.coordinates[1]==t.coordinates[1];if("MultiPoint"==e.type||"LineString"==e.type){for(o=0;e.coordinates&&o<e.coordinates.length;o++)if(e.coordinates[o][0]==t.coordinates[0]&&e.coordinates[o][1]==t.coordinates[1])return!0;return!1}if("MultiLineString"==e.type){for(o=0;e.coordinates&&o<e.coordinates.length;o++)for(n=0;e.coordinates[o]&&n<e.coordinates[o].length;n++)if(e.coordinates[o][n][0]==t.coordinates[0]&&e.coordinates[o][n][1]==t.coordinates[1])return!0;return!1}if("Polygon"==e.type)return jsonOdm.Geo.pointWithinPolygon(t.coordinates,e.coordinates?e.coordinates[0]:null);if("MultiPolygon"==e.type){for(o=0;e.coordinates&&o<e.coordinates.length;o++)if(jsonOdm.Geo.pointWithinPolygon(t.coordinates,e.coordinates[o]?e.coordinates[o][0]:null))return!0;return!1}if("GeometryCollection"==e.type&&jsonOdm.util.isArray(e.geometries)){for(o=0;o<e.geometries.length;o++)if(jsonOdm.Geo.Point.within(t,e.geometries[o]))return!0;return!1}return jsonOdm.Geo.pointWithinBounds(t.coordinates,e)},jsonOdm.Geo.Point.intersects=jsonOdm.Geo.Point.within,jsonOdm.Geo.MultiPoint=function(t,e){this.type="MultiPoint",this.coordinates=t,e&&(this.bbox=e)},jsonOdm.Geo.MultiPoint.within=function(t,e){var o,n,r,i;if(!t.coordinates||!jsonOdm.util.isArray(t.coordinates))return!1;if("Point"==e.type)return 1==t.coordinates.length&&t.coordinates[0][0]==e.coordinates[0]&&t.coordinates[0][1]==e.coordinates[1];if("MultiPoint"==e.type){for(n=0;t.coordinates&&n<t.coordinates.length;n++){for(i=!1,o=0;e.coordinates&&o<e.coordinates.length;o++)if(e.coordinates[o][0]==t.coordinates[n][0]&&e.coordinates[o][1]==t.coordinates[n][1]){i=!0;break}if(!i)return!1}return!0}if("LineString"==e.type){for(r=0;t.coordinates&&r<t.coordinates.length;r++)if(!jsonOdm.Geo.pointWithinLineString(t.coordinates[r],e.coordinates))return!1;return!0}if("MultiLineString"==e.type){for(r=0;t.coordinates&&r<t.coordinates.length;r++){for(i=!1,o=0;e.coordinates&&o<e.coordinates.length;o++)if(jsonOdm.Geo.pointWithinLineString(t.coordinates[r],e.coordinates[o])){i=!0;break}if(!i)return!1}return!0}if("Polygon"==e.type){for(o=0;t.coordinates&&o<t.coordinates.length;o++)if(!jsonOdm.Geo.pointWithinPolygon(t.coordinates[o],e.coordinates?e.coordinates[0]:null))return!1;return!0}if("MultiPolygon"==e.type){for(n=0;t.coordinates&&n<t.coordinates.length;n++){for(i=!1,o=0;e.coordinates&&o<e.coordinates.length;o++)if(jsonOdm.Geo.pointWithinPolygon(t.coordinates[n],e.coordinates[o]?e.coordinates[o][0]:null)){i=!0;break}if(!i)return!1}return!0}if("GeometryCollection"==e.type&&jsonOdm.util.isArray(e.geometries)){for(o=0;o<e.geometries.length;o++)if(jsonOdm.Geo.MultiPoint.within(t,e.geometries[o]))return!0;return!1}for(o=0;o<t.coordinates.length;o++)if(!jsonOdm.Geo.pointWithinBounds(t.coordinates[o],e))return!1;return!0},jsonOdm.Geo.MultiPoint.intersects=function(t,e){var o,n,r;if(!t.coordinates||!jsonOdm.util.isArray(t.coordinates))return!1;if("Point"==e.type)return jsonOdm.Geo.Point.intersects(e,t);if("MultiPoint"==e.type){for(n=0;t.coordinates&&n<t.coordinates.length;n++)for(o=0;e.coordinates&&o<e.coordinates.length;o++)if(e.coordinates[o][0]==t.coordinates[n][0]&&e.coordinates[o][1]==t.coordinates[n][1])return!0;return!1}if("LineString"==e.type){for(r=0;t.coordinates&&r<t.coordinates.length;r++)if(jsonOdm.Geo.pointWithinLineString(t.coordinates[r],e.coordinates))return!0;return!1}if("MultiLineString"==e.type){for(r=0;t.coordinates&&r<t.coordinates.length;r++)for(o=0;e.coordinates&&o<e.coordinates.length;o++)if(jsonOdm.Geo.pointWithinLineString(t.coordinates[r],e.coordinates[o]))return!0;return!1}if("Polygon"==e.type){for(o=0;t.coordinates&&o<t.coordinates.length;o++)if(jsonOdm.Geo.pointWithinPolygon(t.coordinates[o],e.coordinates?e.coordinates[0]:null))return!0;return!1}if("MultiPolygon"==e.type){for(n=0;t.coordinates&&n<t.coordinates.length;n++)for(o=0;e.coordinates&&o<e.coordinates.length;o++)if(jsonOdm.Geo.pointWithinPolygon(t.coordinates[n],e.coordinates[o]?e.coordinates[o][0]:null))return!0;return!1}if("GeometryCollection"==e.type&&jsonOdm.util.isArray(e.geometries)){for(o=0;o<e.geometries.length;o++)if(jsonOdm.Geo.MultiPoint.intersects(t,e.geometries[o]))return!0;return!1}for(o=0;o<t.coordinates.length;o++)if(jsonOdm.Geo.pointWithinBounds(t.coordinates[o],e))return!0;return!1},jsonOdm.Geo.LineString=function(t,e){this.type="LineString",this.coordinates=t,e&&(this.bbox=e)},jsonOdm.Geo.LineString.within=function(t,e){var o,n;if(!t.coordinates||!jsonOdm.util.isArray(t.coordinates))return!1;if("Point"==e.type||"MultiPoint"==e.type)return!1;if("LineString"==e.type)return jsonOdm.Geo.lineStringWithinLineString(t.coordinates,e.coordinates);if("MultiLineString"==e.type){for(o=0;e.coordinates&&o<e.coordinates.length;o++)if(jsonOdm.Geo.lineStringWithinLineString(t.coordinates,e.coordinates[o]))return!0;return!1}if("Polygon"==e.type){for(o=0;t.coordinates&&o<t.coordinates.length-1;o++)if(!jsonOdm.Geo.edgeWithinPolygon([t.coordinates[o],t.coordinates[o+1]],e.coordinates[0]))return!1;return!0}if("MultiPolygon"==e.type){for(o=0;e.coordinates&&o<e.coordinates.length;o++)for(n=0;t.coordinates&&n<t.coordinates.length-1;n++)if(jsonOdm.Geo.edgeWithinPolygon([t.coordinates[n],t.coordinates[n+1]],e.coordinates[o][0])&&n+1==t.coordinates.length-1)return!0;return!1}if("GeometryCollection"==e.type&&jsonOdm.util.isArray(e.geometries)){for(o=0;o<e.geometries.length;o++)if(jsonOdm.Geo.LineString.within(t,e.geometries[o]))return!0;return!1}for(o=0;o<t.coordinates.length;o++)if(!jsonOdm.Geo.pointWithinBounds(t.coordinates[o],e))return!1;return!0},jsonOdm.Geo.LineString.intersects=function(t,e){var o,n;if(!t.coordinates||!jsonOdm.util.isArray(t.coordinates))return!1;if("Point"==e.type)return jsonOdm.Geo.Point.intersects(e,t);if("MultiPoint"==e.type)return jsonOdm.Geo.MultiPoint.intersects(e,t);if("LineString"==e.type){for(o=0;o<t.coordinates.length-1;o++)if(jsonOdm.Geo.edgeIntersectsLineString([t.coordinates[o],t.coordinates[o+1]],e.coordinates))return!0;return!1}if("MultiLineString"==e.type){for(o=0;e.coordinates&&o<e.coordinates.length;o++)for(n=0;n<t.coordinates.length-1;n++)if(jsonOdm.Geo.edgeIntersectsLineString([t.coordinates[n],t.coordinates[n+1]],e.coordinates[o]))return!0;return!1}if("Polygon"==e.type){for(o=0;t.coordinates&&o<t.coordinates.length-1;o++)if(jsonOdm.Geo.edgeIntersectsPolygon([t.coordinates[o],t.coordinates[o+1]],e.coordinates[0]))return!0;return!1}if("MultiPolygon"==e.type){for(o=0;e.coordinates&&o<e.coordinates.length;o++)for(n=0;t.coordinates&&n<t.coordinates.length-1;n++)if(jsonOdm.Geo.edgeIntersectsPolygon([t.coordinates[n],t.coordinates[n+1]],e.coordinates[o][0]))return!0;return!1}if("GeometryCollection"==e.type&&jsonOdm.util.isArray(e.geometries)){for(o=0;o<e.geometries.length;o++)if(jsonOdm.Geo.LineString.intersects(t,e.geometries[o]))return!0;return!1}for(o=0;t.coordinates&&o<t.coordinates.length-1;o++)if(jsonOdm.Geo.edgeIntersectsBounds([t.coordinates[o],t.coordinates[o+1]],e))return!0;return!1},jsonOdm.Geo.MultiLineString=function(t,e){this.type="MultiLineString",this.coordinates=t,e&&(this.bbox=e)},jsonOdm.Geo.MultiLineString.within=function(t,e){var o,n,r,i;if(!t.coordinates||!jsonOdm.util.isArray(t.coordinates))return!1;if("Point"==e.type||"MultiPoint"==e.type)return!1;if("LineString"==e.type){for(o=0;t.coordinates&&o<t.coordinates.length;o++)if(!jsonOdm.Geo.lineStringWithinLineString(t.coordinates[o],e.coordinates))return!1;return!0}if("MultiLineString"==e.type){for(n=0;t.coordinates&&n<t.coordinates.length;n++){for(i=!1,o=0;e.coordinates&&o<e.coordinates.length;o++)if(jsonOdm.Geo.lineStringWithinLineString(t.coordinates[n],e.coordinates[o])){i=!0;break}if(!i)return!1}return!0}if("Polygon"==e.type){for(o=0;t.coordinates&&o<t.coordinates.length;o++)for(n=0;t.coordinates&&n<t.coordinates[o].length-1;n++)if(!jsonOdm.Geo.edgeWithinPolygon([t.coordinates[o][n],t.coordinates[o][n+1]],e.coordinates[0]))return!1;return!0}if("MultiPolygon"==e.type){for(n=0;t.coordinates&&n<t.coordinates.length;n++){for(i=!1,o=0;e.coordinates&&o<e.coordinates.length;o++)for(r=0;t.coordinates[n]&&r<t.coordinates[n].length-1;r++)if(jsonOdm.Geo.edgeWithinPolygon([t.coordinates[n][r],t.coordinates[n][r+1]],e.coordinates[o][0])&&r+1==t.coordinates[n].length-1){i=!0;break}if(!i)return!1}return!0}if("GeometryCollection"==e.type&&jsonOdm.util.isArray(e.geometries)){for(o=0;o<e.geometries.length;o++)if(jsonOdm.Geo.MultiLineString.within(t,e.geometries[o]))return!0;return!1}for(o=0;o<t.coordinates.length;o++)for(n=0;n<t.coordinates[o].length;n++)if(!jsonOdm.Geo.pointWithinBounds(t.coordinates[o][n],e))return!1;return!0},jsonOdm.Geo.MultiLineString.intersects=function(t,e){var o,n,r;if(!t.coordinates||!jsonOdm.util.isArray(t.coordinates))return!1;if("Point"==e.type)return jsonOdm.Geo.Point.intersects(e,t);if("MultiPoint"==e.type)return jsonOdm.Geo.MultiPoint.intersects(e,t);if("LineString"==e.type)return jsonOdm.Geo.LineString.intersects(e,t);if("MultiLineString"==e.type){for(n=0;t.coordinates&&n<t.coordinates.length;n++)for(r=0;t.coordinates[n]&&r<t.coordinates[n].length-1;r++)for(o=0;e.coordinates&&o<e.coordinates.length;o++)if(jsonOdm.Geo.edgeIntersectsLineString([t.coordinates[n][r],t.coordinates[n][r+1]],e.coordinates[o]))return!0;return!1}if("Polygon"==e.type){for(o=0;t.coordinates&&o<t.coordinates.length;o++)for(n=0;t.coordinates&&n<t.coordinates[o].length-1;n++)if(jsonOdm.Geo.edgeIntersectsPolygon([t.coordinates[o][n],t.coordinates[o][n+1]],e.coordinates[0]))return!0;return!1}if("MultiPolygon"==e.type){for(n=0;t.coordinates&&n<t.coordinates.length;n++)for(o=0;e.coordinates&&o<e.coordinates.length;o++)for(r=0;t.coordinates[n]&&r<t.coordinates[n].length-1;r++)if(jsonOdm.Geo.edgeIntersectsPolygon([t.coordinates[n][r],t.coordinates[n][r+1]],e.coordinates[o][0]))return!0;return!1}if("GeometryCollection"==e.type&&jsonOdm.util.isArray(e.geometries)){for(o=0;o<e.geometries.length;o++)if(jsonOdm.Geo.MultiLineString.intersects(t,e.geometries[o]))return!0;return!1}for(o=0;t.coordinates&&o<t.coordinates.length;o++)for(n=0;n<t.coordinates[o].length-1;n++)if(jsonOdm.Geo.edgeIntersectsBounds([t.coordinates[o][n],t.coordinates[o][n+1]],e))return!0;return!1},jsonOdm.Geo.Polygon=function(t,e){this.type="Polygon",this.coordinates=t,e&&(this.bbox=e)},jsonOdm.Geo.Polygon.within=function(t,e){var o,n;if(!t.coordinates||!jsonOdm.util.isArray(t.coordinates))return!1;if("Point"==e.type||"MultiPoint"==e.type||"LineString"==e.type||"MultiLineString"==e.type)return!1;if("Polygon"==e.type){for(o=0;t.coordinates[0]&&o<t.coordinates[0].length-1;o++)if(!jsonOdm.Geo.edgeWithinPolygon([t.coordinates[0][o],t.coordinates[0][o+1]],e.coordinates[0]))return!1;return!0}if("MultiPolygon"==e.type){for(o=0;e.coordinates&&o<e.coordinates.length;o++)for(n=0;t.coordinates[0]&&n<t.coordinates[0].length-1;n++){var r=jsonOdm.Geo.edgeWithinPolygon([t.coordinates[0][n],t.coordinates[0][n+1]],e.coordinates[o][0]);if(!r)break;if(r&&n+1==t.coordinates[0].length-1)return!0}return!1}if("GeometryCollection"==e.type&&jsonOdm.util.isArray(e.geometries)){for(o=0;o<e.geometries.length;o++)if(jsonOdm.Geo.Polygon.within(t,e.geometries[o]))return!0;return!1}for(o=0;t.coordinates[0]&&o<t.coordinates[0].length;o++)if(!jsonOdm.Geo.pointWithinBounds(t.coordinates[0][o],e))return!1;return!0},jsonOdm.Geo.Polygon.intersects=function(t,e){var o,n;if(!t.coordinates||!jsonOdm.util.isArray(t.coordinates))return!1;if("Point"==e.type)return jsonOdm.Geo.Point.intersects(e,t);if("MultiPoint"==e.type)return jsonOdm.Geo.MultiPoint.intersects(e,t);if("LineString"==e.type)return jsonOdm.Geo.LineString.intersects(e,t);if("MultiLineString"==e.type)return jsonOdm.Geo.MultiLineString.intersects(e,t);if("Polygon"==e.type){for(o=0;t.coordinates[0]&&o<t.coordinates[0].length-1;o++)if(jsonOdm.Geo.edgeIntersectsPolygon([t.coordinates[0][o],t.coordinates[0][o+1]],e.coordinates[0]))return!0;return!1}if("MultiPolygon"==e.type){for(o=0;e.coordinates&&o<e.coordinates.length;o++)for(n=0;t.coordinates[0]&&n<t.coordinates[0].length-1;n++)if(jsonOdm.Geo.edgeIntersectsPolygon([t.coordinates[0][n],t.coordinates[0][n+1]],e.coordinates[o][0]))return!0;return!1}if("GeometryCollection"==e.type&&jsonOdm.util.isArray(e.geometries)){for(o=0;o<e.geometries.length;o++)if(jsonOdm.Geo.Polygon.intersects(t,e.geometries[o]))return!0;return!1}for(o=0;t.coordinates[0]&&o<t.coordinates[0].length-1;o++)if(jsonOdm.Geo.edgeIntersectsBounds([t.coordinates[0][o],t.coordinates[0][o+1]],e))return!0;return!1},jsonOdm.Geo.MultiPolygon=function(t,e){this.type="MultiPolygon",this.coordinates=t,e&&(this.bbox=e)},jsonOdm.Geo.MultiPolygon.within=function(t,e){var o,n,r,i;if(!t.coordinates||!jsonOdm.util.isArray(t.coordinates))return!1;if("Point"==e.type||"MultiPoint"==e.type||"LineString"==e.type||"MultiLineString"==e.type)return!1;if("Polygon"==e.type){for(o=0;t.coordinates&&o<t.coordinates.length;o++)for(n=0;n<t.coordinates[o][0].length-1;n++)if(!jsonOdm.Geo.edgeWithinPolygon([t.coordinates[o][0][n],t.coordinates[o][0][n+1]],e.coordinates[0]))return!1;return!0}if("MultiPolygon"==e.type){for(o=0;t.coordinates&&o<t.coordinates.length;o++){for(i=!1,n=0;e.coordinates&&n<e.coordinates.length;n++)for(r=0;t.coordinates[o][0]&&r<t.coordinates[o][0].length-1;r++){var s=jsonOdm.Geo.edgeWithinPolygon([t.coordinates[o][0][r],t.coordinates[o][0][r+1]],e.coordinates[n][0]);if(!s)break;if(s&&r+1==t.coordinates[o][0].length-1){i=!0;break}}if(!i)return!1}return!0}if("GeometryCollection"==e.type&&jsonOdm.util.isArray(e.geometries)){for(o=0;o<e.geometries.length;o++)if(jsonOdm.Geo.MultiPolygon.within(t,e.geometries[o]))return!0;return!1}for(o=0;o<t.coordinates.length;o++)for(n=0;n<t.coordinates[o][0].length;n++)if(!jsonOdm.Geo.pointWithinBounds(t.coordinates[o][0][n],e))return!1;return!0},jsonOdm.Geo.MultiPolygon.intersects=function(t,e){var o,n,r;if(!t.coordinates||!jsonOdm.util.isArray(t.coordinates))return!1;if("Point"==e.type)return jsonOdm.Geo.Point.intersects(e,t);if("MultiPoint"==e.type)return jsonOdm.Geo.MultiPoint.intersects(e,t);if("LineString"==e.type)return jsonOdm.Geo.LineString.intersects(e,t);if("MultiLineString"==e.type)return jsonOdm.Geo.MultiLineString.intersects(e,t);if("Polygon"==e.type)return jsonOdm.Geo.Polygon.intersects(e,t);if("MultiPolygon"==e.type){for(o=0;t.coordinates&&o<t.coordinates.length;o++)for(n=0;e.coordinates&&n<e.coordinates.length;n++)for(r=0;t.coordinates[o][0]&&r<t.coordinates[o][0].length-1;r++)if(jsonOdm.Geo.pointWithinPolygon(t.coordinates[o][0][r],e.coordinates[n][0]))return!0;return!1}if("GeometryCollection"==e.type&&jsonOdm.util.isArray(e.geometries)){for(o=0;o<e.geometries.length;o++)if(jsonOdm.Geo.MultiPolygon.intersects(t,e.geometries[o]))return!0;return!1}for(o=0;o<t.coordinates.length;o++)for(n=0;n<t.coordinates[o][0].length-1;n++)if(jsonOdm.Geo.edgeIntersectsBounds([t.coordinates[o][0][n],t.coordinates[o][0][n+1]],e))return!0;return!1},jsonOdm.Geo.GeometryCollection=function(t,e){this.type="GeometryCollection",this.geometries=t,e&&(this.bbox=e)},jsonOdm.Geo.GeometryCollection.within=function(t,e){if(!jsonOdm.util.isArray(t.geometries)||!t.geometries.length||!e.type)return!1;for(var o=0;o<t.geometries.length;o++){if(!jsonOdm.Geo[t.geometries[o].type]||!jsonOdm.Geo[t.geometries[o].type].within)return!1;if(!jsonOdm.Geo[t.geometries[o].type].within(t.geometries[o],e))return!1}return!0},jsonOdm.Geo.GeometryCollection.intersects=function(t,e){if(!jsonOdm.util.isArray(t.geometries)||!t.geometries.length||!e.type)return!1;for(var o=0;o<t.geometries.length;o++)if(jsonOdm.Geo[t.geometries[o].type]&&jsonOdm.Geo[t.geometries[o].type].intersects&&jsonOdm.Geo[t.geometries[o].type].intersects(t.geometries[o],e))return!0;return!1},jsonOdm.Geo.pointWithinPolygon=function(t,e){if(!(jsonOdm.util.isArray(t)&&jsonOdm.util.isArray(e)&&e.length>2))return!1;var o,n=0;(e[0][0]!=e[e.length-1][0]||e[0][1]!=e[e.length-1][1])&&(e=e.concat([e[0]]));for(var r=0;r<e.length-1;r++){if(e[r][0]==t[0]&&e[r][1]==t[1])return!0;if(!(e[r][0]<t[0]&&e[r+1][0]<t[0]||e[r][1]<t[1]&&e[r+1][1]<t[1]||e[r][1]>t[1]&&e[r+1][1]>t[1])){if(o=(e[r][0]-e[r+1][0])*((t[1]-e[r+1][1])/(e[r][1]-e[r+1][1]))+e[r+1][0],o==t[0]&&t[1]<=Math.max(e[r][1],e[r+1][1])&&t[1]>=Math.min(e[r][1],e[r+1][1]))return!0;o>t[0]&&n++}}return n%2==1},jsonOdm.Geo.edgeWithinPolygon=function(t,e){if(!(jsonOdm.util.isArray(t)&&2==t.length&&jsonOdm.util.isArray(e)&&e.length>=2))return!1;if((e[0][0]!=e[e.length-1][0]||e[0][1]!=e[e.length-1][1])&&(e=e.concat([e[0]])),!jsonOdm.Geo.pointWithinPolygon(t[0],e)||!jsonOdm.Geo.pointWithinPolygon(t[1],e))return!1;for(var o=0;o<e.length-1;o++)if(jsonOdm.Geo.edgeIntersectsEdge(t,[e[o],e[o+1]],!1))return!1;return!0},jsonOdm.Geo.edgeIntersectsPolygon=function(t,e){if(!(jsonOdm.util.isArray(t)&&2==t.length&&jsonOdm.util.isArray(e)&&e.length>=2))return!1;if((e[0][0]!=e[e.length-1][0]||e[0][1]!=e[e.length-1][1])&&(e=e.concat([e[0]])),jsonOdm.Geo.pointWithinPolygon(t[0],e)||jsonOdm.Geo.pointWithinPolygon(t[1],e))return!0;for(var o=0;o<e.length-1;o++)if(jsonOdm.Geo.edgeIntersectsEdge(t,[e[o],e[o+1]]))return!0;return!1},jsonOdm.Geo.edgeIntersectsLineString=function(t,e){if(!jsonOdm.util.isArray(t)||2!=t.length||!jsonOdm.util.isArray(e))return!1;for(var o=0;o<e.length-1;o++)if(jsonOdm.Geo.edgeIntersectsEdge(t,[e[o],e[o+1]]))return!0;return!1},jsonOdm.Geo.edgeIntersectsEdge=function(t,e,o){o="undefined"==typeof o?!0:o;var n=[t[1][0]-t[0][0],t[1][1]-t[0][1]],r=[Math.min(t[0][0],t[1][0]),Math.min(t[0][1],t[1][1]),Math.max(t[0][0],t[1][0]),Math.max(t[0][1],t[1][1])],i=[e[1][0]-e[0][0],e[1][1]-e[0][1]],s=[Math.min(e[0][0],e[1][0]),Math.min(e[0][1],e[1][1]),Math.max(e[0][0],e[1][0]),Math.max(e[0][1],e[1][1])];if(r[0]>s[0]&&r[0]>s[2]||r[1]>s[1]&&r[1]>s[3]||s[0]>r[0]&&s[0]>r[2]||s[1]>r[1]&&s[1]>r[3])return!1;if(i[0]*n[1]-n[0]*i[1]==0)return o&&t[0][1]+(e[0][0]-t[0][0])/n[0]*n[1]==e[0][1];var u=(e[0][1]*i[0]+t[0][0]*i[1]-e[0][0]*i[1]-t[0][1]*i[0])/(n[1]*i[0]-n[0]*i[1]),d=t[0][0]+u*n[0],c=t[0][1]+u*n[1];return o?d>=r[0]&&d<=r[2]&&c>=r[1]&&c<=r[3]&&d>=s[0]&&d<=s[2]&&c>=s[1]&&c<=s[3]:d>r[0]&&d<r[2]&&c>r[1]&&c<r[3]&&d>s[0]&&d<s[2]&&c>s[1]&&c<s[3]},jsonOdm.Geo.pointWithinLineString=function(t,e){if(!(jsonOdm.util.isArray(t)&&jsonOdm.util.isArray(e)&&e.length>=2))return!1;for(var o=0;o<e.length-1;o++)if((t[0]>=e[o][0]&&t[0]<=e[o+1][0]&&e[o][0]<=e[o+1][0]||t[0]<=e[o][0]&&t[0]>=e[o+1][0]&&e[o][0]>=e[o+1][0])&&(t[1]>=e[o][1]&&t[1]<=e[o+1][1]&&e[o][1]<=e[o+1][1]||t[1]<=e[o][1]&&t[1]>=e[o+1][1]&&e[o][1]>=e[o+1][1])&&(e[o][0]==t[0]&&e[o][1]==t[1]||e[o+1][0]==t[0]&&e[o+1][1]==t[1]||e[o][1]-e[o+1][1]!=0&&(e[o][0]-e[o+1][0])*((t[1]-e[o+1][1])/(e[o][1]-e[o+1][1]))+e[o+1][0]==t[0]||e[o][0]-e[o+1][0]!=0&&(e[o][1]-e[o+1][1])*((t[0]-e[o+1][0])/(e[o][0]-e[o+1][0]))+e[o+1][1]==t[1]))return!0;return!1},jsonOdm.Geo.pointWithinBounds=function(t,e){return jsonOdm.util.isArray(t)&&jsonOdm.util.isArray(e)&&4==e.length?t[0]>=e[0]&&t[1]>=e[1]&&t[0]<=e[2]&&t[1]<=e[3]:!1},jsonOdm.Geo.edgeIntersectsBounds=function(t,e){return jsonOdm.util.isArray(t)&&jsonOdm.util.isArray(e)&&4==e.length?jsonOdm.Geo.edgeIntersectsPolygon(t,[[e[0],e[1]],[e[2],e[1]],[e[2],e[3]],[e[0],e[3]]]):!1},jsonOdm.Geo.lineStringWithinLineString=function(t,e){if(!jsonOdm.util.isArray(t)||!jsonOdm.util.isArray(e))return!1;var o,n;for(o=0;t&&o<t.length;o++){var r=!1;for(n=0;e&&n<e.length;n++)if(t[o][0]==e[n][0]&&t[o][1]==e[n][1]){if(o+1==t.length)return!0;if(!(e[n+1]&&t[o+1][0]==e[n+1][0]&&t[o+1][1]==e[n+1][1]||t[o+1][0]==e[n][0]&&t[o+1][1]==e[n][1]||n>0&&t[o+1][0]==e[n-1][0]&&t[o+1][1]==e[n-1][1]))return!1;r=!0}if(!r)return!1}return!0},jsonOdm.Collection=function(t){var e=Object.create(Array.prototype);return e=Array.apply(e)||e,"undefined"!=typeof t&&jsonOdm.selectedSource&&jsonOdm.selectedSource[t]&&(e=e.concat(jsonOdm.selectedSource[t])),jsonOdm.Collection.decorate(e),e.$branch=function(){var t=jsonOdm.util.branch(e,arguments);return jsonOdm.Collection.decorate(t),t},e},jsonOdm.Collection.decorate=function(t){var e=function(t){jsonOdm.util.isArray(t)&&(t.$hasMany=function(e,o,n,r){"string"==typeof n&&(r=r||n);var i=n;"string"==typeof n&&jsonOdm.selectedSource&&jsonOdm.selectedSource[n]&&(i=jsonOdm.selectedSource[n]);for(var s=0;s<t.length;s++){var u=e;if(t[s].hasOwnProperty(e)&&(u=t[s][e]),"undefined"==typeof t[s][r])for(var d=0;u.length&&d<u.length;d++){for(var c=null,a=0;a<i.length;a++)if(u[d]==i[a][o]){c=i[a];break}null!=c&&(t[s][r]||(t[s][r]=[]),t[s][r].push(c))}}},t.$hasOne=function(e,o,n,r){"string"==typeof n&&(r=r||n);var i=n;"string"==typeof n&&jsonOdm.selectedSource&&jsonOdm.selectedSource[n]&&(i=jsonOdm.selectedSource[n]);for(var s=0;s<t.length;s++){var u;if(t[s].hasOwnProperty(e)&&(u=t[s][e]),"undefined"==typeof t[s][r]){for(var d=null,c=0;c<i.length;c++)if(u==i[c][o]){d=i[c];break}null!=d&&(t[s][r]=d)}}},t.$query=function(){return new jsonOdm.Query(t)})};e(t)},jsonOdm.Query=function(t){this.$$commandQueue=[],this.$$aggregationBeforeCollectQueue=[],this.$$aggregationResultQueue=[],this.$$collection=t||[]},jsonOdm.Query.prototype.$delete=function(){if(this.$$commandQueue.length<1)return this;for(var t=0;t<this.$$collection.length;){for(var e=!0,o=0;o<this.$$commandQueue.length&&(e=e&&this.$$commandQueue[o](this.$$collection[t]));o++);e?this.$$collection.splice(t,1):t++}return this},jsonOdm.Query.prototype.$result=function(t,e){if(this.$$commandQueue.length<1&&this.$$aggregationBeforeCollectQueue<1)return this.$$collection;t="undefined"==typeof t?0:t,e="undefined"==typeof e?this.$$collection.length:e;var o,n,r,i=new jsonOdm.Collection;for(n=0;n<this.$$collection.length;n++){var s=!0;for(r=0;r<this.$$commandQueue.length&&(s=s&&this.$$commandQueue[r](this.$$collection[n]));r++);if(s){if(t>0){t--;continue}if(0>=e)return i;for(o=this.$$collection[n],r=0;r<this.$$aggregationBeforeCollectQueue.length;r++)o=this.$$aggregationBeforeCollectQueue[r](n,o);i.push(o),e--}}for(n=0;n<this.$$aggregationResultQueue.length;n++)i=this.$$aggregationResultQueue[n](i);return i},jsonOdm.Query.prototype.$all=function(){return this.$result()},jsonOdm.Query.prototype.$first=function(){return this.$result(0,1)[0]},jsonOdm.Query.prototype.$aggregateCollection=function(t,e,o){return"function"==typeof t&&(t=[t]),"function"==typeof e&&(e=[e]),"function"==typeof o&&(o=[o]),jsonOdm.util.isArray(t)&&(this.$$commandQueue=this.$$commandQueue.concat(t)),jsonOdm.util.isArray(e)&&(this.$$aggregationBeforeCollectQueue=this.$$aggregationBeforeCollectQueue.concat(e)),jsonOdm.util.isArray(o)&&(this.$$aggregationResultQueue=this.$$aggregationResultQueue.concat(o)),this},jsonOdm.Query.prototype.$project=function(t){return this.$aggregateCollection(null,function(e,o){return jsonOdm.util.projectElement(t,o)})},jsonOdm.Query.prototype.$testCollection=function(t,e){var o=this.$$commandQueue.pop(),n=function(){return function(n){if(!(o instanceof jsonOdm.Collection||"function"==typeof o||"undefined"==typeof o)||"function"!=typeof e)return!1;var r="undefined"==typeof o?n:o instanceof jsonOdm.Collection?o:o(n);return!!e(r,t)}}();return this.$$commandQueue.push(n),this},jsonOdm.Query.prototype.$binaryOperator=function(t,e){var o=function(t,o){return function(n){if("function"!=typeof o)return!1;for(var r=[],i=0;i<t.length;i++)for(var s=0;s<t[i].$$commandQueue.length;s++)r.push(t[i].$$commandQueue[s](n));return!!e(r)}}(t,e),n=new jsonOdm.Query(this.$$collection);return n.$$commandQueue.push(o),n},jsonOdm.Query.prototype.$branch=function(){var t=function(t){return function(e){return jsonOdm.util.branch(e,t)}}(arguments),e=new jsonOdm.Query(this.$$collection);return e.$$commandQueue.push(t),e},jsonOdm.Query.prototype.$modifyField=function(t){var e=function(t,e){return function(o){return o=null!==e?e(o):o,"function"==typeof t?t(o):o}}(t,this.$$commandQueue.length?this.$$commandQueue[this.$$commandQueue.length-1]:null);return this.$$commandQueue.push(e),this},jsonOdm.Query.stringFiledModifyer=["charAt","charCodeAt","concat","fromCharCode","indexOf","lastIndexOf","localeCompare","match","replace","search","slice","split","substr","substring","toLocaleLowerCase","toLocaleUpperCase","toLowerCase","toUpperCase","trim","valueOf"];for(var i=0;i<jsonOdm.Query.stringFiledModifyer.length;i++)jsonOdm.Query.prototype["$"+jsonOdm.Query.stringFiledModifyer[i]]=function(t){return function(){return this.$modifyField(function(t,e){return function(o){return"string"==typeof o&&String.prototype.hasOwnProperty(e)?String.prototype[e].apply(o,t):o}}(arguments,t))}}(jsonOdm.Query.stringFiledModifyer[i]);jsonOdm.Query.prototype.$add=function(){return this.$modifyField(function(){return function(){}}(arguments))},jsonOdm.Query.prototype.$eq=function(){return this.$testCollection(arguments,function(t,e){for(var o=0;o<e.length;o++)if(e[o]==t)return!0;return!1})},jsonOdm.Query.prototype.$in=function(t){return this.$testCollection(t,function(t,e){for(var o=0;o<e.length;o++)if(e[o]==t)return!0;return!1})},jsonOdm.Query.prototype.$ne=function(){return this.$testCollection(arguments,function(t,e){for(var o=0;o<e.length;o++)if(e[o]==t)return!1;return!0})},jsonOdm.Query.prototype.$nin=function(t){return this.$testCollection(t,function(t,e){for(var o=0;o<e.length;o++)if(e[o]==t)return!1;return!0})},jsonOdm.Query.prototype.$gt=function(t){return this.$testCollection(t,function(t,e){return t>e})},jsonOdm.Query.prototype.$gte=function(t){return this.$testCollection(t,function(t,e){return t>=e})},jsonOdm.Query.prototype.$lt=function(t){return this.$testCollection(t,function(t,e){return e>t})},jsonOdm.Query.prototype.$lte=function(t){return this.$testCollection(t,function(t,e){return e>=t})},jsonOdm.Query.prototype.$isNull=function(){return this.$testCollection(null,function(t){return"undefined"==typeof t||null===t})},jsonOdm.Query.prototype.$exists=function(){return this.$testCollection(null,function(t){return"undefined"!=typeof t})},jsonOdm.Query.prototype.$type=function(){return this.$testCollection(arguments,function(t,e){return jsonOdm.util.is(t,e)})},jsonOdm.Query.prototype.$mod=function(){return this.$testCollection(arguments,function(t,e){return t%e[0]==e[1]})},jsonOdm.Query.prototype.$regex=function(t,e){return"string"==typeof t&&(t="string"==typeof e?new RegExp(t,e):new RegExp(t)),this.$testCollection(t,function(t,e){return e.test(t)})},jsonOdm.Query.prototype.$text=function(t){for(var e,o,n=/(^| )-([^ ]+)( |$)/g,r=/"([^"]+)"/g,i=[],s=[];null!==(e=n.exec(t));)i.push(e[2]);for(t=t.replace(n,"");null!==(o=r.exec(t));)s.push(o[1]);t=t.replace(r,"");var u=t.split(" ");return this.$testCollection([i,s,u],function(t,e){for(var o=0;o<e[0].length;o++)if(t.indexOf(e[0][o])>-1)return!1;for(o=0;o<e[1].length;o++)if(t.indexOf(e[1][o])<0)return!1;for(o=0;o<e[2].length;o++)if(t.indexOf(e[2][o])>-1)return!0;return!!e[1].length})},jsonOdm.Query.prototype.$where=function(t){return"string"==typeof t&&(t=new Function(t)),this.$testCollection(t,function(t,e){return"function"!=typeof e?!1:e.apply(t)})},jsonOdm.Query.prototype.$geoWithin=function(t){return this.$testCollection(jsonOdm.Geo.detectAsGeometry(t),function(t,e){return jsonOdm.Geo[t.type]&&jsonOdm.Geo[t.type].within&&jsonOdm.Geo[t.type].within(t,e)})},jsonOdm.Query.prototype.$geoIntersects=function(t){return this.$testCollection(jsonOdm.Geo.detectAsGeometry(t),function(t,e){return jsonOdm.Geo[t.type]&&jsonOdm.Geo[t.type].intersects&&jsonOdm.Geo[t.type].intersects(t,e)})},jsonOdm.Query.prototype.$and=function(){return this.$binaryOperator(arguments,function(t){for(var e=0;e<t.length;e++)if(!t[e])return!1;return!0})},jsonOdm.Query.prototype.$nand=function(){return this.$binaryOperator(arguments,function(t){for(var e=0;e<t.length;e++)if(!t[e])return!0;return!1})},jsonOdm.Query.prototype.$not=jsonOdm.Query.prototype.$nand,jsonOdm.Query.prototype.$or=function(){return this.$binaryOperator(arguments,function(t){for(var e=0;e<t.length;e++)if(t[e])return!0;return!1})},jsonOdm.Query.prototype.$nor=function(){return this.$binaryOperator(arguments,function(t){for(var e=0;e<t.length;e++)if(t[e])return!1;return!0})};
"use strict";function JsonOdm(){var t=this;this.sources={},this.selectedSource={},this.addSource=function(e,o,n){"object"==typeof o&&("undefined"==typeof t.sources[e]&&(t.sources[e]=o),n&&(t.selectedSource=o))},this.selectSource=function(e){"undefined"!=typeof t.sources[e]&&(t.selectedSource=t.sources[e])}}var root="undefined"!=typeof window?window:global,odm=new JsonOdm;root.jsonOdm||(root.jsonOdm=odm),"undefined"!=typeof module&&module.exports&&(module.exports=odm),jsonOdm.Util=function(){},jsonOdm.Util.prototype.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)},jsonOdm.Util.prototype.is=function(t,e){e="string"==typeof e?[e]:e;var o=Object.prototype.toString.call(t);o=o.substring(8,o.length-1).toLowerCase();for(var n=0;n<e.length;n++){var r=e[n].toLowerCase();if("array"==r&&this.isArray(t))return!0;if(r==o)return!0;if(typeof t==r)return!0}return!1},jsonOdm.Util.prototype.objectKeys=Object.keys||function(){var t=Object.prototype.hasOwnProperty,e=!{toString:null}.propertyIsEnumerable("toString"),o=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],n=o.length;return function(r){if("object"!=typeof r&&("function"!=typeof r||null===r))throw new TypeError("Object.keys called on non-object");var i,s,u=[];for(i in r)t.call(r,i)&&u.push(i);if(e)for(s=0;n>s;s++)t.call(r,o[s])&&u.push(o[s]);return u}}(),jsonOdm.Util.prototype.branch=function(t,e){function o(){if(arguments&&arguments.length&&this){var t=this[arguments[0]];return t?o.apply(t,Array.prototype.slice.call(arguments,1)):t}return this}return o.apply(t,e)},jsonOdm.Util.prototype.projectElement=function(t,e,o){var n={};for(var r in t)t.hasOwnProperty(r)&&(1==t[r]?n[r]=e[r]:"function"==typeof t[r]?n[r]=t[r](o||e):t[r]instanceof jsonOdm.Query?n[r]=t[r].$$commandQueue[t[r].$$commandQueue.length-1](e):"object"==typeof t[r]&&(n[r]=this.projectElement(t[r],e[r],o||e)));return n},jsonOdm.util=new jsonOdm.Util,jsonOdm.Geo=function(){},jsonOdm.Geo.detectAsGeometry=function(t){if(!t.type)if(jsonOdm.util.isArray(t)&&2==t.length&&!jsonOdm.util.isArray(t[0]))t=new jsonOdm.Geo.Point(t);else if(jsonOdm.util.isArray(t)&&4==t.length&&!jsonOdm.util.isArray(t[0]))t=new jsonOdm.Geo.BoundaryBox(t);else if(jsonOdm.util.isArray(t)&&t.length>=1&&jsonOdm.util.isArray(t[0])&&2==t[0].length&&!jsonOdm.util.isArray(t[0][0]))t=new jsonOdm.Geo.LineString(t);else if(jsonOdm.util.isArray(t)&&t.length>=1&&jsonOdm.util.isArray(t[0])&&t[0].length>=1&&jsonOdm.util.isArray(t[0][0])&&2==t[0][0].length&&!jsonOdm.util.isArray(t[0][0][0]))t=new jsonOdm.Geo.Polygon(t);else{if(!(jsonOdm.util.isArray(t)&&t.length>=1&&jsonOdm.util.isArray(t[0])&&t[0].length>=1&&jsonOdm.util.isArray(t[0][0])&&t[0][0].length>=1&&jsonOdm.util.isArray(t[0][0][0])&&2==t[0][0][0].length)||jsonOdm.util.isArray(t[0][0][0][0]))return!1;t=new jsonOdm.Geo.MultiPolygon(t)}return t},jsonOdm.Geo.FeatureCollection=function(t,e){this.type="FeatureCollection",this.features=t||[],e&&(this.bbox=e)},jsonOdm.Geo.Feature=function(t,e,o,n){this.geometry=t||{},e&&(this.properties=e),o&&(this.bbox=o),n&&(this.id=n)},jsonOdm.Geo.BoundaryBox=function(t){var e=Object.create(Array.prototype);return e=Array.apply(e)||e,jsonOdm.util.isArray(t)?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3]):(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e},jsonOdm.Geo.BoundaryBox.within=function(t,e){return jsonOdm.util.isArray(t)&&4==t.length?jsonOdm.Geo.Polygon.within(new jsonOdm.Geo.Polygon([[[t[0],t[1]],[t[2],t[1]],[t[2],t[3]],[t[0],t[3]],[t[0],t[1]]]]),e):!1},jsonOdm.Geo.Point=function(t,e){this.type="Point",this.coordinates=t,e&&(this.bbox=e)},jsonOdm.Geo.Point.within=function(t,e){var o,n;if(!t.coordinates)return!1;if("Point"==e.type)return e.coordinates[0]==t.coordinates[0]&&e.coordinates[1]==t.coordinates[1];if("MultiPoint"==e.type||"LineString"==e.type){for(o=0;e.coordinates&&o<e.coordinates.length;o++)if(e.coordinates[o][0]==t.coordinates[0]&&e.coordinates[o][1]==t.coordinates[1])return!0;return!1}if("MultiLineString"==e.type){for(o=0;e.coordinates&&o<e.coordinates.length;o++)for(n=0;e.coordinates[o]&&n<e.coordinates[o].length;n++)if(e.coordinates[o][n][0]==t.coordinates[0]&&e.coordinates[o][n][1]==t.coordinates[1])return!0;return!1}if("Polygon"==e.type)return jsonOdm.Geo.pointWithinPolygon(t.coordinates,e.coordinates?e.coordinates[0]:null);if("MultiPolygon"==e.type){for(o=0;e.coordinates&&o<e.coordinates.length;o++)if(jsonOdm.Geo.pointWithinPolygon(t.coordinates,e.coordinates[o]?e.coordinates[o][0]:null))return!0;return!1}if("GeometryCollection"==e.type&&jsonOdm.util.isArray(e.geometries)){for(o=0;o<e.geometries.length;o++)if(jsonOdm.Geo.Point.within(t,e.geometries[o]))return!0;return!1}return jsonOdm.Geo.pointWithinBounds(t.coordinates,e)},jsonOdm.Geo.Point.intersects=jsonOdm.Geo.Point.within,jsonOdm.Geo.MultiPoint=function(t,e){this.type="MultiPoint",this.coordinates=t,e&&(this.bbox=e)},jsonOdm.Geo.MultiPoint.within=function(t,e){var o,n,r,i;if(!t.coordinates||!jsonOdm.util.isArray(t.coordinates))return!1;if("Point"==e.type)return 1==t.coordinates.length&&t.coordinates[0][0]==e.coordinates[0]&&t.coordinates[0][1]==e.coordinates[1];if("MultiPoint"==e.type){for(n=0;t.coordinates&&n<t.coordinates.length;n++){for(i=!1,o=0;e.coordinates&&o<e.coordinates.length;o++)if(e.coordinates[o][0]==t.coordinates[n][0]&&e.coordinates[o][1]==t.coordinates[n][1]){i=!0;break}if(!i)return!1}return!0}if("LineString"==e.type){for(r=0;t.coordinates&&r<t.coordinates.length;r++)if(!jsonOdm.Geo.pointWithinLineString(t.coordinates[r],e.coordinates))return!1;return!0}if("MultiLineString"==e.type){for(r=0;t.coordinates&&r<t.coordinates.length;r++){for(i=!1,o=0;e.coordinates&&o<e.coordinates.length;o++)if(jsonOdm.Geo.pointWithinLineString(t.coordinates[r],e.coordinates[o])){i=!0;break}if(!i)return!1}return!0}if("Polygon"==e.type){for(o=0;t.coordinates&&o<t.coordinates.length;o++)if(!jsonOdm.Geo.pointWithinPolygon(t.coordinates[o],e.coordinates?e.coordinates[0]:null))return!1;return!0}if("MultiPolygon"==e.type){for(n=0;t.coordinates&&n<t.coordinates.length;n++){for(i=!1,o=0;e.coordinates&&o<e.coordinates.length;o++)if(jsonOdm.Geo.pointWithinPolygon(t.coordinates[n],e.coordinates[o]?e.coordinates[o][0]:null)){i=!0;break}if(!i)return!1}return!0}if("GeometryCollection"==e.type&&jsonOdm.util.isArray(e.geometries)){for(o=0;o<e.geometries.length;o++)if(jsonOdm.Geo.MultiPoint.within(t,e.geometries[o]))return!0;return!1}for(o=0;o<t.coordinates.length;o++)if(!jsonOdm.Geo.pointWithinBounds(t.coordinates[o],e))return!1;return!0},jsonOdm.Geo.MultiPoint.intersects=function(t,e){var o,n,r;if(!t.coordinates||!jsonOdm.util.isArray(t.coordinates))return!1;if("Point"==e.type)return jsonOdm.Geo.Point.intersects(e,t);if("MultiPoint"==e.type){for(n=0;t.coordinates&&n<t.coordinates.length;n++)for(o=0;e.coordinates&&o<e.coordinates.length;o++)if(e.coordinates[o][0]==t.coordinates[n][0]&&e.coordinates[o][1]==t.coordinates[n][1])return!0;return!1}if("LineString"==e.type){for(r=0;t.coordinates&&r<t.coordinates.length;r++)if(jsonOdm.Geo.pointWithinLineString(t.coordinates[r],e.coordinates))return!0;return!1}if("MultiLineString"==e.type){for(r=0;t.coordinates&&r<t.coordinates.length;r++)for(o=0;e.coordinates&&o<e.coordinates.length;o++)if(jsonOdm.Geo.pointWithinLineString(t.coordinates[r],e.coordinates[o]))return!0;return!1}if("Polygon"==e.type){for(o=0;t.coordinates&&o<t.coordinates.length;o++)if(jsonOdm.Geo.pointWithinPolygon(t.coordinates[o],e.coordinates?e.coordinates[0]:null))return!0;return!1}if("MultiPolygon"==e.type){for(n=0;t.coordinates&&n<t.coordinates.length;n++)for(o=0;e.coordinates&&o<e.coordinates.length;o++)if(jsonOdm.Geo.pointWithinPolygon(t.coordinates[n],e.coordinates[o]?e.coordinates[o][0]:null))return!0;return!1}if("GeometryCollection"==e.type&&jsonOdm.util.isArray(e.geometries)){for(o=0;o<e.geometries.length;o++)if(jsonOdm.Geo.MultiPoint.intersects(t,e.geometries[o]))return!0;return!1}for(o=0;o<t.coordinates.length;o++)if(jsonOdm.Geo.pointWithinBounds(t.coordinates[o],e))return!0;return!1},jsonOdm.Geo.LineString=function(t,e){this.type="LineString",this.coordinates=t,e&&(this.bbox=e)},jsonOdm.Geo.LineString.within=function(t,e){var o,n;if(!t.coordinates||!jsonOdm.util.isArray(t.coordinates))return!1;if("Point"==e.type||"MultiPoint"==e.type)return!1;if("LineString"==e.type)return jsonOdm.Geo.lineStringWithinLineString(t.coordinates,e.coordinates);if("MultiLineString"==e.type){for(o=0;e.coordinates&&o<e.coordinates.length;o++)if(jsonOdm.Geo.lineStringWithinLineString(t.coordinates,e.coordinates[o]))return!0;return!1}if("Polygon"==e.type){for(o=0;t.coordinates&&o<t.coordinates.length-1;o++)if(!jsonOdm.Geo.edgeWithinPolygon([t.coordinates[o],t.coordinates[o+1]],e.coordinates[0]))return!1;return!0}if("MultiPolygon"==e.type){for(o=0;e.coordinates&&o<e.coordinates.length;o++)for(n=0;t.coordinates&&n<t.coordinates.length-1;n++)if(jsonOdm.Geo.edgeWithinPolygon([t.coordinates[n],t.coordinates[n+1]],e.coordinates[o][0])&&n+1==t.coordinates.length-1)return!0;return!1}if("GeometryCollection"==e.type&&jsonOdm.util.isArray(e.geometries)){for(o=0;o<e.geometries.length;o++)if(jsonOdm.Geo.LineString.within(t,e.geometries[o]))return!0;return!1}for(o=0;o<t.coordinates.length;o++)if(!jsonOdm.Geo.pointWithinBounds(t.coordinates[o],e))return!1;return!0},jsonOdm.Geo.LineString.intersects=function(t,e){var o,n;if(!t.coordinates||!jsonOdm.util.isArray(t.coordinates))return!1;if("Point"==e.type)return jsonOdm.Geo.Point.intersects(e,t);if("MultiPoint"==e.type)return jsonOdm.Geo.MultiPoint.intersects(e,t);if("LineString"==e.type){for(o=0;o<t.coordinates.length-1;o++)if(jsonOdm.Geo.edgeIntersectsLineString([t.coordinates[o],t.coordinates[o+1]],e.coordinates))return!0;return!1}if("MultiLineString"==e.type){for(o=0;e.coordinates&&o<e.coordinates.length;o++)for(n=0;n<t.coordinates.length-1;n++)if(jsonOdm.Geo.edgeIntersectsLineString([t.coordinates[n],t.coordinates[n+1]],e.coordinates[o]))return!0;return!1}if("Polygon"==e.type){for(o=0;t.coordinates&&o<t.coordinates.length-1;o++)if(jsonOdm.Geo.edgeIntersectsPolygon([t.coordinates[o],t.coordinates[o+1]],e.coordinates[0]))return!0;return!1}if("MultiPolygon"==e.type){for(o=0;e.coordinates&&o<e.coordinates.length;o++)for(n=0;t.coordinates&&n<t.coordinates.length-1;n++)if(jsonOdm.Geo.edgeIntersectsPolygon([t.coordinates[n],t.coordinates[n+1]],e.coordinates[o][0]))return!0;return!1}if("GeometryCollection"==e.type&&jsonOdm.util.isArray(e.geometries)){for(o=0;o<e.geometries.length;o++)if(jsonOdm.Geo.LineString.intersects(t,e.geometries[o]))return!0;return!1}for(o=0;t.coordinates&&o<t.coordinates.length-1;o++)if(jsonOdm.Geo.edgeIntersectsBounds([t.coordinates[o],t.coordinates[o+1]],e))return!0;return!1},jsonOdm.Geo.MultiLineString=function(t,e){this.type="MultiLineString",this.coordinates=t,e&&(this.bbox=e)},jsonOdm.Geo.MultiLineString.within=function(t,e){var o,n,r,i;if(!t.coordinates||!jsonOdm.util.isArray(t.coordinates))return!1;if("Point"==e.type||"MultiPoint"==e.type)return!1;if("LineString"==e.type){for(o=0;t.coordinates&&o<t.coordinates.length;o++)if(!jsonOdm.Geo.lineStringWithinLineString(t.coordinates[o],e.coordinates))return!1;return!0}if("MultiLineString"==e.type){for(n=0;t.coordinates&&n<t.coordinates.length;n++){for(i=!1,o=0;e.coordinates&&o<e.coordinates.length;o++)if(jsonOdm.Geo.lineStringWithinLineString(t.coordinates[n],e.coordinates[o])){i=!0;break}if(!i)return!1}return!0}if("Polygon"==e.type){for(o=0;t.coordinates&&o<t.coordinates.length;o++)for(n=0;t.coordinates&&n<t.coordinates[o].length-1;n++)if(!jsonOdm.Geo.edgeWithinPolygon([t.coordinates[o][n],t.coordinates[o][n+1]],e.coordinates[0]))return!1;return!0}if("MultiPolygon"==e.type){for(n=0;t.coordinates&&n<t.coordinates.length;n++){for(i=!1,o=0;e.coordinates&&o<e.coordinates.length;o++)for(r=0;t.coordinates[n]&&r<t.coordinates[n].length-1;r++)if(jsonOdm.Geo.edgeWithinPolygon([t.coordinates[n][r],t.coordinates[n][r+1]],e.coordinates[o][0])&&r+1==t.coordinates[n].length-1){i=!0;break}if(!i)return!1}return!0}if("GeometryCollection"==e.type&&jsonOdm.util.isArray(e.geometries)){for(o=0;o<e.geometries.length;o++)if(jsonOdm.Geo.MultiLineString.within(t,e.geometries[o]))return!0;return!1}for(o=0;o<t.coordinates.length;o++)for(n=0;n<t.coordinates[o].length;n++)if(!jsonOdm.Geo.pointWithinBounds(t.coordinates[o][n],e))return!1;return!0},jsonOdm.Geo.MultiLineString.intersects=function(t,e){var o,n,r;if(!t.coordinates||!jsonOdm.util.isArray(t.coordinates))return!1;if("Point"==e.type)return jsonOdm.Geo.Point.intersects(e,t);if("MultiPoint"==e.type)return jsonOdm.Geo.MultiPoint.intersects(e,t);if("LineString"==e.type)return jsonOdm.Geo.LineString.intersects(e,t);if("MultiLineString"==e.type){for(n=0;t.coordinates&&n<t.coordinates.length;n++)for(r=0;t.coordinates[n]&&r<t.coordinates[n].length-1;r++)for(o=0;e.coordinates&&o<e.coordinates.length;o++)if(jsonOdm.Geo.edgeIntersectsLineString([t.coordinates[n][r],t.coordinates[n][r+1]],e.coordinates[o]))return!0;return!1}if("Polygon"==e.type){for(o=0;t.coordinates&&o<t.coordinates.length;o++)for(n=0;t.coordinates&&n<t.coordinates[o].length-1;n++)if(jsonOdm.Geo.edgeIntersectsPolygon([t.coordinates[o][n],t.coordinates[o][n+1]],e.coordinates[0]))return!0;return!1}if("MultiPolygon"==e.type){for(n=0;t.coordinates&&n<t.coordinates.length;n++)for(o=0;e.coordinates&&o<e.coordinates.length;o++)for(r=0;t.coordinates[n]&&r<t.coordinates[n].length-1;r++)if(jsonOdm.Geo.edgeIntersectsPolygon([t.coordinates[n][r],t.coordinates[n][r+1]],e.coordinates[o][0]))return!0;return!1}if("GeometryCollection"==e.type&&jsonOdm.util.isArray(e.geometries)){for(o=0;o<e.geometries.length;o++)if(jsonOdm.Geo.MultiLineString.intersects(t,e.geometries[o]))return!0;return!1}for(o=0;t.coordinates&&o<t.coordinates.length;o++)for(n=0;n<t.coordinates[o].length-1;n++)if(jsonOdm.Geo.edgeIntersectsBounds([t.coordinates[o][n],t.coordinates[o][n+1]],e))return!0;return!1},jsonOdm.Geo.Polygon=function(t,e){this.type="Polygon",this.coordinates=t,e&&(this.bbox=e)},jsonOdm.Geo.Polygon.within=function(t,e){var o,n;if(!t.coordinates||!jsonOdm.util.isArray(t.coordinates))return!1;if("Point"==e.type||"MultiPoint"==e.type||"LineString"==e.type||"MultiLineString"==e.type)return!1;if("Polygon"==e.type){for(o=0;t.coordinates[0]&&o<t.coordinates[0].length-1;o++)if(!jsonOdm.Geo.edgeWithinPolygon([t.coordinates[0][o],t.coordinates[0][o+1]],e.coordinates[0]))return!1;return!0}if("MultiPolygon"==e.type){for(o=0;e.coordinates&&o<e.coordinates.length;o++)for(n=0;t.coordinates[0]&&n<t.coordinates[0].length-1;n++){var r=jsonOdm.Geo.edgeWithinPolygon([t.coordinates[0][n],t.coordinates[0][n+1]],e.coordinates[o][0]);if(!r)break;if(r&&n+1==t.coordinates[0].length-1)return!0}return!1}if("GeometryCollection"==e.type&&jsonOdm.util.isArray(e.geometries)){for(o=0;o<e.geometries.length;o++)if(jsonOdm.Geo.Polygon.within(t,e.geometries[o]))return!0;return!1}for(o=0;t.coordinates[0]&&o<t.coordinates[0].length;o++)if(!jsonOdm.Geo.pointWithinBounds(t.coordinates[0][o],e))return!1;return!0},jsonOdm.Geo.Polygon.intersects=function(t,e){var o,n;if(!t.coordinates||!jsonOdm.util.isArray(t.coordinates))return!1;if("Point"==e.type)return jsonOdm.Geo.Point.intersects(e,t);if("MultiPoint"==e.type)return jsonOdm.Geo.MultiPoint.intersects(e,t);if("LineString"==e.type)return jsonOdm.Geo.LineString.intersects(e,t);if("MultiLineString"==e.type)return jsonOdm.Geo.MultiLineString.intersects(e,t);if("Polygon"==e.type){for(o=0;t.coordinates[0]&&o<t.coordinates[0].length-1;o++)if(jsonOdm.Geo.edgeIntersectsPolygon([t.coordinates[0][o],t.coordinates[0][o+1]],e.coordinates[0]))return!0;return!1}if("MultiPolygon"==e.type){for(o=0;e.coordinates&&o<e.coordinates.length;o++)for(n=0;t.coordinates[0]&&n<t.coordinates[0].length-1;n++)if(jsonOdm.Geo.edgeIntersectsPolygon([t.coordinates[0][n],t.coordinates[0][n+1]],e.coordinates[o][0]))return!0;return!1}if("GeometryCollection"==e.type&&jsonOdm.util.isArray(e.geometries)){for(o=0;o<e.geometries.length;o++)if(jsonOdm.Geo.Polygon.intersects(t,e.geometries[o]))return!0;return!1}for(o=0;t.coordinates[0]&&o<t.coordinates[0].length-1;o++)if(jsonOdm.Geo.edgeIntersectsBounds([t.coordinates[0][o],t.coordinates[0][o+1]],e))return!0;return!1},jsonOdm.Geo.MultiPolygon=function(t,e){this.type="MultiPolygon",this.coordinates=t,e&&(this.bbox=e)},jsonOdm.Geo.MultiPolygon.within=function(t,e){var o,n,r,i;if(!t.coordinates||!jsonOdm.util.isArray(t.coordinates))return!1;if("Point"==e.type||"MultiPoint"==e.type||"LineString"==e.type||"MultiLineString"==e.type)return!1;if("Polygon"==e.type){for(o=0;t.coordinates&&o<t.coordinates.length;o++)for(n=0;n<t.coordinates[o][0].length-1;n++)if(!jsonOdm.Geo.edgeWithinPolygon([t.coordinates[o][0][n],t.coordinates[o][0][n+1]],e.coordinates[0]))return!1;return!0}if("MultiPolygon"==e.type){for(o=0;t.coordinates&&o<t.coordinates.length;o++){for(i=!1,n=0;e.coordinates&&n<e.coordinates.length;n++)for(r=0;t.coordinates[o][0]&&r<t.coordinates[o][0].length-1;r++){var s=jsonOdm.Geo.edgeWithinPolygon([t.coordinates[o][0][r],t.coordinates[o][0][r+1]],e.coordinates[n][0]);if(!s)break;if(s&&r+1==t.coordinates[o][0].length-1){i=!0;break}}if(!i)return!1}return!0}if("GeometryCollection"==e.type&&jsonOdm.util.isArray(e.geometries)){for(o=0;o<e.geometries.length;o++)if(jsonOdm.Geo.MultiPolygon.within(t,e.geometries[o]))return!0;return!1}for(o=0;o<t.coordinates.length;o++)for(n=0;n<t.coordinates[o][0].length;n++)if(!jsonOdm.Geo.pointWithinBounds(t.coordinates[o][0][n],e))return!1;return!0},jsonOdm.Geo.MultiPolygon.intersects=function(t,e){var o,n,r;if(!t.coordinates||!jsonOdm.util.isArray(t.coordinates))return!1;if("Point"==e.type)return jsonOdm.Geo.Point.intersects(e,t);if("MultiPoint"==e.type)return jsonOdm.Geo.MultiPoint.intersects(e,t);if("LineString"==e.type)return jsonOdm.Geo.LineString.intersects(e,t);if("MultiLineString"==e.type)return jsonOdm.Geo.MultiLineString.intersects(e,t);if("Polygon"==e.type)return jsonOdm.Geo.Polygon.intersects(e,t);if("MultiPolygon"==e.type){for(o=0;t.coordinates&&o<t.coordinates.length;o++)for(n=0;e.coordinates&&n<e.coordinates.length;n++)for(r=0;t.coordinates[o][0]&&r<t.coordinates[o][0].length-1;r++)if(jsonOdm.Geo.pointWithinPolygon(t.coordinates[o][0][r],e.coordinates[n][0]))return!0;return!1}if("GeometryCollection"==e.type&&jsonOdm.util.isArray(e.geometries)){for(o=0;o<e.geometries.length;o++)if(jsonOdm.Geo.MultiPolygon.intersects(t,e.geometries[o]))return!0;return!1}for(o=0;o<t.coordinates.length;o++)for(n=0;n<t.coordinates[o][0].length-1;n++)if(jsonOdm.Geo.edgeIntersectsBounds([t.coordinates[o][0][n],t.coordinates[o][0][n+1]],e))return!0;return!1},jsonOdm.Geo.GeometryCollection=function(t,e){this.type="GeometryCollection",this.geometries=t,e&&(this.bbox=e)},jsonOdm.Geo.GeometryCollection.within=function(t,e){if(!jsonOdm.util.isArray(t.geometries)||!t.geometries.length||!e.type)return!1;for(var o=0;o<t.geometries.length;o++){if(!jsonOdm.Geo[t.geometries[o].type]||!jsonOdm.Geo[t.geometries[o].type].within)return!1;if(!jsonOdm.Geo[t.geometries[o].type].within(t.geometries[o],e))return!1}return!0},jsonOdm.Geo.GeometryCollection.intersects=function(t,e){if(!jsonOdm.util.isArray(t.geometries)||!t.geometries.length||!e.type)return!1;for(var o=0;o<t.geometries.length;o++)if(jsonOdm.Geo[t.geometries[o].type]&&jsonOdm.Geo[t.geometries[o].type].intersects&&jsonOdm.Geo[t.geometries[o].type].intersects(t.geometries[o],e))return!0;return!1},jsonOdm.Geo.pointWithinPolygon=function(t,e){if(!(jsonOdm.util.isArray(t)&&jsonOdm.util.isArray(e)&&e.length>2))return!1;var o,n=0;(e[0][0]!=e[e.length-1][0]||e[0][1]!=e[e.length-1][1])&&(e=e.concat([e[0]]));for(var r=0;r<e.length-1;r++){if(e[r][0]==t[0]&&e[r][1]==t[1])return!0;if(!(e[r][0]<t[0]&&e[r+1][0]<t[0]||e[r][1]<t[1]&&e[r+1][1]<t[1]||e[r][1]>t[1]&&e[r+1][1]>t[1])){if(o=(e[r][0]-e[r+1][0])*((t[1]-e[r+1][1])/(e[r][1]-e[r+1][1]))+e[r+1][0],o==t[0]&&t[1]<=Math.max(e[r][1],e[r+1][1])&&t[1]>=Math.min(e[r][1],e[r+1][1]))return!0;o>t[0]&&n++}}return n%2==1},jsonOdm.Geo.edgeWithinPolygon=function(t,e){if(!(jsonOdm.util.isArray(t)&&2==t.length&&jsonOdm.util.isArray(e)&&e.length>=2))return!1;if((e[0][0]!=e[e.length-1][0]||e[0][1]!=e[e.length-1][1])&&(e=e.concat([e[0]])),!jsonOdm.Geo.pointWithinPolygon(t[0],e)||!jsonOdm.Geo.pointWithinPolygon(t[1],e))return!1;for(var o=0;o<e.length-1;o++)if(jsonOdm.Geo.edgeIntersectsEdge(t,[e[o],e[o+1]],!1))return!1;return!0},jsonOdm.Geo.edgeIntersectsPolygon=function(t,e){if(!(jsonOdm.util.isArray(t)&&2==t.length&&jsonOdm.util.isArray(e)&&e.length>=2))return!1;if((e[0][0]!=e[e.length-1][0]||e[0][1]!=e[e.length-1][1])&&(e=e.concat([e[0]])),jsonOdm.Geo.pointWithinPolygon(t[0],e)||jsonOdm.Geo.pointWithinPolygon(t[1],e))return!0;for(var o=0;o<e.length-1;o++)if(jsonOdm.Geo.edgeIntersectsEdge(t,[e[o],e[o+1]]))return!0;return!1},jsonOdm.Geo.edgeIntersectsLineString=function(t,e){if(!jsonOdm.util.isArray(t)||2!=t.length||!jsonOdm.util.isArray(e))return!1;for(var o=0;o<e.length-1;o++)if(jsonOdm.Geo.edgeIntersectsEdge(t,[e[o],e[o+1]]))return!0;return!1},jsonOdm.Geo.edgeIntersectsEdge=function(t,e,o){o="undefined"==typeof o?!0:o;var n=[t[1][0]-t[0][0],t[1][1]-t[0][1]],r=[Math.min(t[0][0],t[1][0]),Math.min(t[0][1],t[1][1]),Math.max(t[0][0],t[1][0]),Math.max(t[0][1],t[1][1])],i=[e[1][0]-e[0][0],e[1][1]-e[0][1]],s=[Math.min(e[0][0],e[1][0]),Math.min(e[0][1],e[1][1]),Math.max(e[0][0],e[1][0]),Math.max(e[0][1],e[1][1])];if(r[0]>s[0]&&r[0]>s[2]||r[1]>s[1]&&r[1]>s[3]||s[0]>r[0]&&s[0]>r[2]||s[1]>r[1]&&s[1]>r[3])return!1;if(i[0]*n[1]-n[0]*i[1]==0)return o&&t[0][1]+(e[0][0]-t[0][0])/n[0]*n[1]==e[0][1];var u=(e[0][1]*i[0]+t[0][0]*i[1]-e[0][0]*i[1]-t[0][1]*i[0])/(n[1]*i[0]-n[0]*i[1]),d=t[0][0]+u*n[0],c=t[0][1]+u*n[1];return o?d>=r[0]&&d<=r[2]&&c>=r[1]&&c<=r[3]&&d>=s[0]&&d<=s[2]&&c>=s[1]&&c<=s[3]:d>r[0]&&d<r[2]&&c>r[1]&&c<r[3]&&d>s[0]&&d<s[2]&&c>s[1]&&c<s[3]},jsonOdm.Geo.pointWithinLineString=function(t,e){if(!(jsonOdm.util.isArray(t)&&jsonOdm.util.isArray(e)&&e.length>=2))return!1;for(var o=0;o<e.length-1;o++)if((t[0]>=e[o][0]&&t[0]<=e[o+1][0]&&e[o][0]<=e[o+1][0]||t[0]<=e[o][0]&&t[0]>=e[o+1][0]&&e[o][0]>=e[o+1][0])&&(t[1]>=e[o][1]&&t[1]<=e[o+1][1]&&e[o][1]<=e[o+1][1]||t[1]<=e[o][1]&&t[1]>=e[o+1][1]&&e[o][1]>=e[o+1][1])&&(e[o][0]==t[0]&&e[o][1]==t[1]||e[o+1][0]==t[0]&&e[o+1][1]==t[1]||e[o][1]-e[o+1][1]!=0&&(e[o][0]-e[o+1][0])*((t[1]-e[o+1][1])/(e[o][1]-e[o+1][1]))+e[o+1][0]==t[0]||e[o][0]-e[o+1][0]!=0&&(e[o][1]-e[o+1][1])*((t[0]-e[o+1][0])/(e[o][0]-e[o+1][0]))+e[o+1][1]==t[1]))return!0;return!1},jsonOdm.Geo.pointWithinBounds=function(t,e){return jsonOdm.util.isArray(t)&&jsonOdm.util.isArray(e)&&4==e.length?t[0]>=e[0]&&t[1]>=e[1]&&t[0]<=e[2]&&t[1]<=e[3]:!1},jsonOdm.Geo.edgeIntersectsBounds=function(t,e){return jsonOdm.util.isArray(t)&&jsonOdm.util.isArray(e)&&4==e.length?jsonOdm.Geo.edgeIntersectsPolygon(t,[[e[0],e[1]],[e[2],e[1]],[e[2],e[3]],[e[0],e[3]]]):!1},jsonOdm.Geo.lineStringWithinLineString=function(t,e){if(!jsonOdm.util.isArray(t)||!jsonOdm.util.isArray(e))return!1;var o,n;for(o=0;t&&o<t.length;o++){var r=!1;for(n=0;e&&n<e.length;n++)if(t[o][0]==e[n][0]&&t[o][1]==e[n][1]){if(o+1==t.length)return!0;if(!(e[n+1]&&t[o+1][0]==e[n+1][0]&&t[o+1][1]==e[n+1][1]||t[o+1][0]==e[n][0]&&t[o+1][1]==e[n][1]||n>0&&t[o+1][0]==e[n-1][0]&&t[o+1][1]==e[n-1][1]))return!1;r=!0}if(!r)return!1}return!0},jsonOdm.Collection=function(t){var e=Object.create(Array.prototype);return e=Array.apply(e)||e,"undefined"!=typeof t&&jsonOdm.selectedSource&&jsonOdm.selectedSource[t]&&(e=e.concat(jsonOdm.selectedSource[t])),jsonOdm.Collection.decorate(e),e.$branch=function(){var t=jsonOdm.util.branch(e,arguments);return jsonOdm.Collection.decorate(t),t},e},jsonOdm.Collection.decorate=function(t){var e=function(t){jsonOdm.util.isArray(t)&&(t.$hasMany=function(e,o,n,r){"string"==typeof n&&(r=r||n);var i=n;"string"==typeof n&&jsonOdm.selectedSource&&jsonOdm.selectedSource[n]&&(i=jsonOdm.selectedSource[n]);for(var s=0;s<t.length;s++){var u=e;if(t[s].hasOwnProperty(e)&&(u=t[s][e]),"undefined"==typeof t[s][r])for(var d=0;u.length&&d<u.length;d++){for(var c=null,a=0;a<i.length;a++)if(u[d]==i[a][o]){c=i[a];break}null!=c&&(t[s][r]||(t[s][r]=[]),t[s][r].push(c))}}},t.$hasOne=function(e,o,n,r){"string"==typeof n&&(r=r||n);var i=n;"string"==typeof n&&jsonOdm.selectedSource&&jsonOdm.selectedSource[n]&&(i=jsonOdm.selectedSource[n]);for(var s=0;s<t.length;s++){var u;if(t[s].hasOwnProperty(e)&&(u=t[s][e]),"undefined"==typeof t[s][r]){for(var d=null,c=0;c<i.length;c++)if(u==i[c][o]){d=i[c];break}null!=d&&(t[s][r]=d)}}},t.$query=function(){return new jsonOdm.Query(t)})};e(t)},jsonOdm.Query=function(t){this.$$commandQueue=[],this.$$aggregationBeforeCollectQueue=[],this.$$aggregationResultQueue=[],this.$$collection=t||[]},jsonOdm.Query.prototype.$delete=function(){if(this.$$commandQueue.length<1)return this;for(var t=0;t<this.$$collection.length;){for(var e=!0,o=0;o<this.$$commandQueue.length&&(e=e&&this.$$commandQueue[o](this.$$collection[t]));o++);e?this.$$collection.splice(t,1):t++}return this},jsonOdm.Query.prototype.$result=function(t,e){if(this.$$commandQueue.length<1&&this.$$aggregationBeforeCollectQueue<1)return this.$$collection;t="undefined"==typeof t?0:t,e="undefined"==typeof e?this.$$collection.length:e;var o,n,r,i=new jsonOdm.Collection;for(n=0;n<this.$$collection.length;n++){var s=!0;for(r=0;r<this.$$commandQueue.length&&(s=s&&this.$$commandQueue[r](this.$$collection[n]));r++);if(s){if(t>0){t--;continue}if(0>=e)return i;for(o=this.$$collection[n],r=0;r<this.$$aggregationBeforeCollectQueue.length;r++)o=this.$$aggregationBeforeCollectQueue[r](n,o);i.push(o),e--}}for(n=0;n<this.$$aggregationResultQueue.length;n++)i=this.$$aggregationResultQueue[n](i);return i},jsonOdm.Query.prototype.$all=function(){return this.$result()},jsonOdm.Query.prototype.$first=function(){return this.$result(0,1)[0]},jsonOdm.Query.prototype.$aggregateCollection=function(t,e,o){return"function"==typeof t&&(t=[t]),"function"==typeof e&&(e=[e]),"function"==typeof o&&(o=[o]),jsonOdm.util.isArray(t)&&(this.$$commandQueue=this.$$commandQueue.concat(t)),jsonOdm.util.isArray(e)&&(this.$$aggregationBeforeCollectQueue=this.$$aggregationBeforeCollectQueue.concat(e)),jsonOdm.util.isArray(o)&&(this.$$aggregationResultQueue=this.$$aggregationResultQueue.concat(o)),this},jsonOdm.Query.prototype.$project=function(t){return this.$aggregateCollection(null,function(e,o){return jsonOdm.util.projectElement(t,o)})},jsonOdm.Query.prototype.$testCollection=function(t,e){var o=this.$$commandQueue.pop(),n=function(){return function(n){if(!(o instanceof jsonOdm.Collection||"function"==typeof o||"undefined"==typeof o)||"function"!=typeof e)return!1;var r="undefined"==typeof o?n:o instanceof jsonOdm.Collection?o:o(n);return!!e(r,t)}}();return this.$$commandQueue.push(n),this},jsonOdm.Query.prototype.$queryOperator=function(t,e){var o=function(t,o){return function(n){if("function"!=typeof o)return!1;for(var r=[],i=0;i<t.length;i++)if(t[i]instanceof jsonOdm.Query)for(var s=0;s<t[i].$$commandQueue.length;s++)r.push(t[i].$$commandQueue[s](n));else r.push(t[i]);return e(r)}}(t,e),n=new jsonOdm.Query(this.$$collection);return n.$$commandQueue.push(o),n},jsonOdm.Query.prototype.$branch=function(){var t=function(t){return function(e){return jsonOdm.util.branch(e,t)}}(arguments),e=new jsonOdm.Query(this.$$collection);return e.$$commandQueue.push(t),e},jsonOdm.Query.prototype.$modifyField=function(t){var e=function(t,e){return function(o){return o=null!==e?e(o):o,"function"==typeof t?t(o):o}}(t,this.$$commandQueue.length?this.$$commandQueue[this.$$commandQueue.length-1]:null);return this.$$commandQueue.push(e),this},jsonOdm.Query.stringFiledModifyer=["charAt","charCodeAt","concat","fromCharCode","indexOf","lastIndexOf","localeCompare","match","replace","search","slice","split","substr","substring","toLocaleLowerCase","toLocaleUpperCase","toLowerCase","toUpperCase","trim","valueOf"];for(var i=0;i<jsonOdm.Query.stringFiledModifyer.length;i++)jsonOdm.Query.prototype["$"+jsonOdm.Query.stringFiledModifyer[i]]=function(t){return function(){return this.$modifyField(function(t,e){return function(o){return"string"==typeof o&&String.prototype.hasOwnProperty(e)?String.prototype[e].apply(o,t):o}}(arguments,t))}}(jsonOdm.Query.stringFiledModifyer[i]);jsonOdm.Query.prototype.$add=function(){return this.$queryOperator(arguments,function(t){for(var e=t.length>0?t[0]:0,o=1;o<t.length;o++)e+=t[o];return e})},jsonOdm.Query.prototype.$subtract=function(){return this.$queryOperator(arguments,function(t){for(var e=t.length>0?t[0]:0,o=1;o<t.length;o++)e-=t[o];return e})},jsonOdm.Query.prototype.$multiply=function(){return this.$queryOperator(arguments,function(t){for(var e=t.length>0?t[0]:0,o=1;o<t.length;o++)e*=t[o];return e})},jsonOdm.Query.prototype.$divide=function(){return this.$queryOperator(arguments,function(t){for(var e=t.length>0?t[0]:0,o=1;o<t.length;o++)e/=t[o];return e})},jsonOdm.Query.prototype.$modulo=function(){return this.$queryOperator(arguments,function(t){for(var e=t.length>0?t[0]:0,o=1;o<t.length;o++)e%=t[o];return e})},jsonOdm.Query.prototype.$eq=function(){return this.$testCollection(arguments,function(t,e){for(var o=0;o<e.length;o++)if(e[o]==t)return!0;return!1})},jsonOdm.Query.prototype.$in=function(t){return this.$testCollection(t,function(t,e){for(var o=0;o<e.length;o++)if(e[o]==t)return!0;return!1})},jsonOdm.Query.prototype.$ne=function(){return this.$testCollection(arguments,function(t,e){for(var o=0;o<e.length;o++)if(e[o]==t)return!1;return!0})},jsonOdm.Query.prototype.$nin=function(t){return this.$testCollection(t,function(t,e){for(var o=0;o<e.length;o++)if(e[o]==t)return!1;return!0})},jsonOdm.Query.prototype.$gt=function(t){return this.$testCollection(t,function(t,e){return t>e})},jsonOdm.Query.prototype.$gte=function(t){return this.$testCollection(t,function(t,e){return t>=e})},jsonOdm.Query.prototype.$lt=function(t){return this.$testCollection(t,function(t,e){return e>t})},jsonOdm.Query.prototype.$lte=function(t){return this.$testCollection(t,function(t,e){return e>=t})},jsonOdm.Query.prototype.$isNull=function(){return this.$testCollection(null,function(t){return"undefined"==typeof t||null===t})},jsonOdm.Query.prototype.$exists=function(){return this.$testCollection(null,function(t){return"undefined"!=typeof t})},jsonOdm.Query.prototype.$type=function(){return this.$testCollection(arguments,function(t,e){return jsonOdm.util.is(t,e)})},jsonOdm.Query.prototype.$mod=function(){return this.$testCollection(arguments,function(t,e){return t%e[0]==e[1]})},jsonOdm.Query.prototype.$regex=function(t,e){return"string"==typeof t&&(t="string"==typeof e?new RegExp(t,e):new RegExp(t)),this.$testCollection(t,function(t,e){return e.test(t)})},jsonOdm.Query.prototype.$text=function(t){for(var e,o,n=/(^| )-([^ ]+)( |$)/g,r=/"([^"]+)"/g,i=[],s=[];null!==(e=n.exec(t));)i.push(e[2]);for(t=t.replace(n,"");null!==(o=r.exec(t));)s.push(o[1]);t=t.replace(r,"");var u=t.split(" ");return this.$testCollection([i,s,u],function(t,e){for(var o=0;o<e[0].length;o++)if(t.indexOf(e[0][o])>-1)return!1;for(o=0;o<e[1].length;o++)if(t.indexOf(e[1][o])<0)return!1;for(o=0;o<e[2].length;o++)if(t.indexOf(e[2][o])>-1)return!0;return!!e[1].length})},jsonOdm.Query.prototype.$where=function(t){return"string"==typeof t&&(t=new Function(t)),this.$testCollection(t,function(t,e){return"function"!=typeof e?!1:e.apply(t)})},jsonOdm.Query.prototype.$geoWithin=function(t){return this.$testCollection(jsonOdm.Geo.detectAsGeometry(t),function(t,e){return jsonOdm.Geo[t.type]&&jsonOdm.Geo[t.type].within&&jsonOdm.Geo[t.type].within(t,e)})},jsonOdm.Query.prototype.$geoIntersects=function(t){return this.$testCollection(jsonOdm.Geo.detectAsGeometry(t),function(t,e){return jsonOdm.Geo[t.type]&&jsonOdm.Geo[t.type].intersects&&jsonOdm.Geo[t.type].intersects(t,e)})},jsonOdm.Query.prototype.$and=function(){return this.$queryOperator(arguments,function(t){for(var e=0;e<t.length;e++)if(!t[e])return!1;return!0})},jsonOdm.Query.prototype.$nand=function(){return this.$queryOperator(arguments,function(t){for(var e=0;e<t.length;e++)if(!t[e])return!0;
return!1})},jsonOdm.Query.prototype.$not=jsonOdm.Query.prototype.$nand,jsonOdm.Query.prototype.$or=function(){return this.$queryOperator(arguments,function(t){for(var e=0;e<t.length;e++)if(t[e])return!0;return!1})},jsonOdm.Query.prototype.$nor=function(){return this.$queryOperator(arguments,function(t){for(var e=0;e<t.length;e++)if(t[e])return!1;return!0})};

@@ -61,3 +61,3 @@ "use strict";

description:"A light weight but fast object document mapper for JavaScript objects.",
version:"0.1.4"
version:"0.1.5"
}, "jsonOdm"))

@@ -64,0 +64,0 @@ .pipe(jsdoc.generator('./doc',

{
"name": "json-odm",
"version": "0.1.4",
"version": "0.1.5",
"description": "Object document mapper for JSON data that provides mongodb methods for querying and transformation as well as additional joining that is not provided by mongodb. >> IF YOU LIKE IT, PLEASE GIVE IT A STAR ON GITHUB <<",

@@ -5,0 +5,0 @@ "main": " ./bin/json.odm.min.js",

@@ -38,3 +38,3 @@ [![npm](https://img.shields.io/npm/dm/json-odm.svg)](https://www.npmjs.com/package/json-odm)

- Pipeline (~~$project~~,$match,$redact,~~$limit~~,~~$skip~~,$unwind,$group,$sort,$geoNear,$out) 30% ($limit and $skip is implemented as $result(skip,limit))
- Operators (Boolean,Set,Comparison,Arithmetic,~~String~~,Array,Date,Conditional,Variable,Grouping) 10%
- Operators (Boolean,Set,Comparison,~~Arithmetic~~,~~String~~,Array,Date,Conditional,Variable,Grouping) 20% ($mod is renamed $modulo, because Evaluation has a $mod)
- Support Promise/A+ sources for the odm.addSource

@@ -41,0 +41,0 @@ - Full CRUD support

@@ -202,3 +202,3 @@ "use strict";

*/
jsonOdm.Query.prototype.$binaryOperator = function (queries,operator) {
jsonOdm.Query.prototype.$queryOperator = function (queries,operator) {
var $testCollection = (function (queries,oprator) {

@@ -209,7 +209,12 @@ return function (collection) {

for(var i = 0; i < queries.length; i++){
for(var j = 0; j < queries[i].$$commandQueue.length; j++){
commandResults.push(queries[i].$$commandQueue[j](collection));
if(queries[i] instanceof jsonOdm.Query){
for(var j = 0; j < queries[i].$$commandQueue.length; j++){
commandResults.push(queries[i].$$commandQueue[j](collection));
}
}else{
// also accept raw values
commandResults.push(queries[i]);
}
}
return !!operator(commandResults);
return operator(commandResults);
}

@@ -287,4 +292,4 @@ })(queries,operator);

* Performs an arithmetic addition on two or more field values
* @param {jsonOdm.Query|String} branch1
* @param {...jsonOdm.Query|String} branch2
* @param {jsonOdm.Query|Number} branch1
* @param {...jsonOdm.Query|...Number} branch2
* @return jsonOdm.Query

@@ -303,10 +308,116 @@ * @example

jsonOdm.Query.prototype.$add = function (branch1, branch2) {
return this.$modifyField((function () {
return function () {
return this.$queryOperator(arguments, function (queryResults) {
var result = queryResults.length > 0 ? queryResults[0] : 0;
for(var i = 1; i < queryResults.length; i++){
result += queryResults[i];
}
return result;
});
};
/**
* Performs an arithmetic subtraction on two or more field values
* @param {jsonOdm.Query|Number} branch1
* @param {...jsonOdm.Query|...Number} branch2
* @return jsonOdm.Query
* @example
* var collection = new jsonOdm.Collection("myCollection");
* var $query = collection.$query();
* $query.$subtract(
* $query.$branch("firstValue"),
* $query.$add(
* $query.$branch("lastValue"),
* $query.$branch(["otherValues","firstValue"])
* )
* ).$eq(12).$all();
*/
jsonOdm.Query.prototype.$subtract = function (branch1, branch2) {
return this.$queryOperator(arguments, function (queryResults) {
var result = queryResults.length > 0 ? queryResults[0] : 0;
for(var i = 1; i < queryResults.length; i++){
result -= queryResults[i];
}
})(arguments));
return result;
});
};
/**
* Performs an arithmetic multiplication on two or more field values
* @param {jsonOdm.Query|Number} branch1
* @param {...jsonOdm.Query|...Number} branch2
* @return jsonOdm.Query
* @example
* var collection = new jsonOdm.Collection("myCollection");
* var $query = collection.$query();
* $query.$multiply(
* $query.$branch("firstValue"),
* $query.$add(
* $query.$branch("lastValue"),
* $query.$branch(["otherValues","firstValue"])
* )
* ).$eq(12).$all();
*/
jsonOdm.Query.prototype.$multiply = function (branch1, branch2) {
return this.$queryOperator(arguments, function (queryResults) {
var result = queryResults.length > 0 ? queryResults[0] : 0;
for(var i = 1; i < queryResults.length; i++){
result *= queryResults[i];
}
return result;
});
};
/**
* Performs an arithmetic divition on two or more field values
* @param {jsonOdm.Query|Number} branch1
* @param {...jsonOdm.Query|...Number} branch2
* @return jsonOdm.Query
* @example
* var collection = new jsonOdm.Collection("myCollection");
* var $query = collection.$query();
* $query.$divide(
* $query.$branch("firstValue"),
* $query.$add(
* $query.$branch("lastValue"),
* $query.$branch(["otherValues","firstValue"])
* )
* ).$eq(12).$all();
*/
jsonOdm.Query.prototype.$divide = function (branch1, branch2) {
return this.$queryOperator(arguments, function (queryResults) {
var result = queryResults.length > 0 ? queryResults[0] : 0;
for(var i = 1; i < queryResults.length; i++){
result /= queryResults[i];
}
return result;
});
};
/**
* Performs an arithmetic modulo on two or more field values
* @param {jsonOdm.Query|Number} branch1
* @param {...jsonOdm.Query|...Number} module
* @return jsonOdm.Query
* @example
* var collection = new jsonOdm.Collection("myCollection");
* var $query = collection.$query();
* $query.$modulo(
* $query.$branch("firstValue"),
* $query.$add(
* $query.$branch("lastValue"),
* $query.$branch(["otherValues","firstValue"])
* )
* ).$eq(12).$all();
*/
jsonOdm.Query.prototype.$modulo = function (branch1, module) {
return this.$queryOperator(arguments, function (queryResults) {
var result = queryResults.length > 0 ? queryResults[0] : 0;
for(var i = 1; i < queryResults.length; i++){
result = result % queryResults[i];
}
return result;
});
};
/**
* Compares the current sub collection value with the comparable

@@ -654,3 +765,3 @@ * like this $eq('1','2','4') so 1 or 2 or 4 are valid fields

// TODO optimize with generators to only query paths that are needed
return this.$binaryOperator(arguments, function (queryResults) {
return this.$queryOperator(arguments, function (queryResults) {
for(var i = 0; i < queryResults.length; i++){

@@ -670,3 +781,3 @@ if(!queryResults[i]) return false;

// TODO optimize with generators to only query paths that are needed
return this.$binaryOperator(arguments, function (queryResults) {
return this.$queryOperator(arguments, function (queryResults) {
for(var i = 0; i < queryResults.length; i++){

@@ -688,3 +799,3 @@ if(!queryResults[i]) return true;

*/
jsonOdm.Query.prototype.$not = jsonOdm.Query.prototype.$nand
jsonOdm.Query.prototype.$not = jsonOdm.Query.prototype.$nand;

@@ -698,3 +809,3 @@ /**

// TODO optimize with generators to only query paths that are needed
return this.$binaryOperator(arguments, function (queryResults) {
return this.$queryOperator(arguments, function (queryResults) {
for(var i = 0; i < queryResults.length; i++){

@@ -714,3 +825,3 @@ if(queryResults[i]) return true;

// TODO optimize with generators to only query paths that are needed
return this.$binaryOperator(arguments, function (queryResults) {
return this.$queryOperator(arguments, function (queryResults) {
for(var i = 0; i < queryResults.length; i++){

@@ -717,0 +828,0 @@ if(queryResults[i]) return false;

@@ -29,2 +29,8 @@ describe("Collection", function () {

],
"arithmeticCollection":[
{id:1,cars:12,trucks:23,bikes:8},
{id:2,cars:3,trucks:18,bikes:18},
{id:3,cars:23,trucks:22,bikes:23},
{id:4,cars:1,trucks:12,bikes:82}
],
"aLot":[],

@@ -352,2 +358,33 @@ "geo":[

});
describe("Arithmetic operators", function () {
var collection, q;
beforeEach(function () {
collection = new jsonOdm.Collection("arithmeticCollection");
q = collection.$query();
});
it("Should add all fields", function () {
var sum = collection[0].cars+collection[0].trucks+collection[0].bikes;
expect(q.$add(q.$branch("cars"),q.$branch("trucks"),q.$branch("bikes")).$eq(sum).$first().id).toBe(collection[0].id);
});
it("Should subtract all fields", function () {
var subtraction = collection[1].cars-collection[1].trucks-collection[1].bikes;
expect(q.$subtract(q.$branch("cars"),q.$branch("trucks"),q.$branch("bikes")).$eq(subtraction).$first().id).toBe(collection[1].id);
});
it("Should multiply all fields", function () {
var multiply = collection[2].cars*collection[2].trucks*collection[2].bikes;
expect(q.$multiply(q.$branch("cars"),q.$branch("trucks"),q.$branch("bikes")).$eq(multiply).$first().id).toBe(collection[2].id);
});
it("Should divide all fields", function () {
var division = collection[3].cars/collection[3].trucks/collection[3].bikes;
expect(q.$divide(q.$branch("cars"),q.$branch("trucks"),q.$branch("bikes")).$eq(division).$first().id).toBe(collection[3].id);
});
it("Should calculate fields1 mod field2", function () {
var moduloResult = collection[1].trucks%collection[1].bikes;
expect(q.$modulo(q.$branch("trucks"),q.$branch("bikes")).$eq(moduloResult).$first().id).toBe(collection[1].id);
});
it("Should calculate fields1 mod 5", function () {
var moduloResult = collection[0].trucks % 5;
expect(q.$modulo(q.$branch("trucks"),5).$eq(moduloResult).$first().id).toBe(collection[0].id);
});
});
});

@@ -354,0 +391,0 @@ describe("String modification", function () {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc