Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cherry-cljs

Package Overview
Dependencies
Maintainers
1
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cherry-cljs - npm Package Compare versions

Comparing version 0.0.0-alpha.54 to 0.0.0-alpha.55

42

lib/cli.js
import * as esm_import$fs from "fs";
import { $APP, shadow$provide, $jscomp } from "./compiler.js";
const shadow_esm_import = function(x) { return import(x) };
'use strict';var VI=function(a,b){return $APP.p($APP.p(b)?$APP.Kk.h(b,""):b)?$APP.vr(a,new $APP.Vp(new $APP.Up(b,$APP.D(b)))):null},XI=function(a){throw $APP.Hm.h(["Unexpected format: ",$APP.t.g(a)].join(""),new $APP.m(null,1,[WI,a],null));},YI=function(a){var b=JSON.parse(a);return $APP.Jd(b)?b:XI(a)},ZI=function(a){var b=JSON.parse(a);return $APP.Od(b)?b:XI(a)},$I=function(a){var b=JSON.parse(a);return $APP.Pd(b)?b:XI(a)},aJ=function(a){var b=JSON.parse(a);return"number"===typeof b?b:XI(a)},bJ=
function(a){return $APP.F.h(":",0<a.length?a.charAt(0):null)?$APP.ii.g($APP.Zh.h(a,1)):$APP.ii.g(a)},cJ=function(a){return $APP.zd(a)?$APP.A(a):a},dJ=function(a){if("string"===typeof a)try{var b=0<a.length?a.charAt(0):null;if($APP.F.h("true",a)||$APP.F.h("false",a))var c=YI(a);else{if($APP.Da(isNaN(a)))var d=aJ(a);else{var e=$APP.F.h(":",b);var f=e?$APP.Xh(/:?[a-zA-Z0-9]+/,a):e;d=$APP.p(f)?bJ(a):a}c=d}return c}catch(g){return a}else return a},iJ=function(a,b){var c=function(){switch(b instanceof $APP.N?
b.La:null){case "boolean":return YI;case "int":case "long":return ZI;case "double":return $I;case "number":return aJ;case "symbol":return $APP.ti;case "keyword":return bJ;case "string":return $APP.de;case "edn":return eJ;case "auto":return dJ;default:return b}}();if("string"===typeof a){try{var d=c.g?c.g(a):c.call(null,a)}catch(e){d=fJ}if($APP.F.h(fJ,d))throw $APP.Hm.h(["Coerce failure: cannot transform input ",$APP.dm.l($APP.T.h([a],0)),b instanceof $APP.N?" to ":" with ",$APP.t.g(b instanceof $APP.N?
$APP.Jh(b):b)].join(""),new $APP.m(null,2,[gJ,a,hJ,b],null));return d}return a},jJ=function(a,b,c){a=$APP.J.h(a,b);c=$APP.p(a)?a:$APP.zd(c)?$APP.od(c):null;return $APP.p(c)?$APP.zd(c)?$APP.Pk.h($APP.oe,c):c:null},kJ=function(a,b,c,d){return $APP.Kk.h(b,c)?$APP.jl.j(a,b,function(e){return null==e?$APP.p(d)?d.h?d.h(e,!0):d.call(null,e,!0):!0:$APP.p(d)?d.h?d.h(e,!0):d.call(null,e,!0):e}):a},lJ=function(a,b,c,d,e){d=$APP.p($APP.p(d)?!$APP.zd(d):d)?iJ(e,d):dJ(e);return $APP.p(c)?$APP.jl.D(a,b,c,d):$APP.W.j(a,
b,d)},qJ=function(a){return $APP.$d.j(function(b,c){var d=$APP.H.j(c,0,null);c=$APP.H.j(c,1,null);c=$APP.Qe(c);var e=$APP.J.h(c,mJ),f=$APP.J.h(c,nJ);c=$APP.J.h(c,$APP.xn);b=$APP.p(e)?$APP.jl.J(b,mJ,$APP.W,d,e):b;b=$APP.p(f)?$APP.jl.j(b,oJ,function(g){if($APP.Rd(g,f))throw $APP.Hm.h(["Conflicting alias ",$APP.t.g(f)," between ",$APP.t.g($APP.J.h(g,f))," and ",$APP.t.g(d)].join(""),new $APP.m(null,1,[nJ,f],null));return $APP.W.j(g,f,d)}):b;return $APP.p(c)?$APP.jl.J(b,pJ,$APP.W,d,c):b},$APP.Pe,a)},
DJ=function(){var a=process.argv.slice(2),b=new $APP.m(null,1,[oJ,new $APP.m(null,1,[rJ,sJ],null)],null),c=tJ.g(b);b=$APP.p(c)?$APP.Hl.l($APP.T.h([b,$APP.p(c)?qJ(c):null],0)):b;var d=mJ.g(b),e=oJ.g(b),f=uJ.g(b),g=pJ.g(b),k=vJ.g(b),l=$APP.F.h(!0,wJ.g(b))?function(){var C=null==c?null:$APP.yh(c);C=null==C?null:$APP.X.h(C,$APP.yh(e));C=null==C?null:$APP.X.h(C,$APP.yh(d));return null==C?null:$APP.Hh(C)}():wJ.g(b);a=$APP.Uh(function(C){var E=$APP.p(k)?null:0==C.lastIndexOf(":",0);return!($APP.p(E)?E:0==
C.lastIndexOf("-",0))},a);var n=$APP.H.j(a,0,null),q=$APP.H.j(a,1,null);a=function(){var C=$APP.z(n);return null==C?null:$APP.U(C)}();var r=function(){for(var C=$APP.p(g)?g:$APP.Pe,E=null,G=null,O=$APP.p(k)?xJ:null,S=$APP.z(q);;){if($APP.Da(S))return new $APP.Q(null,3,5,$APP.R,[C,E,G],null);var Y=$APP.A(S),ka=jJ(f,E,$APP.J.h(d,E)),ya=0<Y.length?Y.charAt(0):null,Db=$APP.F.h(ya,"-"),ac=function(){var td=O;return $APP.p(td)?td:Db?xJ:null}(),qa=$APP.F.h(":",ya),jc=$APP.Kk.h(xJ,ac)&&qa&&($APP.Da(E)||$APP.F.h(G,
E));ya=function(){var td=ac;return $APP.p(td)?td:jc?yJ:null}();if(Db||jc){var $a=(qa=0==Y.lastIndexOf("--",0))&&$APP.F.h("--",Y);if($a){var Nd=$APP.B(S);return new $APP.Q(null,3,5,$APP.R,[function(){var td=C;return Nd?$APP.Jk.D(td,$APP.hl,new $APP.Q(null,2,5,$APP.R,[zJ,AJ],null),$APP.U(Nd)):td}(),E,G],null)}$a=qa?$APP.Zh.h(Y,2):$APP.zp(Y,/^(:|-|)/,"");qa=qa?$APP.Ep($a,/=/):new $APP.Q(null,1,5,$APP.R,[$a],null);$a=$APP.H.j(qa,0,null);qa=$APP.H.j(qa,1,null);$a=$APP.ii.g($a);$a=$APP.J.j(e,$a,$a);if($APP.p($APP.p(l)?
$APP.Da($APP.J.h(l,$a)):l))throw $APP.Hm.h(["Unknown option ",$APP.t.g(Y)].join(""),new $APP.m(null,1,[wJ,l],null));$APP.p(qa)?(E=kJ(C,E,G,ka),G=$a,S=$APP.M(qa,$APP.Kc(S)),C=E,E=G,G=null,O=ya):(E=kJ(C,E,G,ka),Y=$a,S=$APP.B(S),C=E,E=Y,O=ya)}else{var Sc=$APP.J.h(d,E);if($a=$APP.F.h(BJ,Sc)&&$APP.Da(G)&&$APP.Kk.h(Y,"true")&&$APP.Kk.h(Y,"false")||$APP.F.h(G,E)&&$APP.Da(ka))return new $APP.Q(null,3,5,$APP.R,[$APP.Jk.D(C,$APP.hl,new $APP.Q(null,2,5,$APP.R,[zJ,AJ],null),$APP.U(S)),E,null],null);G=lJ(C,E,
ka,cJ(Sc),Y);Y=$APP.F.h(yJ,ya)&&qa?null:E;ka=$APP.F.h(yJ,ya)&&qa?null:E;S=$APP.B(S);C=G;E=Y;G=ka;O=ya}}}();b=$APP.H.j(r,0,null);var v=$APP.H.j(r,1,null);r=$APP.H.j(r,2,null);var y=jJ(f,v,$APP.J.h(iJ,v));b=kJ(b,v,r,y);return $APP.p(a)?$APP.Jk.D(b,$APP.hl,new $APP.Q(null,2,5,$APP.R,[zJ,CJ],null),a):b},FJ=function(){var a=DJ(),b=zJ.g($APP.vd(a));return $APP.W.j(b,EJ,$APP.Xj.h(a,zJ))},GJ=function(a,b){var c=$APP.zf($APP.D(a),b);b=$APP.H.j(c,0,null);c=$APP.H.j(c,1,null);return $APP.F.h(b,a)?c:null},KJ=
function(){var a=HJ,b=FJ(),c=$APP.Qe(b),d=$APP.J.h(c,CJ),e=$APP.J.h(c,EJ);$APP.$d.j(function(f,g){f=$APP.Qe(g);var k=$APP.J.h(f,CJ),l=$APP.J.h(f,$APP.it),n=$APP.J.h(f,IJ),q=GJ(k,d);if($APP.p(q)){var r=function(){var C=null==q?null:$APP.z(q);return null==C?null:$APP.U(C)}();f=$APP.p($APP.p(r)?n:r)?function(){var C=$APP.D(r),E=$APP.D(n);return new $APP.Q(null,2,5,$APP.R,[$APP.yf.h(C<E?C:E,r),$APP.Kh(n,r)],null)}():new $APP.Q(null,2,5,$APP.R,[r,null],null);var v=$APP.H.j(f,0,null);f=$APP.H.j(f,1,null);
var y=$APP.p(f)?$APP.Hl.l($APP.T.h([e,f],0)):e;return $APP.Wc(function(){var C=$APP.W.l(c,JJ,v,$APP.T.h([EJ,y,$APP.It,k],0));return l.g?l.g(C):l.call(null,C)}())}return null},null,a)},LJ=function(a,b){return 0==b.lastIndexOf("./",0)?$APP.Cp("/",$APP.X.l(new $APP.Q(null,1,5,$APP.R,[process.cwd()],null),$APP.Ih($APP.Dp(a,"/")),$APP.T.h([new $APP.Q(null,1,5,$APP.R,[$APP.Zh.h(b,2)],null)],0))):b},PJ=function(a){var b=MJ.readFileSync(a,"utf-8");b=$APP.Mt($APP.Kt(b),$APP.qu);return $APP.Kd(b)&&$APP.F.h($APP.jj,
$APP.A(b))?(b=$APP.z(b),$APP.A(b),b=$APP.B(b),$APP.A(b),b=$APP.B(b),b=$APP.nf(function(c){return $APP.Kd(c)&&$APP.F.h(NJ,$APP.A(c))?$APP.Kc(c):null},b),$APP.p(b)?$APP.$d.j(function(c,d){return c.then(function(){var e=$APP.z(d),f=$APP.A(e);e=$APP.B(e);e=$APP.Qe(e);var g=$APP.J.h(e,$APP.gu);f=LJ(a,f);return(OJ.g?OJ.g(f):OJ.call(null,f)).then(function(k){return $APP.Kh(g,$APP.V.h(function(l){return k[$APP.Gj(l)]},g))}).then(function(k){return $APP.OI=$APP.Hl.l($APP.T.h([$APP.OI,k],0))})})},Promise.resolve(null),
b):null):null},SJ=function(a){a=$APP.Qe(a);var b=$APP.J.h(a,QJ),c=$APP.J.h(a,RJ);return Promise.resolve(PJ(b)).then(function(){return $APP.Cu(MJ.readFileSync(b,"utf-8"),null)}).then(function(d){var e=$APP.Qe(d);d=$APP.J.h(e,$APP.Au);e=$APP.J.h(e,$APP.Bu);e=$APP.p(c)?c:$APP.zp(b,/.clj(s|c)$/,$APP.p(e)?".jsx":".mjs");MJ.writeFileSync(e,d,"utf-8");return new $APP.m(null,1,[RJ,e],null)})},TJ=function(a){return $APP.$d.j(function(b,c){return Promise.resolve(b).then(function(){$APP.im.l($APP.T.h(["[cherry] Compiling CLJS file:",
c],0));return SJ(new $APP.m(null,1,[QJ,c],null))}).then(function(d){d=$APP.Qe(d);d=$APP.J.h(d,RJ);$APP.im.l($APP.T.h(["[cherry] Wrote JS file:",d],0));return d})},null,a)},eJ=function eJ(a){switch(arguments.length){case 1:return eJ.g(arguments[0]);case 2:return eJ.h(arguments[0],arguments[1]);default:throw Error(["Invalid arity: ",$APP.t.g(arguments.length)].join(""));}};eJ.g=function(a){return VI(new $APP.m(null,3,[$APP.ur,$APP.tb($APP.KI),$APP.xn,$APP.tb($APP.JI),$APP.mq,null],null),a)};
eJ.h=function(a,b){return VI($APP.jl.j($APP.Hl.l($APP.T.h([new $APP.m(null,1,[$APP.xn,$APP.tb($APP.JI)],null),a],0)),$APP.ur,function(c){return $APP.Hl.l($APP.T.h([$APP.tb($APP.KI),c],0))}),b)};eJ.o=2;
var tJ=new $APP.N(null,"spec","spec",347520401),BJ=new $APP.N(null,"boolean","boolean",-1919418404),EJ=new $APP.N(null,"opts","opts",155075701),sJ=new $APP.N(null,"help","help",-439233446),hJ=new $APP.N(null,"coerce-fn","coerce-fn",-821146515),vJ=new $APP.N(null,"no-keyword-opts","no-keyword-opts",761286018),JJ=new $APP.N(null,"rest-cmds","rest-cmds",-423198324),yJ=new $APP.N(null,"keywords","keywords",1526959054),CJ=new $APP.N(null,"cmds","cmds",-1841503952),oJ=new $APP.N(null,"aliases","aliases",
1346874714),uJ=new $APP.N(null,"collect","collect",-284321549),QJ=new $APP.N(null,"in-file","in-file",-1682176692),NJ=new $APP.N(null,"require-macros","require-macros",707947416),zJ=new $APP.N("org.babashka","cli","org.babashka/cli",1162430315),fJ=new $APP.N("babashka.cli","error","babashka.cli/error",-939678701),IJ=new $APP.N(null,"cmds-opts","cmds-opts",-390130362),pJ=new $APP.N(null,"exec-args","exec-args",-1860766354),gJ=new $APP.N(null,"input","input",556931961),mJ=new $APP.N(null,"coerce","coerce",
1917884504),UJ=new $APP.N(null,"show","show",-576705889),wJ=new $APP.N(null,"closed","closed",-919675359),rJ=new $APP.N(null,"h","h",1109658740),VJ=new $APP.N(null,"e","e",1381269198),WI=new $APP.N(null,"s","s",1705939918),xJ=new $APP.N(null,"hyphens","hyphens",2113533609),nJ=new $APP.N(null,"alias","alias",-2039751630),AJ=new $APP.N(null,"args","args",1315556576),RJ=new $APP.N(null,"out-file","out-file",-1187066405);var MJ=esm_import$fs;var OJ=eval("(x) \x3d\x3e { return import(x) }");var HJ=new $APP.Q(null,3,5,$APP.R,[new $APP.m(null,3,[CJ,new $APP.Q(null,1,5,$APP.R,["run"],null),$APP.it,function(a){a=$APP.Qe(a);a=$APP.J.h(a,EJ);a=$APP.Qe(a);a=$APP.J.h(a,$APP.Mo);$APP.im.l($APP.T.h(["[cherry] Running",a],0));return SJ(new $APP.m(null,1,[QJ,a],null)).then(function(b){b=$APP.Qe(b);b=$APP.J.h(b,RJ);return shadow_esm_import([$APP.t.g(process.cwd()),"/",$APP.t.g(b)].join(""))})},IJ,new $APP.Q(null,1,5,$APP.R,[$APP.Mo],null)],null),new $APP.m(null,2,[CJ,new $APP.Q(null,1,5,$APP.R,["compile"],
null),$APP.it,function(a){a=$APP.Qe(a);a=$APP.J.h(a,JJ);return TJ(a)}],null),new $APP.m(null,2,[CJ,$APP.Zf,$APP.it,function(a){a=$APP.Qe(a);var b=$APP.J.h(a,JJ),c=$APP.J.h(a,EJ);a=VJ.g(c);if($APP.p(a)){a=$APP.UI.g(a);var d=MJ.mkdtempSync(".tmp"),e=[$APP.t.g(d),"/cherry.mjs"].join("");MJ.writeFileSync(e,a,"utf-8");$APP.p(UJ.g(c))&&$APP.im.l($APP.T.h([a],0));return shadow_esm_import([$APP.t.g(process.cwd()),"/",e].join("")).finally(function(){return MJ.rmSync(d,{force:!0,recursive:!0})})}return $APP.p(function(){var f=
sJ.g(c);return $APP.p(f)?f:$APP.F.h("help",$APP.A(b))||$APP.yd(b)}())?$APP.im.l($APP.T.h(["Cherry v0.0.0\n\nUsage:\n\nrun \x3cfile.cljs\x3e Compile and run a file\ncompile \x3cfile.cljs\x3e ... Compile file(s)\nhelp Print this help"],0)):TJ(b)}],null)],null);try{KJ()}catch(a){throw console.error("An error occurred when calling (cherry.internal.cli/init)"),a;};
'use strict';var ZI=function(a,b){return $APP.p($APP.p(b)?$APP.Lk.h(b,""):b)?$APP.zr(a,new $APP.Zp(new $APP.Yp(b,$APP.D(b)))):null},aJ=function(a){throw $APP.Im.h(["Unexpected format: ",$APP.t.g(a)].join(""),new $APP.m(null,1,[$I,a],null));},bJ=function(a){var b=JSON.parse(a);return $APP.Jd(b)?b:aJ(a)},cJ=function(a){var b=JSON.parse(a);return $APP.Od(b)?b:aJ(a)},dJ=function(a){var b=JSON.parse(a);return $APP.Pd(b)?b:aJ(a)},eJ=function(a){var b=JSON.parse(a);return"number"===typeof b?b:aJ(a)},fJ=
function(a){return $APP.F.h(":",0<a.length?a.charAt(0):null)?$APP.ji.g($APP.$h.h(a,1)):$APP.ji.g(a)},gJ=function(a){return $APP.zd(a)?$APP.A(a):a},hJ=function(a){if("string"===typeof a)try{var b=0<a.length?a.charAt(0):null;if($APP.F.h("true",a)||$APP.F.h("false",a))var c=bJ(a);else{if($APP.Da(isNaN(a)))var d=eJ(a);else{var e=$APP.F.h(":",b);var f=e?$APP.Yh(/:?[a-zA-Z0-9]+/,a):e;d=$APP.p(f)?fJ(a):a}c=d}return c}catch(g){return a}else return a},mJ=function(a,b){var c=function(){switch(b instanceof $APP.N?
b.La:null){case "boolean":return bJ;case "int":case "long":return cJ;case "double":return dJ;case "number":return eJ;case "symbol":return $APP.ui;case "keyword":return fJ;case "string":return $APP.de;case "edn":return iJ;case "auto":return hJ;default:return b}}();if("string"===typeof a){try{var d=c.g?c.g(a):c.call(null,a)}catch(e){d=jJ}if($APP.F.h(jJ,d))throw $APP.Im.h(["Coerce failure: cannot transform input ",$APP.em.l($APP.T.h([a],0)),b instanceof $APP.N?" to ":" with ",$APP.t.g(b instanceof $APP.N?
$APP.Kh(b):b)].join(""),new $APP.m(null,2,[kJ,a,lJ,b],null));return d}return a},nJ=function(a,b,c){a=$APP.J.h(a,b);c=$APP.p(a)?a:$APP.zd(c)?$APP.od(c):null;return $APP.p(c)?$APP.zd(c)?$APP.Qk.h($APP.oe,c):c:null},oJ=function(a,b,c,d){return $APP.Lk.h(b,c)?$APP.kl.j(a,b,function(e){return null==e?$APP.p(d)?d.h?d.h(e,!0):d.call(null,e,!0):!0:$APP.p(d)?d.h?d.h(e,!0):d.call(null,e,!0):e}):a},pJ=function(a,b,c,d,e){d=$APP.p($APP.p(d)?!$APP.zd(d):d)?mJ(e,d):hJ(e);return $APP.p(c)?$APP.kl.D(a,b,c,d):$APP.W.j(a,
b,d)},uJ=function(a){return $APP.$d.j(function(b,c){var d=$APP.H.j(c,0,null);c=$APP.H.j(c,1,null);c=$APP.Re(c);var e=$APP.J.h(c,qJ),f=$APP.J.h(c,rJ);c=$APP.J.h(c,$APP.An);b=$APP.p(e)?$APP.kl.J(b,qJ,$APP.W,d,e):b;b=$APP.p(f)?$APP.kl.j(b,sJ,function(g){if($APP.Rd(g,f))throw $APP.Im.h(["Conflicting alias ",$APP.t.g(f)," between ",$APP.t.g($APP.J.h(g,f))," and ",$APP.t.g(d)].join(""),new $APP.m(null,1,[rJ,f],null));return $APP.W.j(g,f,d)}):b;return $APP.p(c)?$APP.kl.J(b,tJ,$APP.W,d,c):b},$APP.Qe,a)},
HJ=function(){var a=process.argv.slice(2),b=new $APP.m(null,1,[sJ,new $APP.m(null,1,[vJ,wJ],null)],null),c=xJ.g(b);b=$APP.p(c)?$APP.Il.l($APP.T.h([b,$APP.p(c)?uJ(c):null],0)):b;var d=qJ.g(b),e=sJ.g(b),f=yJ.g(b),g=tJ.g(b),k=zJ.g(b),l=$APP.F.h(!0,AJ.g(b))?function(){var C=null==c?null:$APP.zh(c);C=null==C?null:$APP.X.h(C,$APP.zh(e));C=null==C?null:$APP.X.h(C,$APP.zh(d));return null==C?null:$APP.Ih(C)}():AJ.g(b);a=$APP.Vh(function(C){var E=$APP.p(k)?null:0==C.lastIndexOf(":",0);return!($APP.p(E)?E:0==
C.lastIndexOf("-",0))},a);var n=$APP.H.j(a,0,null),q=$APP.H.j(a,1,null);a=function(){var C=$APP.z(n);return null==C?null:$APP.U(C)}();var r=function(){for(var C=$APP.p(g)?g:$APP.Qe,E=null,G=null,O=$APP.p(k)?BJ:null,S=$APP.z(q);;){if($APP.Da(S))return new $APP.Q(null,3,5,$APP.R,[C,E,G],null);var Y=$APP.A(S),ka=nJ(f,E,$APP.J.h(d,E)),ya=0<Y.length?Y.charAt(0):null,Db=$APP.F.h(ya,"-"),bc=function(){var td=O;return $APP.p(td)?td:Db?BJ:null}(),qa=$APP.F.h(":",ya),jc=$APP.Lk.h(BJ,bc)&&qa&&($APP.Da(E)||$APP.F.h(G,
E));ya=function(){var td=bc;return $APP.p(td)?td:jc?CJ:null}();if(Db||jc){var Za=(qa=0==Y.lastIndexOf("--",0))&&$APP.F.h("--",Y);if(Za){var Nd=$APP.B(S);return new $APP.Q(null,3,5,$APP.R,[function(){var td=C;return Nd?$APP.Kk.D(td,$APP.il,new $APP.Q(null,2,5,$APP.R,[DJ,EJ],null),$APP.U(Nd)):td}(),E,G],null)}Za=qa?$APP.$h.h(Y,2):$APP.Cp(Y,/^(:|-|)/,"");qa=qa?$APP.Ip(Za,/=/):new $APP.Q(null,1,5,$APP.R,[Za],null);Za=$APP.H.j(qa,0,null);qa=$APP.H.j(qa,1,null);Za=$APP.ji.g(Za);Za=$APP.J.j(e,Za,Za);if($APP.p($APP.p(l)?
$APP.Da($APP.J.h(l,Za)):l))throw $APP.Im.h(["Unknown option ",$APP.t.g(Y)].join(""),new $APP.m(null,1,[AJ,l],null));$APP.p(qa)?(E=oJ(C,E,G,ka),G=Za,S=$APP.M(qa,$APP.Kc(S)),C=E,E=G,G=null,O=ya):(E=oJ(C,E,G,ka),Y=Za,S=$APP.B(S),C=E,E=Y,O=ya)}else{var Rc=$APP.J.h(d,E);if(Za=$APP.F.h(FJ,Rc)&&$APP.Da(G)&&$APP.Lk.h(Y,"true")&&$APP.Lk.h(Y,"false")||$APP.F.h(G,E)&&$APP.Da(ka))return new $APP.Q(null,3,5,$APP.R,[$APP.Kk.D(C,$APP.il,new $APP.Q(null,2,5,$APP.R,[DJ,EJ],null),$APP.U(S)),E,null],null);G=pJ(C,E,
ka,gJ(Rc),Y);Y=$APP.F.h(CJ,ya)&&qa?null:E;ka=$APP.F.h(CJ,ya)&&qa?null:E;S=$APP.B(S);C=G;E=Y;G=ka;O=ya}}}();b=$APP.H.j(r,0,null);var v=$APP.H.j(r,1,null);r=$APP.H.j(r,2,null);var y=nJ(f,v,$APP.J.h(mJ,v));b=oJ(b,v,r,y);return $APP.p(a)?$APP.Kk.D(b,$APP.il,new $APP.Q(null,2,5,$APP.R,[DJ,GJ],null),a):b},JJ=function(){var a=HJ(),b=DJ.g($APP.vd(a));return $APP.W.j(b,IJ,$APP.Yj.h(a,DJ))},KJ=function(a,b){var c=$APP.Af($APP.D(a),b);b=$APP.H.j(c,0,null);c=$APP.H.j(c,1,null);return $APP.F.h(b,a)?c:null},OJ=
function(){var a=LJ,b=JJ(),c=$APP.Re(b),d=$APP.J.h(c,GJ),e=$APP.J.h(c,IJ);$APP.$d.j(function(f,g){f=$APP.Re(g);var k=$APP.J.h(f,GJ),l=$APP.J.h(f,$APP.mt),n=$APP.J.h(f,MJ),q=KJ(k,d);if($APP.p(q)){var r=function(){var C=null==q?null:$APP.z(q);return null==C?null:$APP.U(C)}();f=$APP.p($APP.p(r)?n:r)?function(){var C=$APP.D(r),E=$APP.D(n);return new $APP.Q(null,2,5,$APP.R,[$APP.zf.h(C<E?C:E,r),$APP.Lh(n,r)],null)}():new $APP.Q(null,2,5,$APP.R,[r,null],null);var v=$APP.H.j(f,0,null);f=$APP.H.j(f,1,null);
var y=$APP.p(f)?$APP.Il.l($APP.T.h([e,f],0)):e;return $APP.Wc(function(){var C=$APP.W.l(c,NJ,v,$APP.T.h([IJ,y,$APP.Mt,k],0));return l.g?l.g(C):l.call(null,C)}())}return null},null,a)},PJ=function(a,b){return 0==b.lastIndexOf("./",0)?$APP.Fp("/",$APP.X.l(new $APP.Q(null,1,5,$APP.R,[process.cwd()],null),$APP.Jh($APP.Ip(a,"/")),$APP.T.h([new $APP.Q(null,1,5,$APP.R,[$APP.$h.h(b,2)],null)],0))):b},TJ=function(a){var b=QJ.readFileSync(a,"utf-8");b=$APP.Qt($APP.Ot(b),$APP.wu);return $APP.Kd(b)&&$APP.F.h($APP.kj,
$APP.A(b))?(b=$APP.z(b),$APP.A(b),b=$APP.B(b),$APP.A(b),b=$APP.B(b),b=$APP.of(function(c){return $APP.Kd(c)&&$APP.F.h(RJ,$APP.A(c))?$APP.Kc(c):null},b),$APP.p(b)?$APP.$d.j(function(c,d){return c.then(function(){var e=$APP.z(d),f=$APP.A(e);e=$APP.B(e);e=$APP.Re(e);var g=$APP.J.h(e,$APP.mu);f=PJ(a,f);return(SJ.g?SJ.g(f):SJ.call(null,f)).then(function(k){return $APP.Lh(g,$APP.V.h(function(l){return k[$APP.Hj(l)]},g))}).then(function(k){return $APP.TI=$APP.Il.l($APP.T.h([$APP.TI,k],0))})})},Promise.resolve(null),
b):null):null},WJ=function(a){a=$APP.Re(a);var b=$APP.J.h(a,UJ),c=$APP.J.h(a,VJ);return Promise.resolve(TJ(b)).then(function(){return $APP.Hu(QJ.readFileSync(b,"utf-8"),null)}).then(function(d){var e=$APP.Re(d);d=$APP.J.h(e,$APP.Gu);e=$APP.J.h(e,$APP.au);e=$APP.p(c)?c:$APP.Cp(b,/.clj(s|c)$/,$APP.p(e)?".jsx":".mjs");QJ.writeFileSync(e,d,"utf-8");return new $APP.m(null,1,[VJ,e],null)})},XJ=function(a){return $APP.$d.j(function(b,c){return Promise.resolve(b).then(function(){$APP.jm.l($APP.T.h(["[cherry] Compiling CLJS file:",
c],0));return WJ(new $APP.m(null,1,[UJ,c],null))}).then(function(d){d=$APP.Re(d);d=$APP.J.h(d,VJ);$APP.jm.l($APP.T.h(["[cherry] Wrote JS file:",d],0));return d})},null,a)},iJ=function iJ(a){switch(arguments.length){case 1:return iJ.g(arguments[0]);case 2:return iJ.h(arguments[0],arguments[1]);default:throw Error(["Invalid arity: ",$APP.t.g(arguments.length)].join(""));}};iJ.g=function(a){return ZI(new $APP.m(null,3,[$APP.yr,$APP.tb($APP.PI),$APP.An,$APP.tb($APP.OI),$APP.qq,null],null),a)};
iJ.h=function(a,b){return ZI($APP.kl.j($APP.Il.l($APP.T.h([new $APP.m(null,1,[$APP.An,$APP.tb($APP.OI)],null),a],0)),$APP.yr,function(c){return $APP.Il.l($APP.T.h([$APP.tb($APP.PI),c],0))}),b)};iJ.o=2;
var xJ=new $APP.N(null,"spec","spec",347520401),FJ=new $APP.N(null,"boolean","boolean",-1919418404),IJ=new $APP.N(null,"opts","opts",155075701),wJ=new $APP.N(null,"help","help",-439233446),lJ=new $APP.N(null,"coerce-fn","coerce-fn",-821146515),zJ=new $APP.N(null,"no-keyword-opts","no-keyword-opts",761286018),NJ=new $APP.N(null,"rest-cmds","rest-cmds",-423198324),CJ=new $APP.N(null,"keywords","keywords",1526959054),GJ=new $APP.N(null,"cmds","cmds",-1841503952),sJ=new $APP.N(null,"aliases","aliases",
1346874714),yJ=new $APP.N(null,"collect","collect",-284321549),UJ=new $APP.N(null,"in-file","in-file",-1682176692),RJ=new $APP.N(null,"require-macros","require-macros",707947416),DJ=new $APP.N("org.babashka","cli","org.babashka/cli",1162430315),jJ=new $APP.N("babashka.cli","error","babashka.cli/error",-939678701),MJ=new $APP.N(null,"cmds-opts","cmds-opts",-390130362),tJ=new $APP.N(null,"exec-args","exec-args",-1860766354),kJ=new $APP.N(null,"input","input",556931961),qJ=new $APP.N(null,"coerce","coerce",
1917884504),YJ=new $APP.N(null,"show","show",-576705889),AJ=new $APP.N(null,"closed","closed",-919675359),vJ=new $APP.N(null,"h","h",1109658740),ZJ=new $APP.N(null,"e","e",1381269198),$I=new $APP.N(null,"s","s",1705939918),BJ=new $APP.N(null,"hyphens","hyphens",2113533609),rJ=new $APP.N(null,"alias","alias",-2039751630),EJ=new $APP.N(null,"args","args",1315556576),VJ=new $APP.N(null,"out-file","out-file",-1187066405);var QJ=esm_import$fs;var SJ=eval("(x) \x3d\x3e { return import(x) }");var LJ=new $APP.Q(null,3,5,$APP.R,[new $APP.m(null,3,[GJ,new $APP.Q(null,1,5,$APP.R,["run"],null),$APP.mt,function(a){a=$APP.Re(a);a=$APP.J.h(a,IJ);a=$APP.Re(a);a=$APP.J.h(a,$APP.Po);$APP.jm.l($APP.T.h(["[cherry] Running",a],0));return WJ(new $APP.m(null,1,[UJ,a],null)).then(function(b){b=$APP.Re(b);b=$APP.J.h(b,VJ);return shadow_esm_import([$APP.t.g(process.cwd()),"/",$APP.t.g(b)].join(""))})},MJ,new $APP.Q(null,1,5,$APP.R,[$APP.Po],null)],null),new $APP.m(null,2,[GJ,new $APP.Q(null,1,5,$APP.R,["compile"],
null),$APP.mt,function(a){a=$APP.Re(a);a=$APP.J.h(a,NJ);return XJ(a)}],null),new $APP.m(null,2,[GJ,$APP.$f,$APP.mt,function(a){a=$APP.Re(a);var b=$APP.J.h(a,NJ),c=$APP.J.h(a,IJ);a=ZJ.g(c);if($APP.p(a)){a=$APP.YI.g(a);var d=QJ.mkdtempSync(".tmp"),e=[$APP.t.g(d),"/cherry.mjs"].join("");QJ.writeFileSync(e,a,"utf-8");$APP.p(YJ.g(c))&&$APP.jm.l($APP.T.h([a],0));return shadow_esm_import([$APP.t.g(process.cwd()),"/",e].join("")).finally(function(){return QJ.rmSync(d,{force:!0,recursive:!0})})}return $APP.p(function(){var f=
wJ.g(c);return $APP.p(f)?f:$APP.F.h("help",$APP.A(b))||$APP.yd(b)}())?$APP.jm.l($APP.T.h(["Cherry v0.0.0\n\nUsage:\n\nrun \x3cfile.cljs\x3e Compile and run a file\ncompile \x3cfile.cljs\x3e ... Compile file(s)\nhelp Print this help"],0)):XJ(b)}],null)],null);try{OJ()}catch(a){throw console.error("An error occurred when calling (cherry.internal.cli/init)"),a;};
export { $APP, shadow$provide, $jscomp };

@@ -5,3 +5,3 @@ {

"sideEffects": false,
"version": "0.0.0-alpha.54",
"version": "0.0.0-alpha.55",
"files": [

@@ -8,0 +8,0 @@ "cljs.core.js",

@@ -10,2 +10,5 @@ ## Cherry :cherries:

Also check out [ClavaScript](https://github.com/clavascript/clavascript) which
is a CLJS _syntax_ to JS compiler.
## Quickstart

@@ -12,0 +15,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc