jonschlinkert/is-match

dropped support for array of glob patterns?

Closed this issue · 7 comments

With this https://github.com/jonschlinkert/is-match/blob/master/index.js#L39-L43 you drop support for

var matcher = require('is-match')
var isMatch = matcher(['*-koaip', '!foo-koa'])

isMatch('x-koaip')
//=> false

yeah @doowb and I both noticed the issues afterwards. sorry about that, I'll mark as a bug.

pr would be great, thanks!

And why is that https://github.com/jonschlinkert/is-match/blob/master/index.js#L31?

do you mean why the comparison? e.g. length !== 0? the main mm function returns an array of matches, so this was a quick way of determining if any matches were found. but truthfully it's probably a lazy way to do it. if you want to rethink how the matching is done with anything in this lib, I'd love to see what you come up with.

No, I mean, why you set to use mm when incoming is string, its no sense for me and we should continue using .isMatch when incoming pattern is string.

I think we should use mm when pattern is array, mm.isMatch when it is a string, deepEqual when it is an object. I think that was the idea behind last changes.

I'll come up with some thing later today.

Oooh, I got the idea behind L31. As it is currently var isMatch = matcher(string) isMatch supports array values to match against string pattern. Clear.

Okey I'll PR later today.

mm i forgot about that, i can come to it today or tomorrow.