Skip to content

Commit

Permalink
refactor: use declarative access to branded type
Browse files Browse the repository at this point in the history
  • Loading branch information
ItMaga committed Apr 22, 2023
1 parent b6c16a1 commit b63b909
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/generators/BrandedGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type BaseGenerator from './BaseGenerator';

export default class BrandedGenerator<T extends z.ZodBranded<z.ZodTypeAny, string | number | symbol>> implements BaseGenerator<T> {
public generate(schema: T): z.infer<typeof schema> {
const mockGenerator = new MockGenerator(schema._def.type);
const mockGenerator = new MockGenerator(schema.unwrap());
return mockGenerator.generate();
}
}

0 comments on commit b63b909

Please sign in to comment.