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 encode = { | |
| 1: function(str){ | |
| return str | |
| .split("") | |
| .filter(function(s){ | |
| return !{D:1, R:1, O:1, P:1, B:1, X:1}[s]; | |
| }).join(""); | |
| }, | |
| 2: function(str){ | |
| return str.split("").map(function(s){ |
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 newQS = require("./new.js"), | |
| oldQS = require("./old.js"), | |
| bench = require("bench"); | |
| //taken from https://github.com/joyent/node/blob/master/test/simple/test-querystring.js | |
| var tests = ["foo=918854443121279438895193", "foo=bar", "foo=bar&foo=quux", "foo=1&bar=2", "my+weird+field=q1%212%22%27w%245%267%2Fz8%29%3F", "foo%3Dbaz=bar", "foo=baz=bar", "str=foo&arr=1&arr=2&arr=3&somenull=&undef=", " foo = bar ", "foo=%zx", "foo=%EF%BF%BD", "hasOwnProperty=x&toString=foo&valueOf=bar&__defineGetter__=baz", "foo&bar=baz"]; | |
| exports.compare = { | |
| "parse from new qs": function(){ | |
| return tests.map(newQS.parse); |
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
| /* | |
| Tags that have a special meaning in HTML | |
| Every tag can have the following properties: | |
| * parent: A list of all possible parent nodes. If none is present, the tag is wrapped in the first one. | |
| * prev: A list of tags that need to preceed the tag. If they don't exist, they are created. | |
| * past: A list of tags that needs to follow the tag. | |
| * close: A list of elements that are closed when the tag appears. Only walks until it finds the next required parent. | |
| * children: The possible child nodes. Can be a list, false or "text". | |
| * If a list, it's a list of elements that need to be included in the tag. If they don't exist, they are created. |
OlderNewer