Pattern docs need a tweak
ChetHarrison opened this issue · 4 comments
ChetHarrison commented
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
sindresorhus commented
Nope:
load-grunt-tasks/load-grunt-tasks.js
Line 11 in 1aa6404
stephenplusplus commented
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 :)
ChetHarrison commented
It looks like the I don't have the latest version the previous one wasn't filtering files.
ChetHarrison commented
FYI, it came with the backbone Yeoman generator. I'll get the latest.