Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AudioKeyに型を付ける #1215

Merged
merged 1 commit into from
Feb 18, 2023

Conversation

Hiroshiba
Copy link
Member

内容

AudioKeyをブランド型にしました。
EngineIdやSpeakerIdと全く同じやり方です。

関連 Issue

@Hiroshiba Hiroshiba requested a review from a team as a code owner February 18, 2023 14:15
@Hiroshiba Hiroshiba requested review from y-chan and removed request for a team February 18, 2023 14:15
Comment on lines +15 to +17
export const audioKeySchema = z.string().uuid().brand<"AudioKey">();
export type AudioKey = z.infer<typeof audioKeySchema>;
export const AudioKey = (id: string): AudioKey => audioKeySchema.parse(id);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここが型定義箇所です。


type DetailKey = { engine: EngineId; character: string };
type DetailKey = { engine: EngineId; character: SpeakerId };
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

以前のSpeakerIdの変更忘れです。

Copy link
Member

@sevenc-nanashi sevenc-nanashi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

問題なさそうです。LGTM!

@Hiroshiba
Copy link
Member Author

レビューありがとうございます!!
問題ない(あったとしても戻せる)と思うのでマージします!

@Hiroshiba Hiroshiba merged commit e17daec into VOICEVOX:main Feb 18, 2023
@Hiroshiba Hiroshiba deleted the AudioKeyに型を付ける branch February 18, 2023 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants