andreyvit/apitree.js — pull request #1 by madscoaducom (2012-07-17 17:25:56+00:00)
Title: Extend default filter to allow any registered extension to be loaded

Hi.

I am using the nice SocketStream framework in combination with a coffee-script derivative called [LiveScript](http://gkz.github.com/LiveScript/). I would very much like to work directly with LiveScript files on the server side and as SocketStream uses apitree to load and build the sever side api, it would be great if you could update apitree.js to allow loading of modules with any registered module extension (in require.extensions).

I originally opened a pull request towards SocketStream [#254](https://github.com/socketstream/socketstream/pull/254) to have it use the apitree filter option, but have since realized that the change belongs in apitree, allowing others users of apitree to benefit from this, while at the same time simplifying the impact on SocketStream.

I have put together this pull request which implements the feature. It includes the change to the default filter, updated spec tests and updates to doc to reflect the change. I have run the tests on node.js v0.8.2 and v0.6.19. I tried running the tests on v0.4.12 but I couldn't get the installed mocha to behave. I have done some manual testing on node 0.4 to check that the code should work there.

I hope you will accept this request and publish a new version of apitree.js, Fell free to ask for changes or more tests.

Kind regards
Mads