This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/uri.js b/lib/uri.js | |
index 45187e0..e44dd40 100644 | |
--- a/lib/uri.js | |
+++ b/lib/uri.js | |
@@ -96,20 +96,7 @@ function uri_parse (url) { | |
} | |
/* normalize */ | |
- var directories = []; | |
- for (var i = 0; i < items.directories.length; i++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---- PARSE TESTS ---- | |
uri fail http://example.com?foo=@bar#frag | |
expected: | |
{"href":"http://example.com?foo=@bar#frag","protocol":"http:","host":"example.com","hostname":"example.com","hash":"#frag","search":"?foo=@bar","query":"foo=@bar"} | |
actual: | |
{"href":"http://example.com?foo=@bar#frag","protocol":"http:","host":"example.com?foo=@bar","hostname":"bar","hash":"#frag","query":""} | |
---- RESOLVE TESTS ---- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// url-rfc module | |
// Just like node's url module, but using the same names used in various UR[LI] RFCs | |
var url = require("url"), | |
path = require("path"); | |
exports.parse = function (str) { | |
var parsed = url.parse(str); | |
var out = {}; | |
if (parsed.protocol) out.scheme = parsed.protocol.substr(-1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var url = require("url"), | |
path = require("path"); | |
exports.parse = function (str) { | |
var parsed = url.parse(str); | |
return { | |
get scheme : function () { return parsed.protocol ? parsed.protocol.substr(-1) : undefined }, | |
get authorityRoot : function () { return parsed.slashes ? "//" : undefined }, | |
get authority : function () { return parsed.host }, | |
get userInfo : function () { return parsed.auth }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var posix = require("posix"), | |
print = require("sys").puts, | |
successes = {}, | |
// number of files to inspect on each pass | |
N = 10, | |
// degree of concurrency | |
C = 5, | |
// print lots of stuff, or just a little? | |
verbose = true, | |
// use a timeout, or call synchronously |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chain | |
(addCustomHeaders) | |
(errorHandler) | |
(deflate) | |
(route | |
("/foo", chain(fooApp)()) // the () ends the chain | |
(/^\/blog\/(.*)/, chain(funkyBlogApp)()) // the () ends the chain | |
(/^\/static\//, chain | |
(farFutureExpiresHeader) | |
(route |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ node bench.js | |
Scores: (bigger is better) | |
with(){} | |
0.4821178821178821 | |
0.48431568431568434 | |
0.4651487916916317 | |
0.4757242757242757 | |
Average (mean) 0.47682665846236844 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/(B)--------------- | |
--(A)--* /(D)--| \ | |
\(C)---* --(G)--(H) | |
\(E)--(F)--/ | |
chain | |
(A) | |
(route | |
("/B", B) // single link, then fallthrough, don't need a chain | |
("/C", chain |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chain | |
(myApp) | |
(route | |
(function (req) { | |
return req.header("accept").indexOf("application/json") !== -1 | |
}, chain(renderAsJSON)())) // terminal, and end route | |
(render) | |
(as) | |
(template) | |
().listen(8000); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Statistical profiling result from v8.log, (30169 ticks, 1042 unaccounted, 0 excluded). | |
[Unknown]: | |
ticks total nonlib name | |
1042 3.5% | |
[Shared libraries]: | |
ticks total nonlib name | |
[JavaScript]: |