lukeed / taskr

A fast, concurrency-focused task automation tool.
MIT License
2.53k stars 74 forks source link

Fixed issue `undefined` not found in Flyfile #190

Closed hzlmn closed 8 years ago

hzlmn commented 8 years ago

Problem with isPlainObject method that was set to negative. Also made a bit "safe" type checking as Object.prototype.toString could be easy rewritten

fly

hzlmn commented 8 years ago

Seems like lots of features depend on that kind of typo, that's why test fails For example


Fly.prototype.source = function () {
    var globs = flatten([].slice.call(arguments))
    var options = globs.pop()

    // if options is not object push back
    if (isPlainObject(options)) { // this not really object checking, what it's actually
// expect is an opposite value
        globs.push(options)
        options = {}
    }

    var files = globs.map(function (glob) {
        return expand(glob, options)
    })

    assign(this, {
        _: {
            filters: [],
            globs: globs,
            files: Promise.all(files)
        }
    })

    this._.cat = undefined
    _('source %o', this._.globs)
    return this
}

And so on. Im going to look on this tomorrow

lukeed commented 8 years ago

@hzlmn I just got home. I'm taking a look now :)

Btw, tests are failing because of linter rules.

lukeed commented 8 years ago

@hzlmn I've got a handle on it. I'll accept the PR right now to get you in here, but changes to come.

Thanks!