Merge branch 'main' into space-lua-fixtures

This commit is contained in:
Zef Hemel
2026-02-25 10:36:32 +01:00
committed by GitHub
23 changed files with 3712 additions and 107 deletions
+6
View File
@@ -16,6 +16,7 @@ import {
patternGsub,
patternMatch,
} from "./pattern.ts";
import { strPackFn, strPackSizeFn, strUnpackFn } from "./string_pack.ts";
function capturesToLua(caps: CaptureResult[]): any {
if (caps.length === 0) return null;
@@ -164,10 +165,15 @@ export const stringApi = new LuaTable({
}
return "";
}),
split: new LuaBuiltinFunction((_sf, s: string, sep: string) => {
return s.split(sep);
}),
pack: strPackFn,
unpack: strUnpackFn,
packsize: strPackSizeFn,
// Non-standard extensions
startsWith: new LuaBuiltinFunction((_sf, s: string, prefix: string) => {
return s.startsWith(prefix);