{"action":"created","comment":{"url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/pulls/comments/209707771","pull_request_review_id":145773718,"id":209707771,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwOTcwNzc3MQ==","diff_hunk":"@@ -412,6 +412,33 @@ function merge_with_defaults(obj) {\n \n MG.merge_with_defaults = merge_with_defaults;\n \n+function options_to_defaults(obj) {\n+  return Object.keys(obj).reduce((r, k) => {\n+    r[k] = obj[k][0];\n+    return r;\n+  }, {});\n+}\n+\n+function compare_type(type, value) {\n+  if (value == null) return true; // allow null or undefined\n+  if (typeof type === 'string') {\n+    if (type.substr(-2) === '[]') {\n+      if (!is_array(value)) return false;\n+      return value.every(i => compare_type(type.slice(0, -2), i));\n+    }\n+    if (typeof value === type || value === type) return true;\n+    return false;\n+  }\n+  return is_array(type) && !!~type.findIndex(i => compare_type(i, value, true));\n+}\n+\n+function mg_validate_option(key, value) {\n+  if (!is_array(MG.options[key])) return false; // not existed option","path":"src/js/misc/utility.js","position":25,"original_position":25,"commit_id":"f7c574340233cb714617489b048d6580a0165ed0","original_commit_id":"f7c574340233cb714617489b048d6580a0165ed0","user":{"login":"wlach","id":20569,"node_id":"MDQ6VXNlcjIwNTY5","avatar_url":"https://avatars3.githubusercontent.com/u/20569?v=4","gravatar_id":"","url":"https://api.github.com/users/wlach","html_url":"https://github.com/wlach","followers_url":"https://api.github.com/users/wlach/followers","following_url":"https://api.github.com/users/wlach/following{/other_user}","gists_url":"https://api.github.com/users/wlach/gists{/gist_id}","starred_url":"https://api.github.com/users/wlach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wlach/subscriptions","organizations_url":"https://api.github.com/users/wlach/orgs","repos_url":"https://api.github.com/users/wlach/repos","events_url":"https://api.github.com/users/wlach/events{/privacy}","received_events_url":"https://api.github.com/users/wlach/received_events","type":"User","site_admin":false},"body":"`not existed` -> `non-existent` :)","created_at":"2018-08-13T18:15:47Z","updated_at":"2018-08-13T18:21:05Z","html_url":"https://github.com/metricsgraphics/metrics-graphics/pull/893#discussion_r209707771","pull_request_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/pulls/893","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/metricsgraphics/metrics-graphics/pulls/comments/209707771"},"html":{"href":"https://github.com/metricsgraphics/metrics-graphics/pull/893#discussion_r209707771"},"pull_request":{"href":"https://api.github.com/repos/metricsgraphics/metrics-graphics/pulls/893"}}},"pull_request":{"url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/pulls/893","id":204061309,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA0MDYxMzA5","html_url":"https://github.com/metricsgraphics/metrics-graphics/pull/893","diff_url":"https://github.com/metricsgraphics/metrics-graphics/pull/893.diff","patch_url":"https://github.com/metricsgraphics/metrics-graphics/pull/893.patch","issue_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/issues/893","number":893,"state":"open","locked":false,"title":"A simple list of options","user":{"login":"cnwangjie","id":7459652,"node_id":"MDQ6VXNlcjc0NTk2NTI=","avatar_url":"https://avatars3.githubusercontent.com/u/7459652?v=4","gravatar_id":"","url":"https://api.github.com/users/cnwangjie","html_url":"https://github.com/cnwangjie","followers_url":"https://api.github.com/users/cnwangjie/followers","following_url":"https://api.github.com/users/cnwangjie/following{/other_user}","gists_url":"https://api.github.com/users/cnwangjie/gists{/gist_id}","starred_url":"https://api.github.com/users/cnwangjie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cnwangjie/subscriptions","organizations_url":"https://api.github.com/users/cnwangjie/orgs","repos_url":"https://api.github.com/users/cnwangjie/repos","events_url":"https://api.github.com/users/cnwangjie/events{/privacy}","received_events_url":"https://api.github.com/users/cnwangjie/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-07-26T08:13:23Z","updated_at":"2018-08-13T18:21:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cf14f16e5e1cf989a3ba68f16f4e92d663c48eae","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/pulls/893/commits","review_comments_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/pulls/893/comments","review_comment_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/pulls/comments{/number}","comments_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/issues/893/comments","statuses_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/statuses/f7c574340233cb714617489b048d6580a0165ed0","head":{"label":"cnwangjie:option_list","ref":"option_list","sha":"f7c574340233cb714617489b048d6580a0165ed0","user":{"login":"cnwangjie","id":7459652,"node_id":"MDQ6VXNlcjc0NTk2NTI=","avatar_url":"https://avatars3.githubusercontent.com/u/7459652?v=4","gravatar_id":"","url":"https://api.github.com/users/cnwangjie","html_url":"https://github.com/cnwangjie","followers_url":"https://api.github.com/users/cnwangjie/followers","following_url":"https://api.github.com/users/cnwangjie/following{/other_user}","gists_url":"https://api.github.com/users/cnwangjie/gists{/gist_id}","starred_url":"https://api.github.com/users/cnwangjie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cnwangjie/subscriptions","organizations_url":"https://api.github.com/users/cnwangjie/orgs","repos_url":"https://api.github.com/users/cnwangjie/repos","events_url":"https://api.github.com/users/cnwangjie/events{/privacy}","received_events_url":"https://api.github.com/users/cnwangjie/received_events","type":"User","site_admin":false},"repo":{"id":132064446,"node_id":"MDEwOlJlcG9zaXRvcnkxMzIwNjQ0NDY=","name":"metrics-graphics","full_name":"cnwangjie/metrics-graphics","owner":{"login":"cnwangjie","id":7459652,"node_id":"MDQ6VXNlcjc0NTk2NTI=","avatar_url":"https://avatars3.githubusercontent.com/u/7459652?v=4","gravatar_id":"","url":"https://api.github.com/users/cnwangjie","html_url":"https://github.com/cnwangjie","followers_url":"https://api.github.com/users/cnwangjie/followers","following_url":"https://api.github.com/users/cnwangjie/following{/other_user}","gists_url":"https://api.github.com/users/cnwangjie/gists{/gist_id}","starred_url":"https://api.github.com/users/cnwangjie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cnwangjie/subscriptions","organizations_url":"https://api.github.com/users/cnwangjie/orgs","repos_url":"https://api.github.com/users/cnwangjie/repos","events_url":"https://api.github.com/users/cnwangjie/events{/privacy}","received_events_url":"https://api.github.com/users/cnwangjie/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cnwangjie/metrics-graphics","description":"A library optimized for concise and principled data graphics and layouts.","fork":true,"url":"https://api.github.com/repos/cnwangjie/metrics-graphics","forks_url":"https://api.github.com/repos/cnwangjie/metrics-graphics/forks","keys_url":"https://api.github.com/repos/cnwangjie/metrics-graphics/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cnwangjie/metrics-graphics/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cnwangjie/metrics-graphics/teams","hooks_url":"https://api.github.com/repos/cnwangjie/metrics-graphics/hooks","issue_events_url":"https://api.github.com/repos/cnwangjie/metrics-graphics/issues/events{/number}","events_url":"https://api.github.com/repos/cnwangjie/metrics-graphics/events","assignees_url":"https://api.github.com/repos/cnwangjie/metrics-graphics/assignees{/user}","branches_url":"https://api.github.com/repos/cnwangjie/metrics-graphics/branches{/branch}","tags_url":"https://api.github.com/repos/cnwangjie/metrics-graphics/tags","blobs_url":"https://api.github.com/repos/cnwangjie/metrics-graphics/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cnwangjie/metrics-graphics/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cnwangjie/metrics-graphics/git/refs{/sha}","trees_url":"https://api.github.com/repos/cnwangjie/metrics-graphics/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cnwangjie/metrics-graphics/statuses/{sha}","languages_url":"https://api.github.com/repos/cnwangjie/metrics-graphics/languages","stargazers_url":"https://api.github.com/repos/cnwangjie/metrics-graphics/stargazers","contributors_url":"https://api.github.com/repos/cnwangjie/metrics-graphics/contributors","subscribers_url":"https://api.github.com/repos/cnwangjie/metrics-graphics/subscribers","subscription_url":"https://api.github.com/repos/cnwangjie/metrics-graphics/subscription","commits_url":"https://api.github.com/repos/cnwangjie/metrics-graphics/commits{/sha}","git_commits_url":"https://api.github.com/repos/cnwangjie/metrics-graphics/git/commits{/sha}","comments_url":"https://api.github.com/repos/cnwangjie/metrics-graphics/comments{/number}","issue_comment_url":"https://api.github.com/repos/cnwangjie/metrics-graphics/issues/comments{/number}","contents_url":"https://api.github.com/repos/cnwangjie/metrics-graphics/contents/{+path}","compare_url":"https://api.github.com/repos/cnwangjie/metrics-graphics/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cnwangjie/metrics-graphics/merges","archive_url":"https://api.github.com/repos/cnwangjie/metrics-graphics/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cnwangjie/metrics-graphics/downloads","issues_url":"https://api.github.com/repos/cnwangjie/metrics-graphics/issues{/number}","pulls_url":"https://api.github.com/repos/cnwangjie/metrics-graphics/pulls{/number}","milestones_url":"https://api.github.com/repos/cnwangjie/metrics-graphics/milestones{/number}","notifications_url":"https://api.github.com/repos/cnwangjie/metrics-graphics/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cnwangjie/metrics-graphics/labels{/name}","releases_url":"https://api.github.com/repos/cnwangjie/metrics-graphics/releases{/id}","deployments_url":"https://api.github.com/repos/cnwangjie/metrics-graphics/deployments","created_at":"2018-05-04T00:31:26Z","updated_at":"2018-05-31T04:48:44Z","pushed_at":"2018-08-12T08:00:04Z","git_url":"git://github.com/cnwangjie/metrics-graphics.git","ssh_url":"git@github.com:cnwangjie/metrics-graphics.git","clone_url":"https://github.com/cnwangjie/metrics-graphics.git","svn_url":"https://github.com/cnwangjie/metrics-graphics","homepage":"http://metricsgraphicsjs.org","size":6224,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"metricsgraphics:master","ref":"master","sha":"8b713bcc35278b0a77ec1f381b3cb12188deb9d5","user":{"login":"metricsgraphics","id":37669658,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3NjY5NjU4","avatar_url":"https://avatars1.githubusercontent.com/u/37669658?v=4","gravatar_id":"","url":"https://api.github.com/users/metricsgraphics","html_url":"https://github.com/metricsgraphics","followers_url":"https://api.github.com/users/metricsgraphics/followers","following_url":"https://api.github.com/users/metricsgraphics/following{/other_user}","gists_url":"https://api.github.com/users/metricsgraphics/gists{/gist_id}","starred_url":"https://api.github.com/users/metricsgraphics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metricsgraphics/subscriptions","organizations_url":"https://api.github.com/users/metricsgraphics/orgs","repos_url":"https://api.github.com/users/metricsgraphics/repos","events_url":"https://api.github.com/users/metricsgraphics/events{/privacy}","received_events_url":"https://api.github.com/users/metricsgraphics/received_events","type":"Organization","site_admin":false},"repo":{"id":19353482,"node_id":"MDEwOlJlcG9zaXRvcnkxOTM1MzQ4Mg==","name":"metrics-graphics","full_name":"metricsgraphics/metrics-graphics","owner":{"login":"metricsgraphics","id":37669658,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3NjY5NjU4","avatar_url":"https://avatars1.githubusercontent.com/u/37669658?v=4","gravatar_id":"","url":"https://api.github.com/users/metricsgraphics","html_url":"https://github.com/metricsgraphics","followers_url":"https://api.github.com/users/metricsgraphics/followers","following_url":"https://api.github.com/users/metricsgraphics/following{/other_user}","gists_url":"https://api.github.com/users/metricsgraphics/gists{/gist_id}","starred_url":"https://api.github.com/users/metricsgraphics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metricsgraphics/subscriptions","organizations_url":"https://api.github.com/users/metricsgraphics/orgs","repos_url":"https://api.github.com/users/metricsgraphics/repos","events_url":"https://api.github.com/users/metricsgraphics/events{/privacy}","received_events_url":"https://api.github.com/users/metricsgraphics/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/metricsgraphics/metrics-graphics","description":"A library optimized for concise and principled data graphics and layouts.","fork":false,"url":"https://api.github.com/repos/metricsgraphics/metrics-graphics","forks_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/forks","keys_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/keys{/key_id}","collaborators_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/teams","hooks_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/hooks","issue_events_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/issues/events{/number}","events_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/events","assignees_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/assignees{/user}","branches_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/branches{/branch}","tags_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/tags","blobs_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/git/refs{/sha}","trees_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/git/trees{/sha}","statuses_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/statuses/{sha}","languages_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/languages","stargazers_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/stargazers","contributors_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/contributors","subscribers_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/subscribers","subscription_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/subscription","commits_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/commits{/sha}","git_commits_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/git/commits{/sha}","comments_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/comments{/number}","issue_comment_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/issues/comments{/number}","contents_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/contents/{+path}","compare_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/compare/{base}...{head}","merges_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/merges","archive_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/downloads","issues_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/issues{/number}","pulls_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/pulls{/number}","milestones_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/milestones{/number}","notifications_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/labels{/name}","releases_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/releases{/id}","deployments_url":"https://api.github.com/repos/metricsgraphics/metrics-graphics/deployments","created_at":"2014-05-01T18:25:52Z","updated_at":"2018-08-13T06:53:26Z","pushed_at":"2018-08-12T08:00:06Z","git_url":"git://github.com/metricsgraphics/metrics-graphics.git","ssh_url":"git@github.com:metricsgraphics/metrics-graphics.git","clone_url":"https://github.com/metricsgraphics/metrics-graphics.git","svn_url":"https://github.com/metricsgraphics/metrics-graphics","homepage":"http://metricsgraphicsjs.org","size":6182,"stargazers_count":6909,"watchers_count":6909,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":471,"mirror_url":null,"archived":false,"open_issues_count":137,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":471,"open_issues":137,"watchers":6909,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/metricsgraphics/metrics-graphics/pulls/893"},"html":{"href":"https://github.com/metricsgraphics/metrics-graphics/pull/893"},"issue":{"href":"https://api.github.com/repos/metricsgraphics/metrics-graphics/issues/893"},"comments":{"href":"https://api.github.com/repos/metricsgraphics/metrics-graphics/issues/893/comments"},"review_comments":{"href":"https://api.github.com/repos/metricsgraphics/metrics-graphics/pulls/893/comments"},"review_comment":{"href":"https://api.github.com/repos/metricsgraphics/metrics-graphics/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/metricsgraphics/metrics-graphics/pulls/893/commits"},"statuses":{"href":"https://api.github.com/repos/metricsgraphics/metrics-graphics/statuses/f7c574340233cb714617489b048d6580a0165ed0"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"wlach"}}