I want to add some custom javascript functions to my design document, I can't find any examples of how to actually add these functions to the "lib" section of a design document. Can someone show me an example of how to add a function definition to the "lib" section?
Follow up:
I started using couchapp to manage my design documents and it has a really nice macro facility for injecting javascript into map and reduce functions before sending them to the server.