UNPKG

chocolog

Version:

A highlighted android-style logger

39 lines 1.1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.forceIndenter = `\u{FFF5}_#>`; exports.valNameIndenter = `\u{FFF5}_N>`; exports.indenter = " "; function forceIndent(str) { const splited = str.split("\n"); return splited.map((v, i) => { if (i === 0) { return v; } else if (i === splited.length - 1 && v.trim() === "}") { return exports.forceIndenter + v; } else { return exports.forceIndenter + v; } }).join("\n"); } exports.forceIndent = forceIndent; function encodeNo(num) { const str = [...num.toString(10)]; const out = []; for (const chNum of str) { out.push((Number.parseInt(chNum) + 10).toString(36)); } return out.join(""); } exports.encodeNo = encodeNo; function decodeNo(num) { const str = [...num]; const out = []; for (const chNum of str) { out.push((Number.parseInt(chNum, 36) - 10).toString(10)); } return Number.parseInt(out.join("")); } exports.decodeNo = decodeNo; //# sourceMappingURL=tostr.js.map