Socket
Socket
Sign inDemoInstall

node-relation

Package Overview
Dependencies
30
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.7.1 to 4.7.2

2

dist/esm/raw/index.d.ts

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

export * from '../../common/index';
export * from '../../common/raw/index';

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

var t={63:t=>{t.exports=function t(e,r){if(e===r)return!0;if(e&&r&&"object"==typeof e&&"object"==typeof r){if(e.constructor!==r.constructor)return!1;var n,o,a;if(Array.isArray(e)){if((n=e.length)!=r.length)return!1;for(o=n;0!=o--;)if(!t(e[o],r[o]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if((n=(a=Object.keys(e)).length)!==Object.keys(r).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(r,a[o]))return!1;for(o=n;0!=o--;){var i=a[o];if(!t(e[i],r[i]))return!1}return!0}return e!=e&&r!=r}}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var a=e[n]={exports:{}};return t[n](a,a.exports,r),a.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var n={};(()=>{r.d(n,{W:()=>D});var t=r(63),e=r.n(t);function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a=[],i=!0,u=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(a.push(n.value),!e||a.length!==e);i=!0);}catch(t){u=!0,o=t}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}}(t,e)||u(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=u(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){l=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(l)throw a}}}}function u(t,e){if(t){if("string"==typeof t)return l(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?l(t,e):void 0}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function f(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function c(){return c="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=s(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},c.apply(this,arguments)}function s(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=g(t)););return t}function y(t,e){if(e&&("object"===o(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function h(t){var e="function"==typeof Map?new Map:void 0;return h=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return v(t,arguments,g(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),d(n,t)},h(t)}function v(t,e,r){return v=p()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&d(o,r.prototype),o},v.apply(null,arguments)}function p(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function d(t,e){return d=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},d(t,e)}function g(t){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},g(t)}var b=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&d(t,e)}(s,t);var r,n,o,u,l=(r=s,n=p(),function(){var t,e=g(r);if(n){var o=g(this).constructor;t=Reflect.construct(e,arguments,o)}else t=e.apply(this,arguments);return y(this,t)});function s(t){var e;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),e=l.call(this);var r,n=i(new Map(t));try{for(n.s();!(r=n.n()).done;){var o=a(r.value,2),u=o[0],f=o[1];e.set(u,f)}}catch(t){n.e(t)}finally{n.f()}return e}return o=s,(u=[{key:"set",value:function(t,e){return this.has(t)||c(g(s.prototype),"set",this).call(this,t,e),this}},{key:"delete",value:function(t){var r,n=!1,o=i(this.keys());try{for(o.s();!(r=o.n()).done;){var a=r.value;e()(a,t)&&(c(g(s.prototype),"delete",this).call(this,a),n=!0)}}catch(t){o.e(t)}finally{o.f()}return n}},{key:"has",value:function(t){var r,n=i(this.keys());try{for(n.s();!(r=n.n()).done;){var o=r.value;if(e()(t,o))return!0}}catch(t){n.e(t)}finally{n.f()}return!1}},{key:"get",value:function(t){var r,n=i(this);try{for(n.s();!(r=n.n()).done;){var o=a(r.value,2),u=o[0],l=o[1];if(e()(t,u))return l}}catch(t){n.e(t)}finally{n.f()}}}])&&f(o.prototype,u),Object.defineProperty(o,"prototype",{writable:!1}),s}(h(Map));function w(t){return function(t){if(Array.isArray(t))return O(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||_(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a=[],i=!0,u=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(a.push(n.value),!e||a.length!==e);i=!0);}catch(t){u=!0,o=t}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}}(t,e)||_(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=_(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function _(t,e){if(t){if("string"==typeof t)return O(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?O(t,e):void 0}}function O(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function A(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function S(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function j(t){return j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},j(t)}function E(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function R(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function q(){return q="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=P(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},q.apply(this,arguments)}function P(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=C(t)););return t}function M(t,e){return M=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},M(t,e)}function x(t,e){if(e&&("object"===j(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function C(t){return C=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},C(t)}var D=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&M(t,e)}(i,t);var e,r,n,o,a=(n=i,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=C(n);if(o){var r=C(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return x(this,t)});function i(){return E(this,i),a.apply(this,arguments)}return e=i,r=[{key:"to",value:function(t){for(var e,r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return(e=q(C(i.prototype),"to",this)).call.apply(e,[this.copy,t].concat(n))}},{key:"both",value:function(t){for(var e,r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return(e=q(C(i.prototype),"both",this)).call.apply(e,[this.copy,t].concat(n))}},{key:"all",value:function(){for(var t,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return(t=q(C(i.prototype),"all",this)).call.apply(t,[this.copy].concat(r))}},{key:"unlinkTo",value:function(t){for(var e,r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return(e=q(C(i.prototype),"unlinkTo",this)).call.apply(e,[this.copy,t].concat(n))}},{key:"unlinkBoth",value:function(t){for(var e,r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return(e=q(C(i.prototype),"unlinkBoth",this)).call.apply(e,[this.copy,t].concat(n))}},{key:"drop",value:function(){for(var t,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return(t=q(C(i.prototype),"drop",this)).call.apply(t,[this.copy].concat(r))}},{key:"merge",value:function(){for(var t,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return(t=q(C(i.prototype),"merge",this)).call.apply(t,[this.copy].concat(r))}}],r&&R(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];A(this,t),this.useEqual=r,this.__relations=t.__CreateMap(e,r)}var r,n,o;return r=t,n=[{key:"dataset",get:function(){return Array.from(this.__relations)}},{key:"nodes",get:function(){var e,r=[],n=k(this.__relations);try{for(n.s();!(e=n.n()).done;){var o=m(e.value,2),a=o[0],i=o[1];t.add.apply(t,[this.useEqual,r,a].concat(w(i)))}}catch(t){n.e(t)}finally{n.f()}return r}},{key:"children",get:function(){var e,r=[],n=k(this.__relations.values());try{for(n.s();!(e=n.n()).done;){var o=e.value;t.add.apply(t,[this.useEqual,r].concat(w(o)))}}catch(t){n.e(t)}finally{n.f()}return r}},{key:"nodeset",get:function(){var t,e=new Set,r=k(this.__relations);try{for(r.s();!(t=r.n()).done;){var n=m(t.value,2),o=n[0],a=n[1];e.add(o);var i,u=k(a);try{for(u.s();!(i=u.n()).done;){var l=i.value;e.add(l)}}catch(t){u.e(t)}finally{u.f()}}}catch(t){r.e(t)}finally{r.f()}return e}},{key:"oneHot",get:function(){var t,e=new Map,r=this.nodes,n=0,o=r.length,a=k(r);try{for(a.s();!(t=a.n()).done;){var i=t.value,u=new Array(o).fill(0);u[n++]=1,e.set(i,u)}}catch(t){a.e(t)}finally{a.f()}return e}},{key:"zeroVector",get:function(){return new Array(this.nodes.length).fill(0)}},{key:"label",get:function(){var t,e=new Map,r=1,n=k(this.nodes);try{for(n.s();!(t=n.n()).done;){var o=t.value;e.set(o,r++)}}catch(t){n.e(t)}finally{n.f()}return e}},{key:"clusters",get:function(){var t,e=[],r=this.nodeset,n=k(r);try{for(n.s();!(t=n.n()).done;){var o=t.value,a=this.from(o).nodes;e.push(a);var i,u=k(a);try{for(u.s();!(i=u.n()).done;){var l=i.value;r.delete(l)}}catch(t){u.e(t)}finally{u.f()}}}catch(t){n.e(t)}finally{n.f()}return e}},{key:"reverse",get:function(){var e,r=this.useEqual,n=t.__CreateMap(void 0,r),o=k(this.__relations);try{for(o.s();!(e=o.n()).done;){var a,i=m(e.value,2),u=i[0],l=k(i[1]);try{for(l.s();!(a=l.n()).done;){var f=a.value;n.has(f)||n.set(f,[]);var c=n.get(f);t.add(r,c,u)}}catch(t){l.e(t)}finally{l.f()}}}catch(t){o.e(t)}finally{o.f()}var s=Array.from(n);return new this.constructor(s,r)}},{key:"clone",get:function(){return this.copy}},{key:"copy",get:function(){return new this.constructor(this.dataset,this.useEqual)}},{key:"ensureRelation",value:function(e){this.__relations.has(e)||this.__relations.set(e,[]);for(var r=this.__relations.get(e),n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];for(var i=0,u=o;i<u.length;i++){var l=u[i];t.add(this.useEqual,r,l)}return r}},{key:"to",value:function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return this.ensureRelation.apply(this,[t].concat(r)),this}},{key:"both",value:function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];this.ensureRelation.apply(this,[t].concat(r));for(var o=0,a=r;o<a.length;o++){var i=a[o];this.ensureRelation(i,t)}return this}},{key:"all",value:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];for(var o=0,a=r;o<a.length;o++){var i=a[o],u=this.ensureRelation.apply(this,[i].concat(r));t.drop(this.useEqual,u,i)}return this}},{key:"getCombinedDataset",value:function(e,r){var n,o=t.__CreateMap(e,this.useEqual),a=t.__CreateMap(r,this.useEqual),i=t.__CreateMap(void 0,this.useEqual),u=k(o);try{for(u.s();!(n=u.n()).done;){var l=m(n.value,2),f=l[0],c=l[1];i.has(f)||i.set(f,c);var s=i.get(f);t.add.apply(t,[this.useEqual,s].concat(w(c)))}}catch(t){u.e(t)}finally{u.f()}var y,h=k(a);try{for(h.s();!(y=h.n()).done;){var v=m(y.value,2),p=v[0],d=v[1];i.has(p)||i.set(p,d);var g=i.get(p);t.add.apply(t,[this.useEqual,g].concat(w(d)))}}catch(t){h.e(t)}finally{h.f()}return Array.from(i)}},{key:"getSearchedRelationDataset",value:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[[e,[]]],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],a=this.__relations.has(e)?this.__relations.get(e):[],i=[[e,a]];if(!r)return i;if(!a)return i;if(t.has(this.useEqual,o,e))return i;t.add(this.useEqual,o,e),r--,n=this.getCombinedDataset(n,i);var u,l=k(a);try{for(l.s();!(u=l.n()).done;){var f=u.value,c=this.getSearchedRelationDataset(f,r,n,o);n=this.getCombinedDataset(n,c)}}catch(t){l.e(t)}finally{l.f()}return n}},{key:"getSearchedDepth",value:function(r,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(!1===this.useEqual&&r===n)return o;if(!0===this.useEqual&&e()(r,n))return o;if(t.has(this.useEqual,a,r))return 1/0;t.add(this.useEqual,a,r),o++;var i,u=1/0,l=this.__relations.has(r)?this.__relations.get(r):[],f=k(l);try{for(f.s();!(i=f.n()).done;){var c=i.value,s=this.getSearchedDepth(c,n,o,a);u=Math.min(u,s)}}catch(t){f.e(t)}finally{f.f()}return u}},{key:"from",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,r=this.copy,n=r.getSearchedRelationDataset(t,--e);return new this.constructor(n,this.useEqual)}},{key:"where",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;--e;var r,n=[],o=this.nodes.filter(t),a=k(o);try{for(a.s();!(r=a.n()).done;){var i=r.value,u=this.getSearchedRelationDataset(i,e);n=this.getCombinedDataset(n,u)}}catch(t){a.e(t)}finally{a.f()}return new this.constructor(n,this.useEqual)}},{key:"without",value:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return t.drop.apply(t,[this.useEqual,this.nodes].concat(r))}},{key:"unlinkRefersFromSource",value:function(e){var r=this.__relations.get(e);if(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];t.drop.apply(t,[this.useEqual,r].concat(o))}}},{key:"unlinkTo",value:function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return this.unlinkRefersFromSource.apply(this,[t].concat(r)),this}},{key:"unlinkBoth",value:function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];this.unlinkRefersFromSource.apply(this,[t].concat(r));for(var o=0,a=r;o<a.length;o++){var i=a[o];this.unlinkRefersFromSource(i,t)}return this}},{key:"drop",value:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var o,a=k(this.__relations.values());try{for(a.s();!(o=a.n()).done;){var i=o.value;t.drop.apply(t,[this.useEqual,i].concat(r))}}catch(t){a.e(t)}finally{a.f()}for(var u=0,l=r;u<l.length;u++){var f=l[u];this.__relations.delete(f)}return this}},{key:"has",value:function(e){var r,n=this.__relations.has(e),o=k(this.__relations);try{for(o.s();!(r=o.n()).done;){var a=m(r.value,2),i=a[0],u=a[1];if(i===e||t.has(this.useEqual,u,e)){n=!0;break}}}catch(t){o.e(t)}finally{o.f()}return n}},{key:"hasAll",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var n=0,o=e;n<o.length;n++){var a=o[n];if(!this.has(a))return!1}return!0}},{key:"weight",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.reverse.from(t).children.length;return e&&(r=Math.log(r+1)),r}},{key:"weights",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=new Map,a=0,i=0,u=k(this.nodes);try{for(u.s();!(t=u.n()).done;){var l=t.value,f=this.weight(l,e);i+=f,f>a&&(a=f),o.set(l,f)}}catch(t){u.e(t)}finally{u.f()}if(r){n&&(a=i);for(var c=Array.from(o),s=0,y=c;s<y.length;s++){var h=m(y[s],2),v=h[0],p=h[1];o.set(v,p/a)}}return o}},{key:"entry",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.from(t).children.length;return e&&(r=Math.log(r+1)),r}},{key:"entries",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=new Map,a=0,i=0,u=k(this.nodes);try{for(u.s();!(t=u.n()).done;){var l=t.value,f=this.entry(l,e);i+=f,f>a&&(a=f),o.set(l,f)}}catch(t){u.e(t)}finally{u.f()}if(r){n&&(a=i);for(var c=Array.from(o),s=0,y=c;s<y.length;s++){var h=m(y[s],2),v=h[0],p=h[1];o.set(v,p/a)}}return o}},{key:"depth",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=this.getSearchedDepth(t,e);return r&&(n=Math.log(n+1)),n}},{key:"distance",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Math.min(this.depth(t,e,r),this.depth(e,t,r))}},{key:"merge",value:function(){for(var t=this.dataset,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];for(var o=0,a=r;o<a.length;o++){var i=a[o];t=this.getCombinedDataset(t,i)}var u,l=k(t);try{for(l.s();!(u=l.n()).done;){var f=m(u.value,2),c=f[0],s=f[1];this.ensureRelation.apply(this,[c].concat(w(s)))}}catch(t){l.e(t)}finally{l.f()}return this}},{key:"raw",value:function(t){var r=this.nodes;if(this.useEqual){var n,o=k(r);try{for(o.s();!(n=o.n()).done;){var a=n.value;if(e()(t,a))return a}}catch(t){o.e(t)}finally{o.f()}}else{var i,u=k(r);try{for(u.s();!(i=u.n()).done;){var l=i.value;if(t===l)return l}}catch(t){u.e(t)}finally{u.f()}}}},{key:"clear",value:function(){this.__relations.clear()}}],o=[{key:"__CreateMap",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1?arguments[1]:void 0;return e?new b(t):new Map(t)}},{key:"findIndex",value:function(t,r,n){return t?r.findIndex((function(t){return e()(n,t)})):r.indexOf(n)}},{key:"has",value:function(e,r,n){return-1!==t.findIndex(e,r,n)}},{key:"add",value:function(e,r){for(var n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];for(var i=0,u=o;i<u.length;i++){var l=u[i];t.has(e,r,l)||r.push(l)}return r}},{key:"drop",value:function(e,r){for(var n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];for(var i=0,u=o;i<u.length;i++){var l=u[i],f=t.findIndex(e,r,l);-1!==f&&r.splice(f,1)}return r}},{key:"clear",value:function(t){return t.length=0,t}}],n&&S(r.prototype,n),o&&S(r,o),Object.defineProperty(r,"prototype",{writable:!1}),t}())})();var o=n.W;export{o as Relationship};
var e={63:e=>{e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,a,o;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(a=n;0!=a--;)if(!e(t[a],r[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(o=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(a=n;0!=a--;)if(!Object.prototype.hasOwnProperty.call(r,o[a]))return!1;for(a=n;0!=a--;){var i=o[a];if(!e(t[i],r[i]))return!1}return!0}return t!=t&&r!=r}}},t={};function r(n){var a=t[n];if(void 0!==a)return a.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n={};(()=>{r.d(n,{W:()=>E});var e=r(63),t=r.n(e);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,u=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){u=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(u)throw a}}return o}}(e,t)||u(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=u(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){l=!0,o=e},f:function(){try{i||null==r.return||r.return()}finally{if(l)throw o}}}}function u(e,t){if(e){if("string"==typeof e)return l(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function f(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)}}function s(){return s="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=c(e,t);if(n){var a=Object.getOwnPropertyDescriptor(n,t);return a.get?a.get.call(arguments.length<3?e:r):a.value}},s.apply(this,arguments)}function c(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=g(e)););return e}function h(e,t){if(t&&("object"===a(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function y(e){var t="function"==typeof Map?new Map:void 0;return y=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return v(e,arguments,g(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),p(n,e)},y(e)}function v(e,t,r){return v=d()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var a=new(Function.bind.apply(e,n));return r&&p(a,r.prototype),a},v.apply(null,arguments)}function d(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function p(e,t){return p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},p(e,t)}function g(e){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},g(e)}var b=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}(c,e);var r,n,a,u,l=(r=c,n=d(),function(){var e,t=g(r);if(n){var a=g(this).constructor;e=Reflect.construct(t,arguments,a)}else e=t.apply(this,arguments);return h(this,e)});function c(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),t=l.call(this);var r,n=i(new Map(e));try{for(n.s();!(r=n.n()).done;){var a=o(r.value,2),u=a[0],f=a[1];t.set(u,f)}}catch(e){n.e(e)}finally{n.f()}return t}return a=c,(u=[{key:"set",value:function(e,t){return this.has(e)||s(g(c.prototype),"set",this).call(this,e,t),this}},{key:"delete",value:function(e){var r,n=!1,a=i(this.keys());try{for(a.s();!(r=a.n()).done;){var o=r.value;t()(o,e)&&(s(g(c.prototype),"delete",this).call(this,o),n=!0)}}catch(e){a.e(e)}finally{a.f()}return n}},{key:"has",value:function(e){var r,n=i(this.keys());try{for(n.s();!(r=n.n()).done;){var a=r.value;if(t()(e,a))return!0}}catch(e){n.e(e)}finally{n.f()}return!1}},{key:"get",value:function(e){var r,n=i(this);try{for(n.s();!(r=n.n()).done;){var a=o(r.value,2),u=a[0],l=a[1];if(t()(e,u))return l}}catch(e){n.e(e)}finally{n.f()}}}])&&f(a.prototype,u),Object.defineProperty(a,"prototype",{writable:!1}),c}(y(Map));function m(e){return function(e){if(Array.isArray(e))return S(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||k(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,u=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){u=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(u)throw a}}return o}}(e,t)||k(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=k(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){u=!0,o=e},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw o}}}}function k(e,t){if(e){if("string"==typeof e)return S(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?S(e,t):void 0}}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function A(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O(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)}}var E=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];A(this,e),this.useEqual=r,this.__relations=e.__CreateMap(t,r)}var r,n,a;return r=e,n=[{key:"dataset",get:function(){return Array.from(this.__relations)}},{key:"nodes",get:function(){var t,r=[],n=_(this.__relations);try{for(n.s();!(t=n.n()).done;){var a=w(t.value,2),o=a[0],i=a[1];e.add.apply(e,[this.useEqual,r,o].concat(m(i)))}}catch(e){n.e(e)}finally{n.f()}return r}},{key:"children",get:function(){var t,r=[],n=_(this.__relations.values());try{for(n.s();!(t=n.n()).done;){var a=t.value;e.add.apply(e,[this.useEqual,r].concat(m(a)))}}catch(e){n.e(e)}finally{n.f()}return r}},{key:"nodeset",get:function(){var e,t=new Set,r=_(this.__relations);try{for(r.s();!(e=r.n()).done;){var n=w(e.value,2),a=n[0],o=n[1];t.add(a);var i,u=_(o);try{for(u.s();!(i=u.n()).done;){var l=i.value;t.add(l)}}catch(e){u.e(e)}finally{u.f()}}}catch(e){r.e(e)}finally{r.f()}return t}},{key:"oneHot",get:function(){var e,t=new Map,r=this.nodes,n=0,a=r.length,o=_(r);try{for(o.s();!(e=o.n()).done;){var i=e.value,u=new Array(a).fill(0);u[n++]=1,t.set(i,u)}}catch(e){o.e(e)}finally{o.f()}return t}},{key:"zeroVector",get:function(){return new Array(this.nodes.length).fill(0)}},{key:"label",get:function(){var e,t=new Map,r=1,n=_(this.nodes);try{for(n.s();!(e=n.n()).done;){var a=e.value;t.set(a,r++)}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"clusters",get:function(){var e,t=[],r=this.nodeset,n=_(r);try{for(n.s();!(e=n.n()).done;){var a=e.value,o=this.from(a).nodes;t.push(o);var i,u=_(o);try{for(u.s();!(i=u.n()).done;){var l=i.value;r.delete(l)}}catch(e){u.e(e)}finally{u.f()}}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"reverse",get:function(){var t,r=this.useEqual,n=e.__CreateMap(void 0,r),a=_(this.__relations);try{for(a.s();!(t=a.n()).done;){var o,i=w(t.value,2),u=i[0],l=_(i[1]);try{for(l.s();!(o=l.n()).done;){var f=o.value;n.has(f)||n.set(f,[]);var s=n.get(f);e.add(r,s,u)}}catch(e){l.e(e)}finally{l.f()}}}catch(e){a.e(e)}finally{a.f()}var c=Array.from(n);return new this.constructor(c,r)}},{key:"clone",get:function(){return this.copy}},{key:"copy",get:function(){return new this.constructor(this.dataset,this.useEqual)}},{key:"ensureRelation",value:function(t){this.__relations.has(t)||this.__relations.set(t,[]);for(var r=this.__relations.get(t),n=arguments.length,a=new Array(n>1?n-1:0),o=1;o<n;o++)a[o-1]=arguments[o];for(var i=0,u=a;i<u.length;i++){var l=u[i];e.add(this.useEqual,r,l)}return r}},{key:"to",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return this.ensureRelation.apply(this,[e].concat(r)),this}},{key:"both",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];this.ensureRelation.apply(this,[e].concat(r));for(var a=0,o=r;a<o.length;a++){var i=o[a];this.ensureRelation(i,e)}return this}},{key:"all",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];for(var a=0,o=r;a<o.length;a++){var i=o[a],u=this.ensureRelation.apply(this,[i].concat(r));e.drop(this.useEqual,u,i)}return this}},{key:"getCombinedDataset",value:function(t,r){var n,a=e.__CreateMap(t,this.useEqual),o=e.__CreateMap(r,this.useEqual),i=e.__CreateMap(void 0,this.useEqual),u=_(a);try{for(u.s();!(n=u.n()).done;){var l=w(n.value,2),f=l[0],s=l[1];i.has(f)||i.set(f,s);var c=i.get(f);e.add.apply(e,[this.useEqual,c].concat(m(s)))}}catch(e){u.e(e)}finally{u.f()}var h,y=_(o);try{for(y.s();!(h=y.n()).done;){var v=w(h.value,2),d=v[0],p=v[1];i.has(d)||i.set(d,p);var g=i.get(d);e.add.apply(e,[this.useEqual,g].concat(m(p)))}}catch(e){y.e(e)}finally{y.f()}return Array.from(i)}},{key:"getSearchedRelationDataset",value:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[[t,[]]],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=this.__relations.has(t)?this.__relations.get(t):[],i=[[t,o]];if(!r)return i;if(!o)return i;if(e.has(this.useEqual,a,t))return i;e.add(this.useEqual,a,t),r--,n=this.getCombinedDataset(n,i);var u,l=_(o);try{for(l.s();!(u=l.n()).done;){var f=u.value,s=this.getSearchedRelationDataset(f,r,n,a);n=this.getCombinedDataset(n,s)}}catch(e){l.e(e)}finally{l.f()}return n}},{key:"getSearchedDepth",value:function(r,n){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(!1===this.useEqual&&r===n)return a;if(!0===this.useEqual&&t()(r,n))return a;if(e.has(this.useEqual,o,r))return 1/0;e.add(this.useEqual,o,r),a++;var i,u=1/0,l=this.__relations.has(r)?this.__relations.get(r):[],f=_(l);try{for(f.s();!(i=f.n()).done;){var s=i.value,c=this.getSearchedDepth(s,n,a,o);u=Math.min(u,c)}}catch(e){f.e(e)}finally{f.f()}return u}},{key:"from",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,r=this.copy,n=r.getSearchedRelationDataset(e,--t);return new this.constructor(n,this.useEqual)}},{key:"where",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;--t;var r,n=[],a=this.nodes.filter(e),o=_(a);try{for(o.s();!(r=o.n()).done;){var i=r.value,u=this.getSearchedRelationDataset(i,t);n=this.getCombinedDataset(n,u)}}catch(e){o.e(e)}finally{o.f()}return new this.constructor(n,this.useEqual)}},{key:"without",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return e.drop.apply(e,[this.useEqual,this.nodes].concat(r))}},{key:"unlinkRefersFromSource",value:function(t){var r=this.__relations.get(t);if(r){for(var n=arguments.length,a=new Array(n>1?n-1:0),o=1;o<n;o++)a[o-1]=arguments[o];e.drop.apply(e,[this.useEqual,r].concat(a))}}},{key:"unlinkTo",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return this.unlinkRefersFromSource.apply(this,[e].concat(r)),this}},{key:"unlinkBoth",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];this.unlinkRefersFromSource.apply(this,[e].concat(r));for(var a=0,o=r;a<o.length;a++){var i=o[a];this.unlinkRefersFromSource(i,e)}return this}},{key:"drop",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var a,o=_(this.__relations.values());try{for(o.s();!(a=o.n()).done;){var i=a.value;e.drop.apply(e,[this.useEqual,i].concat(r))}}catch(e){o.e(e)}finally{o.f()}for(var u=0,l=r;u<l.length;u++){var f=l[u];this.__relations.delete(f)}return this}},{key:"has",value:function(t){var r,n=this.__relations.has(t),a=_(this.__relations);try{for(a.s();!(r=a.n()).done;){var o=w(r.value,2),i=o[0],u=o[1];if(i===t||e.has(this.useEqual,u,t)){n=!0;break}}}catch(e){a.e(e)}finally{a.f()}return n}},{key:"hasAll",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0,a=t;n<a.length;n++){var o=a[n];if(!this.has(o))return!1}return!0}},{key:"weight",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.reverse.from(e).children.length;return t&&(r=Math.log(r+1)),r}},{key:"weights",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=new Map,o=0,i=0,u=_(this.nodes);try{for(u.s();!(e=u.n()).done;){var l=e.value,f=this.weight(l,t);i+=f,f>o&&(o=f),a.set(l,f)}}catch(e){u.e(e)}finally{u.f()}if(r){n&&(o=i);for(var s=Array.from(a),c=0,h=s;c<h.length;c++){var y=w(h[c],2),v=y[0],d=y[1];a.set(v,d/o)}}return a}},{key:"entry",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.from(e).children.length;return t&&(r=Math.log(r+1)),r}},{key:"entries",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=new Map,o=0,i=0,u=_(this.nodes);try{for(u.s();!(e=u.n()).done;){var l=e.value,f=this.entry(l,t);i+=f,f>o&&(o=f),a.set(l,f)}}catch(e){u.e(e)}finally{u.f()}if(r){n&&(o=i);for(var s=Array.from(a),c=0,h=s;c<h.length;c++){var y=w(h[c],2),v=y[0],d=y[1];a.set(v,d/o)}}return a}},{key:"depth",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=this.getSearchedDepth(e,t);return r&&(n=Math.log(n+1)),n}},{key:"distance",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Math.min(this.depth(e,t,r),this.depth(t,e,r))}},{key:"merge",value:function(){for(var e=this.dataset,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];for(var a=0,o=r;a<o.length;a++){var i=o[a];e=this.getCombinedDataset(e,i)}var u,l=_(e);try{for(l.s();!(u=l.n()).done;){var f=w(u.value,2),s=f[0],c=f[1];this.ensureRelation.apply(this,[s].concat(m(c)))}}catch(e){l.e(e)}finally{l.f()}return this}},{key:"raw",value:function(e){var r=this.nodes;if(this.useEqual){var n,a=_(r);try{for(a.s();!(n=a.n()).done;){var o=n.value;if(t()(e,o))return o}}catch(e){a.e(e)}finally{a.f()}}else{var i,u=_(r);try{for(u.s();!(i=u.n()).done;){var l=i.value;if(e===l)return l}}catch(e){u.e(e)}finally{u.f()}}}},{key:"clear",value:function(){this.__relations.clear()}}],a=[{key:"__CreateMap",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return t?new b(e):new Map(e)}},{key:"findIndex",value:function(e,r,n){return e?r.findIndex((function(e){return t()(n,e)})):r.indexOf(n)}},{key:"has",value:function(t,r,n){return-1!==e.findIndex(t,r,n)}},{key:"add",value:function(t,r){for(var n=arguments.length,a=new Array(n>2?n-2:0),o=2;o<n;o++)a[o-2]=arguments[o];for(var i=0,u=a;i<u.length;i++){var l=u[i];e.has(t,r,l)||r.push(l)}return r}},{key:"drop",value:function(t,r){for(var n=arguments.length,a=new Array(n>2?n-2:0),o=2;o<n;o++)a[o-2]=arguments[o];for(var i=0,u=a;i<u.length;i++){var l=u[i],f=e.findIndex(t,r,l);-1!==f&&r.splice(f,1)}return r}},{key:"clear",value:function(e){return e.length=0,e}}],n&&O(r.prototype,n),a&&O(r,a),Object.defineProperty(r,"prototype",{writable:!1}),e}()})();var a=n.W;export{a as Relationship};
{
"name": "node-relation",
"version": "4.7.1",
"version": "4.7.2",
"description": "Manage strings, number, object that are related to each other.",

@@ -32,4 +32,4 @@ "main": "dist/umd/index.js",

"edge",
"frond-end",
"back-end",
"front-end",
"backend",
"math"

@@ -36,0 +36,0 @@ ],

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