feat: use go tool

This commit is contained in:
2026-07-03 19:24:01 -04:00
parent 39548b4332
commit 4d0cab1fe0
1542 changed files with 252399 additions and 14 deletions
+25
View File
@@ -0,0 +1,25 @@
// @ts-check
"use strict";
const indentFor = (string, indentation) => {
// eslint-disable-next-line max-len
const regex = new RegExp("^(?<indents>(" + indentation + ")*)(?<adds>- |> |>|\\* |\\d+\\. )?");
const match = regex.exec(string);
if (!match) {
return "";
}
let indentSize = 0;
if (match.groups.indents) {
indentSize = match.groups.indents.length / indentation.length;
}
if (match.groups.adds) {
if (match.groups.adds.includes(">")) {
return indentation.repeat(indentSize) + match.groups.adds;
}
indentSize++;
}
return indentation.repeat(indentSize);
};
module.exports.indentFor = indentFor;