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

StyleIdをブランド型にする #1211

Merged
merged 2 commits into from
Feb 22, 2023

Conversation

Hiroshiba
Copy link
Member

@Hiroshiba Hiroshiba commented Feb 16, 2023

内容

StyleIdをブランド型にしました。
これでVoiceの中身は全部Brand型になります。

関連 Issue

close: #1148

スクリーンショット・動画など

その他

@Hiroshiba Hiroshiba requested a review from a team as a code owner February 16, 2023 17:48
@Hiroshiba Hiroshiba requested review from y-chan and removed request for a team February 16, 2023 17:48
Comment on lines +15 to +17
export const styleIdSchema = z.number().brand<"StyleId">();
export type StyleId = z.infer<typeof styleIdSchema>;
export const StyleId = (id: number): StyleId => styleIdSchema.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.

ここが型の定義箇所です

@@ -73,7 +74,7 @@ function parseTextFile(
initVoice?: Voice
): AudioItem[] {
const name2Voice = new Map<string, Voice>();
const uuid2Voice = new Map<string, Voice>();
const uuid2Voice = new Map<SpeakerId, Voice>();
Copy link
Member Author

@Hiroshiba Hiroshiba Feb 16, 2023

Choose a reason for hiding this comment

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

SpeakerId時の変更漏れ

Copy link
Member

@y-chan y-chan 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
Copy link
Member Author

多分大丈夫だと思うのでマージします!

@Hiroshiba Hiroshiba merged commit 9a8d1d2 into VOICEVOX:main Feb 22, 2023
@Hiroshiba Hiroshiba deleted the StyleIdをブランド型にする branch February 22, 2023 16:06
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.

EngineId、SpeakerId、StyleIdそれぞれにユニークな型を作る
2 participants