diff --git a/README.markdown b/README.markdown index 1a0d4a9..ec1932a 100644 --- a/README.markdown +++ b/README.markdown @@ -126,5 +126,5 @@ Hash supports map(), filter(), and reduce(). In the first style, you can chain together operations before the ".end". Each callback is executed like this: f.call(hash, value, key) -See also "creationix's pattern/hash":http://github.com/creationix/pattern, which -does a similar thing except with hash inputs and array outputs. +See also [creationix's pattern/hash](http://github.com/creationix/pattern), +which does a similar thing except with hash inputs and array outputs. diff --git a/lib/web.js b/lib/web.js index 0237860..9543a40 100644 --- a/lib/web.js +++ b/lib/web.js @@ -2,10 +2,14 @@ var fs = require('fs'); // return a special webified version of traverse exports.source = function () { - return fs.readFileSync(__dirname + '/traverse.js') + [ 'traverse.js', 'hash.js' ].map(scrub).join('\n'); +}; + +function scrub (filename) { + return fs.readFileSync(__dirname + '/' + filename) .toString() .replace(/^module\..*/mg, '') .replace(/^var \S+\s*=\s*require\(.*\);/mg, '') ; -}; +}