chore: initialize bun ts config

This commit is contained in:
gitea committed 2026-06-05 16:03:46 +08:00
commit 25e4dd7714
8 files changed
+447

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
import { existsSync, readFileSync, readdirSync } from "node:fs";
import { join } from "node:path";
import { CorpConfig, CorpConfigSchema } from "./types.js";
const ENTERPRISES_DIR = "enterprises";
export function loadCorpConfigs(): CorpConfig[] {
if (!existsSync(ENTERPRISES_DIR)) {
return [];
}
return readdirSync(ENTERPRISES_DIR)
.filter((file) => file.endsWith(".json"))
.filter((file) => !file.startsWith("example."))
.map((file) => {
const content = readFileSync(join(ENTERPRISES_DIR, file), "utf-8");
return CorpConfigSchema.parse(JSON.parse(content));
});
}