{"action":"created","comment":{"url":"https://api.github.com/repos/code-squad/javascript-json/pulls/comments/187883477","pull_request_review_id":119750021,"id":187883477,"diff_hunk":"@@ -43,47 +42,157 @@ class ArrayParser {\n \n     createObject() {\n         let mergeData = \"\";\n-        let repeatCount = 1;\n-        let startParenthesisCount = 0;\n-        let endParenthesisCount = 0;\n+        let repeatCount = 0;\n+        let startSquareBracketsCount = 0;\n+        let endSquareBracketsCount = 0;\n+        let startCurlyBracketsCount = 0;\n+        let endCurlyBracketsCount = 0;\n+        let curlyBracketsMode = false;\n         let recursionMode = false;\n         const arrayEndPoint = this.dividedCharacterDatas.length;\n-        const dataObject = {\n-            type: this.checkType(mergeData),\n-            value: mergeData,\n-            child: [],\n-        }\n \n         this.dividedCharacterDatas.forEach(element => {\n-            if (element === '[') { startParenthesisCount++; }\n+            repeatCount++;\n+\n+            if (element === ' ') {\n+                return;\n+            }\n+\n+            if (element === '{') {\n+                startCurlyBracketsCount++;\n+                if (mergeData.trim() === \"\") {\n+                    curlyBracketsMode = true;\n+                }\n+            }\n+\n+            if (element === '}') {\n+                endCurlyBracketsCount++;\n+            }\n+\n+            if (curlyBracketsMode) {\n+                mergeData += element;\n+                if (startCurlyBracketsCount === endCurlyBracketsCount) {\n+                    curlyBracketsMode = false;\n+\n+                    const secondArrayParser = new ArrayParser(mergeData);\n+                    mergeData = secondArrayParser.getResult();\n+                }\n+                return;\n+            }\n+\n+            if (element === '[') { startSquareBracketsCount++; }\n             if (element === ']') {\n-                if (startParenthesisCount >= 3) { startParenthesisCount--; }\n-                else { endParenthesisCount++; }\n+                if (startSquareBracketsCount >= 3) { startSquareBracketsCount--; }\n+                else { endSquareBracketsCount++; }\n+            }\n+\n+            if (startSquareBracketsCount >= 2 &&\n+                endSquareBracketsCount === 0) {\n+                mergeData += element;\n+                return;\n             }\n \n-            if (startParenthesisCount >= 2 && !recursionMode) { mergeData += element; }\n-            else if (element === ',' || repeatCount === arrayEndPoint) {\n+            if (element === ',' || repeatCount === arrayEndPoint) {\n                 mergeData = this.typeDecision(mergeData);\n-            } else if (startParenthesisCount >= 1) { mergeData += element; }\n+                return;\n+            }\n+\n+            if (startSquareBracketsCount >= 1) {\n+                mergeData += element;\n+            }\n \n-            if (mergeData === \"\" ||  repeatCount === arrayEndPoint) { } \n-            else if (endParenthesisCount >= 1 && endParenthesisCount === startParenthesisCount-1) {\n-                startParenthesisCount--;\n-                endParenthesisCount--;\n-                recursionMode = true;\n+            if (endSquareBracketsCount >= 1 && \n+                endSquareBracketsCount == startSquareBracketsCount-1) {\n+                startSquareBracketsCount--;\n+                endSquareBracketsCount--;\n \n                 const secondArrayParser = new ArrayParser(mergeData);\n                 mergeData = secondArrayParser.getResult();\n             }\n-            repeatCount++;\n         });\n     }\n \n+    createCurlyObject(inputData, param1, param2) {","path":"arrayParser.js","position":158,"original_position":158,"commit_id":"09b9206d9176a52d6c14852577ef8aff2167d98b","original_commit_id":"09b9206d9176a52d6c14852577ef8aff2167d98b","user":{"login":"nigayo","id":1456761,"avatar_url":"https://avatars2.githubusercontent.com/u/1456761?v=4","gravatar_id":"","url":"https://api.github.com/users/nigayo","html_url":"https://github.com/nigayo","followers_url":"https://api.github.com/users/nigayo/followers","following_url":"https://api.github.com/users/nigayo/following{/other_user}","gists_url":"https://api.github.com/users/nigayo/gists{/gist_id}","starred_url":"https://api.github.com/users/nigayo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nigayo/subscriptions","organizations_url":"https://api.github.com/users/nigayo/orgs","repos_url":"https://api.github.com/users/nigayo/repos","events_url":"https://api.github.com/users/nigayo/events{/privacy}","received_events_url":"https://api.github.com/users/nigayo/received_events","type":"User","site_admin":false},"body":"이 함수가 createObject 함수와 중복아닌 중복인 느낌이죠? \r\n이 두개의 비슷한 큰 덩어리가 분리되어 있는 점이 아쉽네요.\r\n개선하기 쉽지 않지만요.","created_at":"2018-05-14T09:12:05Z","updated_at":"2018-05-14T09:38:14Z","html_url":"https://github.com/code-squad/javascript-json/pull/40#discussion_r187883477","pull_request_url":"https://api.github.com/repos/code-squad/javascript-json/pulls/40","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/code-squad/javascript-json/pulls/comments/187883477"},"html":{"href":"https://github.com/code-squad/javascript-json/pull/40#discussion_r187883477"},"pull_request":{"href":"https://api.github.com/repos/code-squad/javascript-json/pulls/40"}}},"pull_request":{"url":"https://api.github.com/repos/code-squad/javascript-json/pulls/40","id":187755494,"html_url":"https://github.com/code-squad/javascript-json/pull/40","diff_url":"https://github.com/code-squad/javascript-json/pull/40.diff","patch_url":"https://github.com/code-squad/javascript-json/pull/40.patch","issue_url":"https://api.github.com/repos/code-squad/javascript-json/issues/40","number":40,"state":"open","locked":false,"title":"[STEP5] Object Type 지원기능 추가","user":{"login":"antaehyeon","id":18719042,"avatar_url":"https://avatars1.githubusercontent.com/u/18719042?v=4","gravatar_id":"","url":"https://api.github.com/users/antaehyeon","html_url":"https://github.com/antaehyeon","followers_url":"https://api.github.com/users/antaehyeon/followers","following_url":"https://api.github.com/users/antaehyeon/following{/other_user}","gists_url":"https://api.github.com/users/antaehyeon/gists{/gist_id}","starred_url":"https://api.github.com/users/antaehyeon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antaehyeon/subscriptions","organizations_url":"https://api.github.com/users/antaehyeon/orgs","repos_url":"https://api.github.com/users/antaehyeon/repos","events_url":"https://api.github.com/users/antaehyeon/events{/privacy}","received_events_url":"https://api.github.com/users/antaehyeon/received_events","type":"User","site_admin":false},"body":"재귀로 구현한 상태에서 기능을 추가하려하니, 블랙홀을 헤메는 기분이였습니다...","created_at":"2018-05-14T08:40:30Z","updated_at":"2018-05-14T09:38:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"102e94df7c527545ed1336bf4a288a898578ec66","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/code-squad/javascript-json/pulls/40/commits","review_comments_url":"https://api.github.com/repos/code-squad/javascript-json/pulls/40/comments","review_comment_url":"https://api.github.com/repos/code-squad/javascript-json/pulls/comments{/number}","comments_url":"https://api.github.com/repos/code-squad/javascript-json/issues/40/comments","statuses_url":"https://api.github.com/repos/code-squad/javascript-json/statuses/09b9206d9176a52d6c14852577ef8aff2167d98b","head":{"label":"antaehyeon:step5","ref":"step5","sha":"09b9206d9176a52d6c14852577ef8aff2167d98b","user":{"login":"antaehyeon","id":18719042,"avatar_url":"https://avatars1.githubusercontent.com/u/18719042?v=4","gravatar_id":"","url":"https://api.github.com/users/antaehyeon","html_url":"https://github.com/antaehyeon","followers_url":"https://api.github.com/users/antaehyeon/followers","following_url":"https://api.github.com/users/antaehyeon/following{/other_user}","gists_url":"https://api.github.com/users/antaehyeon/gists{/gist_id}","starred_url":"https://api.github.com/users/antaehyeon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antaehyeon/subscriptions","organizations_url":"https://api.github.com/users/antaehyeon/orgs","repos_url":"https://api.github.com/users/antaehyeon/repos","events_url":"https://api.github.com/users/antaehyeon/events{/privacy}","received_events_url":"https://api.github.com/users/antaehyeon/received_events","type":"User","site_admin":false},"repo":{"id":129863204,"name":"javascript-json","full_name":"antaehyeon/javascript-json","owner":{"login":"antaehyeon","id":18719042,"avatar_url":"https://avatars1.githubusercontent.com/u/18719042?v=4","gravatar_id":"","url":"https://api.github.com/users/antaehyeon","html_url":"https://github.com/antaehyeon","followers_url":"https://api.github.com/users/antaehyeon/followers","following_url":"https://api.github.com/users/antaehyeon/following{/other_user}","gists_url":"https://api.github.com/users/antaehyeon/gists{/gist_id}","starred_url":"https://api.github.com/users/antaehyeon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antaehyeon/subscriptions","organizations_url":"https://api.github.com/users/antaehyeon/orgs","repos_url":"https://api.github.com/users/antaehyeon/repos","events_url":"https://api.github.com/users/antaehyeon/events{/privacy}","received_events_url":"https://api.github.com/users/antaehyeon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/antaehyeon/javascript-json","description":"레벨2","fork":true,"url":"https://api.github.com/repos/antaehyeon/javascript-json","forks_url":"https://api.github.com/repos/antaehyeon/javascript-json/forks","keys_url":"https://api.github.com/repos/antaehyeon/javascript-json/keys{/key_id}","collaborators_url":"https://api.github.com/repos/antaehyeon/javascript-json/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/antaehyeon/javascript-json/teams","hooks_url":"https://api.github.com/repos/antaehyeon/javascript-json/hooks","issue_events_url":"https://api.github.com/repos/antaehyeon/javascript-json/issues/events{/number}","events_url":"https://api.github.com/repos/antaehyeon/javascript-json/events","assignees_url":"https://api.github.com/repos/antaehyeon/javascript-json/assignees{/user}","branches_url":"https://api.github.com/repos/antaehyeon/javascript-json/branches{/branch}","tags_url":"https://api.github.com/repos/antaehyeon/javascript-json/tags","blobs_url":"https://api.github.com/repos/antaehyeon/javascript-json/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/antaehyeon/javascript-json/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/antaehyeon/javascript-json/git/refs{/sha}","trees_url":"https://api.github.com/repos/antaehyeon/javascript-json/git/trees{/sha}","statuses_url":"https://api.github.com/repos/antaehyeon/javascript-json/statuses/{sha}","languages_url":"https://api.github.com/repos/antaehyeon/javascript-json/languages","stargazers_url":"https://api.github.com/repos/antaehyeon/javascript-json/stargazers","contributors_url":"https://api.github.com/repos/antaehyeon/javascript-json/contributors","subscribers_url":"https://api.github.com/repos/antaehyeon/javascript-json/subscribers","subscription_url":"https://api.github.com/repos/antaehyeon/javascript-json/subscription","commits_url":"https://api.github.com/repos/antaehyeon/javascript-json/commits{/sha}","git_commits_url":"https://api.github.com/repos/antaehyeon/javascript-json/git/commits{/sha}","comments_url":"https://api.github.com/repos/antaehyeon/javascript-json/comments{/number}","issue_comment_url":"https://api.github.com/repos/antaehyeon/javascript-json/issues/comments{/number}","contents_url":"https://api.github.com/repos/antaehyeon/javascript-json/contents/{+path}","compare_url":"https://api.github.com/repos/antaehyeon/javascript-json/compare/{base}...{head}","merges_url":"https://api.github.com/repos/antaehyeon/javascript-json/merges","archive_url":"https://api.github.com/repos/antaehyeon/javascript-json/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/antaehyeon/javascript-json/downloads","issues_url":"https://api.github.com/repos/antaehyeon/javascript-json/issues{/number}","pulls_url":"https://api.github.com/repos/antaehyeon/javascript-json/pulls{/number}","milestones_url":"https://api.github.com/repos/antaehyeon/javascript-json/milestones{/number}","notifications_url":"https://api.github.com/repos/antaehyeon/javascript-json/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/antaehyeon/javascript-json/labels{/name}","releases_url":"https://api.github.com/repos/antaehyeon/javascript-json/releases{/id}","deployments_url":"https://api.github.com/repos/antaehyeon/javascript-json/deployments","created_at":"2018-04-17T07:21:29Z","updated_at":"2018-04-17T07:21:31Z","pushed_at":"2018-05-14T08:43:06Z","git_url":"git://github.com/antaehyeon/javascript-json.git","ssh_url":"git@github.com:antaehyeon/javascript-json.git","clone_url":"https://github.com/antaehyeon/javascript-json.git","svn_url":"https://github.com/antaehyeon/javascript-json","homepage":null,"size":4882,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"code-squad:antaehyeon","ref":"antaehyeon","sha":"c07b15929419fe2000a013669d4b21efb680cad7","user":{"login":"code-squad","id":22832280,"avatar_url":"https://avatars2.githubusercontent.com/u/22832280?v=4","gravatar_id":"","url":"https://api.github.com/users/code-squad","html_url":"https://github.com/code-squad","followers_url":"https://api.github.com/users/code-squad/followers","following_url":"https://api.github.com/users/code-squad/following{/other_user}","gists_url":"https://api.github.com/users/code-squad/gists{/gist_id}","starred_url":"https://api.github.com/users/code-squad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-squad/subscriptions","organizations_url":"https://api.github.com/users/code-squad/orgs","repos_url":"https://api.github.com/users/code-squad/repos","events_url":"https://api.github.com/users/code-squad/events{/privacy}","received_events_url":"https://api.github.com/users/code-squad/received_events","type":"Organization","site_admin":false},"repo":{"id":107010155,"name":"javascript-json","full_name":"code-squad/javascript-json","owner":{"login":"code-squad","id":22832280,"avatar_url":"https://avatars2.githubusercontent.com/u/22832280?v=4","gravatar_id":"","url":"https://api.github.com/users/code-squad","html_url":"https://github.com/code-squad","followers_url":"https://api.github.com/users/code-squad/followers","following_url":"https://api.github.com/users/code-squad/following{/other_user}","gists_url":"https://api.github.com/users/code-squad/gists{/gist_id}","starred_url":"https://api.github.com/users/code-squad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-squad/subscriptions","organizations_url":"https://api.github.com/users/code-squad/orgs","repos_url":"https://api.github.com/users/code-squad/repos","events_url":"https://api.github.com/users/code-squad/events{/privacy}","received_events_url":"https://api.github.com/users/code-squad/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/code-squad/javascript-json","description":"레벨2","fork":false,"url":"https://api.github.com/repos/code-squad/javascript-json","forks_url":"https://api.github.com/repos/code-squad/javascript-json/forks","keys_url":"https://api.github.com/repos/code-squad/javascript-json/keys{/key_id}","collaborators_url":"https://api.github.com/repos/code-squad/javascript-json/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/code-squad/javascript-json/teams","hooks_url":"https://api.github.com/repos/code-squad/javascript-json/hooks","issue_events_url":"https://api.github.com/repos/code-squad/javascript-json/issues/events{/number}","events_url":"https://api.github.com/repos/code-squad/javascript-json/events","assignees_url":"https://api.github.com/repos/code-squad/javascript-json/assignees{/user}","branches_url":"https://api.github.com/repos/code-squad/javascript-json/branches{/branch}","tags_url":"https://api.github.com/repos/code-squad/javascript-json/tags","blobs_url":"https://api.github.com/repos/code-squad/javascript-json/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/code-squad/javascript-json/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/code-squad/javascript-json/git/refs{/sha}","trees_url":"https://api.github.com/repos/code-squad/javascript-json/git/trees{/sha}","statuses_url":"https://api.github.com/repos/code-squad/javascript-json/statuses/{sha}","languages_url":"https://api.github.com/repos/code-squad/javascript-json/languages","stargazers_url":"https://api.github.com/repos/code-squad/javascript-json/stargazers","contributors_url":"https://api.github.com/repos/code-squad/javascript-json/contributors","subscribers_url":"https://api.github.com/repos/code-squad/javascript-json/subscribers","subscription_url":"https://api.github.com/repos/code-squad/javascript-json/subscription","commits_url":"https://api.github.com/repos/code-squad/javascript-json/commits{/sha}","git_commits_url":"https://api.github.com/repos/code-squad/javascript-json/git/commits{/sha}","comments_url":"https://api.github.com/repos/code-squad/javascript-json/comments{/number}","issue_comment_url":"https://api.github.com/repos/code-squad/javascript-json/issues/comments{/number}","contents_url":"https://api.github.com/repos/code-squad/javascript-json/contents/{+path}","compare_url":"https://api.github.com/repos/code-squad/javascript-json/compare/{base}...{head}","merges_url":"https://api.github.com/repos/code-squad/javascript-json/merges","archive_url":"https://api.github.com/repos/code-squad/javascript-json/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/code-squad/javascript-json/downloads","issues_url":"https://api.github.com/repos/code-squad/javascript-json/issues{/number}","pulls_url":"https://api.github.com/repos/code-squad/javascript-json/pulls{/number}","milestones_url":"https://api.github.com/repos/code-squad/javascript-json/milestones{/number}","notifications_url":"https://api.github.com/repos/code-squad/javascript-json/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/code-squad/javascript-json/labels{/name}","releases_url":"https://api.github.com/repos/code-squad/javascript-json/releases{/id}","deployments_url":"https://api.github.com/repos/code-squad/javascript-json/deployments","created_at":"2017-10-15T12:28:38Z","updated_at":"2018-03-13T05:43:41Z","pushed_at":"2018-05-14T08:52:54Z","git_url":"git://github.com/code-squad/javascript-json.git","ssh_url":"git@github.com:code-squad/javascript-json.git","clone_url":"https://github.com/code-squad/javascript-json.git","svn_url":"https://github.com/code-squad/javascript-json","homepage":null,"size":5002,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":12,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/code-squad/javascript-json/pulls/40"},"html":{"href":"https://github.com/code-squad/javascript-json/pull/40"},"issue":{"href":"https://api.github.com/repos/code-squad/javascript-json/issues/40"},"comments":{"href":"https://api.github.com/repos/code-squad/javascript-json/issues/40/comments"},"review_comments":{"href":"https://api.github.com/repos/code-squad/javascript-json/pulls/40/comments"},"review_comment":{"href":"https://api.github.com/repos/code-squad/javascript-json/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/code-squad/javascript-json/pulls/40/commits"},"statuses":{"href":"https://api.github.com/repos/code-squad/javascript-json/statuses/09b9206d9176a52d6c14852577ef8aff2167d98b"}},"author_association":"NONE"}}
{"actor":{"display_login":"nigayo"}}