navigator deprecated 속성 변경 및 ssr 환경 고려 #3245
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please check if the PR fulfills these requirements
fix #xxx[,#xxx], where "xxx" is the issue number)Description
navigator.platform속성은deprecated된 상태이기 때문에, 대체 속성인navigator.userAgent를 사용했습니다.navigator객체는 브라우져 속성이기 때문에, ssr 환경에서 editor를 불러오면undefined한 타입 에러가 납니다. 이에 앞에 브라우져 환경에서만 속성에 접근할 수 있도록 조치하였습니다.test함수는string타입의 인자를 받는데,undefined한 값이 들어가면 안되기에 index로 고려하는 기능을 제안합니다. 하지만 이미 앞에서undefined하지 않을 경우에만 통과하기 때문에 뒤 검증 로직은 test, match, indexOf 아무거나 사용해도 무방할 것 같습니다.Thank you for your contribution to TOAST UI product. 🎉 😘 ✨