{"action":"created","comment":{"url":"https://api.github.com/repos/gemini-testing/glob-extra/pulls/comments/74760979","id":74760979,"diff_hunk":"@@ -0,0 +1,61 @@\n+'use strict';\n+\n+const q = require('q');\n+const qfs = require('q-io/fs');\n+const _ = require('lodash');\n+const glob = require('glob');\n+\n+const getFilesByMask = (mask) => {\n+    return q.nfcall(glob, mask)\n+        .then((paths) => {\n+            return _.isEmpty(paths)\n+                ? q.reject(`Cannot find files by mask ${mask}`)\n+                : paths;\n+        });\n+};\n+\n+const asyncFilter = (items, cb, options) => {\n+    return _(items)\n+        .map((item) => cb(item, options).then((res) => res && item))\n+        .thru(q.all)\n+        .value()\n+        .then(_.compact);\n+};\n+\n+const checkPath = (path, options) => {\n+    return qfs.stat(path)\n+        .then((stat) => {\n+            if (stat.isDirectory()) {\n+                return false;\n+            }\n+\n+            return !_.isEmpty(options.formats)\n+                ? _.includes(options.formats, qfs.extension(path))\n+                : true;\n+        });\n+};\n+\n+const listFiles = (path, options) => {\n+    return qfs.listTree(path)","path":"lib/index.js","position":39,"original_position":39,"commit_id":"92c8f4fb797d8bcd9400dd50c5df7cdf80338455","original_commit_id":"92c8f4fb797d8bcd9400dd50c5df7cdf80338455","user":{"login":"eGavr","id":6376693,"avatar_url":"https://avatars.githubusercontent.com/u/6376693?v=3","gravatar_id":"","url":"https://api.github.com/users/eGavr","html_url":"https://github.com/eGavr","followers_url":"https://api.github.com/users/eGavr/followers","following_url":"https://api.github.com/users/eGavr/following{/other_user}","gists_url":"https://api.github.com/users/eGavr/gists{/gist_id}","starred_url":"https://api.github.com/users/eGavr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eGavr/subscriptions","organizations_url":"https://api.github.com/users/eGavr/orgs","repos_url":"https://api.github.com/users/eGavr/repos","events_url":"https://api.github.com/users/eGavr/events{/privacy}","received_events_url":"https://api.github.com/users/eGavr/received_events","type":"User","site_admin":false},"body":"а `listTree` же возвращает еще и пути к папкам,  а не только к файлам..\r\n\r\nто есть если у нас такая ситуация:\r\n\r\n```\r\ndir1/\r\n   dir2/\r\n       index.js\r\n```\r\n\r\nто\r\n\r\n`qfs.listTree('dir1')`\r\n\r\nвернет что-то такое:\r\n\r\n```\r\n[\r\n   'dir1/dir2/',\r\n   'dir1/dir2/index.js\r\n]\r\n```\r\n\r\nпроверь так ли это.\r\n\r\nесли это так, то, кажется, что папки надо выфильтровывать","created_at":"2016-08-15T13:29:33Z","updated_at":"2016-08-15T13:29:33Z","html_url":"https://github.com/gemini-testing/glob-extra/pull/1#discussion_r74760979","pull_request_url":"https://api.github.com/repos/gemini-testing/glob-extra/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/gemini-testing/glob-extra/pulls/comments/74760979"},"html":{"href":"https://github.com/gemini-testing/glob-extra/pull/1#discussion_r74760979"},"pull_request":{"href":"https://api.github.com/repos/gemini-testing/glob-extra/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/gemini-testing/glob-extra/pulls/1","id":81101483,"html_url":"https://github.com/gemini-testing/glob-extra/pull/1","diff_url":"https://github.com/gemini-testing/glob-extra/pull/1.diff","patch_url":"https://github.com/gemini-testing/glob-extra/pull/1.patch","issue_url":"https://api.github.com/repos/gemini-testing/glob-extra/issues/1","number":1,"state":"open","locked":false,"title":"Glob-extra","user":{"login":"rostik404","id":8089139,"avatar_url":"https://avatars.githubusercontent.com/u/8089139?v=3","gravatar_id":"","url":"https://api.github.com/users/rostik404","html_url":"https://github.com/rostik404","followers_url":"https://api.github.com/users/rostik404/followers","following_url":"https://api.github.com/users/rostik404/following{/other_user}","gists_url":"https://api.github.com/users/rostik404/gists{/gist_id}","starred_url":"https://api.github.com/users/rostik404/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rostik404/subscriptions","organizations_url":"https://api.github.com/users/rostik404/orgs","repos_url":"https://api.github.com/users/rostik404/repos","events_url":"https://api.github.com/users/rostik404/events{/privacy}","received_events_url":"https://api.github.com/users/rostik404/received_events","type":"User","site_admin":false},"body":"@j0tunn, @eGavr, @DudaGod","created_at":"2016-08-12T10:56:07Z","updated_at":"2016-08-15T13:29:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"01752a31e5ab45e47f659bc30f4dd7d3f632f3ea","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/gemini-testing/glob-extra/pulls/1/commits","review_comments_url":"https://api.github.com/repos/gemini-testing/glob-extra/pulls/1/comments","review_comment_url":"https://api.github.com/repos/gemini-testing/glob-extra/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gemini-testing/glob-extra/issues/1/comments","statuses_url":"https://api.github.com/repos/gemini-testing/glob-extra/statuses/92c8f4fb797d8bcd9400dd50c5df7cdf80338455","head":{"label":"gemini-testing:initial-branch","ref":"initial-branch","sha":"92c8f4fb797d8bcd9400dd50c5df7cdf80338455","user":{"login":"gemini-testing","id":11424134,"avatar_url":"https://avatars.githubusercontent.com/u/11424134?v=3","gravatar_id":"","url":"https://api.github.com/users/gemini-testing","html_url":"https://github.com/gemini-testing","followers_url":"https://api.github.com/users/gemini-testing/followers","following_url":"https://api.github.com/users/gemini-testing/following{/other_user}","gists_url":"https://api.github.com/users/gemini-testing/gists{/gist_id}","starred_url":"https://api.github.com/users/gemini-testing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gemini-testing/subscriptions","organizations_url":"https://api.github.com/users/gemini-testing/orgs","repos_url":"https://api.github.com/users/gemini-testing/repos","events_url":"https://api.github.com/users/gemini-testing/events{/privacy}","received_events_url":"https://api.github.com/users/gemini-testing/received_events","type":"Organization","site_admin":false},"repo":{"id":65537889,"name":"glob-extra","full_name":"gemini-testing/glob-extra","owner":{"login":"gemini-testing","id":11424134,"avatar_url":"https://avatars.githubusercontent.com/u/11424134?v=3","gravatar_id":"","url":"https://api.github.com/users/gemini-testing","html_url":"https://github.com/gemini-testing","followers_url":"https://api.github.com/users/gemini-testing/followers","following_url":"https://api.github.com/users/gemini-testing/following{/other_user}","gists_url":"https://api.github.com/users/gemini-testing/gists{/gist_id}","starred_url":"https://api.github.com/users/gemini-testing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gemini-testing/subscriptions","organizations_url":"https://api.github.com/users/gemini-testing/orgs","repos_url":"https://api.github.com/users/gemini-testing/repos","events_url":"https://api.github.com/users/gemini-testing/events{/privacy}","received_events_url":"https://api.github.com/users/gemini-testing/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gemini-testing/glob-extra","description":null,"fork":false,"url":"https://api.github.com/repos/gemini-testing/glob-extra","forks_url":"https://api.github.com/repos/gemini-testing/glob-extra/forks","keys_url":"https://api.github.com/repos/gemini-testing/glob-extra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gemini-testing/glob-extra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gemini-testing/glob-extra/teams","hooks_url":"https://api.github.com/repos/gemini-testing/glob-extra/hooks","issue_events_url":"https://api.github.com/repos/gemini-testing/glob-extra/issues/events{/number}","events_url":"https://api.github.com/repos/gemini-testing/glob-extra/events","assignees_url":"https://api.github.com/repos/gemini-testing/glob-extra/assignees{/user}","branches_url":"https://api.github.com/repos/gemini-testing/glob-extra/branches{/branch}","tags_url":"https://api.github.com/repos/gemini-testing/glob-extra/tags","blobs_url":"https://api.github.com/repos/gemini-testing/glob-extra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gemini-testing/glob-extra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gemini-testing/glob-extra/git/refs{/sha}","trees_url":"https://api.github.com/repos/gemini-testing/glob-extra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gemini-testing/glob-extra/statuses/{sha}","languages_url":"https://api.github.com/repos/gemini-testing/glob-extra/languages","stargazers_url":"https://api.github.com/repos/gemini-testing/glob-extra/stargazers","contributors_url":"https://api.github.com/repos/gemini-testing/glob-extra/contributors","subscribers_url":"https://api.github.com/repos/gemini-testing/glob-extra/subscribers","subscription_url":"https://api.github.com/repos/gemini-testing/glob-extra/subscription","commits_url":"https://api.github.com/repos/gemini-testing/glob-extra/commits{/sha}","git_commits_url":"https://api.github.com/repos/gemini-testing/glob-extra/git/commits{/sha}","comments_url":"https://api.github.com/repos/gemini-testing/glob-extra/comments{/number}","issue_comment_url":"https://api.github.com/repos/gemini-testing/glob-extra/issues/comments{/number}","contents_url":"https://api.github.com/repos/gemini-testing/glob-extra/contents/{+path}","compare_url":"https://api.github.com/repos/gemini-testing/glob-extra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gemini-testing/glob-extra/merges","archive_url":"https://api.github.com/repos/gemini-testing/glob-extra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gemini-testing/glob-extra/downloads","issues_url":"https://api.github.com/repos/gemini-testing/glob-extra/issues{/number}","pulls_url":"https://api.github.com/repos/gemini-testing/glob-extra/pulls{/number}","milestones_url":"https://api.github.com/repos/gemini-testing/glob-extra/milestones{/number}","notifications_url":"https://api.github.com/repos/gemini-testing/glob-extra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gemini-testing/glob-extra/labels{/name}","releases_url":"https://api.github.com/repos/gemini-testing/glob-extra/releases{/id}","deployments_url":"https://api.github.com/repos/gemini-testing/glob-extra/deployments","created_at":"2016-08-12T08:41:01Z","updated_at":"2016-08-15T11:24:24Z","pushed_at":"2016-08-15T11:32:23Z","git_url":"git://github.com/gemini-testing/glob-extra.git","ssh_url":"git@github.com:gemini-testing/glob-extra.git","clone_url":"https://github.com/gemini-testing/glob-extra.git","svn_url":"https://github.com/gemini-testing/glob-extra","homepage":null,"size":7,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"gemini-testing:master","ref":"master","sha":"24612276a5eca12dbc26bb1a27330bdd1884e4e2","user":{"login":"gemini-testing","id":11424134,"avatar_url":"https://avatars.githubusercontent.com/u/11424134?v=3","gravatar_id":"","url":"https://api.github.com/users/gemini-testing","html_url":"https://github.com/gemini-testing","followers_url":"https://api.github.com/users/gemini-testing/followers","following_url":"https://api.github.com/users/gemini-testing/following{/other_user}","gists_url":"https://api.github.com/users/gemini-testing/gists{/gist_id}","starred_url":"https://api.github.com/users/gemini-testing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gemini-testing/subscriptions","organizations_url":"https://api.github.com/users/gemini-testing/orgs","repos_url":"https://api.github.com/users/gemini-testing/repos","events_url":"https://api.github.com/users/gemini-testing/events{/privacy}","received_events_url":"https://api.github.com/users/gemini-testing/received_events","type":"Organization","site_admin":false},"repo":{"id":65537889,"name":"glob-extra","full_name":"gemini-testing/glob-extra","owner":{"login":"gemini-testing","id":11424134,"avatar_url":"https://avatars.githubusercontent.com/u/11424134?v=3","gravatar_id":"","url":"https://api.github.com/users/gemini-testing","html_url":"https://github.com/gemini-testing","followers_url":"https://api.github.com/users/gemini-testing/followers","following_url":"https://api.github.com/users/gemini-testing/following{/other_user}","gists_url":"https://api.github.com/users/gemini-testing/gists{/gist_id}","starred_url":"https://api.github.com/users/gemini-testing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gemini-testing/subscriptions","organizations_url":"https://api.github.com/users/gemini-testing/orgs","repos_url":"https://api.github.com/users/gemini-testing/repos","events_url":"https://api.github.com/users/gemini-testing/events{/privacy}","received_events_url":"https://api.github.com/users/gemini-testing/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gemini-testing/glob-extra","description":null,"fork":false,"url":"https://api.github.com/repos/gemini-testing/glob-extra","forks_url":"https://api.github.com/repos/gemini-testing/glob-extra/forks","keys_url":"https://api.github.com/repos/gemini-testing/glob-extra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gemini-testing/glob-extra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gemini-testing/glob-extra/teams","hooks_url":"https://api.github.com/repos/gemini-testing/glob-extra/hooks","issue_events_url":"https://api.github.com/repos/gemini-testing/glob-extra/issues/events{/number}","events_url":"https://api.github.com/repos/gemini-testing/glob-extra/events","assignees_url":"https://api.github.com/repos/gemini-testing/glob-extra/assignees{/user}","branches_url":"https://api.github.com/repos/gemini-testing/glob-extra/branches{/branch}","tags_url":"https://api.github.com/repos/gemini-testing/glob-extra/tags","blobs_url":"https://api.github.com/repos/gemini-testing/glob-extra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gemini-testing/glob-extra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gemini-testing/glob-extra/git/refs{/sha}","trees_url":"https://api.github.com/repos/gemini-testing/glob-extra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gemini-testing/glob-extra/statuses/{sha}","languages_url":"https://api.github.com/repos/gemini-testing/glob-extra/languages","stargazers_url":"https://api.github.com/repos/gemini-testing/glob-extra/stargazers","contributors_url":"https://api.github.com/repos/gemini-testing/glob-extra/contributors","subscribers_url":"https://api.github.com/repos/gemini-testing/glob-extra/subscribers","subscription_url":"https://api.github.com/repos/gemini-testing/glob-extra/subscription","commits_url":"https://api.github.com/repos/gemini-testing/glob-extra/commits{/sha}","git_commits_url":"https://api.github.com/repos/gemini-testing/glob-extra/git/commits{/sha}","comments_url":"https://api.github.com/repos/gemini-testing/glob-extra/comments{/number}","issue_comment_url":"https://api.github.com/repos/gemini-testing/glob-extra/issues/comments{/number}","contents_url":"https://api.github.com/repos/gemini-testing/glob-extra/contents/{+path}","compare_url":"https://api.github.com/repos/gemini-testing/glob-extra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gemini-testing/glob-extra/merges","archive_url":"https://api.github.com/repos/gemini-testing/glob-extra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gemini-testing/glob-extra/downloads","issues_url":"https://api.github.com/repos/gemini-testing/glob-extra/issues{/number}","pulls_url":"https://api.github.com/repos/gemini-testing/glob-extra/pulls{/number}","milestones_url":"https://api.github.com/repos/gemini-testing/glob-extra/milestones{/number}","notifications_url":"https://api.github.com/repos/gemini-testing/glob-extra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gemini-testing/glob-extra/labels{/name}","releases_url":"https://api.github.com/repos/gemini-testing/glob-extra/releases{/id}","deployments_url":"https://api.github.com/repos/gemini-testing/glob-extra/deployments","created_at":"2016-08-12T08:41:01Z","updated_at":"2016-08-15T11:24:24Z","pushed_at":"2016-08-15T11:32:23Z","git_url":"git://github.com/gemini-testing/glob-extra.git","ssh_url":"git@github.com:gemini-testing/glob-extra.git","clone_url":"https://github.com/gemini-testing/glob-extra.git","svn_url":"https://github.com/gemini-testing/glob-extra","homepage":null,"size":7,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gemini-testing/glob-extra/pulls/1"},"html":{"href":"https://github.com/gemini-testing/glob-extra/pull/1"},"issue":{"href":"https://api.github.com/repos/gemini-testing/glob-extra/issues/1"},"comments":{"href":"https://api.github.com/repos/gemini-testing/glob-extra/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/gemini-testing/glob-extra/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/gemini-testing/glob-extra/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gemini-testing/glob-extra/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/gemini-testing/glob-extra/statuses/92c8f4fb797d8bcd9400dd50c5df7cdf80338455"}}}}
{"actor":{"display_login":"eGavr"}}