-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathvenn.min.js
3 lines (2 loc) · 1.49 KB
/
venn.min.js
1
2
3
/*! venn 2019-02-21 */
if("function"!=typeof define)var define=require("amdefine")(module,require);define(function(){var i=[],r=[].__proto__?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)e[n]=t[n]},e=function(e){return u=this,e.forEach(function(e){u.push(e)}),t=u,n=this.keyFunction,r=[].concat(t),o={},t.length=0,n=n||c,r.forEach(function(e){i=n(e),o[i]||(t.push(e),o[i]=!0)}),t;var t,n,i,r,o,u},t=function(e){var t=this;if(e&&0!=e.length&&this&&0!=this.length){var n,i=[].concat(this),r={};this.length=0,e.forEach(function(e){r[o.call(t,e)]=!0}),i.forEach(function(e){n=o.call(t,e),r[n]&&(t.push(e),delete r[n])})}else this.length=0;return this},o=function(e){return this.keyFunction?this.keyFunction(e):c(e)};return Object.defineProperty(i,"union",{value:e,writable:!1,enumerable:!1}),Object.defineProperty(i,"or",{value:e,writable:!1,enumerable:!1}),Object.defineProperty(i,"intersection",{value:t,writable:!1,enumerable:!1}),Object.defineProperty(i,"and",{value:t,writable:!1,enumerable:!1}),Object.defineProperty(i,"not",{value:function(e){var t=this;if(!e||0==e.length||!this||0==this.length)return this;var n,i=[].concat(this),r={};return this.length=0,e.forEach(function(e){r[o.call(t,e)]=!0}),i.forEach(function(e){n=o.call(t,e),r[n]||(t.push(e),delete r[n])}),this},writable:!1,enumerable:!1}),{create:function(e,t){var n=e?[].concat(e):[];return r(n,i),Object.defineProperty(n,"keyFunction",{writable:!1,enumerable:!1,value:t}),n.union([])}};function c(e){return"string"==typeof e?e:JSON.stringify(e)}});