{"action":"closed","number":187,"pull_request":{"url":"https://api.github.com/repos/Marak/faker.js/pulls/187","id":31452907,"html_url":"https://github.com/Marak/faker.js/pull/187","diff_url":"https://github.com/Marak/faker.js/pull/187.diff","patch_url":"https://github.com/Marak/faker.js/pull/187.patch","issue_url":"https://api.github.com/repos/Marak/faker.js/issues/187","number":187,"state":"closed","locked":false,"title":"replace broken shuffle algorithm with one from the internet","user":{"login":"jamespharaoh","id":230005,"avatar_url":"https://avatars.githubusercontent.com/u/230005?v=3","gravatar_id":"","url":"https://api.github.com/users/jamespharaoh","html_url":"https://github.com/jamespharaoh","followers_url":"https://api.github.com/users/jamespharaoh/followers","following_url":"https://api.github.com/users/jamespharaoh/following{/other_user}","gists_url":"https://api.github.com/users/jamespharaoh/gists{/gist_id}","starred_url":"https://api.github.com/users/jamespharaoh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamespharaoh/subscriptions","organizations_url":"https://api.github.com/users/jamespharaoh/orgs","repos_url":"https://api.github.com/users/jamespharaoh/repos","events_url":"https://api.github.com/users/jamespharaoh/events{/privacy}","received_events_url":"https://api.github.com/users/jamespharaoh/received_events","type":"User","site_admin":false},"body":"The shuffle algorithm was broken, and extremely hard to follow. I've replaced it with one I found on stackoverflow. This kind of thing is notoriously difficult to get right, so best to use a trusted implementation.\r\n\r\nTo demonstrate the problem, simply call the old shuffle many times. Eventually, all the items in the array are replaced with undefined.\r\n\r\nfor (var i = 0; i < 10000; i++) { console.log (faker.lorem.words ()); }","created_at":"2015-03-18T17:36:06Z","updated_at":"2015-06-04T18:58:05Z","closed_at":"2015-06-04T18:58:05Z","merged_at":null,"merge_commit_sha":"d4f373a3c3e8e369ec5ac09a4c84f34fb9910d42","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Marak/faker.js/pulls/187/commits","review_comments_url":"https://api.github.com/repos/Marak/faker.js/pulls/187/comments","review_comment_url":"https://api.github.com/repos/Marak/faker.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Marak/faker.js/issues/187/comments","statuses_url":"https://api.github.com/repos/Marak/faker.js/statuses/15c37ad299d3d2337fdacacfed57f018524a49fd","head":{"label":"jamespharaoh:fix-shuffle","ref":"fix-shuffle","sha":"15c37ad299d3d2337fdacacfed57f018524a49fd","user":{"login":"jamespharaoh","id":230005,"avatar_url":"https://avatars.githubusercontent.com/u/230005?v=3","gravatar_id":"","url":"https://api.github.com/users/jamespharaoh","html_url":"https://github.com/jamespharaoh","followers_url":"https://api.github.com/users/jamespharaoh/followers","following_url":"https://api.github.com/users/jamespharaoh/following{/other_user}","gists_url":"https://api.github.com/users/jamespharaoh/gists{/gist_id}","starred_url":"https://api.github.com/users/jamespharaoh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamespharaoh/subscriptions","organizations_url":"https://api.github.com/users/jamespharaoh/orgs","repos_url":"https://api.github.com/users/jamespharaoh/repos","events_url":"https://api.github.com/users/jamespharaoh/events{/privacy}","received_events_url":"https://api.github.com/users/jamespharaoh/received_events","type":"User","site_admin":false},"repo":{"id":32474143,"name":"faker.js","full_name":"jamespharaoh/faker.js","owner":{"login":"jamespharaoh","id":230005,"avatar_url":"https://avatars.githubusercontent.com/u/230005?v=3","gravatar_id":"","url":"https://api.github.com/users/jamespharaoh","html_url":"https://github.com/jamespharaoh","followers_url":"https://api.github.com/users/jamespharaoh/followers","following_url":"https://api.github.com/users/jamespharaoh/following{/other_user}","gists_url":"https://api.github.com/users/jamespharaoh/gists{/gist_id}","starred_url":"https://api.github.com/users/jamespharaoh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamespharaoh/subscriptions","organizations_url":"https://api.github.com/users/jamespharaoh/orgs","repos_url":"https://api.github.com/users/jamespharaoh/repos","events_url":"https://api.github.com/users/jamespharaoh/events{/privacy}","received_events_url":"https://api.github.com/users/jamespharaoh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jamespharaoh/faker.js","description":"generate massive amounts of fake data in Node.js and the browser","fork":true,"url":"https://api.github.com/repos/jamespharaoh/faker.js","forks_url":"https://api.github.com/repos/jamespharaoh/faker.js/forks","keys_url":"https://api.github.com/repos/jamespharaoh/faker.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jamespharaoh/faker.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jamespharaoh/faker.js/teams","hooks_url":"https://api.github.com/repos/jamespharaoh/faker.js/hooks","issue_events_url":"https://api.github.com/repos/jamespharaoh/faker.js/issues/events{/number}","events_url":"https://api.github.com/repos/jamespharaoh/faker.js/events","assignees_url":"https://api.github.com/repos/jamespharaoh/faker.js/assignees{/user}","branches_url":"https://api.github.com/repos/jamespharaoh/faker.js/branches{/branch}","tags_url":"https://api.github.com/repos/jamespharaoh/faker.js/tags","blobs_url":"https://api.github.com/repos/jamespharaoh/faker.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jamespharaoh/faker.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jamespharaoh/faker.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/jamespharaoh/faker.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jamespharaoh/faker.js/statuses/{sha}","languages_url":"https://api.github.com/repos/jamespharaoh/faker.js/languages","stargazers_url":"https://api.github.com/repos/jamespharaoh/faker.js/stargazers","contributors_url":"https://api.github.com/repos/jamespharaoh/faker.js/contributors","subscribers_url":"https://api.github.com/repos/jamespharaoh/faker.js/subscribers","subscription_url":"https://api.github.com/repos/jamespharaoh/faker.js/subscription","commits_url":"https://api.github.com/repos/jamespharaoh/faker.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/jamespharaoh/faker.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/jamespharaoh/faker.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/jamespharaoh/faker.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/jamespharaoh/faker.js/contents/{+path}","compare_url":"https://api.github.com/repos/jamespharaoh/faker.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jamespharaoh/faker.js/merges","archive_url":"https://api.github.com/repos/jamespharaoh/faker.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jamespharaoh/faker.js/downloads","issues_url":"https://api.github.com/repos/jamespharaoh/faker.js/issues{/number}","pulls_url":"https://api.github.com/repos/jamespharaoh/faker.js/pulls{/number}","milestones_url":"https://api.github.com/repos/jamespharaoh/faker.js/milestones{/number}","notifications_url":"https://api.github.com/repos/jamespharaoh/faker.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jamespharaoh/faker.js/labels{/name}","releases_url":"https://api.github.com/repos/jamespharaoh/faker.js/releases{/id}","created_at":"2015-03-18T17:34:24Z","updated_at":"2015-03-18T17:34:24Z","pushed_at":"2015-03-18T17:34:52Z","git_url":"git://github.com/jamespharaoh/faker.js.git","ssh_url":"git@github.com:jamespharaoh/faker.js.git","clone_url":"https://github.com/jamespharaoh/faker.js.git","svn_url":"https://github.com/jamespharaoh/faker.js","homepage":"http://marak.com/faker.js/","size":1893,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Marak:master","ref":"master","sha":"a39082f6f49fb326111bc2a0d9014c9dc65fe1fa","user":{"login":"Marak","id":70011,"avatar_url":"https://avatars.githubusercontent.com/u/70011?v=3","gravatar_id":"","url":"https://api.github.com/users/Marak","html_url":"https://github.com/Marak","followers_url":"https://api.github.com/users/Marak/followers","following_url":"https://api.github.com/users/Marak/following{/other_user}","gists_url":"https://api.github.com/users/Marak/gists{/gist_id}","starred_url":"https://api.github.com/users/Marak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Marak/subscriptions","organizations_url":"https://api.github.com/users/Marak/orgs","repos_url":"https://api.github.com/users/Marak/repos","events_url":"https://api.github.com/users/Marak/events{/privacy}","received_events_url":"https://api.github.com/users/Marak/received_events","type":"User","site_admin":false},"repo":{"id":667561,"name":"faker.js","full_name":"Marak/faker.js","owner":{"login":"Marak","id":70011,"avatar_url":"https://avatars.githubusercontent.com/u/70011?v=3","gravatar_id":"","url":"https://api.github.com/users/Marak","html_url":"https://github.com/Marak","followers_url":"https://api.github.com/users/Marak/followers","following_url":"https://api.github.com/users/Marak/following{/other_user}","gists_url":"https://api.github.com/users/Marak/gists{/gist_id}","starred_url":"https://api.github.com/users/Marak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Marak/subscriptions","organizations_url":"https://api.github.com/users/Marak/orgs","repos_url":"https://api.github.com/users/Marak/repos","events_url":"https://api.github.com/users/Marak/events{/privacy}","received_events_url":"https://api.github.com/users/Marak/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Marak/faker.js","description":"generate massive amounts of fake data in Node.js and the browser","fork":false,"url":"https://api.github.com/repos/Marak/faker.js","forks_url":"https://api.github.com/repos/Marak/faker.js/forks","keys_url":"https://api.github.com/repos/Marak/faker.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Marak/faker.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Marak/faker.js/teams","hooks_url":"https://api.github.com/repos/Marak/faker.js/hooks","issue_events_url":"https://api.github.com/repos/Marak/faker.js/issues/events{/number}","events_url":"https://api.github.com/repos/Marak/faker.js/events","assignees_url":"https://api.github.com/repos/Marak/faker.js/assignees{/user}","branches_url":"https://api.github.com/repos/Marak/faker.js/branches{/branch}","tags_url":"https://api.github.com/repos/Marak/faker.js/tags","blobs_url":"https://api.github.com/repos/Marak/faker.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Marak/faker.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Marak/faker.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/Marak/faker.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Marak/faker.js/statuses/{sha}","languages_url":"https://api.github.com/repos/Marak/faker.js/languages","stargazers_url":"https://api.github.com/repos/Marak/faker.js/stargazers","contributors_url":"https://api.github.com/repos/Marak/faker.js/contributors","subscribers_url":"https://api.github.com/repos/Marak/faker.js/subscribers","subscription_url":"https://api.github.com/repos/Marak/faker.js/subscription","commits_url":"https://api.github.com/repos/Marak/faker.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/Marak/faker.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/Marak/faker.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/Marak/faker.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/Marak/faker.js/contents/{+path}","compare_url":"https://api.github.com/repos/Marak/faker.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Marak/faker.js/merges","archive_url":"https://api.github.com/repos/Marak/faker.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Marak/faker.js/downloads","issues_url":"https://api.github.com/repos/Marak/faker.js/issues{/number}","pulls_url":"https://api.github.com/repos/Marak/faker.js/pulls{/number}","milestones_url":"https://api.github.com/repos/Marak/faker.js/milestones{/number}","notifications_url":"https://api.github.com/repos/Marak/faker.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Marak/faker.js/labels{/name}","releases_url":"https://api.github.com/repos/Marak/faker.js/releases{/id}","created_at":"2010-05-15T00:53:07Z","updated_at":"2015-06-04T15:56:44Z","pushed_at":"2015-06-04T18:57:10Z","git_url":"git://github.com/Marak/faker.js.git","ssh_url":"git@github.com:Marak/faker.js.git","clone_url":"https://github.com/Marak/faker.js.git","svn_url":"https://github.com/Marak/faker.js","homepage":"","size":3630,"stargazers_count":3852,"watchers_count":3852,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":327,"mirror_url":null,"open_issues_count":55,"forks":327,"open_issues":55,"watchers":3852,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Marak/faker.js/pulls/187"},"html":{"href":"https://github.com/Marak/faker.js/pull/187"},"issue":{"href":"https://api.github.com/repos/Marak/faker.js/issues/187"},"comments":{"href":"https://api.github.com/repos/Marak/faker.js/issues/187/comments"},"review_comments":{"href":"https://api.github.com/repos/Marak/faker.js/pulls/187/comments"},"review_comment":{"href":"https://api.github.com/repos/Marak/faker.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Marak/faker.js/pulls/187/commits"},"statuses":{"href":"https://api.github.com/repos/Marak/faker.js/statuses/15c37ad299d3d2337fdacacfed57f018524a49fd"}},"merged":false,"mergeable":false,"mergeable_state":"dirty","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":25,"deletions":5,"changed_files":1}}