-
Notifications
You must be signed in to change notification settings - Fork 300
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
Comments
This was referenced Mar 16, 2024
Merged
こちらやってみようと思います! |
たぶん がマージされたらそちらにも適用する必要がありそう |
達成されているのでクローズ! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
内容
ソングは音符一つ一つをNoteとして扱っています。
ノートごとにIDを割り当てているのですが、今のところstringとして扱っているので他のstringと取り違えてしまう可能性があります。
TypeScriptは同じstringだとしてもそこそこしっかり型を割り当てることができる(ブランド型)ので、それを達成すればこの課題は解決だと思います。
Pros 良くなる点
コーディングしやすくなる
実現方法
たぶんこんな感じで定義して、
https://github.com/VOICEVOX/voicevox/pull/1217/files#diff-a2e928a7b8428dba5f753cc8014e39204ccb3aaf1049ba8567f4b59af69defc7R26-R28
あとはいろんなところの
Note.id: string
をNoteId
に置き換える感じだと思います。noteSchemaの
id
のstringとか。The text was updated successfully, but these errors were encountered: