I don't understand your detection method. What `/` has to do here ?
Even if it's not perfect, you could consider an item as file if:

* It's a one liner
* It ends by `.js` (not sure)
* It doesn't end by `;`

Ping help @dpobel