{"action":"opened","issue":{"url":"https://api.github.com/repos/atom/fs-plus/issues/36","repository_url":"https://api.github.com/repos/atom/fs-plus","labels_url":"https://api.github.com/repos/atom/fs-plus/issues/36/labels{/name}","comments_url":"https://api.github.com/repos/atom/fs-plus/issues/36/comments","events_url":"https://api.github.com/repos/atom/fs-plus/issues/36/events","html_url":"https://github.com/atom/fs-plus/issues/36","id":198228470,"number":36,"title":"resolve - loadPaths argument is not properly handled","user":{"login":"Faleij","id":1973894,"avatar_url":"https://avatars.githubusercontent.com/u/1973894?v=3","gravatar_id":"","url":"https://api.github.com/users/Faleij","html_url":"https://github.com/Faleij","followers_url":"https://api.github.com/users/Faleij/followers","following_url":"https://api.github.com/users/Faleij/following{/other_user}","gists_url":"https://api.github.com/users/Faleij/gists{/gist_id}","starred_url":"https://api.github.com/users/Faleij/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Faleij/subscriptions","organizations_url":"https://api.github.com/users/Faleij/orgs","repos_url":"https://api.github.com/users/Faleij/repos","events_url":"https://api.github.com/users/Faleij/events{/privacy}","received_events_url":"https://api.github.com/users/Faleij/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-31T11:14:05Z","updated_at":"2016-12-31T11:14:05Z","closed_at":null,"body":"fs-plus.coffee\r\n```javascript\r\n# loadPaths - An {Array} of absolute and relative paths to search.\r\n\r\n...\r\n\r\nresolve: (args...) ->\r\n    extensions = args.pop() if _.isArray(_.last(args))\r\n    pathToResolve = args.pop()?.toString()\r\n    loadPaths = args\r\n```\r\n\r\nwhen loadPaths is assigned ``args``, ``args`` is an array containing the rest of the parameters - excluding ``extensions`` and ``pathToResolve``. ``args`` will unexpectedly be a nested array (it should not be) and the resolve method will break because of this. As I have seen implementations using a single string as argument, I propose that ``loadPaths`` should be able to be a string or an array;\r\n```javascript\r\nloadPaths = if _.isArray(_.last(args)) args.pop() else args \r\n```"}}
{"actor":{"display_login":"Faleij"}}