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

[ソング] NoteIdにブランド型をつける #1935

Closed
Hiroshiba opened this issue Mar 16, 2024 · 3 comments
Closed

[ソング] NoteIdにブランド型をつける #1935

Hiroshiba opened this issue Mar 16, 2024 · 3 comments
Labels
初心者歓迎タスク 初心者にも優しい簡単めなタスク 機能向上

Comments

@Hiroshiba
Copy link
Member

内容

ソングは音符一つ一つをNoteとして扱っています。
ノートごとにIDを割り当てているのですが、今のところstringとして扱っているので他のstringと取り違えてしまう可能性があります。

TypeScriptは同じstringだとしてもそこそこしっかり型を割り当てることができる(ブランド型)ので、それを達成すればこの課題は解決だと思います。

Pros 良くなる点

コーディングしやすくなる

実現方法

たぶんこんな感じで定義して、
https://github.com/VOICEVOX/voicevox/pull/1217/files#diff-a2e928a7b8428dba5f753cc8014e39204ccb3aaf1049ba8567f4b59af69defc7R26-R28
あとはいろんなところのNote.id: stringNoteIdに置き換える感じだと思います。
noteSchemaのidのstringとか。

@Hiroshiba
Copy link
Member Author

こちらやってみようと思います!

@Hiroshiba
Copy link
Member Author

たぶん

がマージされたらそちらにも適用する必要がありそう

@Hiroshiba
Copy link
Member Author

達成されているのでクローズ!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
初心者歓迎タスク 初心者にも優しい簡単めなタスク 機能向上
Projects
None yet
Development

No branches or pull requests

1 participant