{"action":"created","issue":{"url":"https://api.github.com/repos/rvagg/learnyounode/issues/104","labels_url":"https://api.github.com/repos/rvagg/learnyounode/issues/104/labels{/name}","comments_url":"https://api.github.com/repos/rvagg/learnyounode/issues/104/comments","events_url":"https://api.github.com/repos/rvagg/learnyounode/issues/104/events","html_url":"https://github.com/rvagg/learnyounode/issues/104","id":35907183,"number":104,"title":"'Make it modular' check for array length","user":{"login":"hectorlee","id":388006,"avatar_url":"https://avatars.githubusercontent.com/u/388006?v=3","gravatar_id":"","url":"https://api.github.com/users/hectorlee","html_url":"https://github.com/hectorlee","followers_url":"https://api.github.com/users/hectorlee/followers","following_url":"https://api.github.com/users/hectorlee/following{/other_user}","gists_url":"https://api.github.com/users/hectorlee/gists{/gist_id}","starred_url":"https://api.github.com/users/hectorlee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hectorlee/subscriptions","organizations_url":"https://api.github.com/users/hectorlee/orgs","repos_url":"https://api.github.com/users/hectorlee/repos","events_url":"https://api.github.com/users/hectorlee/events{/privacy}","received_events_url":"https://api.github.com/users/hectorlee/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2014-06-17T16:28:26Z","updated_at":"2015-03-22T02:15:51Z","closed_at":"2015-03-22T02:15:51Z","body":"I believe that I've gotten this correct but it still lists as a fail for \"Your additional module file [mymodule.js] did not return an Array with the correct number of elements as the second argument of the callback\"\r\n\r\nprogram.js\r\n```js\r\nvar mymodule = require('./mymodule.js')\r\n\r\nmymodule(process.argv[2], process.argv[3], function(err, files) {\r\n\tif(err) throw err\r\n\tfiles.forEach(function(file){\r\n\t\tconsole.log(file)\r\n\t})\r\n})\r\n```\r\n\r\nmymodule.js\r\n```js\r\nvar fs = require('fs')\r\nvar path = require('path')\r\n\r\nmodule.exports = function(directory, extension, callback) {\r\n\tfs.readdir(directory, function(err, files) {\r\n\t\tif(err)\r\n\t\t\treturn callback(err)\r\n\t\tvar filteredFiles = files.filter(function(filepath) {\r\n\t\t\tif (path.extname(filepath) == '.' + process.argv[3]) return true\r\n\t\t})\r\n\t\tcallback(null, filteredFiles)\r\n\t})\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/rvagg/learnyounode/issues/comments/84494720","html_url":"https://github.com/rvagg/learnyounode/issues/104#issuecomment-84494720","issue_url":"https://api.github.com/repos/rvagg/learnyounode/issues/104","id":84494720,"user":{"login":"Flet","id":360233,"avatar_url":"https://avatars.githubusercontent.com/u/360233?v=3","gravatar_id":"","url":"https://api.github.com/users/Flet","html_url":"https://github.com/Flet","followers_url":"https://api.github.com/users/Flet/followers","following_url":"https://api.github.com/users/Flet/following{/other_user}","gists_url":"https://api.github.com/users/Flet/gists{/gist_id}","starred_url":"https://api.github.com/users/Flet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Flet/subscriptions","organizations_url":"https://api.github.com/users/Flet/orgs","repos_url":"https://api.github.com/users/Flet/repos","events_url":"https://api.github.com/users/Flet/events{/privacy}","received_events_url":"https://api.github.com/users/Flet/received_events","type":"User","site_admin":false},"created_at":"2015-03-22T02:15:51Z","updated_at":"2015-03-22T02:15:51Z","body":"Probably safe to close eh? Reopen if you feel otherwise."}}