findFirst should return Object instead of Array
Closed this issue · 7 comments
Flackus commented
var susanin = require('./routes'),
found = susanin.findFirst(req.url);
if (found !== null) {
console.log(Array.isArray(found)); // true
}
kaero commented
It's not an array of routes, it's a pair of the route and object used for matching. I think, what matching object is valuable for the debug purpose only, and find*
methods mustn't returns it.
@ruslankerimov what are you think?
Flackus commented
@ruslankerimov we need your opinion, though we can pull-request ourselves ;)
miripiruni commented
+1
kaero commented
Flackus commented
OK, I'm taking this issue :)
Will do on friday.
ruslankerimov commented
I was wondering if you could do this task.
Flackus commented
After a further discussion we decided that this change would break backward compatibility, plus used object is still necessary.
So this is a won't fix :)