{"action":"created","comment":{"url":"https://api.github.com/repos/jussi-kalliokoski/trine/pulls/comments/33436120","id":33436120,"diff_hunk":"@@ -0,0 +1,64 @@\n+\"use strict\";\n+\n+import { flatten } from \"../../../src/iterable/flatten\";\n+\n+describe(\"flatten()\", function () {\n+    it(\"should return an empty array\", function () {\n+      [...[]::flatten()].should.deep.equal([]);\n+    });\n+\n+    it(\"should flatten a simple array\", function () {\n+      [...[1]::flatten()].should.deep.equal([1]);\n+    });\n+\n+    it(\"should flatten as default 1 level deep\", function () {\n+      [...[[1],[2]]::flatten()].should.deep.equal([1,2]);\n+    });\n+\n+    it(\"should flatten a mix of arrays and values\", function () {\n+      [...[[1,2], [1],3]::flatten()].should.deep.equal([1,2,1,3]);\n+    });\n+\n+    it(\"shouldn't flatten more than 1 level deep\", function () {\n+      [...[[1,2,[3,4]]]::flatten()].should.deep.equal([1,2,[3,4]]);\n+    });\n+\n+    it(\"should flatten string\", function () {\n+      [...[\"hello\"]::flatten()].should.deep.equal([\"h\",\"e\",\"l\",\"l\",\"o\"]);\n+    });\n+\n+    it(\"should flatten array of strings\", function () {\n+      const outcome = [\"h\",\"e\",\"l\",\"l\",\"o\",\"w\",\"o\",\"r\",\"l\",\"d\"];\n+      [...[\"hello\", \"world\"]::flatten()].should.deep.equal(outcome);\n+    });\n+\n+    it(\"should flatten map\", function () {\n+      const map = new Map([[1,\"a\"], [2, \"b\"]]);\n+      [...[map]::flatten()].should.deep.equal([[1,\"a\"],[2,\"b\"]]);\n+    });\n+\n+    it(\"should flatten set\", function () {\n+      const set = new Set([\"a\", [1,2,3]]);\n+      [...[set]::flatten()].should.deep.equal([\"a\", [1,2,3]]);\n+    });\n+\n+    it(\"should flatten a mix of types\", function () {\n+      const elements = [\n+        new Set([\"a\", 1]),\n+        [4,5,6],\n+        new Map([[1,\"a\"], [2, \"b\"]]),\n+        \"cd\"\n+      ];\n+      const outcome = [\"a\", 1,4,5,6, [1,\"a\"],[2,\"b\"], \"c\",\"d\"];\n+      [...elements::flatten()].should.deep.equal(outcome);\n+    });\n+\n+    it(\"should flatten generators\", function () {","path":"test/spec/iterable/flattenSpec.js","position":56,"original_position":56,"commit_id":"9866587ef5c0b0fc88f66b6fdddf7ee107cfb815","original_commit_id":"9866587ef5c0b0fc88f66b6fdddf7ee107cfb815","user":{"login":"jussi-kalliokoski","id":547186,"avatar_url":"https://avatars.githubusercontent.com/u/547186?v=3","gravatar_id":"","url":"https://api.github.com/users/jussi-kalliokoski","html_url":"https://github.com/jussi-kalliokoski","followers_url":"https://api.github.com/users/jussi-kalliokoski/followers","following_url":"https://api.github.com/users/jussi-kalliokoski/following{/other_user}","gists_url":"https://api.github.com/users/jussi-kalliokoski/gists{/gist_id}","starred_url":"https://api.github.com/users/jussi-kalliokoski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jussi-kalliokoski/subscriptions","organizations_url":"https://api.github.com/users/jussi-kalliokoski/orgs","repos_url":"https://api.github.com/users/jussi-kalliokoski/repos","events_url":"https://api.github.com/users/jussi-kalliokoski/events{/privacy}","received_events_url":"https://api.github.com/users/jussi-kalliokoski/received_events","type":"User","site_admin":false},"body":"again, no need to test generators specifically - this is the same thing as flattening `[1, 2, 3]` - also flattening `[1,2,3]` should yield nothing because none of the items is a collection.","created_at":"2015-06-29T06:02:47Z","updated_at":"2015-06-29T06:02:47Z","html_url":"https://github.com/jussi-kalliokoski/trine/pull/28#discussion_r33436120","pull_request_url":"https://api.github.com/repos/jussi-kalliokoski/trine/pulls/28","_links":{"self":{"href":"https://api.github.com/repos/jussi-kalliokoski/trine/pulls/comments/33436120"},"html":{"href":"https://github.com/jussi-kalliokoski/trine/pull/28#discussion_r33436120"},"pull_request":{"href":"https://api.github.com/repos/jussi-kalliokoski/trine/pulls/28"}}},"pull_request":{"url":"https://api.github.com/repos/jussi-kalliokoski/trine/pulls/28","id":37900631,"html_url":"https://github.com/jussi-kalliokoski/trine/pull/28","diff_url":"https://github.com/jussi-kalliokoski/trine/pull/28.diff","patch_url":"https://github.com/jussi-kalliokoski/trine/pull/28.patch","issue_url":"https://api.github.com/repos/jussi-kalliokoski/trine/issues/28","number":28,"state":"open","locked":false,"title":"Feature/iterable flatten","user":{"login":"ivoreis","id":1410207,"avatar_url":"https://avatars.githubusercontent.com/u/1410207?v=3","gravatar_id":"","url":"https://api.github.com/users/ivoreis","html_url":"https://github.com/ivoreis","followers_url":"https://api.github.com/users/ivoreis/followers","following_url":"https://api.github.com/users/ivoreis/following{/other_user}","gists_url":"https://api.github.com/users/ivoreis/gists{/gist_id}","starred_url":"https://api.github.com/users/ivoreis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivoreis/subscriptions","organizations_url":"https://api.github.com/users/ivoreis/orgs","repos_url":"https://api.github.com/users/ivoreis/repos","events_url":"https://api.github.com/users/ivoreis/events{/privacy}","received_events_url":"https://api.github.com/users/ivoreis/received_events","type":"User","site_admin":false},"body":"Proposal for #8 ","created_at":"2015-06-17T13:33:10Z","updated_at":"2015-06-29T06:02:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"412515ada54340a2e2ec9b09f1b00707a5a4968c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jussi-kalliokoski/trine/pulls/28/commits","review_comments_url":"https://api.github.com/repos/jussi-kalliokoski/trine/pulls/28/comments","review_comment_url":"https://api.github.com/repos/jussi-kalliokoski/trine/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jussi-kalliokoski/trine/issues/28/comments","statuses_url":"https://api.github.com/repos/jussi-kalliokoski/trine/statuses/9866587ef5c0b0fc88f66b6fdddf7ee107cfb815","head":{"label":"ivoreis:feature/iterable-flatten","ref":"feature/iterable-flatten","sha":"9866587ef5c0b0fc88f66b6fdddf7ee107cfb815","user":{"login":"ivoreis","id":1410207,"avatar_url":"https://avatars.githubusercontent.com/u/1410207?v=3","gravatar_id":"","url":"https://api.github.com/users/ivoreis","html_url":"https://github.com/ivoreis","followers_url":"https://api.github.com/users/ivoreis/followers","following_url":"https://api.github.com/users/ivoreis/following{/other_user}","gists_url":"https://api.github.com/users/ivoreis/gists{/gist_id}","starred_url":"https://api.github.com/users/ivoreis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivoreis/subscriptions","organizations_url":"https://api.github.com/users/ivoreis/orgs","repos_url":"https://api.github.com/users/ivoreis/repos","events_url":"https://api.github.com/users/ivoreis/events{/privacy}","received_events_url":"https://api.github.com/users/ivoreis/received_events","type":"User","site_admin":false},"repo":{"id":37467167,"name":"trine","full_name":"ivoreis/trine","owner":{"login":"ivoreis","id":1410207,"avatar_url":"https://avatars.githubusercontent.com/u/1410207?v=3","gravatar_id":"","url":"https://api.github.com/users/ivoreis","html_url":"https://github.com/ivoreis","followers_url":"https://api.github.com/users/ivoreis/followers","following_url":"https://api.github.com/users/ivoreis/following{/other_user}","gists_url":"https://api.github.com/users/ivoreis/gists{/gist_id}","starred_url":"https://api.github.com/users/ivoreis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivoreis/subscriptions","organizations_url":"https://api.github.com/users/ivoreis/orgs","repos_url":"https://api.github.com/users/ivoreis/repos","events_url":"https://api.github.com/users/ivoreis/events{/privacy}","received_events_url":"https://api.github.com/users/ivoreis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ivoreis/trine","description":"The library modern JavaScript doesn't deserve, but needs right now.","fork":true,"url":"https://api.github.com/repos/ivoreis/trine","forks_url":"https://api.github.com/repos/ivoreis/trine/forks","keys_url":"https://api.github.com/repos/ivoreis/trine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ivoreis/trine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ivoreis/trine/teams","hooks_url":"https://api.github.com/repos/ivoreis/trine/hooks","issue_events_url":"https://api.github.com/repos/ivoreis/trine/issues/events{/number}","events_url":"https://api.github.com/repos/ivoreis/trine/events","assignees_url":"https://api.github.com/repos/ivoreis/trine/assignees{/user}","branches_url":"https://api.github.com/repos/ivoreis/trine/branches{/branch}","tags_url":"https://api.github.com/repos/ivoreis/trine/tags","blobs_url":"https://api.github.com/repos/ivoreis/trine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ivoreis/trine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ivoreis/trine/git/refs{/sha}","trees_url":"https://api.github.com/repos/ivoreis/trine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ivoreis/trine/statuses/{sha}","languages_url":"https://api.github.com/repos/ivoreis/trine/languages","stargazers_url":"https://api.github.com/repos/ivoreis/trine/stargazers","contributors_url":"https://api.github.com/repos/ivoreis/trine/contributors","subscribers_url":"https://api.github.com/repos/ivoreis/trine/subscribers","subscription_url":"https://api.github.com/repos/ivoreis/trine/subscription","commits_url":"https://api.github.com/repos/ivoreis/trine/commits{/sha}","git_commits_url":"https://api.github.com/repos/ivoreis/trine/git/commits{/sha}","comments_url":"https://api.github.com/repos/ivoreis/trine/comments{/number}","issue_comment_url":"https://api.github.com/repos/ivoreis/trine/issues/comments{/number}","contents_url":"https://api.github.com/repos/ivoreis/trine/contents/{+path}","compare_url":"https://api.github.com/repos/ivoreis/trine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ivoreis/trine/merges","archive_url":"https://api.github.com/repos/ivoreis/trine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ivoreis/trine/downloads","issues_url":"https://api.github.com/repos/ivoreis/trine/issues{/number}","pulls_url":"https://api.github.com/repos/ivoreis/trine/pulls{/number}","milestones_url":"https://api.github.com/repos/ivoreis/trine/milestones{/number}","notifications_url":"https://api.github.com/repos/ivoreis/trine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ivoreis/trine/labels{/name}","releases_url":"https://api.github.com/repos/ivoreis/trine/releases{/id}","created_at":"2015-06-15T13:35:48Z","updated_at":"2015-06-15T13:35:49Z","pushed_at":"2015-06-24T08:18:57Z","git_url":"git://github.com/ivoreis/trine.git","ssh_url":"git@github.com:ivoreis/trine.git","clone_url":"https://github.com/ivoreis/trine.git","svn_url":"https://github.com/ivoreis/trine","homepage":"","size":293,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jussi-kalliokoski:master","ref":"master","sha":"1069f5ba307e32936d073a451955a32de2154560","user":{"login":"jussi-kalliokoski","id":547186,"avatar_url":"https://avatars.githubusercontent.com/u/547186?v=3","gravatar_id":"","url":"https://api.github.com/users/jussi-kalliokoski","html_url":"https://github.com/jussi-kalliokoski","followers_url":"https://api.github.com/users/jussi-kalliokoski/followers","following_url":"https://api.github.com/users/jussi-kalliokoski/following{/other_user}","gists_url":"https://api.github.com/users/jussi-kalliokoski/gists{/gist_id}","starred_url":"https://api.github.com/users/jussi-kalliokoski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jussi-kalliokoski/subscriptions","organizations_url":"https://api.github.com/users/jussi-kalliokoski/orgs","repos_url":"https://api.github.com/users/jussi-kalliokoski/repos","events_url":"https://api.github.com/users/jussi-kalliokoski/events{/privacy}","received_events_url":"https://api.github.com/users/jussi-kalliokoski/received_events","type":"User","site_admin":false},"repo":{"id":37113843,"name":"trine","full_name":"jussi-kalliokoski/trine","owner":{"login":"jussi-kalliokoski","id":547186,"avatar_url":"https://avatars.githubusercontent.com/u/547186?v=3","gravatar_id":"","url":"https://api.github.com/users/jussi-kalliokoski","html_url":"https://github.com/jussi-kalliokoski","followers_url":"https://api.github.com/users/jussi-kalliokoski/followers","following_url":"https://api.github.com/users/jussi-kalliokoski/following{/other_user}","gists_url":"https://api.github.com/users/jussi-kalliokoski/gists{/gist_id}","starred_url":"https://api.github.com/users/jussi-kalliokoski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jussi-kalliokoski/subscriptions","organizations_url":"https://api.github.com/users/jussi-kalliokoski/orgs","repos_url":"https://api.github.com/users/jussi-kalliokoski/repos","events_url":"https://api.github.com/users/jussi-kalliokoski/events{/privacy}","received_events_url":"https://api.github.com/users/jussi-kalliokoski/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jussi-kalliokoski/trine","description":"A utility library for modern JavaScript.","fork":false,"url":"https://api.github.com/repos/jussi-kalliokoski/trine","forks_url":"https://api.github.com/repos/jussi-kalliokoski/trine/forks","keys_url":"https://api.github.com/repos/jussi-kalliokoski/trine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jussi-kalliokoski/trine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jussi-kalliokoski/trine/teams","hooks_url":"https://api.github.com/repos/jussi-kalliokoski/trine/hooks","issue_events_url":"https://api.github.com/repos/jussi-kalliokoski/trine/issues/events{/number}","events_url":"https://api.github.com/repos/jussi-kalliokoski/trine/events","assignees_url":"https://api.github.com/repos/jussi-kalliokoski/trine/assignees{/user}","branches_url":"https://api.github.com/repos/jussi-kalliokoski/trine/branches{/branch}","tags_url":"https://api.github.com/repos/jussi-kalliokoski/trine/tags","blobs_url":"https://api.github.com/repos/jussi-kalliokoski/trine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jussi-kalliokoski/trine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jussi-kalliokoski/trine/git/refs{/sha}","trees_url":"https://api.github.com/repos/jussi-kalliokoski/trine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jussi-kalliokoski/trine/statuses/{sha}","languages_url":"https://api.github.com/repos/jussi-kalliokoski/trine/languages","stargazers_url":"https://api.github.com/repos/jussi-kalliokoski/trine/stargazers","contributors_url":"https://api.github.com/repos/jussi-kalliokoski/trine/contributors","subscribers_url":"https://api.github.com/repos/jussi-kalliokoski/trine/subscribers","subscription_url":"https://api.github.com/repos/jussi-kalliokoski/trine/subscription","commits_url":"https://api.github.com/repos/jussi-kalliokoski/trine/commits{/sha}","git_commits_url":"https://api.github.com/repos/jussi-kalliokoski/trine/git/commits{/sha}","comments_url":"https://api.github.com/repos/jussi-kalliokoski/trine/comments{/number}","issue_comment_url":"https://api.github.com/repos/jussi-kalliokoski/trine/issues/comments{/number}","contents_url":"https://api.github.com/repos/jussi-kalliokoski/trine/contents/{+path}","compare_url":"https://api.github.com/repos/jussi-kalliokoski/trine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jussi-kalliokoski/trine/merges","archive_url":"https://api.github.com/repos/jussi-kalliokoski/trine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jussi-kalliokoski/trine/downloads","issues_url":"https://api.github.com/repos/jussi-kalliokoski/trine/issues{/number}","pulls_url":"https://api.github.com/repos/jussi-kalliokoski/trine/pulls{/number}","milestones_url":"https://api.github.com/repos/jussi-kalliokoski/trine/milestones{/number}","notifications_url":"https://api.github.com/repos/jussi-kalliokoski/trine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jussi-kalliokoski/trine/labels{/name}","releases_url":"https://api.github.com/repos/jussi-kalliokoski/trine/releases{/id}","created_at":"2015-06-09T06:12:51Z","updated_at":"2015-06-29T05:35:16Z","pushed_at":"2015-06-25T19:16:01Z","git_url":"git://github.com/jussi-kalliokoski/trine.git","ssh_url":"git@github.com:jussi-kalliokoski/trine.git","clone_url":"https://github.com/jussi-kalliokoski/trine.git","svn_url":"https://github.com/jussi-kalliokoski/trine","homepage":"","size":825,"stargazers_count":1095,"watchers_count":1095,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":26,"mirror_url":null,"open_issues_count":18,"forks":26,"open_issues":18,"watchers":1095,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jussi-kalliokoski/trine/pulls/28"},"html":{"href":"https://github.com/jussi-kalliokoski/trine/pull/28"},"issue":{"href":"https://api.github.com/repos/jussi-kalliokoski/trine/issues/28"},"comments":{"href":"https://api.github.com/repos/jussi-kalliokoski/trine/issues/28/comments"},"review_comments":{"href":"https://api.github.com/repos/jussi-kalliokoski/trine/pulls/28/comments"},"review_comment":{"href":"https://api.github.com/repos/jussi-kalliokoski/trine/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jussi-kalliokoski/trine/pulls/28/commits"},"statuses":{"href":"https://api.github.com/repos/jussi-kalliokoski/trine/statuses/9866587ef5c0b0fc88f66b6fdddf7ee107cfb815"}}}}