Skip to content

Commit

Permalink
rework getConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
narthur committed Apr 12, 2024
1 parent 1b6f094 commit 4b2c3c8
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/getConfig.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import rc from "rc";
import z from "zod";

const schema = z
.object({
url: z.string(),
tables: z.record(z.string(), z.number()),
databaseToken: z.string(),
outDir: z.string(),
config: z.string(),
})
.partial();
const schema = z.object({
url: z.string(),
tables: z.record(z.string(), z.number()),
databaseToken: z.string(),
outDir: z.string(),
config: z.string(),
});

export type BaserowConfig = z.infer<typeof schema>;

export function getConfig(): BaserowConfig {
return schema.parse(rc("baserow"));
return schema.parse(rc("baserow", { tables: {} }));
}

0 comments on commit 4b2c3c8

Please sign in to comment.