Skip to content

Commit

Permalink
Add display_resistance and display_capacitance to zod schema
Browse files Browse the repository at this point in the history
  • Loading branch information
Anshgrover23 committed Dec 29, 2024
1 parent 024a11f commit 3877916
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/source/source_simple_capacitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { expectTypesMatch } from "src/utils/expect-types-match"
export const source_simple_capacitor = source_component_base.extend({
ftype: z.literal("simple_capacitor"),
capacitance,
display_capacitance: z.string().optional(),
})

export type SourceSimpleCapacitorInput = z.input<typeof source_simple_capacitor>
Expand All @@ -20,6 +21,7 @@ type InferredSourceSimpleCapacitor = z.infer<typeof source_simple_capacitor>
export interface SourceSimpleCapacitor extends SourceComponentBase {
ftype: "simple_capacitor"
capacitance: number
display_capacitance?: string
}

expectTypesMatch<SourceSimpleCapacitor, InferredSourceSimpleCapacitor>(true)
2 changes: 2 additions & 0 deletions src/source/source_simple_resistor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { expectTypesMatch } from "src/utils/expect-types-match"
export const source_simple_resistor = source_component_base.extend({
ftype: z.literal("simple_resistor"),
resistance,
display_resistance: z.string().optional(),
})

export type SourceSimpleResistorInput = z.input<typeof source_simple_resistor>
Expand All @@ -20,6 +21,7 @@ type InferredSourceSimpleResistor = z.infer<typeof source_simple_resistor>
export interface SourceSimpleResistor extends SourceComponentBase {
ftype: "simple_resistor"
resistance: number
display_resistance?: string
}

expectTypesMatch<SourceSimpleResistor, InferredSourceSimpleResistor>(true)

0 comments on commit 3877916

Please sign in to comment.