Skip to content

Commit

Permalink
Merge pull request #26 from narthur/codegen
Browse files Browse the repository at this point in the history
rework getConfig
  • Loading branch information
narthur committed Apr 12, 2024
2 parents 6dcf25a + 4b2c3c8 commit a3b66cf
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 a3b66cf

Please sign in to comment.