20 lines
678 B
TypeScript
20 lines
678 B
TypeScript
// Vite ?raw import는 seed CSV를 빌드 타임 상수로 번들합니다.
|
|
// eslint-disable-next-line import/no-unresolved
|
|
import seedTenantCSVRaw from "../../../../seed-tenant.csv?raw";
|
|
import type { TenantSummary } from "../../../lib/adminApi";
|
|
import { parseTenantCSV } from "./tenantCsvImport";
|
|
|
|
const seedTenantSlugs = new Set(
|
|
parseTenantCSV(seedTenantCSVRaw)
|
|
.map((row) => row.slug.trim().toLowerCase())
|
|
.filter(Boolean),
|
|
);
|
|
|
|
export function isSeedTenant(tenant: Pick<TenantSummary, "slug">): boolean {
|
|
return seedTenantSlugs.has(tenant.slug.trim().toLowerCase());
|
|
}
|
|
|
|
export function getSeedTenantSlugs(): string[] {
|
|
return Array.from(seedTenantSlugs);
|
|
}
|