nodules/susanin

findFirst should return Object instead of Array

Closed this issue · 7 comments

var susanin = require('./routes'),
    found = susanin.findFirst(req.url);

if (found !== null) {
    console.log(Array.isArray(found)); // true
}

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?

@ruslankerimov we need your opinion, though we can pull-request ourselves ;)

OK, I'm taking this issue :)
Will do on friday.

I was wondering if you could do this task.

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 :)