Path: blob/main/userscripts/examples/haxe_transcend/min.js
936 views
const fs = require("fs");1const luamin = require("luamin");23const in_path = "out.lua";4const out_path = "out.min.lua";56var data = fs.readFileSync(in_path, "utf8");7data = luamin.minify(data);8data = '-- Haxe transcendental test\n\9-- This is a script written in Haxe that prints the natural logarithm of the\n\10-- golden ratio in base 10 to arbitrarily many digits.\n\11\n\12-- This file is part of KoboldAI.\n\13--\n\14-- KoboldAI is free software: you can redistribute it and/or modify\n\15-- it under the terms of the GNU Affero General Public License as published by\n\16-- the Free Software Foundation, either version 3 of the License, or\n\17-- (at your option) any later version.\n\18--\n\19-- This program is distributed in the hope that it will be useful,\n\20-- but WITHOUT ANY WARRANTY; without even the implied warranty of\n\21-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\22-- GNU Affero General Public License for more details.\n\23--\n\24-- You should have received a copy of the GNU Affero General Public License\n\25-- along with this program. If not, see <https://www.gnu.org/licenses/>.\n\26\n\27--------------------------------------------------------------------------------\n\28\n\29-- License for littleBigInt:\n\30\n\31-- MIT License\n\32--\n\33-- Copyright (c) 2020 Sylvio Sell\n\34--\n\35-- Permission is hereby granted, free of charge, to any person obtaining a copy\n\36-- of this software and associated documentation files (the "Software"), to deal\n\37-- in the Software without restriction, including without limitation the rights\n\38-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\39-- copies of the Software, and to permit persons to whom the Software is\n\40-- furnished to do so, subject to the following conditions:\n\41--\n\42-- The above copyright notice and this permission notice shall be included in all\n\43-- copies or substantial portions of the Software.\n\44--\n\45-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\46-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\47-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\48-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\49-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\50-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n\51-- SOFTWARE.\n\52\n' + data + "\n";53fs.writeFileSync(out_path, data);545556