Enable biome based formatter and reformat

This commit is contained in:
Zef Hemel
2026-03-10 09:38:59 +01:00
parent a0b79e7c1d
commit 799e27a9b4
230 changed files with 4145 additions and 4472 deletions
+7 -17
View File
@@ -24,9 +24,7 @@ function capturesToLua(caps: CaptureResult[]): any {
const c = caps[0];
return "s" in c ? c.s : c.position;
}
return new LuaMultiRes(
caps.map((c) => ("s" in c ? c.s : c.position)),
);
return new LuaMultiRes(caps.map((c) => ("s" in c ? c.s : c.position)));
}
export const stringApi = new LuaTable({
@@ -72,13 +70,7 @@ export const stringApi = new LuaTable({
},
),
gsub: new LuaBuiltinFunction(
async (
sf,
s: string,
pattern: string,
repl: any,
n?: number,
) => {
async (sf, s: string, pattern: string, repl: any, n?: number) => {
const callbacks: GsubCallbacks = {};
if (typeof repl === "string") {
callbacks.replString = repl;
@@ -121,13 +113,11 @@ export const stringApi = new LuaTable({
upper: new LuaBuiltinFunction((_sf, s: string) => {
return luaToString(s.toUpperCase());
}),
match: new LuaBuiltinFunction(
(_sf, s: string, pattern: string, init = 1) => {
const caps = patternMatch(s, pattern, init);
if (!caps) return null;
return capturesToLua(caps);
},
),
match: new LuaBuiltinFunction((_sf, s: string, pattern: string, init = 1) => {
const caps = patternMatch(s, pattern, init);
if (!caps) return null;
return capturesToLua(caps);
}),
rep: new LuaBuiltinFunction((_sf, s: string, n: number, sep?: string) => {
if (n <= 0) return "";
sep = sep ?? "";