From 53b3ed213ad51e49435c34d283ea93748943e8a9 Mon Sep 17 00:00:00 2001 From: didier amyot Date: Thu, 15 Nov 2018 13:33:57 -0500 Subject: [PATCH] added dodgebotbackend --- dodgebotbackend/.gitignore | 11 + dodgebotbackend/CHANGELOG.md | 24 ++ dodgebotbackend/LICENSE | 214 ++++++++++++ dodgebotbackend/README.md | 14 + dodgebotbackend/doc/intro.md | 3 + dodgebotbackend/index.js | 307 ++++++++++++++++++ dodgebotbackend/project.clj | 19 ++ .../src/cljs/dodgebotbackend/core.cljs | 26 ++ .../test/dodgebotbackend/core_test.clj | 7 + 9 files changed, 625 insertions(+) create mode 100644 dodgebotbackend/.gitignore create mode 100644 dodgebotbackend/CHANGELOG.md create mode 100644 dodgebotbackend/LICENSE create mode 100644 dodgebotbackend/README.md create mode 100644 dodgebotbackend/doc/intro.md create mode 100644 dodgebotbackend/index.js create mode 100644 dodgebotbackend/project.clj create mode 100644 dodgebotbackend/src/cljs/dodgebotbackend/core.cljs create mode 100644 dodgebotbackend/test/dodgebotbackend/core_test.clj diff --git a/dodgebotbackend/.gitignore b/dodgebotbackend/.gitignore new file mode 100644 index 0000000..c53038e --- /dev/null +++ b/dodgebotbackend/.gitignore @@ -0,0 +1,11 @@ +/target +/classes +/checkouts +pom.xml +pom.xml.asc +*.jar +*.class +/.lein-* +/.nrepl-port +.hgignore +.hg/ diff --git a/dodgebotbackend/CHANGELOG.md b/dodgebotbackend/CHANGELOG.md new file mode 100644 index 0000000..c24e950 --- /dev/null +++ b/dodgebotbackend/CHANGELOG.md @@ -0,0 +1,24 @@ +# Change Log +All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/). + +## [Unreleased] +### Changed +- Add a new arity to `make-widget-async` to provide a different widget shape. + +## [0.1.1] - 2018-11-15 +### Changed +- Documentation on how to make the widgets. + +### Removed +- `make-widget-sync` - we're all async, all the time. + +### Fixed +- Fixed widget maker to keep working when daylight savings switches over. + +## 0.1.0 - 2018-11-15 +### Added +- Files from the new template. +- Widget maker public API - `make-widget-sync`. + +[Unreleased]: https://github.com/your-name/dodgebotbackend/compare/0.1.1...HEAD +[0.1.1]: https://github.com/your-name/dodgebotbackend/compare/0.1.0...0.1.1 diff --git a/dodgebotbackend/LICENSE b/dodgebotbackend/LICENSE new file mode 100644 index 0000000..d921d3d --- /dev/null +++ b/dodgebotbackend/LICENSE @@ -0,0 +1,214 @@ +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC +LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM +CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + +1. DEFINITIONS + +"Contribution" means: + +a) in the case of the initial Contributor, the initial code and +documentation distributed under this Agreement, and + +b) in the case of each subsequent Contributor: + +i) changes to the Program, and + +ii) additions to the Program; + +where such changes and/or additions to the Program originate from and are +distributed by that particular Contributor. A Contribution 'originates' from +a Contributor if it was added to the Program by such Contributor itself or +anyone acting on such Contributor's behalf. Contributions do not include +additions to the Program which: (i) are separate modules of software +distributed in conjunction with the Program under their own license +agreement, and (ii) are not derivative works of the Program. + +"Contributor" means any person or entity that distributes the Program. + +"Licensed Patents" mean patent claims licensable by a Contributor which are +necessarily infringed by the use or sale of its Contribution alone or when +combined with the Program. + +"Program" means the Contributions distributed in accordance with this +Agreement. + +"Recipient" means anyone who receives the Program under this Agreement, +including all Contributors. + +2. GRANT OF RIGHTS + +a) Subject to the terms of this Agreement, each Contributor hereby grants +Recipient a non-exclusive, worldwide, royalty-free copyright license to +reproduce, prepare derivative works of, publicly display, publicly perform, +distribute and sublicense the Contribution of such Contributor, if any, and +such derivative works, in source code and object code form. + +b) Subject to the terms of this Agreement, each Contributor hereby grants +Recipient a non-exclusive, worldwide, royalty-free patent license under +Licensed Patents to make, use, sell, offer to sell, import and otherwise +transfer the Contribution of such Contributor, if any, in source code and +object code form. This patent license shall apply to the combination of the +Contribution and the Program if, at the time the Contribution is added by the +Contributor, such addition of the Contribution causes such combination to be +covered by the Licensed Patents. The patent license shall not apply to any +other combinations which include the Contribution. No hardware per se is +licensed hereunder. + +c) Recipient understands that although each Contributor grants the licenses +to its Contributions set forth herein, no assurances are provided by any +Contributor that the Program does not infringe the patent or other +intellectual property rights of any other entity. Each Contributor disclaims +any liability to Recipient for claims brought by any other entity based on +infringement of intellectual property rights or otherwise. As a condition to +exercising the rights and licenses granted hereunder, each Recipient hereby +assumes sole responsibility to secure any other intellectual property rights +needed, if any. For example, if a third party patent license is required to +allow Recipient to distribute the Program, it is Recipient's responsibility +to acquire that license before distributing the Program. + +d) Each Contributor represents that to its knowledge it has sufficient +copyright rights in its Contribution, if any, to grant the copyright license +set forth in this Agreement. + +3. REQUIREMENTS + +A Contributor may choose to distribute the Program in object code form under +its own license agreement, provided that: + +a) it complies with the terms and conditions of this Agreement; and + +b) its license agreement: + +i) effectively disclaims on behalf of all Contributors all warranties and +conditions, express and implied, including warranties or conditions of title +and non-infringement, and implied warranties or conditions of merchantability +and fitness for a particular purpose; + +ii) effectively excludes on behalf of all Contributors all liability for +damages, including direct, indirect, special, incidental and consequential +damages, such as lost profits; + +iii) states that any provisions which differ from this Agreement are offered +by that Contributor alone and not by any other party; and + +iv) states that source code for the Program is available from such +Contributor, and informs licensees how to obtain it in a reasonable manner on +or through a medium customarily used for software exchange. + +When the Program is made available in source code form: + +a) it must be made available under this Agreement; and + +b) a copy of this Agreement must be included with each copy of the Program. + +Contributors may not remove or alter any copyright notices contained within +the Program. + +Each Contributor must identify itself as the originator of its Contribution, +if any, in a manner that reasonably allows subsequent Recipients to identify +the originator of the Contribution. + +4. COMMERCIAL DISTRIBUTION + +Commercial distributors of software may accept certain responsibilities with +respect to end users, business partners and the like. While this license is +intended to facilitate the commercial use of the Program, the Contributor who +includes the Program in a commercial product offering should do so in a +manner which does not create potential liability for other Contributors. +Therefore, if a Contributor includes the Program in a commercial product +offering, such Contributor ("Commercial Contributor") hereby agrees to defend +and indemnify every other Contributor ("Indemnified Contributor") against any +losses, damages and costs (collectively "Losses") arising from claims, +lawsuits and other legal actions brought by a third party against the +Indemnified Contributor to the extent caused by the acts or omissions of such +Commercial Contributor in connection with its distribution of the Program in +a commercial product offering. The obligations in this section do not apply +to any claims or Losses relating to any actual or alleged intellectual +property infringement. In order to qualify, an Indemnified Contributor must: +a) promptly notify the Commercial Contributor in writing of such claim, and +b) allow the Commercial Contributor to control, and cooperate with the +Commercial Contributor in, the defense and any related settlement +negotiations. The Indemnified Contributor may participate in any such claim +at its own expense. + +For example, a Contributor might include the Program in a commercial product +offering, Product X. That Contributor is then a Commercial Contributor. If +that Commercial Contributor then makes performance claims, or offers +warranties related to Product X, those performance claims and warranties are +such Commercial Contributor's responsibility alone. Under this section, the +Commercial Contributor would have to defend claims against the other +Contributors related to those performance claims and warranties, and if a +court requires any other Contributor to pay any damages as a result, the +Commercial Contributor must pay those damages. + +5. NO WARRANTY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON +AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER +EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR +CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A +PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the +appropriateness of using and distributing the Program and assumes all risks +associated with its exercise of rights under this Agreement , including but +not limited to the risks and costs of program errors, compliance with +applicable laws, damage to or loss of data, programs or equipment, and +unavailability or interruption of operations. + +6. DISCLAIMER OF LIABILITY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY +CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION +LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE +EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGES. + +7. GENERAL + +If any provision of this Agreement is invalid or unenforceable under +applicable law, it shall not affect the validity or enforceability of the +remainder of the terms of this Agreement, and without further action by the +parties hereto, such provision shall be reformed to the minimum extent +necessary to make such provision valid and enforceable. + +If Recipient institutes patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Program itself +(excluding combinations of the Program with other software or hardware) +infringes such Recipient's patent(s), then such Recipient's rights granted +under Section 2(b) shall terminate as of the date such litigation is filed. + +All Recipient's rights under this Agreement shall terminate if it fails to +comply with any of the material terms or conditions of this Agreement and +does not cure such failure in a reasonable period of time after becoming +aware of such noncompliance. If all Recipient's rights under this Agreement +terminate, Recipient agrees to cease use and distribution of the Program as +soon as reasonably practicable. However, Recipient's obligations under this +Agreement and any licenses granted by Recipient relating to the Program shall +continue and survive. + +Everyone is permitted to copy and distribute copies of this Agreement, but in +order to avoid inconsistency the Agreement is copyrighted and may only be +modified in the following manner. The Agreement Steward reserves the right to +publish new versions (including revisions) of this Agreement from time to +time. No one other than the Agreement Steward has the right to modify this +Agreement. The Eclipse Foundation is the initial Agreement Steward. The +Eclipse Foundation may assign the responsibility to serve as the Agreement +Steward to a suitable separate entity. Each new version of the Agreement will +be given a distinguishing version number. The Program (including +Contributions) may always be distributed subject to the version of the +Agreement under which it was received. In addition, after a new version of +the Agreement is published, Contributor may elect to distribute the Program +(including its Contributions) under the new version. Except as expressly +stated in Sections 2(a) and 2(b) above, Recipient receives no rights or +licenses to the intellectual property of any Contributor under this +Agreement, whether expressly, by implication, estoppel or otherwise. All +rights in the Program not expressly granted under this Agreement are +reserved. + +This Agreement is governed by the laws of the State of New York and the +intellectual property laws of the United States of America. No party to this +Agreement will bring a legal action under this Agreement more than one year +after the cause of action arose. Each party waives its rights to a jury trial +in any resulting litigation. diff --git a/dodgebotbackend/README.md b/dodgebotbackend/README.md new file mode 100644 index 0000000..ccb0202 --- /dev/null +++ b/dodgebotbackend/README.md @@ -0,0 +1,14 @@ +# dodgebotbackend + +A Clojure library designed to ... well, that part is up to you. + +## Usage + +FIXME + +## License + +Copyright © 2018 FIXME + +Distributed under the Eclipse Public License either version 1.0 or (at +your option) any later version. diff --git a/dodgebotbackend/doc/intro.md b/dodgebotbackend/doc/intro.md new file mode 100644 index 0000000..4ad7e7d --- /dev/null +++ b/dodgebotbackend/doc/intro.md @@ -0,0 +1,3 @@ +# Introduction to dodgebotbackend + +TODO: write [great documentation](http://jacobian.org/writing/what-to-write/) diff --git a/dodgebotbackend/index.js b/dodgebotbackend/index.js new file mode 100644 index 0000000..f0fa5e0 --- /dev/null +++ b/dodgebotbackend/index.js @@ -0,0 +1,307 @@ +#!/usr/bin/env node +if(typeof Math.imul == "undefined" || (Math.imul(0xffffffff,5) == 0)) { + Math.imul = function (a, b) { + var ah = (a >>> 16) & 0xffff; + var al = a & 0xffff; + var bh = (b >>> 16) & 0xffff; + var bl = b & 0xffff; + // the shift by 0 fixes the sign on the high part + // the final |0 converts the unsigned value into a signed value + return ((al * bl) + (((ah * bl + al * bh) << 16) >>> 0)|0); + } +} + + +;(function(){ +var f;function aa(a){return"string"==typeof a} +function q(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; +else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function ba(a){var b=q(a);return"array"==b||"object"==b&&"number"==typeof a.length}var da="closure_uid_"+(1E9*Math.random()>>>0),fa=0;var ha=Array.prototype.forEach?function(a,b,c){Array.prototype.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=aa(a)?a.split(""):a,g=0;g2*this.T&&ua(this),!0):!1};function ua(a){if(a.T!=a.ja.length){for(var b=0,c=0;bb)throw Error("Bad port number "+b);a.jb=b}else a.jb=null} +function Ga(a,b,c){Da(a);b instanceof Ia?(a.xa=b,a.xa.Lb(a.pa)):(c||(b=Ja(b,Pa)),a.xa=new Ia(b,a.pa))}f.getQuery=function(){return this.xa.toString()};f.removeParameter=function(a){Da(this);this.xa.remove(a);return this};function Da(a){if(a.jc)throw Error("Tried to modify a read-only Uri");}f.Lb=function(a){this.pa=a;this.xa&&this.xa.Lb(a)};function Ha(a,b){return a?b?decodeURI(a.replace(/%25/g,"%2525")):decodeURIComponent(a):""} +function Ja(a,b,c){return aa(a)?(a=encodeURI(a).replace(b,Qa),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null}function Qa(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)}var Ka=/[#\/\?@]/g,Na=/[#\?:]/g,Ma=/[#\?]/g,Pa=/[#\?@]/g,Oa=/#/g;function Ia(a,b){this.T=this.N=null;this.ma=a||null;this.pa=!!b}function Ra(a){a.N||(a.N=new sa,a.T=0,a.ma&&ya(a.ma,function(b,c){a.add(decodeURIComponent(b.replace(/\+/g," ")),c)}))}f=Ia.prototype; +f.add=function(a,b){Ra(this);this.ma=null;a=Sa(this,a);var c=this.N.get(a);c||this.N.set(a,c=[]);c.push(b);this.T+=1;return this};f.remove=function(a){Ra(this);a=Sa(this,a);return this.N.mb(a)?(this.ma=null,this.T-=this.N.get(a).length,this.N.remove(a)):!1};f.clear=function(){this.N=this.ma=null;this.T=0};f.mb=function(a){Ra(this);a=Sa(this,a);return this.N.mb(a)};f.forEach=function(a,b){Ra(this);this.N.forEach(function(c,d){ha(c,function(c){a.call(b,c,d,this)},this)},this)}; +f.Wa=function(){Ra(this);for(var a=this.N.qa(),b=this.N.Wa(),c=[],d=0;da){var b=Va[a];if(b)return b}b=new Ta([a|0],0>a?-1:0);-128<=a&&128>a&&(Va[a]=b);return b}function Xa(a){if(isNaN(a)||!isFinite(a))return Ya;if(0>a)return Za(Xa(-a));for(var b=[],c=1,d=0;a>=c;d++)b[d]=a/c|0,c*=$a;return new Ta(b,0)}var $a=4294967296,Ya=Wa(0),ab=Wa(1),cb=Wa(16777216); +function db(a){if(-1==a.K)return-db(Za(a));for(var b=0,c=1,d=0;da||36>>0).toString(a);c=e;if(fb(c))return g+d;for(;6>g.length;)g="0"+g;d=""+g+d}}; +function eb(a,b){return 0>b?0:b>>16)+(eb(this,e)>>>16)+(eb(a,e)>>>16);d=h>>>16;g&=65535;h&=65535;c[e]=h<<16|g}return new Ta(c,c[c.length-1]&-2147483648?-1:0)}; +f.multiply=function(a){if(fb(this)||fb(a))return Ya;if(-1==this.K)return-1==a.K?Za(this).multiply(Za(a)):Za(Za(this).multiply(a));if(-1==a.K)return Za(this.multiply(Za(a)));if(0>this.compare(cb)&&0>a.compare(cb))return Xa(db(this)*db(a));for(var b=this.H.length+a.H.length,c=[],d=0;d<2*b;d++)c[d]=0;for(d=0;d>>16,h=eb(this,d)&65535,k=eb(a,e)>>>16,l=eb(a,e)&65535;c[2*d+2*e]+=h*l;hb(c,2*d+2*e);c[2*d+2*e+1]+=g*l;hb(c,2*d+2*e+1);c[2*d+2* +e+1]+=h*k;hb(c,2*d+2*e+1);c[2*d+2*e+2]+=g*k;hb(c,2*d+2*e+2)}for(d=0;d>>16,a[b]&=65535,b++} +function gb(a,b){if(fb(b))throw Error("division by zero");if(fb(a))return Ya;if(-1==a.K)return-1==b.K?gb(Za(a),Za(b)):Za(gb(Za(a),b));if(-1==b.K)return Za(gb(a,Za(b)));if(30=b.compare(a);)c=c.shiftLeft(1),b=b.shiftLeft(1);var d=jb(c,1),e=jb(b,1);b=jb(b,2);for(c=jb(c,2);!fb(b);){var g=e.add(b);0>=g.compare(a)&&(d=d.add(c),e=g);b=jb(b,1);c=jb(c,1)}return d}for(c=Ya;0<=a.compare(b);){d=Math.max(1, +Math.floor(db(a)/db(b)));e=Math.ceil(Math.log(d)/Math.LN2);e=48>=e?1:Math.pow(2,e-48);g=Xa(d);for(var h=g.multiply(b);-1==h.K||0>5;a%=32;for(var c=this.H.length+b+(0>>32-a:eb(this,e-b);return new Ta(d,this.K)};function jb(a,b){var c=b>>5;b%=32;for(var d=a.H.length-c,e=[],g=0;g>>b|eb(a,g+c+1)<<32-b:eb(a,g+c);return new Ta(e,a.K)};function kb(a,b){null!=a&&this.append.apply(this,arguments)}f=kb.prototype;f.Za="";f.set=function(a){this.Za=""+a};f.append=function(a,b,c){this.Za+=String(a);if(null!=b)for(var d=1;d>>16&65535)*d+c*(b>>>16&65535)<<16>>>0)|0};function Cc(a){a=Bc(a|0,-862048943);return Bc(a<<15|a>>>-15,461845907)}function Dc(a,b){a=(a|0)^(b|0);return Bc(a<<13|a>>>-13,5)+-430675100|0}function Ec(a,b){a=(a|0)^b;a=Bc(a^a>>>16,-2048144789);a=Bc(a^a>>>13,-1028477387);return a^a>>>16} +function Fc(a){a:{var b=1;for(var c=0;;)if(b>2)} +function Mc(a,b,c,d,e){this.sb=a;this.name=b;this.Ya=c;this.fb=d;this.ha=e;this.i=2154168321;this.u=4096}f=Mc.prototype;f.toString=function(){return this.Ya};f.equiv=function(a){return this.s(null,a)};f.s=function(a,b){return b instanceof Mc?this.Ya===b.Ya:!1}; +f.call=function(){var a=null;a=function(a,c,d){switch(arguments.length){case 2:return I.b(c,this);case 3:return I.f(c,this,d)}throw Error("Invalid arity: "+(arguments.length-1));};a.b=function(a,c){return I.b(c,this)};a.f=function(a,c,d){return I.f(c,this,d)};return a}();f.apply=function(a,b){return this.call.apply(this,[this].concat(Ab(b)))};f.a=function(a){return I.b(a,this)};f.b=function(a,b){return I.f(a,this,b)};f.R=function(){return this.ha}; +f.S=function(a,b){return new Mc(this.sb,this.name,this.Ya,this.fb,b)};f.O=function(){var a=this.fb;return null!=a?a:this.fb=a=Lc(Fc(this.name),Jc(this.sb))};f.L=function(a,b){return H(b,this.Ya)};function Nc(a){return null!=a?a.u&131072||t===a.sc?!0:a.u?!1:A(xc,a):A(xc,a)} +function J(a){if(null==a)return null;if(null!=a&&(a.i&8388608||t===a.hc))return a.M(null);if(Array.isArray(a)||"string"===typeof a)return 0===a.length?null:new K(a,0,null);if(A(hc,a))return ic(a);throw Error([E.a(a)," is not ISeqable"].join(""));}function M(a){if(null==a)return null;if(null!=a&&(a.i&64||t===a.Ua))return a.da(null);a=J(a);return null==a?null:G(a)}function Oc(a){return null!=a?null!=a&&(a.i&64||t===a.Ua)?a.ia(null):(a=J(a))?a.ia(null):N:N} +function O(a){return null==a?null:null!=a&&(a.i&128||t===a.Ab)?a.$():J(Oc(a))}var P=function P(a){switch(arguments.length){case 1:return P.a(arguments[0]);case 2:return P.b(arguments[0],arguments[1]);default:for(var c=[],d=arguments.length,e=0;;)if(e=d)return-1;!(0c&&(c+=d,c=0>c?0:c);for(;;)if(cc?d+c:c;for(;;)if(0<=c){if(P.b(cd(a,c),b))return c;--c}else return-1}function dd(a,b){this.c=a;this.j=b}dd.prototype.la=function(){return this.ja?0:a};f.Bb=function(){var a=this.Y(null);return 0b)throw Error("Index out of bounds");a:for(;;){if(null==a)throw Error("Index out of bounds"); +if(0===b){if(J(a)){a=M(a);break a}throw Error("Index out of bounds");}if(bd(a)){a=F.b(a,b);break a}if(J(a))a=O(a),--b;else throw Error("Index out of bounds");}return a}if(A(Jb,a))return F.b(a,b);throw Error(["nth not supported on this type ",E.a(yb(null==a?null:a.constructor))].join(""));} +function V(a,b){if("number"!==typeof b)throw Error("Index argument to nth must be a number.");if(null==a)return null;if(null!=a&&(a.i&16||t===a.Pb))return a.fa(null,b,null);if(Array.isArray(a))return 0<=b&&bb?null:od(a,b);if(A(Jb,a))return F.f(a,b,null);throw Error(["nth not supported on this type ",E.a(yb(null==a?null:a.constructor))].join("")); +}var I=function I(a){switch(arguments.length){case 2:return I.b(arguments[0],arguments[1]);case 3:return I.f(arguments[0],arguments[1],arguments[2]);default:throw Error(["Invalid arity: ",E.a(arguments.length)].join(""));}};I.b=function(a,b){return null==a?null:null!=a&&(a.i&256||t===a.bc)?a.P(null,b):Array.isArray(a)?null!=b&&b>1&1431655765;a=(a&858993459)+(a>>2&858993459);return 16843009*(a+(a>>4)&252645135)>>24} +var E=function E(a){switch(arguments.length){case 0:return E.v();case 1:return E.a(arguments[0]);default:for(var c=[],d=arguments.length,e=0;;)if(ea?0:a-1>>>5<<5}function De(a,b,c){for(;;){if(0===b)return c;var d=Be(a);d.c[0]=c;c=d;b-=5}} +var Ee=function Ee(a,b,c,d){var g=new Ae(c.F,Ab(c.c)),h=a.h-1>>>b&31;5===b?g.c[h]=d:(c=c.c[h],null!=c?(b-=5,a=Ee.J?Ee.J(a,b,c,d):Ee.call(null,a,b,c,d)):a=De(null,b-5,d),g.c[h]=a);return g};function Fe(a,b){throw Error(["No item ",E.a(a)," in vector of length ",E.a(b)].join(""));}function Ge(a,b){if(b>=Ce(a))return a.ka;var c=a.root;for(a=a.shift;;)if(0>>a&31];a=d}else return c.c} +var He=function He(a,b,c,d,e){var h=new Ae(c.F,Ab(c.c));if(0===b)h.c[d&31]=e;else{var k=d>>>b&31;b-=5;c=c.c[k];a=He.Z?He.Z(a,b,c,d,e):He.call(null,a,b,c,d,e);h.c[k]=a}return h};function Ie(a,b,c){this.Eb=this.j=0;this.c=a;this.mc=b;this.start=0;this.end=c}Ie.prototype.la=function(){return this.j=this.h)a=new K(this.ka,0,null);else{a:{a=this.root;for(var b=this.shift;;)if(0this.h-Ce(this)){a=this.ka.length;for(var c=Array(a+1),d=0;;)if(d>>5>1<b)return new Y(null,b,5,me,a,null);for(var c=32,d=(new Y(null,32,5,me,a.slice(0,32),null)).kb(null);;)if(c>>b&31;if(5===b)a=d;else{var h=c.c[g];null!=h?(b-=5,a=Se.J?Se.J(a,b,h,d):Se.call(null,a,b,h,d)):a=De(a.root.F,b-5,d)}c.c[g]=a;return c};function Le(a,b,c,d){this.h=a;this.shift=b;this.root=c;this.ka=d;this.u=88;this.i=275}f=Le.prototype; +f.lb=function(a,b){if(this.root.F){if(32>this.h-Ce(this))this.ka[this.h&31]=b;else{a=new Ae(this.root.F,this.ka);var c=[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null];c[0]=b;this.ka=c;this.h>>>5>1<>>d&31;d=k(d-5,h.c[g]);h.c[g]=d}return h}}(a)(a.shift,a.root)}();a.root=d}return a}if(b===a.h)return a.lb(null,c);throw Error(["Index ",E.a(b)," out of bounds for TransientVector of length",E.a(a.h)].join(""));}throw Error("assoc! after persistent!");} +f.Y=function(){if(this.root.F)return this.h;throw Error("count after persistent!");};f.V=function(a,b){if(this.root.F)return(0<=b&&b=a)return new vb(this.m,this.h-1,c,null);P.b(b,this.c[d])?d+=2:(c[e]=this.c[d],c[e+1]=this.c[d+1],e+=2,d+=2)}}else return this}; +f.Aa=function(a,b,c){a=Ze(this.c,b);if(-1===a){if(this.hb?4:2*(b+1));Cd(this.c,0,c,0,2*b);return new pf(a,this.G,c)};f.ob=function(){return qf(this.c,0,null)};f.qb=function(a,b){return nf(this.c,a,b)};f.cb=function(a,b,c,d){var e=1<<(b>>>a&31);if(0===(this.G&e))return d;var g=Pd(this.G&e-1);e=this.c[2*g];g=this.c[2*g+1];return null==e?g.cb(a+5,b,c,d):jf(c,e)?g:d}; +f.sa=function(a,b,c,d,e,g){var h=1<<(c>>>b&31),k=Pd(this.G&h-1);if(0===(this.G&h)){var l=Pd(this.G);if(2*l>>b&31]=rf.sa(a,b+5,c,d,e,g);for(e=d=0;;)if(32>d)0=== +(this.G>>>d&1)?d+=1:(k[d]=null!=this.c[e]?rf.sa(a,b+5,Kc(this.c[e]),this.c[e],this.c[e+1],g):this.c[e+1],e+=2,d+=1);else break;return new sf(a,l+1,k)}b=Array(2*(l+4));Cd(this.c,0,b,0,2*k);b[2*k]=d;b[2*k+1]=e;Cd(this.c,2*k,b,2*(k+1),2*(l-k));g.I=!0;a=this.ab(a);a.c=b;a.G|=h;return a}l=this.c[2*k];h=this.c[2*k+1];if(null==l)return l=h.sa(a,b+5,c,d,e,g),l===h?this:mf(this,a,2*k+1,l);if(jf(d,l))return e===h?this:mf(this,a,2*k+1,e);g.I=!0;g=b+5;b=Kc(l);if(b===c)e=new tf(null,b,2,[l,h,d,e]);else{var m= +new hf;e=rf.sa(a,g,b,l,h,m).sa(a,g,c,d,e,m)}d=2*k;k=2*k+1;a=this.ab(a);a.c[d]=null;a.c[k]=e;return a}; +f.ra=function(a,b,c,d,e){var g=1<<(b>>>a&31),h=Pd(this.G&g-1);if(0===(this.G&g)){var k=Pd(this.G);if(16<=k){h=[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null];h[b>>>a&31]=rf.ra(a+5,b,c,d,e);for(d=c=0;;)if(32>c)0===(this.G>>>c&1)?c+=1:(h[c]=null!=this.c[d]?rf.ra(a+5,Kc(this.c[d]),this.c[d],this.c[d+1],e):this.c[d+1],d+=2,c+=1);else break;return new sf(null,k+1,h)}a=Array(2*(k+1));Cd(this.c, +0,a,0,2*h);a[2*h]=c;a[2*h+1]=d;Cd(this.c,2*h,a,2*(h+1),2*(k-h));e.I=!0;return new pf(null,this.G|g,a)}var l=this.c[2*h];g=this.c[2*h+1];if(null==l)return k=g.ra(a+5,b,c,d,e),k===g?this:new pf(null,this.G,kf(this.c,2*h+1,k));if(jf(c,l))return d===g?this:new pf(null,this.G,kf(this.c,2*h+1,d));e.I=!0;e=this.G;k=this.c;a+=5;var m=Kc(l);if(m===b)c=new tf(null,m,2,[l,g,c,d]);else{var n=new hf;c=rf.ra(a,m,l,g,n).ra(a,b,c,d,n)}a=2*h;h=2*h+1;d=Ab(k);d[a]=null;d[h]=c;return new pf(null,e,d)}; +f.pb=function(a,b,c){var d=1<<(b>>>a&31);if(0===(this.G&d))return this;var e=Pd(this.G&d-1),g=this.c[2*e],h=this.c[2*e+1];return null==g?(a=h.pb(a+5,b,c),a===h?this:null!=a?new pf(null,this.G,kf(this.c,2*e+1,a)):this.G===d?null:new pf(null,this.G^d,lf(this.c,e))):jf(c,g)?new pf(null,this.G^d,lf(this.c,e)):this};f.Pa=function(){return new of(this.c)};var rf=new pf(null,0,[]);function uf(a){this.c=a;this.j=0;this.ua=null} +uf.prototype.la=function(){for(var a=this.c.length;;){if(null!=this.ua&&this.ua.la())return!0;if(this.j>>a&31];return null!=e?e.cb(a+5,b,c,d):d};f.sa=function(a,b,c,d,e,g){var h=c>>>b&31,k=this.c[h];if(null==k)return a=mf(this,a,h,rf.sa(a,b+5,c,d,e,g)),a.h+=1,a;b=k.sa(a,b+5,c,d,e,g);return b===k?this:mf(this,a,h,b)}; +f.ra=function(a,b,c,d,e){var g=b>>>a&31,h=this.c[g];if(null==h)return new sf(null,this.h+1,kf(this.c,g,rf.ra(a+5,b,c,d,e)));a=h.ra(a+5,b,c,d,e);return a===h?this:new sf(null,this.h,kf(this.c,g,a))}; +f.pb=function(a,b,c){var d=b>>>a&31,e=this.c[d];if(null!=e){a=e.pb(a+5,b,c);if(a===e)d=this;else if(null==a)if(8>=this.h)a:{e=this.c;a=e.length;b=Array(2*(this.h-1));c=0;for(var g=1,h=0;;)if(ca?d:jf(c,this.c[a])?this.c[a+1]:d}; +f.sa=function(a,b,c,d,e,g){if(c===this.Qa){b=wf(this.c,this.h,d);if(-1===b){if(this.c.length>2*this.h)return b=2*this.h,c=2*this.h+1,a=this.ab(a),a.c[b]=d,a.c[c]=e,g.I=!0,a.h+=1,a;c=this.c.length;b=Array(c+2);Cd(this.c,0,b,0,c);b[c]=d;b[c+1]=e;g.I=!0;d=this.h+1;a===this.F?(this.c=b,this.h=d,a=this):a=new tf(this.F,this.Qa,d,b);return a}return this.c[b+1]===e?this:mf(this,a,b+1,e)}return(new pf(a,1<<(this.Qa>>>b&31),[null,this,null,null])).sa(a,b,c,d,e,g)}; +f.ra=function(a,b,c,d,e){return b===this.Qa?(a=wf(this.c,this.h,c),-1===a?(a=2*this.h,b=Array(a+2),Cd(this.c,0,b,0,a),b[a]=c,b[a+1]=d,e.I=!0,new tf(null,this.Qa,this.h+1,b)):P.b(this.c[a+1],d)?this:new tf(null,this.Qa,this.h,kf(this.c,a+1,d))):(new pf(null,1<<(this.Qa>>>a&31),[null,this])).ra(a,b,c,d,e)};f.pb=function(a,b,c){a=wf(this.c,this.h,c);return-1===a?this:1===this.h?null:new tf(null,this.Qa,this.h-1,lf(this.c,Od(a)))};f.Pa=function(){return new of(this.c)}; +function xf(a,b,c,d,e){this.m=a;this.va=b;this.j=c;this.C=d;this.o=e;this.i=32374988;this.u=0}f=xf.prototype;f.toString=function(){return Ac(this)};f.equiv=function(a){return this.s(null,a)};f.indexOf=function(){var a=null;a=function(a,c){switch(arguments.length){case 1:return R(this,a,0);case 2:return R(this,a,c)}throw Error("Invalid arity: "+arguments.length);};a.a=function(a){return R(this,a,0)};a.b=function(a,c){return R(this,a,c)};return a}(); +f.lastIndexOf=function(){function a(a){return T(this,a,S(this))}var b=null;b=function(b,d){switch(arguments.length){case 1:return a.call(this,b);case 2:return T(this,b,d)}throw Error("Invalid arity: "+arguments.length);};b.a=a;b.b=function(a,b){return T(this,a,b)};return b}();f.R=function(){return this.m};f.$=function(){return null==this.C?qf(this.va,this.j+2,null):qf(this.va,this.j,O(this.C))};f.O=function(){var a=this.o;return null!=a?a:this.o=a=Sc(this)};f.s=function(a,b){return fd(this,b)}; +f.W=function(){return $b(N,this.m)};f.ba=function(a,b){return hd(b,this)};f.ca=function(a,b,c){return id(b,c,this)};f.da=function(){return null==this.C?new $e(this.va[this.j],this.va[this.j+1]):M(this.C)};f.ia=function(){var a=null==this.C?qf(this.va,this.j+2,null):qf(this.va,this.j,O(this.C));return null!=a?a:N};f.M=function(){return this};f.S=function(a,b){return new xf(b,this.va,this.j,this.C,this.o)};f.U=function(a,b){return U(b,this)};xf.prototype[zb]=function(){return Qc(this)}; +function qf(a,b,c){if(null==c)for(c=a.length;;)if(bsb)return H(a,"#");H(a,c);if(0===(new w(null,"print-length","print-length",1931866356)).a(g))J(h)&&H(a,function(){var a=(new w(null,"more-marker","more-marker",-14717935)).a(g);return y(a)?a:"..."}());else{if(J(h)){var l=M(h);b.f?b.f(l,a,g):b.call(null,l,a,g)}for(var m=O(h),n=(new w(null,"print-length","print-length",1931866356)).a(g)-1;;)if(!m||null!=n&&0===n){J(m)&&0===n&&(H(a,d),H(a,function(){var a=(new w(null,"more-marker", +"more-marker",-14717935)).a(g);return y(a)?a:"..."}()));break}else{H(a,d);var p=M(m);c=a;h=g;b.f?b.f(p,c,h):b.call(null,p,c,h);var r=O(m);c=n-1;m=r;n=c}}return H(a,e)}finally{sb=k}}function Nf(a,b){b=J(b);for(var c=null,d=0,e=0;;)if(eclj (.parse js/JSON (.stringify circular-json raw-req)) :keywordize-keys true)) + +(def my-routes ["/" [["index.html" :index] + [true :not-found]]]) + +(defn index-handler + [req] + (:headers req)) + +(defn greet [raw-req raw-res] + (let [req (parse-raw-req raw-req)] + (do + (println (.-path raw-req)) + (println req) + (println (bidi/match-route my-routes (:path req))) + (.json raw-res (clj->js (:headers req)))))) + +(enable-console-print!) +(set! (.-exports js/module) #js {:greet greet}) diff --git a/dodgebotbackend/test/dodgebotbackend/core_test.clj b/dodgebotbackend/test/dodgebotbackend/core_test.clj new file mode 100644 index 0000000..37d65c5 --- /dev/null +++ b/dodgebotbackend/test/dodgebotbackend/core_test.clj @@ -0,0 +1,7 @@ +(ns dodgebotbackend.core-test + (:require [clojure.test :refer :all] + [dodgebotbackend.core :refer :all])) + +(deftest a-test + (testing "FIXME, I fail." + (is (= 0 1))))