{"action":"closed","number":51,"pull_request":{"url":"https://api.github.com/repos/yargs/yargs-parser/pulls/51","id":81189916,"html_url":"https://github.com/yargs/yargs-parser/pull/51","diff_url":"https://github.com/yargs/yargs-parser/pull/51.diff","patch_url":"https://github.com/yargs/yargs-parser/pull/51.patch","issue_url":"https://api.github.com/repos/yargs/yargs-parser/issues/51","number":51,"state":"closed","locked":false,"title":"feat: coerce full array instead of each element","user":{"login":"nexdrew","id":1929625,"avatar_url":"https://avatars.githubusercontent.com/u/1929625?v=3","gravatar_id":"","url":"https://api.github.com/users/nexdrew","html_url":"https://github.com/nexdrew","followers_url":"https://api.github.com/users/nexdrew/followers","following_url":"https://api.github.com/users/nexdrew/following{/other_user}","gists_url":"https://api.github.com/users/nexdrew/gists{/gist_id}","starred_url":"https://api.github.com/users/nexdrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nexdrew/subscriptions","organizations_url":"https://api.github.com/users/nexdrew/orgs","repos_url":"https://api.github.com/users/nexdrew/repos","events_url":"https://api.github.com/users/nexdrew/events{/privacy}","received_events_url":"https://api.github.com/users/nexdrew/received_events","type":"User","site_admin":false},"body":"Fixes #50.\r\n\r\nAs a bonus, this also means coercion can apply to `argv._`. Here's an example:\r\n\r\n```js\r\nvar parse = require('yargs-parser')\r\nvar argv = parse(process.argv.slice(2), {\r\n  coerce: {\r\n    _: function (arg) {\r\n      // do something special here\r\n      return arg\r\n    }\r\n  }\r\n})\r\nconsole.log(argv)\r\n```\r\n\r\nThis works with an explicit `string: ['_']` option too (the coerce function would be guaranteed to be given an array of strings).\r\n\r\nNote that coercion for implicit arrays (options parsed with multiple values but without `array` config) still happens per element.","created_at":"2016-08-12T22:07:04Z","updated_at":"2016-08-13T19:38:20Z","closed_at":"2016-08-13T19:38:20Z","merged_at":"2016-08-13T19:38:19Z","merge_commit_sha":"cc4dc5663bf9a29527127cf575d37b461c1c47a2","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/yargs/yargs-parser/pulls/51/commits","review_comments_url":"https://api.github.com/repos/yargs/yargs-parser/pulls/51/comments","review_comment_url":"https://api.github.com/repos/yargs/yargs-parser/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yargs/yargs-parser/issues/51/comments","statuses_url":"https://api.github.com/repos/yargs/yargs-parser/statuses/0e74ca8737f2cd90e25fad13dfe781838fdda51b","head":{"label":"yargs:array-coercion","ref":"array-coercion","sha":"0e74ca8737f2cd90e25fad13dfe781838fdda51b","user":{"login":"yargs","id":16504989,"avatar_url":"https://avatars.githubusercontent.com/u/16504989?v=3","gravatar_id":"","url":"https://api.github.com/users/yargs","html_url":"https://github.com/yargs","followers_url":"https://api.github.com/users/yargs/followers","following_url":"https://api.github.com/users/yargs/following{/other_user}","gists_url":"https://api.github.com/users/yargs/gists{/gist_id}","starred_url":"https://api.github.com/users/yargs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yargs/subscriptions","organizations_url":"https://api.github.com/users/yargs/orgs","repos_url":"https://api.github.com/users/yargs/repos","events_url":"https://api.github.com/users/yargs/events{/privacy}","received_events_url":"https://api.github.com/users/yargs/received_events","type":"Organization","site_admin":false},"repo":{"id":50258379,"name":"yargs-parser","full_name":"yargs/yargs-parser","owner":{"login":"yargs","id":16504989,"avatar_url":"https://avatars.githubusercontent.com/u/16504989?v=3","gravatar_id":"","url":"https://api.github.com/users/yargs","html_url":"https://github.com/yargs","followers_url":"https://api.github.com/users/yargs/followers","following_url":"https://api.github.com/users/yargs/following{/other_user}","gists_url":"https://api.github.com/users/yargs/gists{/gist_id}","starred_url":"https://api.github.com/users/yargs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yargs/subscriptions","organizations_url":"https://api.github.com/users/yargs/orgs","repos_url":"https://api.github.com/users/yargs/repos","events_url":"https://api.github.com/users/yargs/events{/privacy}","received_events_url":"https://api.github.com/users/yargs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yargs/yargs-parser","description":":muscle: the mighty option parser used by yargs","fork":false,"url":"https://api.github.com/repos/yargs/yargs-parser","forks_url":"https://api.github.com/repos/yargs/yargs-parser/forks","keys_url":"https://api.github.com/repos/yargs/yargs-parser/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yargs/yargs-parser/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yargs/yargs-parser/teams","hooks_url":"https://api.github.com/repos/yargs/yargs-parser/hooks","issue_events_url":"https://api.github.com/repos/yargs/yargs-parser/issues/events{/number}","events_url":"https://api.github.com/repos/yargs/yargs-parser/events","assignees_url":"https://api.github.com/repos/yargs/yargs-parser/assignees{/user}","branches_url":"https://api.github.com/repos/yargs/yargs-parser/branches{/branch}","tags_url":"https://api.github.com/repos/yargs/yargs-parser/tags","blobs_url":"https://api.github.com/repos/yargs/yargs-parser/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yargs/yargs-parser/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yargs/yargs-parser/git/refs{/sha}","trees_url":"https://api.github.com/repos/yargs/yargs-parser/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yargs/yargs-parser/statuses/{sha}","languages_url":"https://api.github.com/repos/yargs/yargs-parser/languages","stargazers_url":"https://api.github.com/repos/yargs/yargs-parser/stargazers","contributors_url":"https://api.github.com/repos/yargs/yargs-parser/contributors","subscribers_url":"https://api.github.com/repos/yargs/yargs-parser/subscribers","subscription_url":"https://api.github.com/repos/yargs/yargs-parser/subscription","commits_url":"https://api.github.com/repos/yargs/yargs-parser/commits{/sha}","git_commits_url":"https://api.github.com/repos/yargs/yargs-parser/git/commits{/sha}","comments_url":"https://api.github.com/repos/yargs/yargs-parser/comments{/number}","issue_comment_url":"https://api.github.com/repos/yargs/yargs-parser/issues/comments{/number}","contents_url":"https://api.github.com/repos/yargs/yargs-parser/contents/{+path}","compare_url":"https://api.github.com/repos/yargs/yargs-parser/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yargs/yargs-parser/merges","archive_url":"https://api.github.com/repos/yargs/yargs-parser/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yargs/yargs-parser/downloads","issues_url":"https://api.github.com/repos/yargs/yargs-parser/issues{/number}","pulls_url":"https://api.github.com/repos/yargs/yargs-parser/pulls{/number}","milestones_url":"https://api.github.com/repos/yargs/yargs-parser/milestones{/number}","notifications_url":"https://api.github.com/repos/yargs/yargs-parser/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yargs/yargs-parser/labels{/name}","releases_url":"https://api.github.com/repos/yargs/yargs-parser/releases{/id}","deployments_url":"https://api.github.com/repos/yargs/yargs-parser/deployments","created_at":"2016-01-23T21:03:32Z","updated_at":"2016-07-24T19:10:54Z","pushed_at":"2016-08-13T19:38:20Z","git_url":"git://github.com/yargs/yargs-parser.git","ssh_url":"git@github.com:yargs/yargs-parser.git","clone_url":"https://github.com/yargs/yargs-parser.git","svn_url":"https://github.com/yargs/yargs-parser","homepage":"http://yargs.js.org/","size":234,"stargazers_count":41,"watchers_count":41,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":1,"forks":9,"open_issues":1,"watchers":41,"default_branch":"master"}},"base":{"label":"yargs:master","ref":"master","sha":"2fa84bd242f64be1660963c933717559a743e9c2","user":{"login":"yargs","id":16504989,"avatar_url":"https://avatars.githubusercontent.com/u/16504989?v=3","gravatar_id":"","url":"https://api.github.com/users/yargs","html_url":"https://github.com/yargs","followers_url":"https://api.github.com/users/yargs/followers","following_url":"https://api.github.com/users/yargs/following{/other_user}","gists_url":"https://api.github.com/users/yargs/gists{/gist_id}","starred_url":"https://api.github.com/users/yargs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yargs/subscriptions","organizations_url":"https://api.github.com/users/yargs/orgs","repos_url":"https://api.github.com/users/yargs/repos","events_url":"https://api.github.com/users/yargs/events{/privacy}","received_events_url":"https://api.github.com/users/yargs/received_events","type":"Organization","site_admin":false},"repo":{"id":50258379,"name":"yargs-parser","full_name":"yargs/yargs-parser","owner":{"login":"yargs","id":16504989,"avatar_url":"https://avatars.githubusercontent.com/u/16504989?v=3","gravatar_id":"","url":"https://api.github.com/users/yargs","html_url":"https://github.com/yargs","followers_url":"https://api.github.com/users/yargs/followers","following_url":"https://api.github.com/users/yargs/following{/other_user}","gists_url":"https://api.github.com/users/yargs/gists{/gist_id}","starred_url":"https://api.github.com/users/yargs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yargs/subscriptions","organizations_url":"https://api.github.com/users/yargs/orgs","repos_url":"https://api.github.com/users/yargs/repos","events_url":"https://api.github.com/users/yargs/events{/privacy}","received_events_url":"https://api.github.com/users/yargs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yargs/yargs-parser","description":":muscle: the mighty option parser used by yargs","fork":false,"url":"https://api.github.com/repos/yargs/yargs-parser","forks_url":"https://api.github.com/repos/yargs/yargs-parser/forks","keys_url":"https://api.github.com/repos/yargs/yargs-parser/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yargs/yargs-parser/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yargs/yargs-parser/teams","hooks_url":"https://api.github.com/repos/yargs/yargs-parser/hooks","issue_events_url":"https://api.github.com/repos/yargs/yargs-parser/issues/events{/number}","events_url":"https://api.github.com/repos/yargs/yargs-parser/events","assignees_url":"https://api.github.com/repos/yargs/yargs-parser/assignees{/user}","branches_url":"https://api.github.com/repos/yargs/yargs-parser/branches{/branch}","tags_url":"https://api.github.com/repos/yargs/yargs-parser/tags","blobs_url":"https://api.github.com/repos/yargs/yargs-parser/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yargs/yargs-parser/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yargs/yargs-parser/git/refs{/sha}","trees_url":"https://api.github.com/repos/yargs/yargs-parser/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yargs/yargs-parser/statuses/{sha}","languages_url":"https://api.github.com/repos/yargs/yargs-parser/languages","stargazers_url":"https://api.github.com/repos/yargs/yargs-parser/stargazers","contributors_url":"https://api.github.com/repos/yargs/yargs-parser/contributors","subscribers_url":"https://api.github.com/repos/yargs/yargs-parser/subscribers","subscription_url":"https://api.github.com/repos/yargs/yargs-parser/subscription","commits_url":"https://api.github.com/repos/yargs/yargs-parser/commits{/sha}","git_commits_url":"https://api.github.com/repos/yargs/yargs-parser/git/commits{/sha}","comments_url":"https://api.github.com/repos/yargs/yargs-parser/comments{/number}","issue_comment_url":"https://api.github.com/repos/yargs/yargs-parser/issues/comments{/number}","contents_url":"https://api.github.com/repos/yargs/yargs-parser/contents/{+path}","compare_url":"https://api.github.com/repos/yargs/yargs-parser/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yargs/yargs-parser/merges","archive_url":"https://api.github.com/repos/yargs/yargs-parser/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yargs/yargs-parser/downloads","issues_url":"https://api.github.com/repos/yargs/yargs-parser/issues{/number}","pulls_url":"https://api.github.com/repos/yargs/yargs-parser/pulls{/number}","milestones_url":"https://api.github.com/repos/yargs/yargs-parser/milestones{/number}","notifications_url":"https://api.github.com/repos/yargs/yargs-parser/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yargs/yargs-parser/labels{/name}","releases_url":"https://api.github.com/repos/yargs/yargs-parser/releases{/id}","deployments_url":"https://api.github.com/repos/yargs/yargs-parser/deployments","created_at":"2016-01-23T21:03:32Z","updated_at":"2016-07-24T19:10:54Z","pushed_at":"2016-08-13T19:38:20Z","git_url":"git://github.com/yargs/yargs-parser.git","ssh_url":"git@github.com:yargs/yargs-parser.git","clone_url":"https://github.com/yargs/yargs-parser.git","svn_url":"https://github.com/yargs/yargs-parser","homepage":"http://yargs.js.org/","size":234,"stargazers_count":41,"watchers_count":41,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":1,"forks":9,"open_issues":1,"watchers":41,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yargs/yargs-parser/pulls/51"},"html":{"href":"https://github.com/yargs/yargs-parser/pull/51"},"issue":{"href":"https://api.github.com/repos/yargs/yargs-parser/issues/51"},"comments":{"href":"https://api.github.com/repos/yargs/yargs-parser/issues/51/comments"},"review_comments":{"href":"https://api.github.com/repos/yargs/yargs-parser/pulls/51/comments"},"review_comment":{"href":"https://api.github.com/repos/yargs/yargs-parser/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yargs/yargs-parser/pulls/51/commits"},"statuses":{"href":"https://api.github.com/repos/yargs/yargs-parser/statuses/0e74ca8737f2cd90e25fad13dfe781838fdda51b"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"bcoe","id":194609,"avatar_url":"https://avatars.githubusercontent.com/u/194609?v=3","gravatar_id":"","url":"https://api.github.com/users/bcoe","html_url":"https://github.com/bcoe","followers_url":"https://api.github.com/users/bcoe/followers","following_url":"https://api.github.com/users/bcoe/following{/other_user}","gists_url":"https://api.github.com/users/bcoe/gists{/gist_id}","starred_url":"https://api.github.com/users/bcoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcoe/subscriptions","organizations_url":"https://api.github.com/users/bcoe/orgs","repos_url":"https://api.github.com/users/bcoe/repos","events_url":"https://api.github.com/users/bcoe/events{/privacy}","received_events_url":"https://api.github.com/users/bcoe/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"commits":2,"additions":62,"deletions":3,"changed_files":2}}
{"actor":{"display_login":"bcoe"}}