@hotmeshio/hotmesh
Version:
Serverless Workflow
1 lines • 4.89 kB
JavaScript
'use strict';const m=b;function a(){const J=['object','defineProperty','__esModule','328088ifKdbt','endsWith','call','context','jobData','isreduceType','Unknown\x20domain\x20name\x20[','{$index','hasOwnProperty','concat','rules','resolveContextTerm','prototype','reduce','Unknown\x20domain\x20function\x20[','getNestedProperty','{$input','processRow',']:\x20','1255566Kgwxfc','resolveContextValue','split','push','7335005qInDwf','isPipeType','308FpIXQY','resolveFunction','Pipe','4642276DkHTqy','resolve','isContextVariable','processCells','isPipeObject','length','process','resolveCellValue','resolveMapTerm','@pipe','resolveMappableValue','cloneUnknown','{$item','isArray','569826nQwYiH','startsWith','default','2611026mvvlaH','isFunction','__importDefault','956350GMjACG','string','isMappable','substring','map'];a=function(){return J;};return a();}(function(c,d){const l=b,e=c();while(!![]){try{const f=parseInt(l(0x6e))/0x1+-parseInt(l(0x89))/0x2+-parseInt(l(0x6b))/0x3+parseInt(l(0x92))/0x4+-parseInt(l(0x8d))/0x5+-parseInt(l(0xa0))/0x6+-parseInt(l(0x8f))/0x7*(-parseInt(l(0x76))/0x8);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0xd247a));function b(c,d){const e=a();return b=function(f,g){f=f-0x6b;let h=e[f];return h;},b(c,d);}var __importDefault=this&&this[m(0x6d)]||function(c){const n=m;return c&&c[n(0x75)]?c:{'default':c};};Object[m(0x74)](exports,m(0x75),{'value':!0x0}),exports[m(0x91)]=void 0x0;const functions_1=__importDefault(require('./functions'));class Pipe{constructor(c,d,f){const o=m;this['rules']=c,this[o(0x7a)]=d,this[o(0x79)]=f;}[m(0x8e)](c){const p=m;return!Array[p(0x9f)](c)&&'@pipe'in c;}['isreduceType'](c){const q=m;return!Array[q(0x9f)](c)&&'@reduce'in c;}static['isPipeObject'](c){const r=m;return r(0x73)==typeof c&&null!==c&&!Array[r(0x9f)](c)&&r(0x9b)in c;}static[m(0x93)](c,d){const s=m;let f;return f=Pipe[s(0x96)](c)?new Pipe(c[s(0x9b)],d):new Pipe([[c]],d),f[s(0x98)]();}[m(0x98)](c=null){const t=m;let d=0x0;c||this[t(0x8e)](this['rules'][0x0])||this[t(0x7b)](this[t(0x80)][0x0])||(c=this[t(0x95)](this['rules'][0x0]),d=0x1);const f=this[t(0x80)][t(0x97)],g=[];for(let h=d;h<f;h++)c=this[t(0x87)](this[t(0x80)][h],c,g);return c[0x0];}['cloneUnknown'](c){const u=m;if(null===c||u(0x73)!=typeof c)return c;if(c instanceof Date)return new Date(c['getTime']());if(c instanceof RegExp)return new RegExp(c);if(Array[u(0x9f)](c))return c[u(0x72)](f=>this[u(0x9d)](f));const d={};for(const f in c)Object[u(0x82)]['hasOwnProperty'][u(0x78)](c,f)&&(d[f]=this[u(0x9d)](c[f]));return d;}['reduce'](c){const v=m;let d=this[v(0x9d)](c[0x1]??null);if(Array[v(0x9f)](c[0x0])){for(let f=0x0;f<c[0x0]['length'];f++)this[v(0x79)]={'$input':c[0x0],'$output':d,'$item':c[0x0][f],'$key':f['toString'](),'$index':f},d=this[v(0x98)]([d]);}else{let g=-0x1;for(const h in c[0x0])g++,this[v(0x79)]={'$input':c[0x0],'$output':d,'$item':c[0x0][h],'$key':h,'$index':g},d=this[v(0x98)]([d]);}return[d];}[m(0x87)](c,d,f){const w=m;if(d&&this['isreduceType'](c))return new Pipe(c['@reduce'],this['jobData'])[w(0x83)](d);if(this[w(0x8e)](c)){const g=new Pipe(c[w(0x9b)],this['jobData'],this['context']);return f[w(0x8c)](g[w(0x98)]()),d;}if(f[w(0x97)]>0x0&&(d=[...f],f[w(0x97)]=0x0),d){const [h,...j]=c;let k;return k=this[w(0x94)](h)?this['resolveContextValue'](h):Pipe[w(0x90)](h)(...d),[k][w(0x7f)](this[w(0x95)]([...j]));}return[][w(0x7f)](this[w(0x95)](Array[w(0x9f)](c)?[...c]:[]));}static['resolveFunction'](c){const x=m;let [d,f]=c[x(0x8b)]('.');d=d[x(0x71)](0x2),f=f[x(0x71)](0x0,f[x(0x97)]-0x1);const g=functions_1[x(0xa2)][d];if(!g)throw new Error(x(0x7c)+c+x(0x88)+d);if(!g[f])throw new Error(x(0x84)+c+x(0x88)+d+'.'+f);return g[f];}[m(0x95)](c){const y=m,d=[];if(Array[y(0x9f)](c)){for(const f of c)d[y(0x8c)](this[y(0x99)](f));}return d;}['isFunction'](c){const z=m;return z(0x6f)==typeof c&&c[z(0xa1)]('{@')&&c[z(0x77)]('}');}[m(0x94)](c){const A=m;if(A(0x6f)==typeof c&&c[A(0x77)]('}'))return c[A(0xa1)](A(0x9e))||c[A(0xa1)]('{$key')||c['startsWith'](A(0x7d))||c['startsWith'](A(0x86))||c['startsWith']('{$output');}['isMappable'](c){const B=m;return B(0x6f)==typeof c&&c[B(0xa1)]('{')&&c[B(0x77)]('}');}[m(0x99)](c){const C=m;if(this[C(0x6c)](c))return Pipe[C(0x90)](c)['call']();return this[C(0x94)](c)?this[C(0x8a)](c):this[C(0x70)](c)?this[C(0x9c)](c):c;}[m(0x85)](c,d){const D=m,f=d[D(0x8b)]('.');let g=c;for(const h of f){if(null===g||D(0x73)!=typeof g||!g[D(0x7e)](h))return;g=g[h];}return g;}['resolveMappableValue'](c){const E=m,d=this[E(0x9a)](c);return this[E(0x85)](this[E(0x7a)],d);}[m(0x8a)](c){const F=m,d=this['resolveContextTerm'](c);return this[F(0x85)](this[F(0x79)],d);}[m(0x81)](c){const G=m;return c[G(0x71)](0x1,c[G(0x97)]-0x1);}['resolveFunctionTerm'](c){const H=m;return c['substring'](0x2,c[H(0x97)]-0x1);}[m(0x9a)](c){const I=m;return c['substring'](0x1,c[I(0x97)]-0x1);}}exports[m(0x91)]=Pipe;