livekit-examples / realtime-playground

Play with OpenAI's new Realtime API in your browser
https://playground.livekit.io
Apache License 2.0
215 stars 67 forks source link

refactor(web): slice instead of substring #13

Closed jjangga0214 closed 1 month ago

jjangga0214 commented 1 month ago

This is not required, but a good convention across the ecosystem.

For example,

Ref: https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v49.0.0/docs/rules/prefer-string-slice.md

String#substr() and String#substring() are the two lesser known legacy ways to slice a string. It's better to use String#slice() as it's a more popular option with clearer behavior that has a consistent Array counterpart.