-
Notifications
You must be signed in to change notification settings - Fork 0
/
eetables-min.js
2 lines (2 loc) · 2.86 KB
/
eetables-min.js
1
2
!function(a){function b(a,b){if(!a)throw b||"Assertion failed"}var c=a._||require("underscore"),d=function(a){function c(c,e){b(a.isFunction(c),"pullFunctionBuilder is not a function, bad use od table iterator api");var f=function(){var f={};return f.spec={contextSize:e.length,contextValueSizes:e,extractionPoints:d(e)},f.nestedNext=c(),b(a.isFunction(f.nestedNext),"nestedNext is not a function, bad use od table iterator api"),f.loopOver=function(a){for(var b=f.nestedNext();void 0!==b;){var c=b[0],d=b[1],e=b[2];a(c,d,e),b=f.nestedNext()}},f};return f.spec={contextSize:e.length,contextValueSizes:e,extractionPoints:d(e)},f}function d(b){var c=b.length;return a.reduce(b,function(b,c){var d=a.last(b);return b.push(d+c),b},[c])}function e(a,b){for(var c=b.length,d=c,e=0;c>e;e++)if(a[e]!==b[e]){d=e;break}return d}function f(a,b){function f(){var a=b(),c=void 0;return function(){var b=a.next();if(void 0===b)return void 0;var d,f=b.slice(0,g);if(void 0===c){var i=b.slice(g);d=[0,f,i]}else{var j=e(c,f),k=f.slice(j),l=b.slice(h[j]);d=[j,k,l]}return c=f,d}}var g=a.length,h=d(a);return c(f,a)}function g(a,b){var c=b.length,d=function(){var a=0;return{next:function(){return c===a?void 0:b[a++]}}};return f(a,d)}function h(b){var c,d,e=[],f=a.map(b.spec.extractionPoints,function(a){return a-b.spec.contextSize}),g=function(b,g,h){if(0===b)c=g,d=h;else{var i=f[b];c=a.first(c,b).concat(g),d=a.first(d,i).concat(h)}e.push(c.concat(d))};return b.loopOver(g),e}function i(){function c(a,b){var c=a.spec.contextValueSizes,d=b.spec.contextValueSizes,e=function(){function c(){}function d(){return i=g.nestedNext(),j=h.nestedNext(),void 0===i||void 0===j?(k=!0,void(l=c)):void(l=f)}function e(){return i=g.nestedNext(),void 0===i?(k=!0,void(l=c)):(h=b(),void(j=h.nestedNext()))}function f(){j=h.nestedNext(),void 0===j&&e()}var g=a(),h=b(),i=void 0,j=void 0,k=!1,l=d;return{next:function(){return l(),k?void 0:i[1].concat(j[1],i[2],j[2])}}};return f(c.concat(d),e)}b(arguments.length>1,"Pass at least 2 table iterators to build a cross product");var d=Array.prototype.slice.call(arguments),e=d[0],g=a.tail(d);return a.reduce(g,c,e)}function j(c,d){function e(b,c){var d=b[0],e=b[1],f=e.length,g=c[0],h=c[1],i=h.length;return a.chain(d).map(function(b){return a.chain(g).map(function(c){var d=a.first(b,f).concat(a.first(c,i)),e=b.slice(f).concat(c.slice(i));return d.concat(e)}).value()}).flatten(!0).value()}b(c.length>1,"Pass at least 2 table iterators to build a cross product"),b(d.length===c.length,"Provide context sizes for each table");var f=a.zip(c,d),g=f[0],h=a.tail(f);return a.reduce(h,e,g)}return{tableIterator:c,tableIteratorFromTable:g,tableIteratorBuilder:f,buildTableFromIterator:h,crossProductTableIterators:i,crossProductTables:j}}(c);a.eetables={tableIterators:d},"function"==typeof define&&define.amd&&define("eetables",["underscore"],function(a){return eetables})}(this);
//# sourceMappingURL=eetables-min.map