Skip to content

Commit

Permalink
Expose LeafValue type.
Browse files Browse the repository at this point in the history
Part of #18.
  • Loading branch information
jkomoros committed Jun 26, 2023
1 parent d34f0f9 commit cd6df58
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,19 @@ import {

const CHANGE_ME_SENTINEL = 'CHANGE_ME';

const baseValue = z.union([
const leafValue = z.union([
z.number(),
z.string(),
z.boolean()
]);

const baseValueRecord = z.record(z.string(), baseValue);
export type LeafValue = z.infer<typeof leafValue>;

const valueObject = z.record(z.string(), leafValue);

const value = z.union([
baseValue,
baseValueRecord
leafValue,
valueObject
]);

export type Value = z.infer<typeof value>;
Expand Down Expand Up @@ -335,7 +337,7 @@ const seedDataConfigTemplate = {
type: z.literal('template'),
properties: {
template: z.string().describe('The template string to replace { vars } in '),
vars: baseValueRecord
vars: valueObject
}
};

Expand Down

0 comments on commit cd6df58

Please sign in to comment.