Skip to content

Commit

Permalink
fix iojs 1.6.0 issue
Browse files Browse the repository at this point in the history
  • Loading branch information
feross committed Mar 20, 2015
1 parent 6d4fd75 commit 2a0500d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ function parseInput (input, opts, cb) {
}
if (!opts) opts = {}

if (Array.isArray(input) && input.length === 0) throw new Error('invalid input type')

if (isFileList(input)) input = Array.prototype.slice.call(input)
if (!Array.isArray(input)) input = [ input ]

if (input.length === 0) throw new Error('invalid input type')
if (!opts.name) opts.name = input[0] && input[0].name
if (!opts.name) opts.name = typeof input[0] === 'string' && corePath.basename(input[0])

if (!opts.name) {
opts.name = input[0].name || (typeof input[0] === 'string' && corePath.basename(input))
}
if (opts.name === undefined) {
throw new Error('missing option \'name\' and unable to infer it from input[0].name')
}
Expand Down

0 comments on commit 2a0500d

Please sign in to comment.