sindresorhus/load-grunt-tasks

Pattern docs need a tweak

ChetHarrison opened this issue · 4 comments

in you docs you are passing an object literal. Your code is expecting an array so rather than

require('load-grunt-tasks')(grunt, {pattern: ['grunt-contrib-*', '!grunt-contrib-coffee']});

I believe it should be

require('load-grunt-tasks')(grunt, ['grunt-contrib-*', '!grunt-contrib-coffee']);

Otherwise it tries to call map() on the object

Nope:

options = options || {};

Hmm, looking at the code, I see:

https://github.com/sindresorhus/load-grunt-tasks/blob/master/load-grunt-tasks.js#L13

function arrayify(el) {
    return Array.isArray(el) ? el : [el];
}
// ...
var pattern = arrayify(options.pattern || ['grunt-*']);

I also don't see map used anywhere. Perhaps you're looking at an older version, like this one? I'm sure the readme 8 months ago had an appropriate example :)

It looks like the I don't have the latest version the previous one wasn't filtering files.

FYI, it came with the backbone Yeoman generator. I'll get the latest.