flatten-js
Version:
Javascript library for 2d geometry
1 lines • 2.44 kB
JSON
{"dependencies":[{"name":"C:\\Users\\alexbol\\WebstormProjects\\flatten-js\\package.json","includedInParent":true,"mtime":1520238055570},{"name":"flatten-interval-tree","loc":{"line":9,"column":27}}],"generated":{"js":"\"use strict\";var e=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,\"value\"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),t=function e(t,r,n){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,r);if(void 0===o){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,r,n)}if(\"value\"in o)return o.value;var u=o.get;return void 0!==u?u.call(n):void 0};function r(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function n(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}function o(e,t){if(!e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!t||\"object\"!=typeof t&&\"function\"!=typeof t?e:t}function i(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=require(\"flatten-interval-tree\");module.exports=function(a){a.PlanarSet=function(c){function f(){n(this,f);var e=o(this,(f.__proto__||Object.getPrototypeOf(f)).call(this));return e.index=new u,e}return i(f,Set),e(f,[{key:\"add\",value:function(e){var r=this.size;if(t(f.prototype.__proto__||Object.getPrototypeOf(f.prototype),\"add\",this).call(this,e),this.size>r)this.index.insert(e.box,e);return this}},{key:\"delete\",value:function(e){var r=t(f.prototype.__proto__||Object.getPrototypeOf(f.prototype),\"delete\",this).call(this,e);return r&&this.index.remove(e.box,e),r}},{key:\"clear\",value:function(){}},{key:\"search\",value:function(e){return this.index.search(e)}},{key:\"hit\",value:function(e){var t=new a.Box(e.x-1,e.y-1,e.x+1,e.y+1);return this.index.search(t).filter(function(t){return e.on(t)})}},{key:\"svg\",value:function(){return[].concat(r(this)).reduce(function(e,t){return e+t.svg()},\"\")}}]),f}()};"},"hash":"b0becba7ace2c07d8d2ef023d4bb6ac7","cacheData":{"env":{}}}