Skip to content

Commit

Permalink
ブランド型をUUIDじゃなくする (#1387)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiroshiba authored Jul 11, 2023
1 parent a993a32 commit 6932eed
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/type/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ export const isMac =
? navigator.userAgent.includes("Mac")
: process.platform === "darwin";

export const engineIdSchema = z.string().uuid().brand<"EngineId">();
export const engineIdSchema = z.string().brand<"EngineId">();
export type EngineId = z.infer<typeof engineIdSchema>;
export const EngineId = (id: string): EngineId => engineIdSchema.parse(id);

export const speakerIdSchema = z.string().uuid().brand<"SpeakerId">();
export const speakerIdSchema = z.string().brand<"SpeakerId">();
export type SpeakerId = z.infer<typeof speakerIdSchema>;
export const SpeakerId = (id: string): SpeakerId => speakerIdSchema.parse(id);

export const styleIdSchema = z.number().brand<"StyleId">();
export type StyleId = z.infer<typeof styleIdSchema>;
export const StyleId = (id: number): StyleId => styleIdSchema.parse(id);

export const audioKeySchema = z.string().uuid().brand<"AudioKey">();
export const audioKeySchema = z.string().brand<"AudioKey">();
export type AudioKey = z.infer<typeof audioKeySchema>;
export const AudioKey = (id: string): AudioKey => audioKeySchema.parse(id);

export const presetKeySchema = z.string().uuid().brand<"PresetKey">();
export const presetKeySchema = z.string().brand<"PresetKey">();
export type PresetKey = z.infer<typeof presetKeySchema>;
export const PresetKey = (id: string): PresetKey => presetKeySchema.parse(id);

Expand Down

0 comments on commit 6932eed

Please sign in to comment.