first commit

This commit is contained in:
kst
2026-08-19 22:52:46 +09:00
commit 8454476c93
30 changed files with 7352 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
import os from "node:os";
import path from "node:path";
export function expandPath(input: string, baseDirectory: string): string {
const expanded = input === "~"
? os.homedir()
: input.startsWith("~/")
? path.join(os.homedir(), input.slice(2))
: input;
return path.isAbsolute(expanded)
? path.normalize(expanded)
: path.resolve(baseDirectory, expanded);
}