chore: add wiki.json testing & sorting task#119
Open
chanheeis wants to merge 5 commits intoEveryAnalytics:mainfrom
Open
chore: add wiki.json testing & sorting task#119chanheeis wants to merge 5 commits intoEveryAnalytics:mainfrom
chanheeis wants to merge 5 commits intoEveryAnalytics:mainfrom
Conversation
- fancy-log : gulp task error 발생 시 로거 역할 - gulp-modify-file : gulp task로 파일 변경에 필요한 모듈 - gulp-prettier : modify-file 시 prettier적용하는 모듈
- root폴더의 wiki.json 파일 읽어서 Assending Sort - isValidName 함수를 통해 Naming Convention 체크 - Regular Experssion (const regex)를 통해 테스팅 [Regex 설명] - 첫 파트의 첫 문자와 마지막 문자는 알파벳, 숫자, 한글만 허용 - 두 번째 파트는 반드시 괄호로 싸여있어야 함 - 두번째 파트의 첫 문자와 마지막 문자는 알파벳, 숫자만 허용
greatSumini
reviewed
Sep 2, 2021
Comment on lines
+9
to
+18
| modifyFile(content => { | ||
| let hasWrongFormatName = false; | ||
| const wikiData = JSON.parse(content); | ||
|
|
||
| for (let idx = 0; idx < wikiData.length; idx++) { | ||
| if (isValidName(wikiData[idx].name) === false) { | ||
| hasWrongFormatName = true; | ||
| break; | ||
| } | ||
| } |
Member
There was a problem hiding this comment.
Suggested change
| modifyFile(content => { | |
| let hasWrongFormatName = false; | |
| const wikiData = JSON.parse(content); | |
| for (let idx = 0; idx < wikiData.length; idx++) { | |
| if (isValidName(wikiData[idx].name) === false) { | |
| hasWrongFormatName = true; | |
| break; | |
| } | |
| } | |
| modifyFile(wikiData => { | |
| const records = JSON.parse(wikiData); | |
| const hasWrongFormatName = records.some(record => !isValidName(record.name)); |
- Array.prototype.some 사용해봐도 좋을 것 같슴다 ㅎㅎ
- 배열 변수 네이밍은 복수형으로해봐도 조흘듯합니다..!
Comment on lines
+22
to
+24
| : wikiData.sort((a, b) => { | ||
| return a.name < b.name ? -1 : a.name > b.name ? 1 : 0; | ||
| }); |
Member
There was a problem hiding this comment.
Suggested change
| : wikiData.sort((a, b) => { | |
| return a.name < b.name ? -1 : a.name > b.name ? 1 : 0; | |
| }); | |
| : wikiData.sort((a, b) => a.localeCompare(b)); |
String.prototype.localeCompare 써봐도 좋을 것 같아요!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
wiki.json의 프로퍼티 검증 및 데이터 정렬을 위한 gulp task 추가
Help Wanted 👀
wiki.json "소스/매체"가 isValidName에 걸리고 있는데, "소스"도 있고, "매체"도 있는데 혹시 필요한 데이터인가요?
Related Issues
resolve #
#29
Checklist ✋
yarn build)