diff options
author | isaacs <i@izs.me> | 2011-01-26 01:17:11 +0300 |
---|---|---|
committer | isaacs <i@izs.me> | 2011-01-26 01:22:04 +0300 |
commit | dcf3f575d9c7c51127c9581d16d9d72614398ba4 (patch) | |
tree | f157b9f2dd6fc9ead77c4c65ef121ba248d734e0 | |
parent | a6b38505e813a7c330039c02b27a840d08bb9c7b (diff) |
Bundled url and querystring, just in case.
43 files changed, 3484 insertions, 7 deletions
diff --git a/lib/bundle.js b/lib/bundle.js index 106c6a601..45d3d3c5e 100644 --- a/lib/bundle.js +++ b/lib/bundle.js @@ -10,7 +10,7 @@ var npm = require("../npm") , fs = require("./utils/graceful-fs") , conf = require("./utils/ini").configList , rm = require("./utils/rm-rf") - , url = require("url") + , url = require("../node_modules/url") , notAllowed = [ "adduser", "build", "bundle", "config", "init", "link" , "owner", "publish", "restart", "start", "stop", "tag" , "unpublish", "update-dependents", "view", "bn" ] diff --git a/lib/install.js b/lib/install.js index d82ee1f36..c6275735d 100644 --- a/lib/install.js +++ b/lib/install.js @@ -33,7 +33,7 @@ var registry = require("./utils/registry") , readInstalled = require("./utils/read-installed") , installedPackages , semver = require("./utils/semver") - , url = require("url") + , url = require("../node_modules/url") , fetch = require("./utils/fetch") , readJson = require("./utils/read-json") , log = require("./utils/log") diff --git a/lib/link.js b/lib/link.js index 7c8f4aa21..4dcd56d96 100644 --- a/lib/link.js +++ b/lib/link.js @@ -12,7 +12,7 @@ var npm = require("../npm") , readInstalled = require("./utils/read-installed") , semver = require("./utils/semver") , symlink = require("./utils/link") - , url = require("url") + , url = require("../node_modules/url") try { crypto = process.binding("crypto") && require("crypto") diff --git a/lib/utils/fetch.js b/lib/utils/fetch.js index 900ec20f3..25ffa9bf2 100644 --- a/lib/utils/fetch.js +++ b/lib/utils/fetch.js @@ -3,7 +3,7 @@ **/ var http = require("http") - , url = require("url") + , url = require("../../node_modules/url") , sys = require("./sys") , fs = require("./graceful-fs") , get = require("./get") diff --git a/lib/utils/parse-args.js b/lib/utils/parse-args.js index fbd9914b7..e536a0ace 100644 --- a/lib/utils/parse-args.js +++ b/lib/utils/parse-args.js @@ -1,6 +1,6 @@ // info about each config option. -var url = require("url") +var url = require("../../node_modules/url") , path = require("path") , Stream , abbrev = require("./abbrev") diff --git a/lib/utils/registry/publish.js b/lib/utils/registry/publish.js index c7d2b6312..104611a80 100644 --- a/lib/utils/registry/publish.js +++ b/lib/utils/registry/publish.js @@ -11,7 +11,7 @@ var request = require("./request") , log = require("../log") , path = require("path") , npm = require("../../../npm") - , url = require("url") + , url = require("../../../node_modules/url") function publish (data, cb) { // add the dist-url to the data, pointing at the tarball. diff --git a/lib/utils/registry/request.js b/lib/utils/registry/request.js index a72fad775..3575eea12 100644 --- a/lib/utils/registry/request.js +++ b/lib/utils/registry/request.js @@ -7,7 +7,7 @@ request.upload = upload var npm = require("../../../npm") , http = require("http") - , url = require("url") + , url = require("../../../node_modules/url") , log = require("../log") , ini = require("../ini") , Buffer = require("buffer").Buffer diff --git a/node_modules/.npm/.cache/querystring/1.0.0/package.json b/node_modules/.npm/.cache/querystring/1.0.0/package.json new file mode 100644 index 000000000..231b7dd2b --- /dev/null +++ b/node_modules/.npm/.cache/querystring/1.0.0/package.json @@ -0,0 +1,40 @@ +{ + "name": "querystring", + "version": "1.0.0", + "description": "The querystring module from nodejs", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": { + "type": "MIT", + "url": "https://github.com/isaacs/node-querystring/raw/master/LICENSE" + }, + "main": "querystring", + "repositories": [ + { + "type": "git", + "url": "https://github.com/isaacs/node-querystring.git" + } + ], + "scripts": { + "test": "node test-querystring.js" + }, + "_id": "querystring@1.0.0", + "engines": { + "node": "*" + }, + "_engineSupported": true, + "_npmVersion": "0.2.16", + "_nodeVersion": "v0.3.7-pre", + "directories": {}, + "files": [ + "" + ], + "_defaultsLoaded": true, + "dist": { + "shasum": "12c5704c2758b32171a3636d8f732d7cd81906a2", + "tarball": "http://registry.npmjs.org/querystring/-/querystring-1.0.0.tgz" + } +}
\ No newline at end of file diff --git a/node_modules/.npm/.cache/querystring/1.0.0/package.tgz b/node_modules/.npm/.cache/querystring/1.0.0/package.tgz Binary files differnew file mode 100644 index 000000000..37e1b8751 --- /dev/null +++ b/node_modules/.npm/.cache/querystring/1.0.0/package.tgz diff --git a/node_modules/.npm/.cache/querystring/1.0.0/package/LICENSE b/node_modules/.npm/.cache/querystring/1.0.0/package/LICENSE new file mode 100644 index 000000000..253ebccc8 --- /dev/null +++ b/node_modules/.npm/.cache/querystring/1.0.0/package/LICENSE @@ -0,0 +1,18 @@ +Copyright 2009, 2010 Joyent, Inc. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. diff --git a/node_modules/.npm/.cache/querystring/1.0.0/package/README.md b/node_modules/.npm/.cache/querystring/1.0.0/package/README.md new file mode 100644 index 000000000..edb6d64c1 --- /dev/null +++ b/node_modules/.npm/.cache/querystring/1.0.0/package/README.md @@ -0,0 +1,40 @@ +## Query String + +This module provides utilities for dealing with query strings. +It provides the following methods: + +### querystring.stringify(obj, sep='&', eq='=') + +Serialize an object to a query string. +Optionally override the default separator and assignment characters. + +Example: + + querystring.stringify({foo: 'bar'}) + // returns + 'foo=bar' + + querystring.stringify({foo: 'bar', baz: 'bob'}, ';', ':') + // returns + 'foo:bar;baz:bob' + +### querystring.parse(str, sep='&', eq='=') + +Deserialize a query string to an object. +Optionally override the default separator and assignment characters. + +Example: + + querystring.parse('a=b&b=c') + // returns + { a: 'b', b: 'c' } + +### querystring.escape + +The escape function used by `querystring.stringify`, +provided so that it could be overridden if necessary. + +### querystring.unescape + +The unescape function used by `querystring.parse`, +provided so that it could be overridden if necessary. diff --git a/node_modules/.npm/.cache/querystring/1.0.0/package/package.json b/node_modules/.npm/.cache/querystring/1.0.0/package/package.json new file mode 100644 index 000000000..38b1001bf --- /dev/null +++ b/node_modules/.npm/.cache/querystring/1.0.0/package/package.json @@ -0,0 +1,10 @@ +{"name":"querystring" +,"version":"1.0.0" +,"description":"The querystring module from nodejs" +,"author":"Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)" +,"license":{"type":"MIT" + ,"url":"https://github.com/isaacs/node-querystring/raw/master/LICENSE"} +,"main":"querystring.js" +,"repositories":[{"type":"git" + ,"url":"https://github.com/isaacs/node-querystring.git"}] +,"scripts":{"test":"node test-querystring.js"}} diff --git a/node_modules/.npm/.cache/querystring/1.0.0/package/querystring.js b/node_modules/.npm/.cache/querystring/1.0.0/package/querystring.js new file mode 100644 index 000000000..87c4391a5 --- /dev/null +++ b/node_modules/.npm/.cache/querystring/1.0.0/package/querystring.js @@ -0,0 +1,158 @@ +// Query String Utilities + +var QueryString = exports; +var urlDecode = process.binding('http_parser').urlDecode; + + +function charCode(c) { + return c.charCodeAt(0); +} + + +// a safe fast alternative to decodeURIComponent +QueryString.unescapeBuffer = function(s, decodeSpaces) { + var out = new Buffer(s.length); + var state = 'CHAR'; // states: CHAR, HEX0, HEX1 + var n, m, hexchar; + + for (var inIndex = 0, outIndex = 0; inIndex <= s.length; inIndex++) { + var c = s.charCodeAt(inIndex); + switch (state) { + case 'CHAR': + switch (c) { + case charCode('%'): + n = 0; + m = 0; + state = 'HEX0'; + break; + case charCode('+'): + if (decodeSpaces) c = charCode(' '); + // pass thru + default: + out[outIndex++] = c; + break; + } + break; + + case 'HEX0': + state = 'HEX1'; + hexchar = c; + if (charCode('0') <= c && c <= charCode('9')) { + n = c - charCode('0'); + } else if (charCode('a') <= c && c <= charCode('f')) { + n = c - charCode('a') + 10; + } else if (charCode('A') <= c && c <= charCode('F')) { + n = c - charCode('A') + 10; + } else { + out[outIndex++] = charCode('%'); + out[outIndex++] = c; + state = 'CHAR'; + break; + } + break; + + case 'HEX1': + state = 'CHAR'; + if (charCode('0') <= c && c <= charCode('9')) { + m = c - charCode('0'); + } else if (charCode('a') <= c && c <= charCode('f')) { + m = c - charCode('a') + 10; + } else if (charCode('A') <= c && c <= charCode('F')) { + m = c - charCode('A') + 10; + } else { + out[outIndex++] = charCode('%'); + out[outIndex++] = hexchar; + out[outIndex++] = c; + break; + } + out[outIndex++] = 16 * n + m; + break; + } + } + + // TODO support returning arbitrary buffers. + + return out.slice(0, outIndex - 1); +}; + + +QueryString.unescape = function(s, decodeSpaces) { + return QueryString.unescapeBuffer(s, decodeSpaces).toString(); +}; + + +QueryString.escape = function(str) { + return encodeURIComponent(str); +}; + +var stringifyPrimitive = function(v) { + switch (typeof v) { + case 'string': + return v; + + case 'boolean': + return v ? 'true' : 'false'; + + case 'number': + return isFinite(v) ? v : ''; + + default: + return ''; + } +}; + + +QueryString.stringify = QueryString.encode = function(obj, sep, eq, name) { + sep = sep || '&'; + eq = eq || '='; + obj = (obj === null) ? undefined : obj; + + switch (typeof obj) { + case 'object': + return Object.keys(obj).map(function(k) { + if (Array.isArray(obj[k])) { + return obj[k].map(function(v) { + return QueryString.escape(stringifyPrimitive(k)) + + eq + + QueryString.escape(stringifyPrimitive(v)); + }).join(sep); + } else { + return QueryString.escape(stringifyPrimitive(k)) + + eq + + QueryString.escape(stringifyPrimitive(obj[k])); + } + }).join(sep); + + default: + if (!name) return ''; + return QueryString.escape(stringifyPrimitive(name)) + eq + + QueryString.escape(stringifyPrimitive(obj)); + } +}; + +// Parse a key=val string. +QueryString.parse = QueryString.decode = function(qs, sep, eq) { + sep = sep || '&'; + eq = eq || '='; + var obj = {}; + + if (typeof qs !== 'string' || qs.length === 0) { + return obj; + } + + qs.split(sep).forEach(function(kvp) { + var x = kvp.split(eq); + var k = QueryString.unescape(x[0], true); + var v = QueryString.unescape(x.slice(1).join(eq), true); + + if (!(k in obj)) { + obj[k] = v; + } else if (!Array.isArray(obj[k])) { + obj[k] = [obj[k], v]; + } else { + obj[k].push(v); + } + }); + + return obj; +}; diff --git a/node_modules/.npm/.cache/querystring/1.0.0/package/test-querystring.js b/node_modules/.npm/.cache/querystring/1.0.0/package/test-querystring.js new file mode 100644 index 000000000..b56275fd5 --- /dev/null +++ b/node_modules/.npm/.cache/querystring/1.0.0/package/test-querystring.js @@ -0,0 +1,181 @@ +var assert = require('assert'); + +// test using assert +var qs = require('./querystring'); + +// folding block, commented to pass gjslint +// {{{ +// [ wonkyQS, canonicalQS, obj ] +var qsTestCases = [ + ['foo=918854443121279438895193', + 'foo=918854443121279438895193', + {'foo': '918854443121279438895193'}], + ['foo=bar', 'foo=bar', {'foo': 'bar'}], + ['foo=bar&foo=quux', 'foo=bar&foo=quux', {'foo': ['bar', 'quux']}], + ['foo=1&bar=2', 'foo=1&bar=2', {'foo': '1', 'bar': '2'}], + ['my+weird+field=q1%212%22%27w%245%267%2Fz8%29%3F', + 'my%20weird%20field=q1!2%22\'w%245%267%2Fz8)%3F', + {'my weird field': 'q1!2"\'w$5&7/z8)?' }], + ['foo%3Dbaz=bar', 'foo%3Dbaz=bar', {'foo=baz': 'bar'}], + ['foo=baz=bar', 'foo=baz%3Dbar', {'foo': 'baz=bar'}], + ['str=foo&arr=1&arr=2&arr=3&somenull=&undef=', + 'str=foo&arr=1&arr=2&arr=3&somenull=&undef=', + { 'str': 'foo', + 'arr': ['1', '2', '3'], + 'somenull': '', + 'undef': ''}], + [' foo = bar ', '%20foo%20=%20bar%20', {' foo ': ' bar '}], + ['foo=%zx', 'foo=%25zx', {'foo': '%zx'}], + ['foo=%EF%BF%BD', 'foo=%EF%BF%BD', {'foo': '\ufffd' }] +]; + +// [ wonkyQS, canonicalQS, obj ] +var qsColonTestCases = [ + ['foo:bar', 'foo:bar', {'foo': 'bar'}], + ['foo:bar;foo:quux', 'foo:bar;foo:quux', {'foo': ['bar', 'quux']}], + ['foo:1&bar:2;baz:quux', + 'foo:1%26bar%3A2;baz:quux', + {'foo': '1&bar:2', 'baz': 'quux'}], + ['foo%3Abaz:bar', 'foo%3Abaz:bar', {'foo:baz': 'bar'}], + ['foo:baz:bar', 'foo:baz%3Abar', {'foo': 'baz:bar'}] +]; + +// [wonkyObj, qs, canonicalObj] +var extendedFunction = function() {}; +extendedFunction.prototype = {a: 'b'}; +var qsWeirdObjects = [ + [{regexp: /./g}, 'regexp=', {'regexp': ''}], + [{regexp: new RegExp('.', 'g')}, 'regexp=', {'regexp': ''}], + [{fn: function() {}}, 'fn=', {'fn': ''}], + [{fn: new Function('')}, 'fn=', {'fn': ''}], + [{math: Math}, 'math=', {'math': ''}], + [{e: extendedFunction}, 'e=', {'e': ''}], + [{d: new Date()}, 'd=', {'d': ''}], + [{d: Date}, 'd=', {'d': ''}], + [{f: new Boolean(false), t: new Boolean(true)}, 'f=&t=', {'f': '', 't': ''}], + [{f: false, t: true}, 'f=false&t=true', {'f': 'false', 't': 'true'}], + [{n: null}, 'n=', {'n': ''}], + [{nan: NaN}, 'nan=', {'nan': ''}], + [{inf: Infinity}, 'inf=', {'inf': ''}] +]; +// }}} + +var Script = require('vm').Script; +var foreignObject = Script.runInContext('({"foo": ["bar", "baz"]})', + Script.createContext()); + +var qsNoMungeTestCases = [ + ['', {}], + ['foo=bar&foo=baz', {'foo': ['bar', 'baz']}], + ['foo=bar&foo=baz', foreignObject], + ['blah=burp', {'blah': 'burp'}], + ['gragh=1&gragh=3&goo=2', {'gragh': ['1', '3'], 'goo': '2'}], + ['frappucino=muffin&goat%5B%5D=scone&pond=moose', + {'frappucino': 'muffin', 'goat[]': 'scone', 'pond': 'moose'}], + ['trololol=yes&lololo=no', {'trololol': 'yes', 'lololo': 'no'}] +]; + +assert.strictEqual('918854443121279438895193', + qs.parse('id=918854443121279438895193').id); + +// test that the canonical qs is parsed properly. +qsTestCases.forEach(function(testCase) { + assert.deepEqual(testCase[2], qs.parse(testCase[0])); +}); + +// test that the colon test cases can do the same +qsColonTestCases.forEach(function(testCase) { + assert.deepEqual(testCase[2], qs.parse(testCase[0], ';', ':')); +}); + +// test the weird objects, that they get parsed properly +qsWeirdObjects.forEach(function(testCase) { + assert.deepEqual(testCase[2], qs.parse(testCase[1])); +}); + +qsNoMungeTestCases.forEach(function(testCase) { + assert.deepEqual(testCase[0], qs.stringify(testCase[1], '&', '=', false)); +}); + +// test the nested qs-in-qs case +(function() { + var f = qs.parse('a=b&q=x%3Dy%26y%3Dz'); + f.q = qs.parse(f.q); + assert.deepEqual(f, { a: 'b', q: { x: 'y', y: 'z' } }); +})(); + +// nested in colon +(function() { + var f = qs.parse('a:b;q:x%3Ay%3By%3Az', ';', ':'); + f.q = qs.parse(f.q, ';', ':'); + assert.deepEqual(f, { a: 'b', q: { x: 'y', y: 'z' } }); +})(); + +// now test stringifying + +// basic +qsTestCases.forEach(function(testCase) { + assert.equal(testCase[1], qs.stringify(testCase[2])); +}); + +qsColonTestCases.forEach(function(testCase) { + assert.equal(testCase[1], qs.stringify(testCase[2], ';', ':')); +}); + +qsWeirdObjects.forEach(function(testCase) { + assert.equal(testCase[1], qs.stringify(testCase[0])); +}); + +// nested +var f = qs.stringify({ + a: 'b', + q: qs.stringify({ + x: 'y', + y: 'z' + }) +}); +assert.equal(f, 'a=b&q=x%3Dy%26y%3Dz'); + +assert.doesNotThrow(function() { + qs.parse(undefined); +}); + +// nested in colon +var f = qs.stringify({ + a: 'b', + q: qs.stringify({ + x: 'y', + y: 'z' + }, ';', ':') +}, ';', ':'); +assert.equal(f, 'a:b;q:x%3Ay%3By%3Az'); + + +assert.deepEqual({}, qs.parse()); + + + +var b = qs.unescapeBuffer('%d3%f2Ug%1f6v%24%5e%98%cb' + + '%0d%ac%a2%2f%9d%eb%d8%a2%e6'); +// <Buffer d3 f2 55 67 1f 36 76 24 5e 98 cb 0d ac a2 2f 9d eb d8 a2 e6> +assert.equal(0xd3, b[0]); +assert.equal(0xf2, b[1]); +assert.equal(0x55, b[2]); +assert.equal(0x67, b[3]); +assert.equal(0x1f, b[4]); +assert.equal(0x36, b[5]); +assert.equal(0x76, b[6]); +assert.equal(0x24, b[7]); +assert.equal(0x5e, b[8]); +assert.equal(0x98, b[9]); +assert.equal(0xcb, b[10]); +assert.equal(0x0d, b[11]); +assert.equal(0xac, b[12]); +assert.equal(0xa2, b[13]); +assert.equal(0x2f, b[14]); +assert.equal(0x9d, b[15]); +assert.equal(0xeb, b[16]); +assert.equal(0xd8, b[17]); +assert.equal(0xa2, b[18]); +assert.equal(0xe6, b[19]); + diff --git a/node_modules/.npm/.cache/url/1.0.0/package.json b/node_modules/.npm/.cache/url/1.0.0/package.json new file mode 100644 index 000000000..46e05184d --- /dev/null +++ b/node_modules/.npm/.cache/url/1.0.0/package.json @@ -0,0 +1,43 @@ +{ + "name": "url", + "version": "1.0.0", + "description": "The url module from nodejs", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": { + "type": "MIT", + "url": "https://github.com/isaacs/node-url/raw/master/LICENSE" + }, + "main": "url", + "dependencies": { + "querystring": "*" + }, + "repositories": [ + { + "type": "git", + "url": "https://github.com/isaacs/node-url.git" + } + ], + "scripts": { + "test": "node test-url.js" + }, + "_id": "url@1.0.0", + "engines": { + "node": "*" + }, + "_engineSupported": true, + "_npmVersion": "0.2.16", + "_nodeVersion": "v0.3.7-pre", + "directories": {}, + "files": [ + "" + ], + "_defaultsLoaded": true, + "dist": { + "shasum": "5581c2b8553f555cbe186a78dcd059ea86eeb4f5", + "tarball": "http://registry.npmjs.org/url/-/url-1.0.0.tgz" + } +}
\ No newline at end of file diff --git a/node_modules/.npm/.cache/url/1.0.0/package.tgz b/node_modules/.npm/.cache/url/1.0.0/package.tgz Binary files differnew file mode 100644 index 000000000..9474dc106 --- /dev/null +++ b/node_modules/.npm/.cache/url/1.0.0/package.tgz diff --git a/node_modules/.npm/.cache/url/1.0.0/package/LICENSE b/node_modules/.npm/.cache/url/1.0.0/package/LICENSE new file mode 100644 index 000000000..253ebccc8 --- /dev/null +++ b/node_modules/.npm/.cache/url/1.0.0/package/LICENSE @@ -0,0 +1,18 @@ +Copyright 2009, 2010 Joyent, Inc. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. diff --git a/node_modules/.npm/.cache/url/1.0.0/package/README.md b/node_modules/.npm/.cache/url/1.0.0/package/README.md new file mode 100644 index 000000000..5f9b31f45 --- /dev/null +++ b/node_modules/.npm/.cache/url/1.0.0/package/README.md @@ -0,0 +1,56 @@ +## URL + +This module has utilities for URL resolution and parsing. +Call `require('url')` to use it. + +Parsed URL objects have some or all of the following fields, depending on +whether or not they exist in the URL string. Any parts that are not in the URL +string will not be in the parsed object. Examples are shown for the URL + +`'http://user:pass@host.com:8080/p/a/t/h?query=string#hash'` + +* `href`: The full URL that was originally parsed. + + Example: `'http://user:pass@host.com:8080/p/a/t/h?query=string#hash'` +* `protocol`: The request protocol. + + Example: `'http:'` +* `host`: The full host portion of the URL, including port and authentication information. + + Example: `'user:pass@host.com:8080'` +* `auth`: The authentication information portion of a URL. + + Example: `'user:pass'` +* `hostname`: Just the hostname portion of the host. + + Example: `'host.com'` +* `port`: The port number portion of the host. + + Example: `'8080'` +* `pathname`: The path section of the URL, that comes after the host and before the query, including the initial slash if present. + + Example: `'/p/a/t/h'` +* `search`: The 'query string' portion of the URL, including the leading question mark. + + Example: `'?query=string'` +* `query`: Either the 'params' portion of the query string, or a querystring-parsed object. + + Example: `'query=string'` or `{'query':'string'}` +* `hash`: The 'fragment' portion of the URL including the pound-sign. + + Example: `'#hash'` + +The following methods are provided by the URL module: + +### url.parse(urlStr, parseQueryString=false) + +Take a URL string, and return an object. Pass `true` as the second argument to also parse +the query string using the `querystring` module. + +### url.format(urlObj) + +Take a parsed URL object, and return a formatted URL string. + +### url.resolve(from, to) + +Take a base URL, and a href URL, and resolve them as a browser would for an anchor tag. diff --git a/node_modules/.npm/.cache/url/1.0.0/package/package.json b/node_modules/.npm/.cache/url/1.0.0/package/package.json new file mode 100644 index 000000000..85dcad13c --- /dev/null +++ b/node_modules/.npm/.cache/url/1.0.0/package/package.json @@ -0,0 +1,10 @@ +{"name":"url" +,"version":"1.0.0" +,"description":"The url module from nodejs" +,"author":"Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)" +,"license":{"type":"MIT" + ,"url":"https://github.com/isaacs/node-url/raw/master/LICENSE"} +,"main":"url.js" +,"dependencies":{"querystring":"*"} +,"repositories":[{"type":"git","url":"https://github.com/isaacs/node-url.git"}] +,"scripts":{"test":"node test-url.js"}} diff --git a/node_modules/.npm/.cache/url/1.0.0/package/test-url.js b/node_modules/.npm/.cache/url/1.0.0/package/test-url.js new file mode 100644 index 000000000..6891a7158 --- /dev/null +++ b/node_modules/.npm/.cache/url/1.0.0/package/test-url.js @@ -0,0 +1,584 @@ +var assert = require('assert'); + +var url = require('./url'), + util = require('util'); + +// URLs to parse, and expected data +// { url : parsed } +var parseTests = { + '//some_path' : { + 'href': '//some_path', + 'pathname': '//some_path' + }, + 'http://www.narwhaljs.org/blog/categories?id=news' : { + 'href': 'http://www.narwhaljs.org/blog/categories?id=news', + 'protocol': 'http:', + 'host': 'www.narwhaljs.org', + 'hostname': 'www.narwhaljs.org', + 'search': '?id=news', + 'query': 'id=news', + 'pathname': '/blog/categories' + }, + 'http://mt0.google.com/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=' : { + 'href': 'http://mt0.google.com/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=', + 'protocol': 'http:', + 'host': 'mt0.google.com', + 'hostname': 'mt0.google.com', + 'pathname': '/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=' + }, + 'http://mt0.google.com/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=' : { + 'href': 'http://mt0.google.com/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=', + 'protocol': 'http:', + 'host': 'mt0.google.com', + 'hostname': 'mt0.google.com', + 'search': '???&hl=en&src=api&x=2&y=2&z=3&s=', + 'query': '??&hl=en&src=api&x=2&y=2&z=3&s=', + 'pathname': '/vt/lyrs=m@114' + }, + 'http://user:pass@mt0.google.com/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=' : { + 'href': 'http://user:pass@mt0.google.com/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=', + 'protocol': 'http:', + 'host': 'user:pass@mt0.google.com', + 'auth': 'user:pass', + 'hostname': 'mt0.google.com', + 'search': '???&hl=en&src=api&x=2&y=2&z=3&s=', + 'query': '??&hl=en&src=api&x=2&y=2&z=3&s=', + 'pathname': '/vt/lyrs=m@114' + }, + 'file:///etc/passwd' : { + 'href': 'file:///etc/passwd', + 'protocol': 'file:', + 'pathname': '///etc/passwd' + }, + 'file:///etc/node/' : { + 'href': 'file:///etc/node/', + 'protocol': 'file:', + 'pathname': '///etc/node/' + }, + 'http:/baz/../foo/bar' : { + 'href': 'http:/baz/../foo/bar', + 'protocol': 'http:', + 'pathname': '/baz/../foo/bar' + }, + 'http://user:pass@example.com:8000/foo/bar?baz=quux#frag' : { + 'href': 'http://user:pass@example.com:8000/foo/bar?baz=quux#frag', + 'protocol': 'http:', + 'host': 'user:pass@example.com:8000', + 'auth': 'user:pass', + 'port': '8000', + 'hostname': 'example.com', + 'hash': '#frag', + 'search': '?baz=quux', + 'query': 'baz=quux', + 'pathname': '/foo/bar' + }, + '//user:pass@example.com:8000/foo/bar?baz=quux#frag' : { + 'href': '//user:pass@example.com:8000/foo/bar?baz=quux#frag', + 'host': 'user:pass@example.com:8000', + 'auth': 'user:pass', + 'port': '8000', + 'hostname': 'example.com', + 'hash': '#frag', + 'search': '?baz=quux', + 'query': 'baz=quux', + 'pathname': '/foo/bar' + }, + 'http://example.com?foo=bar#frag' : { + 'href': 'http://example.com?foo=bar#frag', + 'protocol': 'http:', + 'host': 'example.com', + 'hostname': 'example.com', + 'hash': '#frag', + 'search': '?foo=bar', + 'query': 'foo=bar' + }, + 'http://example.com?foo=@bar#frag' : { + 'href': 'http://example.com?foo=@bar#frag', + 'protocol': 'http:', + 'host': 'example.com', + 'hostname': 'example.com', + 'hash': '#frag', + 'search': '?foo=@bar', + 'query': 'foo=@bar' + }, + 'http://example.com?foo=/bar/#frag' : { + 'href': 'http://example.com?foo=/bar/#frag', + 'protocol': 'http:', + 'host': 'example.com', + 'hostname': 'example.com', + 'hash': '#frag', + 'search': '?foo=/bar/', + 'query': 'foo=/bar/' + }, + 'http://example.com?foo=?bar/#frag' : { + 'href': 'http://example.com?foo=?bar/#frag', + 'protocol': 'http:', + 'host': 'example.com', + 'hostname': 'example.com', + 'hash': '#frag', + 'search': '?foo=?bar/', + 'query': 'foo=?bar/' + }, + 'http://example.com#frag=?bar/#frag' : { + 'href': 'http://example.com#frag=?bar/#frag', + 'protocol': 'http:', + 'host': 'example.com', + 'hostname': 'example.com', + 'hash': '#frag=?bar/#frag' + }, + '/foo/bar?baz=quux#frag' : { + 'href': '/foo/bar?baz=quux#frag', + 'hash': '#frag', + 'search': '?baz=quux', + 'query': 'baz=quux', + 'pathname': '/foo/bar' + }, + 'http:/foo/bar?baz=quux#frag' : { + 'href': 'http:/foo/bar?baz=quux#frag', + 'protocol': 'http:', + 'hash': '#frag', + 'search': '?baz=quux', + 'query': 'baz=quux', + 'pathname': '/foo/bar' + }, + 'mailto:foo@bar.com?subject=hello' : { + 'href': 'mailto:foo@bar.com?subject=hello', + 'protocol': 'mailto:', + 'host': 'foo@bar.com', + 'auth' : 'foo', + 'hostname' : 'bar.com', + 'search': '?subject=hello', + 'query': 'subject=hello' + }, + 'javascript:alert(\'hello\');' : { + 'href': 'javascript:alert(\'hello\');', + 'protocol': 'javascript:', + 'host': 'alert(\'hello\')', + 'hostname': 'alert(\'hello\')', + 'pathname' : ';' + }, + 'xmpp:isaacschlueter@jabber.org' : { + 'href': 'xmpp:isaacschlueter@jabber.org', + 'protocol': 'xmpp:', + 'host': 'isaacschlueter@jabber.org', + 'auth': 'isaacschlueter', + 'hostname': 'jabber.org' + } +}; +for (var u in parseTests) { + var actual = url.parse(u), + expected = parseTests[u]; + for (var i in expected) { + var e = JSON.stringify(expected[i]), + a = JSON.stringify(actual[i]); + assert.equal(e, a, + 'parse(' + u + ').' + i + ' == ' + e + '\nactual: ' + a); + } + + var expected = u, + actual = url.format(parseTests[u]); + + assert.equal(expected, actual, + 'format(' + u + ') == ' + u + '\nactual:' + actual); +} + +var parseTestsWithQueryString = { + '/foo/bar?baz=quux#frag' : { + 'href': '/foo/bar?baz=quux#frag', + 'hash': '#frag', + 'search': '?baz=quux', + 'query': { + 'baz': 'quux' + }, + 'pathname': '/foo/bar' + }, + 'http://example.com' : { + 'href': 'http://example.com', + 'protocol': 'http:', + 'slashes': true, + 'host': 'example.com', + 'hostname': 'example.com', + 'query': {} + }, + 'http://example.com?' : { + 'href': 'http://example.com?', + 'protocol': 'http:', + 'slashes': true, + 'host': 'example.com', + 'hostname': 'example.com', + 'search': '?', + 'query': {} + } +}; +for (var u in parseTestsWithQueryString) { + var actual = url.parse(u, true); + var expected = parseTestsWithQueryString[u]; + for (var i in expected) { + var e = JSON.stringify(expected[i]), + a = JSON.stringify(actual[i]); + assert.equal(e, a, + 'parse(' + u + ').' + i + ' == ' + e + '\nactual: ' + a); + } +} + +// some extra formatting tests, just to verify +// that it'll format slightly wonky content to a valid url. +var formatTests = { + 'http://a.com/a/b/c?s#h' : { + 'protocol': 'http', + 'host': 'a.com', + 'pathname': 'a/b/c', + 'hash': 'h', + 'search': 's' + }, + 'xmpp:isaacschlueter@jabber.org' : { + 'href': 'xmpp://isaacschlueter@jabber.org', + 'protocol': 'xmpp:', + 'host': 'isaacschlueter@jabber.org', + 'auth': 'isaacschlueter', + 'hostname': 'jabber.org' + } +}; +for (var u in formatTests) { + var actual = url.format(formatTests[u]); + assert.equal(actual, u, + 'wonky format(' + u + ') == ' + u + '\nactual:' + actual); +} + +/* + [from, path, expected] +*/ +var relativeTests = [ + ['/foo/bar/baz', 'quux', '/foo/bar/quux'], + ['/foo/bar/baz', 'quux/asdf', '/foo/bar/quux/asdf'], + ['/foo/bar/baz', 'quux/baz', '/foo/bar/quux/baz'], + ['/foo/bar/baz', '../quux/baz', '/foo/quux/baz'], + ['/foo/bar/baz', '/bar', '/bar'], + ['/foo/bar/baz/', 'quux', '/foo/bar/baz/quux'], + ['/foo/bar/baz/', 'quux/baz', '/foo/bar/baz/quux/baz'], + ['/foo/bar/baz', '../../../../../../../../quux/baz', '/quux/baz'], + ['/foo/bar/baz', '../../../../../../../quux/baz', '/quux/baz'], + ['foo/bar', '../../../baz', '../../baz'], + ['foo/bar/', '../../../baz', '../baz'], + ['http://example.com/b//c//d;p?q#blarg', 'https:#hash2', 'https:///#hash2'], + ['http://example.com/b//c//d;p?q#blarg', + 'https:/p/a/t/h?s#hash2', + 'https://p/a/t/h?s#hash2'], + ['http://example.com/b//c//d;p?q#blarg', + 'https://u:p@h.com/p/a/t/h?s#hash2', + 'https://u:p@h.com/p/a/t/h?s#hash2'], + ['http://example.com/b//c//d;p?q#blarg', + 'https:/a/b/c/d', + 'https://a/b/c/d'], + ['http://example.com/b//c//d;p?q#blarg', + 'http:#hash2', + 'http://example.com/b//c//d;p?q#hash2'], + ['http://example.com/b//c//d;p?q#blarg', + 'http:/p/a/t/h?s#hash2', + 'http://example.com/p/a/t/h?s#hash2'], + ['http://example.com/b//c//d;p?q#blarg', + 'http://u:p@h.com/p/a/t/h?s#hash2', + 'http://u:p@h.com/p/a/t/h?s#hash2'], + ['http://example.com/b//c//d;p?q#blarg', + 'http:/a/b/c/d', + 'http://example.com/a/b/c/d'], + ['/foo/bar/baz', '/../etc/passwd', '/etc/passwd'] +]; +relativeTests.forEach(function(relativeTest) { + var a = url.resolve(relativeTest[0], relativeTest[1]), + e = relativeTest[2]; + assert.equal(e, a, + 'resolve(' + [relativeTest[0], relativeTest[1]] + ') == ' + e + + '\n actual=' + a); +}); + + +// +// Tests below taken from Chiron +// http://code.google.com/p/chironjs/source/browse/trunk/src/test/http/url.js +// +// Copyright (c) 2002-2008 Kris Kowal <http://cixar.com/~kris.kowal> +// used with permission under MIT License +// +// Changes marked with @isaacs + +var bases = [ + 'http://a/b/c/d;p?q', + 'http://a/b/c/d;p?q=1/2', + 'http://a/b/c/d;p=1/2?q', + 'fred:///s//a/b/c', + 'http:///s//a/b/c' +]; + +//[to, from, result] +var relativeTests2 = [ + // http://lists.w3.org/Archives/Public/uri/2004Feb/0114.html + ['../c', 'foo:a/b', 'foo:c'], + ['foo:.', 'foo:a', 'foo:'], + ['/foo/../../../bar', 'zz:abc', 'zz:/bar'], + ['/foo/../bar', 'zz:abc', 'zz:/bar'], + // @isaacs Disagree. Not how web browsers resolve this. + ['foo/../../../bar', 'zz:abc', 'zz:bar'], + // ['foo/../../../bar', 'zz:abc', 'zz:../../bar'], // @isaacs Added + ['foo/../bar', 'zz:abc', 'zz:bar'], + ['zz:.', 'zz:abc', 'zz:'], + ['/.', bases[0], 'http://a/'], + ['/.foo', bases[0], 'http://a/.foo'], + ['.foo', bases[0], 'http://a/b/c/.foo'], + + // http://gbiv.com/protocols/uri/test/rel_examples1.html + // examples from RFC 2396 + ['g:h', bases[0], 'g:h'], + ['g', bases[0], 'http://a/b/c/g'], + ['./g', bases[0], 'http://a/b/c/g'], + ['g/', bases[0], 'http://a/b/c/g/'], + ['/g', bases[0], 'http://a/g'], + ['//g', bases[0], 'http://g'], + // changed with RFC 2396bis + //('?y', bases[0], 'http://a/b/c/d;p?y'], + ['?y', bases[0], 'http://a/b/c/d;p?y'], + ['g?y', bases[0], 'http://a/b/c/g?y'], + // changed with RFC 2396bis + //('#s', bases[0], CURRENT_DOC_URI + '#s'], + ['#s', bases[0], 'http://a/b/c/d;p?q#s'], + ['g#s', bases[0], 'http://a/b/c/g#s'], + ['g?y#s', bases[0], 'http://a/b/c/g?y#s'], + [';x', bases[0], 'http://a/b/c/;x'], + ['g;x', bases[0], 'http://a/b/c/g;x'], + ['g;x?y#s' , bases[0], 'http://a/b/c/g;x?y#s'], + // changed with RFC 2396bis + //('', bases[0], CURRENT_DOC_URI], + ['', bases[0], 'http://a/b/c/d;p?q'], + ['.', bases[0], 'http://a/b/c/'], + ['./', bases[0], 'http://a/b/c/'], + ['..', bases[0], 'http://a/b/'], + ['../', bases[0], 'http://a/b/'], + ['../g', bases[0], 'http://a/b/g'], + ['../..', bases[0], 'http://a/'], + ['../../', bases[0], 'http://a/'], + ['../../g' , bases[0], 'http://a/g'], + ['../../../g', bases[0], ('http://a/../g', 'http://a/g')], + ['../../../../g', bases[0], ('http://a/../../g', 'http://a/g')], + // changed with RFC 2396bis + //('/./g', bases[0], 'http://a/./g'], + ['/./g', bases[0], 'http://a/g'], + // changed with RFC 2396bis + //('/../g', bases[0], 'http://a/../g'], + ['/../g', bases[0], 'http://a/g'], + ['g.', bases[0], 'http://a/b/c/g.'], + ['.g', bases[0], 'http://a/b/c/.g'], + ['g..', bases[0], 'http://a/b/c/g..'], + ['..g', bases[0], 'http://a/b/c/..g'], + ['./../g', bases[0], 'http://a/b/g'], + ['./g/.', bases[0], 'http://a/b/c/g/'], + ['g/./h', bases[0], 'http://a/b/c/g/h'], + ['g/../h', bases[0], 'http://a/b/c/h'], + ['g;x=1/./y', bases[0], 'http://a/b/c/g;x=1/y'], + ['g;x=1/../y', bases[0], 'http://a/b/c/y'], + ['g?y/./x', bases[0], 'http://a/b/c/g?y/./x'], + ['g?y/../x', bases[0], 'http://a/b/c/g?y/../x'], + ['g#s/./x', bases[0], 'http://a/b/c/g#s/./x'], + ['g#s/../x', bases[0], 'http://a/b/c/g#s/../x'], + ['http:g', bases[0], ('http:g', 'http://a/b/c/g')], + ['http:', bases[0], ('http:', bases[0])], + // not sure where this one originated + ['/a/b/c/./../../g', bases[0], 'http://a/a/g'], + + // http://gbiv.com/protocols/uri/test/rel_examples2.html + // slashes in base URI's query args + ['g', bases[1], 'http://a/b/c/g'], + ['./g', bases[1], 'http://a/b/c/g'], + ['g/', bases[1], 'http://a/b/c/g/'], + ['/g', bases[1], 'http://a/g'], + ['//g', bases[1], 'http://g'], + // changed in RFC 2396bis + //('?y', bases[1], 'http://a/b/c/?y'], + ['?y', bases[1], 'http://a/b/c/d;p?y'], + ['g?y', bases[1], 'http://a/b/c/g?y'], + ['g?y/./x' , bases[1], 'http://a/b/c/g?y/./x'], + ['g?y/../x', bases[1], 'http://a/b/c/g?y/../x'], + ['g#s', bases[1], 'http://a/b/c/g#s'], + ['g#s/./x' , bases[1], 'http://a/b/c/g#s/./x'], + ['g#s/../x', bases[1], 'http://a/b/c/g#s/../x'], + ['./', bases[1], 'http://a/b/c/'], + ['../', bases[1], 'http://a/b/'], + ['../g', bases[1], 'http://a/b/g'], + ['../../', bases[1], 'http://a/'], + ['../../g' , bases[1], 'http://a/g'], + + // http://gbiv.com/protocols/uri/test/rel_examples3.html + // slashes in path params + // all of these changed in RFC 2396bis + ['g', bases[2], 'http://a/b/c/d;p=1/g'], + ['./g', bases[2], 'http://a/b/c/d;p=1/g'], + ['g/', bases[2], 'http://a/b/c/d;p=1/g/'], + ['g?y', bases[2], 'http://a/b/c/d;p=1/g?y'], + [';x', bases[2], 'http://a/b/c/d;p=1/;x'], + ['g;x', bases[2], 'http://a/b/c/d;p=1/g;x'], + ['g;x=1/./y', bases[2], 'http://a/b/c/d;p=1/g;x=1/y'], + ['g;x=1/../y', bases[2], 'http://a/b/c/d;p=1/y'], + ['./', bases[2], 'http://a/b/c/d;p=1/'], + ['../', bases[2], 'http://a/b/c/'], + ['../g', bases[2], 'http://a/b/c/g'], + ['../../', bases[2], 'http://a/b/'], + ['../../g' , bases[2], 'http://a/b/g'], + + // http://gbiv.com/protocols/uri/test/rel_examples4.html + // double and triple slash, unknown scheme + ['g:h', bases[3], 'g:h'], + ['g', bases[3], 'fred:///s//a/b/g'], + ['./g', bases[3], 'fred:///s//a/b/g'], + ['g/', bases[3], 'fred:///s//a/b/g/'], + ['/g', bases[3], 'fred:///g'], // may change to fred:///s//a/g + ['//g', bases[3], 'fred://g'], // may change to fred:///s//g + ['//g/x', bases[3], 'fred://g/x'], // may change to fred:///s//g/x + ['///g', bases[3], 'fred:///g'], + ['./', bases[3], 'fred:///s//a/b/'], + ['../', bases[3], 'fred:///s//a/'], + ['../g', bases[3], 'fred:///s//a/g'], + + ['../../', bases[3], 'fred:///s//'], + ['../../g' , bases[3], 'fred:///s//g'], + ['../../../g', bases[3], 'fred:///s/g'], + // may change to fred:///s//a/../../../g + ['../../../../g', bases[3], 'fred:///g'], + + // http://gbiv.com/protocols/uri/test/rel_examples5.html + // double and triple slash, well-known scheme + ['g:h', bases[4], 'g:h'], + ['g', bases[4], 'http:///s//a/b/g'], + ['./g', bases[4], 'http:///s//a/b/g'], + ['g/', bases[4], 'http:///s//a/b/g/'], + ['/g', bases[4], 'http:///g'], // may change to http:///s//a/g + ['//g', bases[4], 'http://g'], // may change to http:///s//g + ['//g/x', bases[4], 'http://g/x'], // may change to http:///s//g/x + ['///g', bases[4], 'http:///g'], + ['./', bases[4], 'http:///s//a/b/'], + ['../', bases[4], 'http:///s//a/'], + ['../g', bases[4], 'http:///s//a/g'], + ['../../', bases[4], 'http:///s//'], + ['../../g' , bases[4], 'http:///s//g'], + // may change to http:///s//a/../../g + ['../../../g', bases[4], 'http:///s/g'], + // may change to http:///s//a/../../../g + ['../../../../g', bases[4], 'http:///g'], + + // from Dan Connelly's tests in http://www.w3.org/2000/10/swap/uripath.py + ['bar:abc', 'foo:xyz', 'bar:abc'], + ['../abc', 'http://example/x/y/z', 'http://example/x/abc'], + ['http://example/x/abc', 'http://example2/x/y/z', 'http://example/x/abc'], + ['../r', 'http://ex/x/y/z', 'http://ex/x/r'], + ['q/r', 'http://ex/x/y', 'http://ex/x/q/r'], + ['q/r#s', 'http://ex/x/y', 'http://ex/x/q/r#s'], + ['q/r#s/t', 'http://ex/x/y', 'http://ex/x/q/r#s/t'], + ['ftp://ex/x/q/r', 'http://ex/x/y', 'ftp://ex/x/q/r'], + ['', 'http://ex/x/y', 'http://ex/x/y'], + ['', 'http://ex/x/y/', 'http://ex/x/y/'], + ['', 'http://ex/x/y/pdq', 'http://ex/x/y/pdq'], + ['z/', 'http://ex/x/y/', 'http://ex/x/y/z/'], + ['#Animal', + 'file:/swap/test/animal.rdf', + 'file:/swap/test/animal.rdf#Animal'], + ['../abc', 'file:/e/x/y/z', 'file:/e/x/abc'], + ['/example/x/abc', 'file:/example2/x/y/z', 'file:/example/x/abc'], + ['../r', 'file:/ex/x/y/z', 'file:/ex/x/r'], + ['/r', 'file:/ex/x/y/z', 'file:/r'], + ['q/r', 'file:/ex/x/y', 'file:/ex/x/q/r'], + ['q/r#s', 'file:/ex/x/y', 'file:/ex/x/q/r#s'], + ['q/r#', 'file:/ex/x/y', 'file:/ex/x/q/r#'], + ['q/r#s/t', 'file:/ex/x/y', 'file:/ex/x/q/r#s/t'], + ['ftp://ex/x/q/r', 'file:/ex/x/y', 'ftp://ex/x/q/r'], + ['', 'file:/ex/x/y', 'file:/ex/x/y'], + ['', 'file:/ex/x/y/', 'file:/ex/x/y/'], + ['', 'file:/ex/x/y/pdq', 'file:/ex/x/y/pdq'], + ['z/', 'file:/ex/x/y/', 'file:/ex/x/y/z/'], + ['file://meetings.example.com/cal#m1', + 'file:/devel/WWW/2000/10/swap/test/reluri-1.n3', + 'file://meetings.example.com/cal#m1'], + ['file://meetings.example.com/cal#m1', + 'file:/home/connolly/w3ccvs/WWW/2000/10/swap/test/reluri-1.n3', + 'file://meetings.example.com/cal#m1'], + ['./#blort', 'file:/some/dir/foo', 'file:/some/dir/#blort'], + ['./#', 'file:/some/dir/foo', 'file:/some/dir/#'], + // Ryan Lee + ['./', 'http://example/x/abc.efg', 'http://example/x/'], + + + // Graham Klyne's tests + // http://www.ninebynine.org/Software/HaskellUtils/Network/UriTest.xls + // 01-31 are from Connelly's cases + + // 32-49 + ['./q:r', 'http://ex/x/y', 'http://ex/x/q:r'], + ['./p=q:r', 'http://ex/x/y', 'http://ex/x/p=q:r'], + ['?pp/rr', 'http://ex/x/y?pp/qq', 'http://ex/x/y?pp/rr'], + ['y/z', 'http://ex/x/y?pp/qq', 'http://ex/x/y/z'], + ['local/qual@domain.org#frag', + 'mailto:local', + 'mailto:local/qual@domain.org#frag'], + ['more/qual2@domain2.org#frag', + 'mailto:local/qual1@domain1.org', + 'mailto:local/more/qual2@domain2.org#frag'], + ['y?q', 'http://ex/x/y?q', 'http://ex/x/y?q'], + ['/x/y?q', 'http://ex?p', 'http://ex/x/y?q'], + ['c/d', 'foo:a/b', 'foo:a/c/d'], + ['/c/d', 'foo:a/b', 'foo:/c/d'], + ['', 'foo:a/b?c#d', 'foo:a/b?c'], + ['b/c', 'foo:a', 'foo:b/c'], + ['../b/c', 'foo:/a/y/z', 'foo:/a/b/c'], + ['./b/c', 'foo:a', 'foo:b/c'], + ['/./b/c', 'foo:a', 'foo:/b/c'], + ['../../d', 'foo://a//b/c', 'foo://a/d'], + ['.', 'foo:a', 'foo:'], + ['..', 'foo:a', 'foo:'], + + // 50-57[cf. TimBL comments -- + // http://lists.w3.org/Archives/Public/uri/2003Feb/0028.html, + // http://lists.w3.org/Archives/Public/uri/2003Jan/0008.html) + ['abc', 'http://example/x/y%2Fz', 'http://example/x/abc'], + ['../../x%2Fabc', 'http://example/a/x/y/z', 'http://example/a/x%2Fabc'], + ['../x%2Fabc', 'http://example/a/x/y%2Fz', 'http://example/a/x%2Fabc'], + ['abc', 'http://example/x%2Fy/z', 'http://example/x%2Fy/abc'], + ['q%3Ar', 'http://ex/x/y', 'http://ex/x/q%3Ar'], + ['/x%2Fabc', 'http://example/x/y%2Fz', 'http://example/x%2Fabc'], + ['/x%2Fabc', 'http://example/x/y/z', 'http://example/x%2Fabc'], + ['/x%2Fabc', 'http://example/x/y%2Fz', 'http://example/x%2Fabc'], + + // 70-77 + ['local2@domain2', 'mailto:local1@domain1?query1', 'mailto:local2@domain2'], + ['local2@domain2?query2', + 'mailto:local1@domain1', + 'mailto:local2@domain2?query2'], + ['local2@domain2?query2', + 'mailto:local1@domain1?query1', + 'mailto:local2@domain2?query2'], + ['?query2', 'mailto:local@domain?query1', 'mailto:local@domain?query2'], + ['local@domain?query2', 'mailto:?query1', 'mailto:local@domain?query2'], + ['?query2', 'mailto:local@domain?query1', 'mailto:local@domain?query2'], + ['http://example/a/b?c/../d', 'foo:bar', 'http://example/a/b?c/../d'], + ['http://example/a/b#c/../d', 'foo:bar', 'http://example/a/b#c/../d'], + + // 82-88 + // @isaacs Disagree. Not how browsers do it. + // ['http:this', 'http://example.org/base/uri', 'http:this'], + // @isaacs Added + ['http:this', 'http://example.org/base/uri', 'http://example.org/base/this'], + ['http:this', 'http:base', 'http:this'], + ['.//g', 'f:/a', 'f://g'], + ['b/c//d/e', 'f://example.org/base/a', 'f://example.org/base/b/c//d/e'], + ['m2@example.ord/c2@example.org', + 'mid:m@example.ord/c@example.org', + 'mid:m@example.ord/m2@example.ord/c2@example.org'], + ['mini1.xml', + 'file:///C:/DEV/Haskell/lib/HXmlToolbox-3.01/examples/', + 'file:///C:/DEV/Haskell/lib/HXmlToolbox-3.01/examples/mini1.xml'], + ['../b/c', 'foo:a/y/z', 'foo:a/b/c'] +]; +relativeTests2.forEach(function(relativeTest) { + var a = url.resolve(relativeTest[1], relativeTest[0]), + e = relativeTest[2]; + assert.equal(e, a, + 'resolve(' + [relativeTest[1], relativeTest[0]] + ') == ' + e + + '\n actual=' + a); +}); + diff --git a/node_modules/.npm/.cache/url/1.0.0/package/url.js b/node_modules/.npm/.cache/url/1.0.0/package/url.js new file mode 100644 index 000000000..f272551ac --- /dev/null +++ b/node_modules/.npm/.cache/url/1.0.0/package/url.js @@ -0,0 +1,357 @@ +exports.parse = urlParse; +exports.resolve = urlResolve; +exports.resolveObject = urlResolveObject; +exports.format = urlFormat; + +// define these here so at least they only have to be +// compiled once on the first module load. +var protocolPattern = /^([a-z0-9]+:)/, + portPattern = /:[0-9]+$/, + nonHostChars = ['/', '?', ';', '#'], + hostlessProtocol = { + 'file': true, + 'file:': true + }, + slashedProtocol = { + 'http': true, + 'https': true, + 'ftp': true, + 'gopher': true, + 'file': true, + 'http:': true, + 'https:': true, + 'ftp:': true, + 'gopher:': true, + 'file:': true + }, + querystring = require('querystring'); + +function urlParse(url, parseQueryString, slashesDenoteHost) { + if (url && typeof(url) === 'object' && url.href) return url; + + var out = { href: url }, + rest = url; + + var proto = protocolPattern.exec(rest); + if (proto) { + proto = proto[0]; + out.protocol = proto; + rest = rest.substr(proto.length); + } + + // figure out if it's got a host + // user@server is *always* interpreted as a hostname, and url + // resolution will treat //foo/bar as host=foo,path=bar because that's + // how the browser resolves relative URLs. + if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { + var slashes = rest.substr(0, 2) === '//'; + if (slashes && !(proto && hostlessProtocol[proto])) { + rest = rest.substr(2); + out.slashes = true; + } + } + if (!hostlessProtocol[proto] && + (slashes || (proto && !slashedProtocol[proto]))) { + // there's a hostname. + // the first instance of /, ?, ;, or # ends the host. + // don't enforce full RFC correctness, just be unstupid about it. + var firstNonHost = -1; + for (var i = 0, l = nonHostChars.length; i < l; i++) { + var index = rest.indexOf(nonHostChars[i]); + if (index !== -1 && + (firstNonHost < 0 || index < firstNonHost)) firstNonHost = index; + } + if (firstNonHost !== -1) { + out.host = rest.substr(0, firstNonHost); + rest = rest.substr(firstNonHost); + } else { + out.host = rest; + rest = ''; + } + + // pull out the auth and port. + var p = parseHost(out.host); + var keys = Object.keys(p); + for (var i = 0, l = keys.length; i < l; i++) { + var key = keys[i]; + out[key] = p[key]; + } + // we've indicated that there is a hostname, + // so even if it's empty, it has to be present. + out.hostname = out.hostname || ''; + } + + // now rest is set to the post-host stuff. + // chop off from the tail first. + var hash = rest.indexOf('#'); + if (hash !== -1) { + // got a fragment string. + out.hash = rest.substr(hash); + rest = rest.slice(0, hash); + } + var qm = rest.indexOf('?'); + if (qm !== -1) { + out.search = rest.substr(qm); + out.query = rest.substr(qm + 1); + if (parseQueryString) { + out.query = querystring.parse(out.query); + } + rest = rest.slice(0, qm); + } else if (parseQueryString) { + // no query string, but parseQueryString still requested + out.query = {}; + } + if (rest) out.pathname = rest; + + return out; +} + +// format a parsed object into a url string +function urlFormat(obj) { + // ensure it's an object, and not a string url. + // If it's an obj, this is a no-op. + // this way, you can call url_format() on strings + // to clean up potentially wonky urls. + if (typeof(obj) === 'string') obj = urlParse(obj); + + var protocol = obj.protocol || '', + host = (obj.host !== undefined) ? obj.host : + obj.hostname !== undefined ? ( + (obj.auth ? obj.auth + '@' : '') + + obj.hostname + + (obj.port ? ':' + obj.port : '') + ) : + false, + pathname = obj.pathname || '', + search = obj.search || ( + obj.query && ('?' + ( + typeof(obj.query) === 'object' ? + querystring.stringify(obj.query) : + String(obj.query) + )) + ) || '', + hash = obj.hash || ''; + + if (protocol && protocol.substr(-1) !== ':') protocol += ':'; + + // only the slashedProtocols get the //. Not mailto:, xmpp:, etc. + // unless they had them to begin with. + if (obj.slashes || + (!protocol || slashedProtocol[protocol]) && host !== false) { + host = '//' + (host || ''); + if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname; + } else if (!host) { + host = ''; + } + + if (hash && hash.charAt(0) !== '#') hash = '#' + hash; + if (search && search.charAt(0) !== '?') search = '?' + search; + + return protocol + host + pathname + search + hash; +} + +function urlResolve(source, relative) { + return urlFormat(urlResolveObject(source, relative)); +} + +function urlResolveObject(source, relative) { + if (!source) return relative; + + source = urlParse(urlFormat(source), false, true); + relative = urlParse(urlFormat(relative), false, true); + + // hash is always overridden, no matter what. + source.hash = relative.hash; + + if (relative.href === '') return source; + + // hrefs like //foo/bar always cut to the protocol. + if (relative.slashes && !relative.protocol) { + relative.protocol = source.protocol; + return relative; + } + + if (relative.protocol && relative.protocol !== source.protocol) { + // if it's a known url protocol, then changing + // the protocol does weird things + // first, if it's not file:, then we MUST have a host, + // and if there was a path + // to begin with, then we MUST have a path. + // if it is file:, then the host is dropped, + // because that's known to be hostless. + // anything else is assumed to be absolute. + + if (!slashedProtocol[relative.protocol]) return relative; + + source.protocol = relative.protocol; + if (!relative.host && !hostlessProtocol[relative.protocol]) { + var relPath = (relative.pathname || '').split('/'); + while (relPath.length && !(relative.host = relPath.shift())); + if (!relative.host) relative.host = ''; + if (relPath[0] !== '') relPath.unshift(''); + if (relPath.length < 2) relPath.unshift(''); + relative.pathname = relPath.join('/'); + } + source.pathname = relative.pathname; + source.search = relative.search; + source.query = relative.query; + source.host = relative.host || ''; + delete source.auth; + delete source.hostname; + source.port = relative.port; + return source; + } + + var isSourceAbs = (source.pathname && source.pathname.charAt(0) === '/'), + isRelAbs = ( + relative.host !== undefined || + relative.pathname && relative.pathname.charAt(0) === '/' + ), + mustEndAbs = (isRelAbs || isSourceAbs || + (source.host && relative.pathname)), + removeAllDots = mustEndAbs, + srcPath = source.pathname && source.pathname.split('/') || [], + relPath = relative.pathname && relative.pathname.split('/') || [], + psychotic = source.protocol && + !slashedProtocol[source.protocol] && + source.host !== undefined; + + // if the url is a non-slashed url, then relative + // links like ../.. should be able + // to crawl up to the hostname, as well. This is strange. + // source.protocol has already been set by now. + // Later on, put the first path part into the host field. + if (psychotic) { + + delete source.hostname; + delete source.auth; + delete source.port; + if (source.host) { + if (srcPath[0] === '') srcPath[0] = source.host; + else srcPath.unshift(source.host); + } + delete source.host; + + if (relative.protocol) { + delete relative.hostname; + delete relative.auth; + delete relative.port; + if (relative.host) { + if (relPath[0] === '') relPath[0] = relative.host; + else relPath.unshift(relative.host); + } + delete relative.host; + } + mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === ''); + } + + if (isRelAbs) { + // it's absolute. + source.host = (relative.host || relative.host === '') ? + relative.host : source.host; + source.search = relative.search; + source.query = relative.query; + srcPath = relPath; + // fall through to the dot-handling below. + } else if (relPath.length) { + // it's relative + // throw away the existing file, and take the new path instead. + if (!srcPath) srcPath = []; + srcPath.pop(); + srcPath = srcPath.concat(relPath); + source.search = relative.search; + source.query = relative.query; + } else if ('search' in relative) { + // just pull out the search. + // like href='?foo'. + // Put this after the other two cases because it simplifies the booleans + if (psychotic) { + source.host = srcPath.shift(); + } + source.search = relative.search; + source.query = relative.query; + return source; + } + if (!srcPath.length) { + // no path at all. easy. + // we've already handled the other stuff above. + delete source.pathname; + return source; + } + + // if a url ENDs in . or .., then it must get a trailing slash. + // however, if it ends in anything else non-slashy, + // then it must NOT get a trailing slash. + var last = srcPath.slice(-1)[0]; + var hasTrailingSlash = ( + (source.host || relative.host) && (last === '.' || last === '..') || + last === ''); + + // strip single dots, resolve double dots to parent dir + // if the path tries to go above the root, `up` ends up > 0 + var up = 0; + for (var i = srcPath.length; i >= 0; i--) { + last = srcPath[i]; + if (last == '.') { + srcPath.splice(i, 1); + } else if (last === '..') { + srcPath.splice(i, 1); + up++; + } else if (up) { + srcPath.splice(i, 1); + up--; + } + } + + // if the path is allowed to go above the root, restore leading ..s + if (!mustEndAbs && !removeAllDots) { + for (; up--; up) { + srcPath.unshift('..'); + } + } + + if (mustEndAbs && srcPath[0] !== '' && + (!srcPath[0] || srcPath[0].charAt(0) !== '/')) { + srcPath.unshift(''); + } + + if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) { + srcPath.push(''); + } + + var isAbsolute = srcPath[0] === '' || + (srcPath[0] && srcPath[0].charAt(0) === '/'); + + // put the host back + if (psychotic) { + source.host = isAbsolute ? '' : srcPath.shift(); + } + + mustEndAbs = mustEndAbs || (source.host && srcPath.length); + + if (mustEndAbs && !isAbsolute) { + srcPath.unshift(''); + } + + source.pathname = srcPath.join('/'); + + + return source; +} + +function parseHost(host) { + var out = {}; + var at = host.indexOf('@'); + if (at !== -1) { + out.auth = host.substr(0, at); + host = host.substr(at + 1); // drop the @ + } + var port = portPattern.exec(host); + if (port) { + port = port[0]; + out.port = port.substr(1); + host = host.substr(0, host.length - port.length); + } + if (host) out.hostname = host; + return out; +} diff --git a/node_modules/.npm/querystring/1.0.0/dependents/url@1.0.0 b/node_modules/.npm/querystring/1.0.0/dependents/url@1.0.0 new file mode 120000 index 000000000..cd7bc6347 --- /dev/null +++ b/node_modules/.npm/querystring/1.0.0/dependents/url@1.0.0 @@ -0,0 +1 @@ +./../../../url/1.0.0
\ No newline at end of file diff --git a/node_modules/.npm/querystring/1.0.0/package/LICENSE b/node_modules/.npm/querystring/1.0.0/package/LICENSE new file mode 100644 index 000000000..253ebccc8 --- /dev/null +++ b/node_modules/.npm/querystring/1.0.0/package/LICENSE @@ -0,0 +1,18 @@ +Copyright 2009, 2010 Joyent, Inc. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. diff --git a/node_modules/.npm/querystring/1.0.0/package/README.md b/node_modules/.npm/querystring/1.0.0/package/README.md new file mode 100644 index 000000000..edb6d64c1 --- /dev/null +++ b/node_modules/.npm/querystring/1.0.0/package/README.md @@ -0,0 +1,40 @@ +## Query String + +This module provides utilities for dealing with query strings. +It provides the following methods: + +### querystring.stringify(obj, sep='&', eq='=') + +Serialize an object to a query string. +Optionally override the default separator and assignment characters. + +Example: + + querystring.stringify({foo: 'bar'}) + // returns + 'foo=bar' + + querystring.stringify({foo: 'bar', baz: 'bob'}, ';', ':') + // returns + 'foo:bar;baz:bob' + +### querystring.parse(str, sep='&', eq='=') + +Deserialize a query string to an object. +Optionally override the default separator and assignment characters. + +Example: + + querystring.parse('a=b&b=c') + // returns + { a: 'b', b: 'c' } + +### querystring.escape + +The escape function used by `querystring.stringify`, +provided so that it could be overridden if necessary. + +### querystring.unescape + +The unescape function used by `querystring.parse`, +provided so that it could be overridden if necessary. diff --git a/node_modules/.npm/querystring/1.0.0/package/package.json b/node_modules/.npm/querystring/1.0.0/package/package.json new file mode 100644 index 000000000..38b1001bf --- /dev/null +++ b/node_modules/.npm/querystring/1.0.0/package/package.json @@ -0,0 +1,10 @@ +{"name":"querystring" +,"version":"1.0.0" +,"description":"The querystring module from nodejs" +,"author":"Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)" +,"license":{"type":"MIT" + ,"url":"https://github.com/isaacs/node-querystring/raw/master/LICENSE"} +,"main":"querystring.js" +,"repositories":[{"type":"git" + ,"url":"https://github.com/isaacs/node-querystring.git"}] +,"scripts":{"test":"node test-querystring.js"}} diff --git a/node_modules/.npm/querystring/1.0.0/package/querystring.js b/node_modules/.npm/querystring/1.0.0/package/querystring.js new file mode 100644 index 000000000..87c4391a5 --- /dev/null +++ b/node_modules/.npm/querystring/1.0.0/package/querystring.js @@ -0,0 +1,158 @@ +// Query String Utilities + +var QueryString = exports; +var urlDecode = process.binding('http_parser').urlDecode; + + +function charCode(c) { + return c.charCodeAt(0); +} + + +// a safe fast alternative to decodeURIComponent +QueryString.unescapeBuffer = function(s, decodeSpaces) { + var out = new Buffer(s.length); + var state = 'CHAR'; // states: CHAR, HEX0, HEX1 + var n, m, hexchar; + + for (var inIndex = 0, outIndex = 0; inIndex <= s.length; inIndex++) { + var c = s.charCodeAt(inIndex); + switch (state) { + case 'CHAR': + switch (c) { + case charCode('%'): + n = 0; + m = 0; + state = 'HEX0'; + break; + case charCode('+'): + if (decodeSpaces) c = charCode(' '); + // pass thru + default: + out[outIndex++] = c; + break; + } + break; + + case 'HEX0': + state = 'HEX1'; + hexchar = c; + if (charCode('0') <= c && c <= charCode('9')) { + n = c - charCode('0'); + } else if (charCode('a') <= c && c <= charCode('f')) { + n = c - charCode('a') + 10; + } else if (charCode('A') <= c && c <= charCode('F')) { + n = c - charCode('A') + 10; + } else { + out[outIndex++] = charCode('%'); + out[outIndex++] = c; + state = 'CHAR'; + break; + } + break; + + case 'HEX1': + state = 'CHAR'; + if (charCode('0') <= c && c <= charCode('9')) { + m = c - charCode('0'); + } else if (charCode('a') <= c && c <= charCode('f')) { + m = c - charCode('a') + 10; + } else if (charCode('A') <= c && c <= charCode('F')) { + m = c - charCode('A') + 10; + } else { + out[outIndex++] = charCode('%'); + out[outIndex++] = hexchar; + out[outIndex++] = c; + break; + } + out[outIndex++] = 16 * n + m; + break; + } + } + + // TODO support returning arbitrary buffers. + + return out.slice(0, outIndex - 1); +}; + + +QueryString.unescape = function(s, decodeSpaces) { + return QueryString.unescapeBuffer(s, decodeSpaces).toString(); +}; + + +QueryString.escape = function(str) { + return encodeURIComponent(str); +}; + +var stringifyPrimitive = function(v) { + switch (typeof v) { + case 'string': + return v; + + case 'boolean': + return v ? 'true' : 'false'; + + case 'number': + return isFinite(v) ? v : ''; + + default: + return ''; + } +}; + + +QueryString.stringify = QueryString.encode = function(obj, sep, eq, name) { + sep = sep || '&'; + eq = eq || '='; + obj = (obj === null) ? undefined : obj; + + switch (typeof obj) { + case 'object': + return Object.keys(obj).map(function(k) { + if (Array.isArray(obj[k])) { + return obj[k].map(function(v) { + return QueryString.escape(stringifyPrimitive(k)) + + eq + + QueryString.escape(stringifyPrimitive(v)); + }).join(sep); + } else { + return QueryString.escape(stringifyPrimitive(k)) + + eq + + QueryString.escape(stringifyPrimitive(obj[k])); + } + }).join(sep); + + default: + if (!name) return ''; + return QueryString.escape(stringifyPrimitive(name)) + eq + + QueryString.escape(stringifyPrimitive(obj)); + } +}; + +// Parse a key=val string. +QueryString.parse = QueryString.decode = function(qs, sep, eq) { + sep = sep || '&'; + eq = eq || '='; + var obj = {}; + + if (typeof qs !== 'string' || qs.length === 0) { + return obj; + } + + qs.split(sep).forEach(function(kvp) { + var x = kvp.split(eq); + var k = QueryString.unescape(x[0], true); + var v = QueryString.unescape(x.slice(1).join(eq), true); + + if (!(k in obj)) { + obj[k] = v; + } else if (!Array.isArray(obj[k])) { + obj[k] = [obj[k], v]; + } else { + obj[k].push(v); + } + }); + + return obj; +}; diff --git a/node_modules/.npm/querystring/1.0.0/package/test-querystring.js b/node_modules/.npm/querystring/1.0.0/package/test-querystring.js new file mode 100644 index 000000000..b56275fd5 --- /dev/null +++ b/node_modules/.npm/querystring/1.0.0/package/test-querystring.js @@ -0,0 +1,181 @@ +var assert = require('assert'); + +// test using assert +var qs = require('./querystring'); + +// folding block, commented to pass gjslint +// {{{ +// [ wonkyQS, canonicalQS, obj ] +var qsTestCases = [ + ['foo=918854443121279438895193', + 'foo=918854443121279438895193', + {'foo': '918854443121279438895193'}], + ['foo=bar', 'foo=bar', {'foo': 'bar'}], + ['foo=bar&foo=quux', 'foo=bar&foo=quux', {'foo': ['bar', 'quux']}], + ['foo=1&bar=2', 'foo=1&bar=2', {'foo': '1', 'bar': '2'}], + ['my+weird+field=q1%212%22%27w%245%267%2Fz8%29%3F', + 'my%20weird%20field=q1!2%22\'w%245%267%2Fz8)%3F', + {'my weird field': 'q1!2"\'w$5&7/z8)?' }], + ['foo%3Dbaz=bar', 'foo%3Dbaz=bar', {'foo=baz': 'bar'}], + ['foo=baz=bar', 'foo=baz%3Dbar', {'foo': 'baz=bar'}], + ['str=foo&arr=1&arr=2&arr=3&somenull=&undef=', + 'str=foo&arr=1&arr=2&arr=3&somenull=&undef=', + { 'str': 'foo', + 'arr': ['1', '2', '3'], + 'somenull': '', + 'undef': ''}], + [' foo = bar ', '%20foo%20=%20bar%20', {' foo ': ' bar '}], + ['foo=%zx', 'foo=%25zx', {'foo': '%zx'}], + ['foo=%EF%BF%BD', 'foo=%EF%BF%BD', {'foo': '\ufffd' }] +]; + +// [ wonkyQS, canonicalQS, obj ] +var qsColonTestCases = [ + ['foo:bar', 'foo:bar', {'foo': 'bar'}], + ['foo:bar;foo:quux', 'foo:bar;foo:quux', {'foo': ['bar', 'quux']}], + ['foo:1&bar:2;baz:quux', + 'foo:1%26bar%3A2;baz:quux', + {'foo': '1&bar:2', 'baz': 'quux'}], + ['foo%3Abaz:bar', 'foo%3Abaz:bar', {'foo:baz': 'bar'}], + ['foo:baz:bar', 'foo:baz%3Abar', {'foo': 'baz:bar'}] +]; + +// [wonkyObj, qs, canonicalObj] +var extendedFunction = function() {}; +extendedFunction.prototype = {a: 'b'}; +var qsWeirdObjects = [ + [{regexp: /./g}, 'regexp=', {'regexp': ''}], + [{regexp: new RegExp('.', 'g')}, 'regexp=', {'regexp': ''}], + [{fn: function() {}}, 'fn=', {'fn': ''}], + [{fn: new Function('')}, 'fn=', {'fn': ''}], + [{math: Math}, 'math=', {'math': ''}], + [{e: extendedFunction}, 'e=', {'e': ''}], + [{d: new Date()}, 'd=', {'d': ''}], + [{d: Date}, 'd=', {'d': ''}], + [{f: new Boolean(false), t: new Boolean(true)}, 'f=&t=', {'f': '', 't': ''}], + [{f: false, t: true}, 'f=false&t=true', {'f': 'false', 't': 'true'}], + [{n: null}, 'n=', {'n': ''}], + [{nan: NaN}, 'nan=', {'nan': ''}], + [{inf: Infinity}, 'inf=', {'inf': ''}] +]; +// }}} + +var Script = require('vm').Script; +var foreignObject = Script.runInContext('({"foo": ["bar", "baz"]})', + Script.createContext()); + +var qsNoMungeTestCases = [ + ['', {}], + ['foo=bar&foo=baz', {'foo': ['bar', 'baz']}], + ['foo=bar&foo=baz', foreignObject], + ['blah=burp', {'blah': 'burp'}], + ['gragh=1&gragh=3&goo=2', {'gragh': ['1', '3'], 'goo': '2'}], + ['frappucino=muffin&goat%5B%5D=scone&pond=moose', + {'frappucino': 'muffin', 'goat[]': 'scone', 'pond': 'moose'}], + ['trololol=yes&lololo=no', {'trololol': 'yes', 'lololo': 'no'}] +]; + +assert.strictEqual('918854443121279438895193', + qs.parse('id=918854443121279438895193').id); + +// test that the canonical qs is parsed properly. +qsTestCases.forEach(function(testCase) { + assert.deepEqual(testCase[2], qs.parse(testCase[0])); +}); + +// test that the colon test cases can do the same +qsColonTestCases.forEach(function(testCase) { + assert.deepEqual(testCase[2], qs.parse(testCase[0], ';', ':')); +}); + +// test the weird objects, that they get parsed properly +qsWeirdObjects.forEach(function(testCase) { + assert.deepEqual(testCase[2], qs.parse(testCase[1])); +}); + +qsNoMungeTestCases.forEach(function(testCase) { + assert.deepEqual(testCase[0], qs.stringify(testCase[1], '&', '=', false)); +}); + +// test the nested qs-in-qs case +(function() { + var f = qs.parse('a=b&q=x%3Dy%26y%3Dz'); + f.q = qs.parse(f.q); + assert.deepEqual(f, { a: 'b', q: { x: 'y', y: 'z' } }); +})(); + +// nested in colon +(function() { + var f = qs.parse('a:b;q:x%3Ay%3By%3Az', ';', ':'); + f.q = qs.parse(f.q, ';', ':'); + assert.deepEqual(f, { a: 'b', q: { x: 'y', y: 'z' } }); +})(); + +// now test stringifying + +// basic +qsTestCases.forEach(function(testCase) { + assert.equal(testCase[1], qs.stringify(testCase[2])); +}); + +qsColonTestCases.forEach(function(testCase) { + assert.equal(testCase[1], qs.stringify(testCase[2], ';', ':')); +}); + +qsWeirdObjects.forEach(function(testCase) { + assert.equal(testCase[1], qs.stringify(testCase[0])); +}); + +// nested +var f = qs.stringify({ + a: 'b', + q: qs.stringify({ + x: 'y', + y: 'z' + }) +}); +assert.equal(f, 'a=b&q=x%3Dy%26y%3Dz'); + +assert.doesNotThrow(function() { + qs.parse(undefined); +}); + +// nested in colon +var f = qs.stringify({ + a: 'b', + q: qs.stringify({ + x: 'y', + y: 'z' + }, ';', ':') +}, ';', ':'); +assert.equal(f, 'a:b;q:x%3Ay%3By%3Az'); + + +assert.deepEqual({}, qs.parse()); + + + +var b = qs.unescapeBuffer('%d3%f2Ug%1f6v%24%5e%98%cb' + + '%0d%ac%a2%2f%9d%eb%d8%a2%e6'); +// <Buffer d3 f2 55 67 1f 36 76 24 5e 98 cb 0d ac a2 2f 9d eb d8 a2 e6> +assert.equal(0xd3, b[0]); +assert.equal(0xf2, b[1]); +assert.equal(0x55, b[2]); +assert.equal(0x67, b[3]); +assert.equal(0x1f, b[4]); +assert.equal(0x36, b[5]); +assert.equal(0x76, b[6]); +assert.equal(0x24, b[7]); +assert.equal(0x5e, b[8]); +assert.equal(0x98, b[9]); +assert.equal(0xcb, b[10]); +assert.equal(0x0d, b[11]); +assert.equal(0xac, b[12]); +assert.equal(0xa2, b[13]); +assert.equal(0x2f, b[14]); +assert.equal(0x9d, b[15]); +assert.equal(0xeb, b[16]); +assert.equal(0xd8, b[17]); +assert.equal(0xa2, b[18]); +assert.equal(0xe6, b[19]); + diff --git a/node_modules/.npm/querystring/active b/node_modules/.npm/querystring/active new file mode 120000 index 000000000..eaeff3155 --- /dev/null +++ b/node_modules/.npm/querystring/active @@ -0,0 +1 @@ +./1.0.0
\ No newline at end of file diff --git a/node_modules/.npm/url/1.0.0/dependson/querystring@1.0.0 b/node_modules/.npm/url/1.0.0/dependson/querystring@1.0.0 new file mode 120000 index 000000000..7c3bb8a48 --- /dev/null +++ b/node_modules/.npm/url/1.0.0/dependson/querystring@1.0.0 @@ -0,0 +1 @@ +./../../../querystring/1.0.0
\ No newline at end of file diff --git a/node_modules/.npm/url/1.0.0/node_modules/querystring/index.js b/node_modules/.npm/url/1.0.0/node_modules/querystring/index.js new file mode 100755 index 000000000..4ed074eb5 --- /dev/null +++ b/node_modules/.npm/url/1.0.0/node_modules/querystring/index.js @@ -0,0 +1,20 @@ +#!/usr/bin/env node +// generated by npm, please don't touch! +var dep = require('path').join(__dirname, "./../../../../querystring/1.0.0/node_modules") +var depMet = require.paths.indexOf(dep) !== -1 +var bundle = dep.replace(/node_modules$/, 'package/node_modules') +var bundleMet = require.paths.indexOf(bundle) !== -1 +var from = "./../../../../querystring/1.0.0/package/querystring" + +if (!depMet) require.paths.unshift(dep) +if (!bundleMet) require.paths.unshift(bundle) +module.exports = require(from) + +if (!depMet) { + var i = require.paths.indexOf(dep) + if (i !== -1) require.paths.splice(i, 1) +} +if (!bundleMet) { + var i = require.paths.indexOf(bundle) + if (i !== -1) require.paths.slice(i, 1) +} diff --git a/node_modules/.npm/url/1.0.0/node_modules/querystring/package.json.js b/node_modules/.npm/url/1.0.0/node_modules/querystring/package.json.js new file mode 100644 index 000000000..16ac6177b --- /dev/null +++ b/node_modules/.npm/url/1.0.0/node_modules/querystring/package.json.js @@ -0,0 +1,152 @@ +module.exports = { + "name": "querystring", + "version": "1.0.0", + "description": "The querystring module from nodejs", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": { + "type": "MIT", + "url": "https://github.com/isaacs/node-querystring/raw/master/LICENSE" + }, + "repositories": [ + { + "type": "git", + "url": "https://github.com/isaacs/node-querystring.git" + } + ], + "scripts": { + "test": "node test-querystring.js" + }, + "_id": "querystring@1.0.0", + "engines": { + "node": "*" + }, + "_engineSupported": true, + "_npmVersion": "0.2.16", + "_nodeVersion": "v0.3.7-pre", + "directories": {}, + "files": [ + "" + ], + "_defaultsLoaded": true, + "dist": { + "shasum": "12c5704c2758b32171a3636d8f732d7cd81906a2", + "tarball": "http://registry.npmjs.org/querystring/-/querystring-1.0.0.tgz" + }, + "_bundledDeps": [], + "_resolvedDeps": [], + "modules": { + "index.js": "querystring" + }, + "_env": { + "SVN_RSH": "ssh", + "TERM_PROGRAM": "iTerm.app", + "COMP_WORDBREAKS": " \t\n\"'><;|&(:", + "TERM": "xterm-color", + "SHELL": "/bin/bash", + "HISTSIZE": "10000", + "TMPDIR": "/var/folders/R3/R3EA-a2UE2OcM6kNMZeg0E++Lz2/-Tmp-/", + "Apple_PubSub_Socket_Render": "/tmp/launch-KgS5uC/Render", + "__dir_history": "/Users/isaacs:/Users/isaacs/dev-src/js:/Users/isaacs/dev-src/js/node-url/:/Users/isaacs/dev-src/js:/Users/isaacs/dev-src/js/.node_modules/:/Users/isaacs/dev-src/js:/Users/isaacs/dev-src/js/node-querystring/:/Users/isaacs/dev-src/js/npm", + "QTDIR": "/opt/local/lib/qt3", + "OLDPWD": "/Users/isaacs/dev-src/js/node-querystring", + "CDPATH": ".:..:/Users/isaacs/dev:/Users/isaacs/dev/js:/Users/isaacs", + "HISTFILESIZE": "1000000000", + "USER": "isaacs", + "LD_LIBRARY_PATH": "/Users/isaacs/lib:/usr/local/lib:/usr/lib:/lib", + "COMMAND_MODE": "unix2003", + "SSH_AUTH_SOCK": "/tmp/launch-5O0npo/Listeners", + "__CF_USER_TEXT_ENCODING": "0x5FF1:0:0", + "GIT_AUTHOR_NAME": "isaacs", + "GIT_COMMITTER_NAME": "isaacs", + "histchars": "!:#", + "PATH": "/Users/isaacs/bin:/usr/local/bin:/usr/local/sbin:/usr/local/include:/usr/bin:/usr/sbin:/usr/libexec:/usr/include:/bin:/sbin:/Users/isaacs/dev/js/narwhal/bin:/usr/X11R6/bin:/usr/X11R6/include:/Users/isaacs/.gem/ruby/1.8/bin", + "GIT_COMMITTER_EMAIL": "i@izs.me", + "JOBS": "4", + "INPUTRC": "/Users/isaacs/.inputrc", + "PWD": "/Users/isaacs/dev-src/js/npm", + "EDITOR": "vim", + "LANG": "en_US.UTF-8", + "NODE_PATH": "", + "MANPAGER": "more", + "SHLVL": "1", + "HOME": "/Users/isaacs", + "GITHUB_USER": "isaacs", + "PYTHONPATH": "/Users/isaacs/dev/js/node/deps/v8/tools/:/Users/isaacs/dev/js/node/tools", + "LOGNAME": "isaacs", + "VISUAL": "vim", + "CLASSPATH": "./", + "GITHUB_TOKEN": "8cb1e0c9857304a436b1234e69720e21", + "PKG_CONFIG_PATH": "/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/usr/X11/lib/pkgconfig", + "DISPLAY": "/tmp/launch-Ushwq2/org.x:0", + "GIT_AUTHOR_EMAIL": "i@izs.me", + "RSYNC_RSH": "ssh", + "__dir_index": "7", + "_": "/usr/local/bin/npm", + "COPY_EXTENDED_ATTRIBUTES_DISABLE": "1" + }, + "_npmConfig": { + "root": "/Users/isaacs/dev-src/js/npm/node_modules", + "binroot": "/Users/isaacs/dev-src/js/npm/node_modules/.bin", + "manroot": null, + "must-install": false, + "showlevel": 1, + "registry": "http://registry.npmjs.org/", + "argv": { + "remain": [ + "url", + "querystring", + "querystring@*" + ], + "cooked": [ + "bundle", + "install", + "url", + "querystring" + ], + "original": [ + "bundle", + "install", + "url", + "querystring" + ] + }, + "email": "i@izs.me", + "package-config:foo": "boo", + "username": "isaacs", + "auto-activate": "always", + "auto-deactivate": true, + "browser": "open", + "color": true, + "description": true, + "dev": false, + "editor": "vim", + "force": false, + "globalconfig": "/usr/local/etc/npmrc", + "gzipbin": "gzip", + "listopts": "", + "logfd": 2, + "loglevel": "info", + "outfd": 1, + "proxy": null, + "rebuild-bundle": true, + "recursive": false, + "tag": "latest", + "tar": "tar", + "tmproot": "/var/folders/R3/R3EA-a2UE2OcM6kNMZeg0E++Lz2/-Tmp-/", + "update-dependents": true, + "userconfig": "/Users/isaacs/.npmrc" + }, + "_npmPaths": { + "root": "/Users/isaacs/dev-src/js/npm/node_modules", + "dir": "/Users/isaacs/dev-src/js/npm/node_modules/.npm", + "cache": "/Users/isaacs/dev-src/js/npm/node_modules/.npm/.cache", + "tmp": "/var/folders/R3/R3EA-a2UE2OcM6kNMZeg0E++Lz2/-Tmp-/npm-1295993817262", + "package": "/Users/isaacs/dev-src/js/npm/node_modules/.npm/querystring/1.0.0/package", + "modules": "/Users/isaacs/dev-src/js/npm/node_modules/.npm/url/1.0.0/node_modules/querystring", + "dependencies": "/Users/isaacs/dev-src/js/npm/node_modules/.npm/querystring/1.0.0/node_modules" + } +} diff --git a/node_modules/.npm/url/1.0.0/package/LICENSE b/node_modules/.npm/url/1.0.0/package/LICENSE new file mode 100644 index 000000000..253ebccc8 --- /dev/null +++ b/node_modules/.npm/url/1.0.0/package/LICENSE @@ -0,0 +1,18 @@ +Copyright 2009, 2010 Joyent, Inc. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. diff --git a/node_modules/.npm/url/1.0.0/package/README.md b/node_modules/.npm/url/1.0.0/package/README.md new file mode 100644 index 000000000..5f9b31f45 --- /dev/null +++ b/node_modules/.npm/url/1.0.0/package/README.md @@ -0,0 +1,56 @@ +## URL + +This module has utilities for URL resolution and parsing. +Call `require('url')` to use it. + +Parsed URL objects have some or all of the following fields, depending on +whether or not they exist in the URL string. Any parts that are not in the URL +string will not be in the parsed object. Examples are shown for the URL + +`'http://user:pass@host.com:8080/p/a/t/h?query=string#hash'` + +* `href`: The full URL that was originally parsed. + + Example: `'http://user:pass@host.com:8080/p/a/t/h?query=string#hash'` +* `protocol`: The request protocol. + + Example: `'http:'` +* `host`: The full host portion of the URL, including port and authentication information. + + Example: `'user:pass@host.com:8080'` +* `auth`: The authentication information portion of a URL. + + Example: `'user:pass'` +* `hostname`: Just the hostname portion of the host. + + Example: `'host.com'` +* `port`: The port number portion of the host. + + Example: `'8080'` +* `pathname`: The path section of the URL, that comes after the host and before the query, including the initial slash if present. + + Example: `'/p/a/t/h'` +* `search`: The 'query string' portion of the URL, including the leading question mark. + + Example: `'?query=string'` +* `query`: Either the 'params' portion of the query string, or a querystring-parsed object. + + Example: `'query=string'` or `{'query':'string'}` +* `hash`: The 'fragment' portion of the URL including the pound-sign. + + Example: `'#hash'` + +The following methods are provided by the URL module: + +### url.parse(urlStr, parseQueryString=false) + +Take a URL string, and return an object. Pass `true` as the second argument to also parse +the query string using the `querystring` module. + +### url.format(urlObj) + +Take a parsed URL object, and return a formatted URL string. + +### url.resolve(from, to) + +Take a base URL, and a href URL, and resolve them as a browser would for an anchor tag. diff --git a/node_modules/.npm/url/1.0.0/package/package.json b/node_modules/.npm/url/1.0.0/package/package.json new file mode 100644 index 000000000..85dcad13c --- /dev/null +++ b/node_modules/.npm/url/1.0.0/package/package.json @@ -0,0 +1,10 @@ +{"name":"url" +,"version":"1.0.0" +,"description":"The url module from nodejs" +,"author":"Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)" +,"license":{"type":"MIT" + ,"url":"https://github.com/isaacs/node-url/raw/master/LICENSE"} +,"main":"url.js" +,"dependencies":{"querystring":"*"} +,"repositories":[{"type":"git","url":"https://github.com/isaacs/node-url.git"}] +,"scripts":{"test":"node test-url.js"}} diff --git a/node_modules/.npm/url/1.0.0/package/test-url.js b/node_modules/.npm/url/1.0.0/package/test-url.js new file mode 100644 index 000000000..6891a7158 --- /dev/null +++ b/node_modules/.npm/url/1.0.0/package/test-url.js @@ -0,0 +1,584 @@ +var assert = require('assert'); + +var url = require('./url'), + util = require('util'); + +// URLs to parse, and expected data +// { url : parsed } +var parseTests = { + '//some_path' : { + 'href': '//some_path', + 'pathname': '//some_path' + }, + 'http://www.narwhaljs.org/blog/categories?id=news' : { + 'href': 'http://www.narwhaljs.org/blog/categories?id=news', + 'protocol': 'http:', + 'host': 'www.narwhaljs.org', + 'hostname': 'www.narwhaljs.org', + 'search': '?id=news', + 'query': 'id=news', + 'pathname': '/blog/categories' + }, + 'http://mt0.google.com/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=' : { + 'href': 'http://mt0.google.com/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=', + 'protocol': 'http:', + 'host': 'mt0.google.com', + 'hostname': 'mt0.google.com', + 'pathname': '/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=' + }, + 'http://mt0.google.com/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=' : { + 'href': 'http://mt0.google.com/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=', + 'protocol': 'http:', + 'host': 'mt0.google.com', + 'hostname': 'mt0.google.com', + 'search': '???&hl=en&src=api&x=2&y=2&z=3&s=', + 'query': '??&hl=en&src=api&x=2&y=2&z=3&s=', + 'pathname': '/vt/lyrs=m@114' + }, + 'http://user:pass@mt0.google.com/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=' : { + 'href': 'http://user:pass@mt0.google.com/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=', + 'protocol': 'http:', + 'host': 'user:pass@mt0.google.com', + 'auth': 'user:pass', + 'hostname': 'mt0.google.com', + 'search': '???&hl=en&src=api&x=2&y=2&z=3&s=', + 'query': '??&hl=en&src=api&x=2&y=2&z=3&s=', + 'pathname': '/vt/lyrs=m@114' + }, + 'file:///etc/passwd' : { + 'href': 'file:///etc/passwd', + 'protocol': 'file:', + 'pathname': '///etc/passwd' + }, + 'file:///etc/node/' : { + 'href': 'file:///etc/node/', + 'protocol': 'file:', + 'pathname': '///etc/node/' + }, + 'http:/baz/../foo/bar' : { + 'href': 'http:/baz/../foo/bar', + 'protocol': 'http:', + 'pathname': '/baz/../foo/bar' + }, + 'http://user:pass@example.com:8000/foo/bar?baz=quux#frag' : { + 'href': 'http://user:pass@example.com:8000/foo/bar?baz=quux#frag', + 'protocol': 'http:', + 'host': 'user:pass@example.com:8000', + 'auth': 'user:pass', + 'port': '8000', + 'hostname': 'example.com', + 'hash': '#frag', + 'search': '?baz=quux', + 'query': 'baz=quux', + 'pathname': '/foo/bar' + }, + '//user:pass@example.com:8000/foo/bar?baz=quux#frag' : { + 'href': '//user:pass@example.com:8000/foo/bar?baz=quux#frag', + 'host': 'user:pass@example.com:8000', + 'auth': 'user:pass', + 'port': '8000', + 'hostname': 'example.com', + 'hash': '#frag', + 'search': '?baz=quux', + 'query': 'baz=quux', + 'pathname': '/foo/bar' + }, + 'http://example.com?foo=bar#frag' : { + 'href': 'http://example.com?foo=bar#frag', + 'protocol': 'http:', + 'host': 'example.com', + 'hostname': 'example.com', + 'hash': '#frag', + 'search': '?foo=bar', + 'query': 'foo=bar' + }, + 'http://example.com?foo=@bar#frag' : { + 'href': 'http://example.com?foo=@bar#frag', + 'protocol': 'http:', + 'host': 'example.com', + 'hostname': 'example.com', + 'hash': '#frag', + 'search': '?foo=@bar', + 'query': 'foo=@bar' + }, + 'http://example.com?foo=/bar/#frag' : { + 'href': 'http://example.com?foo=/bar/#frag', + 'protocol': 'http:', + 'host': 'example.com', + 'hostname': 'example.com', + 'hash': '#frag', + 'search': '?foo=/bar/', + 'query': 'foo=/bar/' + }, + 'http://example.com?foo=?bar/#frag' : { + 'href': 'http://example.com?foo=?bar/#frag', + 'protocol': 'http:', + 'host': 'example.com', + 'hostname': 'example.com', + 'hash': '#frag', + 'search': '?foo=?bar/', + 'query': 'foo=?bar/' + }, + 'http://example.com#frag=?bar/#frag' : { + 'href': 'http://example.com#frag=?bar/#frag', + 'protocol': 'http:', + 'host': 'example.com', + 'hostname': 'example.com', + 'hash': '#frag=?bar/#frag' + }, + '/foo/bar?baz=quux#frag' : { + 'href': '/foo/bar?baz=quux#frag', + 'hash': '#frag', + 'search': '?baz=quux', + 'query': 'baz=quux', + 'pathname': '/foo/bar' + }, + 'http:/foo/bar?baz=quux#frag' : { + 'href': 'http:/foo/bar?baz=quux#frag', + 'protocol': 'http:', + 'hash': '#frag', + 'search': '?baz=quux', + 'query': 'baz=quux', + 'pathname': '/foo/bar' + }, + 'mailto:foo@bar.com?subject=hello' : { + 'href': 'mailto:foo@bar.com?subject=hello', + 'protocol': 'mailto:', + 'host': 'foo@bar.com', + 'auth' : 'foo', + 'hostname' : 'bar.com', + 'search': '?subject=hello', + 'query': 'subject=hello' + }, + 'javascript:alert(\'hello\');' : { + 'href': 'javascript:alert(\'hello\');', + 'protocol': 'javascript:', + 'host': 'alert(\'hello\')', + 'hostname': 'alert(\'hello\')', + 'pathname' : ';' + }, + 'xmpp:isaacschlueter@jabber.org' : { + 'href': 'xmpp:isaacschlueter@jabber.org', + 'protocol': 'xmpp:', + 'host': 'isaacschlueter@jabber.org', + 'auth': 'isaacschlueter', + 'hostname': 'jabber.org' + } +}; +for (var u in parseTests) { + var actual = url.parse(u), + expected = parseTests[u]; + for (var i in expected) { + var e = JSON.stringify(expected[i]), + a = JSON.stringify(actual[i]); + assert.equal(e, a, + 'parse(' + u + ').' + i + ' == ' + e + '\nactual: ' + a); + } + + var expected = u, + actual = url.format(parseTests[u]); + + assert.equal(expected, actual, + 'format(' + u + ') == ' + u + '\nactual:' + actual); +} + +var parseTestsWithQueryString = { + '/foo/bar?baz=quux#frag' : { + 'href': '/foo/bar?baz=quux#frag', + 'hash': '#frag', + 'search': '?baz=quux', + 'query': { + 'baz': 'quux' + }, + 'pathname': '/foo/bar' + }, + 'http://example.com' : { + 'href': 'http://example.com', + 'protocol': 'http:', + 'slashes': true, + 'host': 'example.com', + 'hostname': 'example.com', + 'query': {} + }, + 'http://example.com?' : { + 'href': 'http://example.com?', + 'protocol': 'http:', + 'slashes': true, + 'host': 'example.com', + 'hostname': 'example.com', + 'search': '?', + 'query': {} + } +}; +for (var u in parseTestsWithQueryString) { + var actual = url.parse(u, true); + var expected = parseTestsWithQueryString[u]; + for (var i in expected) { + var e = JSON.stringify(expected[i]), + a = JSON.stringify(actual[i]); + assert.equal(e, a, + 'parse(' + u + ').' + i + ' == ' + e + '\nactual: ' + a); + } +} + +// some extra formatting tests, just to verify +// that it'll format slightly wonky content to a valid url. +var formatTests = { + 'http://a.com/a/b/c?s#h' : { + 'protocol': 'http', + 'host': 'a.com', + 'pathname': 'a/b/c', + 'hash': 'h', + 'search': 's' + }, + 'xmpp:isaacschlueter@jabber.org' : { + 'href': 'xmpp://isaacschlueter@jabber.org', + 'protocol': 'xmpp:', + 'host': 'isaacschlueter@jabber.org', + 'auth': 'isaacschlueter', + 'hostname': 'jabber.org' + } +}; +for (var u in formatTests) { + var actual = url.format(formatTests[u]); + assert.equal(actual, u, + 'wonky format(' + u + ') == ' + u + '\nactual:' + actual); +} + +/* + [from, path, expected] +*/ +var relativeTests = [ + ['/foo/bar/baz', 'quux', '/foo/bar/quux'], + ['/foo/bar/baz', 'quux/asdf', '/foo/bar/quux/asdf'], + ['/foo/bar/baz', 'quux/baz', '/foo/bar/quux/baz'], + ['/foo/bar/baz', '../quux/baz', '/foo/quux/baz'], + ['/foo/bar/baz', '/bar', '/bar'], + ['/foo/bar/baz/', 'quux', '/foo/bar/baz/quux'], + ['/foo/bar/baz/', 'quux/baz', '/foo/bar/baz/quux/baz'], + ['/foo/bar/baz', '../../../../../../../../quux/baz', '/quux/baz'], + ['/foo/bar/baz', '../../../../../../../quux/baz', '/quux/baz'], + ['foo/bar', '../../../baz', '../../baz'], + ['foo/bar/', '../../../baz', '../baz'], + ['http://example.com/b//c//d;p?q#blarg', 'https:#hash2', 'https:///#hash2'], + ['http://example.com/b//c//d;p?q#blarg', + 'https:/p/a/t/h?s#hash2', + 'https://p/a/t/h?s#hash2'], + ['http://example.com/b//c//d;p?q#blarg', + 'https://u:p@h.com/p/a/t/h?s#hash2', + 'https://u:p@h.com/p/a/t/h?s#hash2'], + ['http://example.com/b//c//d;p?q#blarg', + 'https:/a/b/c/d', + 'https://a/b/c/d'], + ['http://example.com/b//c//d;p?q#blarg', + 'http:#hash2', + 'http://example.com/b//c//d;p?q#hash2'], + ['http://example.com/b//c//d;p?q#blarg', + 'http:/p/a/t/h?s#hash2', + 'http://example.com/p/a/t/h?s#hash2'], + ['http://example.com/b//c//d;p?q#blarg', + 'http://u:p@h.com/p/a/t/h?s#hash2', + 'http://u:p@h.com/p/a/t/h?s#hash2'], + ['http://example.com/b//c//d;p?q#blarg', + 'http:/a/b/c/d', + 'http://example.com/a/b/c/d'], + ['/foo/bar/baz', '/../etc/passwd', '/etc/passwd'] +]; +relativeTests.forEach(function(relativeTest) { + var a = url.resolve(relativeTest[0], relativeTest[1]), + e = relativeTest[2]; + assert.equal(e, a, + 'resolve(' + [relativeTest[0], relativeTest[1]] + ') == ' + e + + '\n actual=' + a); +}); + + +// +// Tests below taken from Chiron +// http://code.google.com/p/chironjs/source/browse/trunk/src/test/http/url.js +// +// Copyright (c) 2002-2008 Kris Kowal <http://cixar.com/~kris.kowal> +// used with permission under MIT License +// +// Changes marked with @isaacs + +var bases = [ + 'http://a/b/c/d;p?q', + 'http://a/b/c/d;p?q=1/2', + 'http://a/b/c/d;p=1/2?q', + 'fred:///s//a/b/c', + 'http:///s//a/b/c' +]; + +//[to, from, result] +var relativeTests2 = [ + // http://lists.w3.org/Archives/Public/uri/2004Feb/0114.html + ['../c', 'foo:a/b', 'foo:c'], + ['foo:.', 'foo:a', 'foo:'], + ['/foo/../../../bar', 'zz:abc', 'zz:/bar'], + ['/foo/../bar', 'zz:abc', 'zz:/bar'], + // @isaacs Disagree. Not how web browsers resolve this. + ['foo/../../../bar', 'zz:abc', 'zz:bar'], + // ['foo/../../../bar', 'zz:abc', 'zz:../../bar'], // @isaacs Added + ['foo/../bar', 'zz:abc', 'zz:bar'], + ['zz:.', 'zz:abc', 'zz:'], + ['/.', bases[0], 'http://a/'], + ['/.foo', bases[0], 'http://a/.foo'], + ['.foo', bases[0], 'http://a/b/c/.foo'], + + // http://gbiv.com/protocols/uri/test/rel_examples1.html + // examples from RFC 2396 + ['g:h', bases[0], 'g:h'], + ['g', bases[0], 'http://a/b/c/g'], + ['./g', bases[0], 'http://a/b/c/g'], + ['g/', bases[0], 'http://a/b/c/g/'], + ['/g', bases[0], 'http://a/g'], + ['//g', bases[0], 'http://g'], + // changed with RFC 2396bis + //('?y', bases[0], 'http://a/b/c/d;p?y'], + ['?y', bases[0], 'http://a/b/c/d;p?y'], + ['g?y', bases[0], 'http://a/b/c/g?y'], + // changed with RFC 2396bis + //('#s', bases[0], CURRENT_DOC_URI + '#s'], + ['#s', bases[0], 'http://a/b/c/d;p?q#s'], + ['g#s', bases[0], 'http://a/b/c/g#s'], + ['g?y#s', bases[0], 'http://a/b/c/g?y#s'], + [';x', bases[0], 'http://a/b/c/;x'], + ['g;x', bases[0], 'http://a/b/c/g;x'], + ['g;x?y#s' , bases[0], 'http://a/b/c/g;x?y#s'], + // changed with RFC 2396bis + //('', bases[0], CURRENT_DOC_URI], + ['', bases[0], 'http://a/b/c/d;p?q'], + ['.', bases[0], 'http://a/b/c/'], + ['./', bases[0], 'http://a/b/c/'], + ['..', bases[0], 'http://a/b/'], + ['../', bases[0], 'http://a/b/'], + ['../g', bases[0], 'http://a/b/g'], + ['../..', bases[0], 'http://a/'], + ['../../', bases[0], 'http://a/'], + ['../../g' , bases[0], 'http://a/g'], + ['../../../g', bases[0], ('http://a/../g', 'http://a/g')], + ['../../../../g', bases[0], ('http://a/../../g', 'http://a/g')], + // changed with RFC 2396bis + //('/./g', bases[0], 'http://a/./g'], + ['/./g', bases[0], 'http://a/g'], + // changed with RFC 2396bis + //('/../g', bases[0], 'http://a/../g'], + ['/../g', bases[0], 'http://a/g'], + ['g.', bases[0], 'http://a/b/c/g.'], + ['.g', bases[0], 'http://a/b/c/.g'], + ['g..', bases[0], 'http://a/b/c/g..'], + ['..g', bases[0], 'http://a/b/c/..g'], + ['./../g', bases[0], 'http://a/b/g'], + ['./g/.', bases[0], 'http://a/b/c/g/'], + ['g/./h', bases[0], 'http://a/b/c/g/h'], + ['g/../h', bases[0], 'http://a/b/c/h'], + ['g;x=1/./y', bases[0], 'http://a/b/c/g;x=1/y'], + ['g;x=1/../y', bases[0], 'http://a/b/c/y'], + ['g?y/./x', bases[0], 'http://a/b/c/g?y/./x'], + ['g?y/../x', bases[0], 'http://a/b/c/g?y/../x'], + ['g#s/./x', bases[0], 'http://a/b/c/g#s/./x'], + ['g#s/../x', bases[0], 'http://a/b/c/g#s/../x'], + ['http:g', bases[0], ('http:g', 'http://a/b/c/g')], + ['http:', bases[0], ('http:', bases[0])], + // not sure where this one originated + ['/a/b/c/./../../g', bases[0], 'http://a/a/g'], + + // http://gbiv.com/protocols/uri/test/rel_examples2.html + // slashes in base URI's query args + ['g', bases[1], 'http://a/b/c/g'], + ['./g', bases[1], 'http://a/b/c/g'], + ['g/', bases[1], 'http://a/b/c/g/'], + ['/g', bases[1], 'http://a/g'], + ['//g', bases[1], 'http://g'], + // changed in RFC 2396bis + //('?y', bases[1], 'http://a/b/c/?y'], + ['?y', bases[1], 'http://a/b/c/d;p?y'], + ['g?y', bases[1], 'http://a/b/c/g?y'], + ['g?y/./x' , bases[1], 'http://a/b/c/g?y/./x'], + ['g?y/../x', bases[1], 'http://a/b/c/g?y/../x'], + ['g#s', bases[1], 'http://a/b/c/g#s'], + ['g#s/./x' , bases[1], 'http://a/b/c/g#s/./x'], + ['g#s/../x', bases[1], 'http://a/b/c/g#s/../x'], + ['./', bases[1], 'http://a/b/c/'], + ['../', bases[1], 'http://a/b/'], + ['../g', bases[1], 'http://a/b/g'], + ['../../', bases[1], 'http://a/'], + ['../../g' , bases[1], 'http://a/g'], + + // http://gbiv.com/protocols/uri/test/rel_examples3.html + // slashes in path params + // all of these changed in RFC 2396bis + ['g', bases[2], 'http://a/b/c/d;p=1/g'], + ['./g', bases[2], 'http://a/b/c/d;p=1/g'], + ['g/', bases[2], 'http://a/b/c/d;p=1/g/'], + ['g?y', bases[2], 'http://a/b/c/d;p=1/g?y'], + [';x', bases[2], 'http://a/b/c/d;p=1/;x'], + ['g;x', bases[2], 'http://a/b/c/d;p=1/g;x'], + ['g;x=1/./y', bases[2], 'http://a/b/c/d;p=1/g;x=1/y'], + ['g;x=1/../y', bases[2], 'http://a/b/c/d;p=1/y'], + ['./', bases[2], 'http://a/b/c/d;p=1/'], + ['../', bases[2], 'http://a/b/c/'], + ['../g', bases[2], 'http://a/b/c/g'], + ['../../', bases[2], 'http://a/b/'], + ['../../g' , bases[2], 'http://a/b/g'], + + // http://gbiv.com/protocols/uri/test/rel_examples4.html + // double and triple slash, unknown scheme + ['g:h', bases[3], 'g:h'], + ['g', bases[3], 'fred:///s//a/b/g'], + ['./g', bases[3], 'fred:///s//a/b/g'], + ['g/', bases[3], 'fred:///s//a/b/g/'], + ['/g', bases[3], 'fred:///g'], // may change to fred:///s//a/g + ['//g', bases[3], 'fred://g'], // may change to fred:///s//g + ['//g/x', bases[3], 'fred://g/x'], // may change to fred:///s//g/x + ['///g', bases[3], 'fred:///g'], + ['./', bases[3], 'fred:///s//a/b/'], + ['../', bases[3], 'fred:///s//a/'], + ['../g', bases[3], 'fred:///s//a/g'], + + ['../../', bases[3], 'fred:///s//'], + ['../../g' , bases[3], 'fred:///s//g'], + ['../../../g', bases[3], 'fred:///s/g'], + // may change to fred:///s//a/../../../g + ['../../../../g', bases[3], 'fred:///g'], + + // http://gbiv.com/protocols/uri/test/rel_examples5.html + // double and triple slash, well-known scheme + ['g:h', bases[4], 'g:h'], + ['g', bases[4], 'http:///s//a/b/g'], + ['./g', bases[4], 'http:///s//a/b/g'], + ['g/', bases[4], 'http:///s//a/b/g/'], + ['/g', bases[4], 'http:///g'], // may change to http:///s//a/g + ['//g', bases[4], 'http://g'], // may change to http:///s//g + ['//g/x', bases[4], 'http://g/x'], // may change to http:///s//g/x + ['///g', bases[4], 'http:///g'], + ['./', bases[4], 'http:///s//a/b/'], + ['../', bases[4], 'http:///s//a/'], + ['../g', bases[4], 'http:///s//a/g'], + ['../../', bases[4], 'http:///s//'], + ['../../g' , bases[4], 'http:///s//g'], + // may change to http:///s//a/../../g + ['../../../g', bases[4], 'http:///s/g'], + // may change to http:///s//a/../../../g + ['../../../../g', bases[4], 'http:///g'], + + // from Dan Connelly's tests in http://www.w3.org/2000/10/swap/uripath.py + ['bar:abc', 'foo:xyz', 'bar:abc'], + ['../abc', 'http://example/x/y/z', 'http://example/x/abc'], + ['http://example/x/abc', 'http://example2/x/y/z', 'http://example/x/abc'], + ['../r', 'http://ex/x/y/z', 'http://ex/x/r'], + ['q/r', 'http://ex/x/y', 'http://ex/x/q/r'], + ['q/r#s', 'http://ex/x/y', 'http://ex/x/q/r#s'], + ['q/r#s/t', 'http://ex/x/y', 'http://ex/x/q/r#s/t'], + ['ftp://ex/x/q/r', 'http://ex/x/y', 'ftp://ex/x/q/r'], + ['', 'http://ex/x/y', 'http://ex/x/y'], + ['', 'http://ex/x/y/', 'http://ex/x/y/'], + ['', 'http://ex/x/y/pdq', 'http://ex/x/y/pdq'], + ['z/', 'http://ex/x/y/', 'http://ex/x/y/z/'], + ['#Animal', + 'file:/swap/test/animal.rdf', + 'file:/swap/test/animal.rdf#Animal'], + ['../abc', 'file:/e/x/y/z', 'file:/e/x/abc'], + ['/example/x/abc', 'file:/example2/x/y/z', 'file:/example/x/abc'], + ['../r', 'file:/ex/x/y/z', 'file:/ex/x/r'], + ['/r', 'file:/ex/x/y/z', 'file:/r'], + ['q/r', 'file:/ex/x/y', 'file:/ex/x/q/r'], + ['q/r#s', 'file:/ex/x/y', 'file:/ex/x/q/r#s'], + ['q/r#', 'file:/ex/x/y', 'file:/ex/x/q/r#'], + ['q/r#s/t', 'file:/ex/x/y', 'file:/ex/x/q/r#s/t'], + ['ftp://ex/x/q/r', 'file:/ex/x/y', 'ftp://ex/x/q/r'], + ['', 'file:/ex/x/y', 'file:/ex/x/y'], + ['', 'file:/ex/x/y/', 'file:/ex/x/y/'], + ['', 'file:/ex/x/y/pdq', 'file:/ex/x/y/pdq'], + ['z/', 'file:/ex/x/y/', 'file:/ex/x/y/z/'], + ['file://meetings.example.com/cal#m1', + 'file:/devel/WWW/2000/10/swap/test/reluri-1.n3', + 'file://meetings.example.com/cal#m1'], + ['file://meetings.example.com/cal#m1', + 'file:/home/connolly/w3ccvs/WWW/2000/10/swap/test/reluri-1.n3', + 'file://meetings.example.com/cal#m1'], + ['./#blort', 'file:/some/dir/foo', 'file:/some/dir/#blort'], + ['./#', 'file:/some/dir/foo', 'file:/some/dir/#'], + // Ryan Lee + ['./', 'http://example/x/abc.efg', 'http://example/x/'], + + + // Graham Klyne's tests + // http://www.ninebynine.org/Software/HaskellUtils/Network/UriTest.xls + // 01-31 are from Connelly's cases + + // 32-49 + ['./q:r', 'http://ex/x/y', 'http://ex/x/q:r'], + ['./p=q:r', 'http://ex/x/y', 'http://ex/x/p=q:r'], + ['?pp/rr', 'http://ex/x/y?pp/qq', 'http://ex/x/y?pp/rr'], + ['y/z', 'http://ex/x/y?pp/qq', 'http://ex/x/y/z'], + ['local/qual@domain.org#frag', + 'mailto:local', + 'mailto:local/qual@domain.org#frag'], + ['more/qual2@domain2.org#frag', + 'mailto:local/qual1@domain1.org', + 'mailto:local/more/qual2@domain2.org#frag'], + ['y?q', 'http://ex/x/y?q', 'http://ex/x/y?q'], + ['/x/y?q', 'http://ex?p', 'http://ex/x/y?q'], + ['c/d', 'foo:a/b', 'foo:a/c/d'], + ['/c/d', 'foo:a/b', 'foo:/c/d'], + ['', 'foo:a/b?c#d', 'foo:a/b?c'], + ['b/c', 'foo:a', 'foo:b/c'], + ['../b/c', 'foo:/a/y/z', 'foo:/a/b/c'], + ['./b/c', 'foo:a', 'foo:b/c'], + ['/./b/c', 'foo:a', 'foo:/b/c'], + ['../../d', 'foo://a//b/c', 'foo://a/d'], + ['.', 'foo:a', 'foo:'], + ['..', 'foo:a', 'foo:'], + + // 50-57[cf. TimBL comments -- + // http://lists.w3.org/Archives/Public/uri/2003Feb/0028.html, + // http://lists.w3.org/Archives/Public/uri/2003Jan/0008.html) + ['abc', 'http://example/x/y%2Fz', 'http://example/x/abc'], + ['../../x%2Fabc', 'http://example/a/x/y/z', 'http://example/a/x%2Fabc'], + ['../x%2Fabc', 'http://example/a/x/y%2Fz', 'http://example/a/x%2Fabc'], + ['abc', 'http://example/x%2Fy/z', 'http://example/x%2Fy/abc'], + ['q%3Ar', 'http://ex/x/y', 'http://ex/x/q%3Ar'], + ['/x%2Fabc', 'http://example/x/y%2Fz', 'http://example/x%2Fabc'], + ['/x%2Fabc', 'http://example/x/y/z', 'http://example/x%2Fabc'], + ['/x%2Fabc', 'http://example/x/y%2Fz', 'http://example/x%2Fabc'], + + // 70-77 + ['local2@domain2', 'mailto:local1@domain1?query1', 'mailto:local2@domain2'], + ['local2@domain2?query2', + 'mailto:local1@domain1', + 'mailto:local2@domain2?query2'], + ['local2@domain2?query2', + 'mailto:local1@domain1?query1', + 'mailto:local2@domain2?query2'], + ['?query2', 'mailto:local@domain?query1', 'mailto:local@domain?query2'], + ['local@domain?query2', 'mailto:?query1', 'mailto:local@domain?query2'], + ['?query2', 'mailto:local@domain?query1', 'mailto:local@domain?query2'], + ['http://example/a/b?c/../d', 'foo:bar', 'http://example/a/b?c/../d'], + ['http://example/a/b#c/../d', 'foo:bar', 'http://example/a/b#c/../d'], + + // 82-88 + // @isaacs Disagree. Not how browsers do it. + // ['http:this', 'http://example.org/base/uri', 'http:this'], + // @isaacs Added + ['http:this', 'http://example.org/base/uri', 'http://example.org/base/this'], + ['http:this', 'http:base', 'http:this'], + ['.//g', 'f:/a', 'f://g'], + ['b/c//d/e', 'f://example.org/base/a', 'f://example.org/base/b/c//d/e'], + ['m2@example.ord/c2@example.org', + 'mid:m@example.ord/c@example.org', + 'mid:m@example.ord/m2@example.ord/c2@example.org'], + ['mini1.xml', + 'file:///C:/DEV/Haskell/lib/HXmlToolbox-3.01/examples/', + 'file:///C:/DEV/Haskell/lib/HXmlToolbox-3.01/examples/mini1.xml'], + ['../b/c', 'foo:a/y/z', 'foo:a/b/c'] +]; +relativeTests2.forEach(function(relativeTest) { + var a = url.resolve(relativeTest[1], relativeTest[0]), + e = relativeTest[2]; + assert.equal(e, a, + 'resolve(' + [relativeTest[1], relativeTest[0]] + ') == ' + e + + '\n actual=' + a); +}); + diff --git a/node_modules/.npm/url/1.0.0/package/url.js b/node_modules/.npm/url/1.0.0/package/url.js new file mode 100644 index 000000000..f272551ac --- /dev/null +++ b/node_modules/.npm/url/1.0.0/package/url.js @@ -0,0 +1,357 @@ +exports.parse = urlParse; +exports.resolve = urlResolve; +exports.resolveObject = urlResolveObject; +exports.format = urlFormat; + +// define these here so at least they only have to be +// compiled once on the first module load. +var protocolPattern = /^([a-z0-9]+:)/, + portPattern = /:[0-9]+$/, + nonHostChars = ['/', '?', ';', '#'], + hostlessProtocol = { + 'file': true, + 'file:': true + }, + slashedProtocol = { + 'http': true, + 'https': true, + 'ftp': true, + 'gopher': true, + 'file': true, + 'http:': true, + 'https:': true, + 'ftp:': true, + 'gopher:': true, + 'file:': true + }, + querystring = require('querystring'); + +function urlParse(url, parseQueryString, slashesDenoteHost) { + if (url && typeof(url) === 'object' && url.href) return url; + + var out = { href: url }, + rest = url; + + var proto = protocolPattern.exec(rest); + if (proto) { + proto = proto[0]; + out.protocol = proto; + rest = rest.substr(proto.length); + } + + // figure out if it's got a host + // user@server is *always* interpreted as a hostname, and url + // resolution will treat //foo/bar as host=foo,path=bar because that's + // how the browser resolves relative URLs. + if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { + var slashes = rest.substr(0, 2) === '//'; + if (slashes && !(proto && hostlessProtocol[proto])) { + rest = rest.substr(2); + out.slashes = true; + } + } + if (!hostlessProtocol[proto] && + (slashes || (proto && !slashedProtocol[proto]))) { + // there's a hostname. + // the first instance of /, ?, ;, or # ends the host. + // don't enforce full RFC correctness, just be unstupid about it. + var firstNonHost = -1; + for (var i = 0, l = nonHostChars.length; i < l; i++) { + var index = rest.indexOf(nonHostChars[i]); + if (index !== -1 && + (firstNonHost < 0 || index < firstNonHost)) firstNonHost = index; + } + if (firstNonHost !== -1) { + out.host = rest.substr(0, firstNonHost); + rest = rest.substr(firstNonHost); + } else { + out.host = rest; + rest = ''; + } + + // pull out the auth and port. + var p = parseHost(out.host); + var keys = Object.keys(p); + for (var i = 0, l = keys.length; i < l; i++) { + var key = keys[i]; + out[key] = p[key]; + } + // we've indicated that there is a hostname, + // so even if it's empty, it has to be present. + out.hostname = out.hostname || ''; + } + + // now rest is set to the post-host stuff. + // chop off from the tail first. + var hash = rest.indexOf('#'); + if (hash !== -1) { + // got a fragment string. + out.hash = rest.substr(hash); + rest = rest.slice(0, hash); + } + var qm = rest.indexOf('?'); + if (qm !== -1) { + out.search = rest.substr(qm); + out.query = rest.substr(qm + 1); + if (parseQueryString) { + out.query = querystring.parse(out.query); + } + rest = rest.slice(0, qm); + } else if (parseQueryString) { + // no query string, but parseQueryString still requested + out.query = {}; + } + if (rest) out.pathname = rest; + + return out; +} + +// format a parsed object into a url string +function urlFormat(obj) { + // ensure it's an object, and not a string url. + // If it's an obj, this is a no-op. + // this way, you can call url_format() on strings + // to clean up potentially wonky urls. + if (typeof(obj) === 'string') obj = urlParse(obj); + + var protocol = obj.protocol || '', + host = (obj.host !== undefined) ? obj.host : + obj.hostname !== undefined ? ( + (obj.auth ? obj.auth + '@' : '') + + obj.hostname + + (obj.port ? ':' + obj.port : '') + ) : + false, + pathname = obj.pathname || '', + search = obj.search || ( + obj.query && ('?' + ( + typeof(obj.query) === 'object' ? + querystring.stringify(obj.query) : + String(obj.query) + )) + ) || '', + hash = obj.hash || ''; + + if (protocol && protocol.substr(-1) !== ':') protocol += ':'; + + // only the slashedProtocols get the //. Not mailto:, xmpp:, etc. + // unless they had them to begin with. + if (obj.slashes || + (!protocol || slashedProtocol[protocol]) && host !== false) { + host = '//' + (host || ''); + if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname; + } else if (!host) { + host = ''; + } + + if (hash && hash.charAt(0) !== '#') hash = '#' + hash; + if (search && search.charAt(0) !== '?') search = '?' + search; + + return protocol + host + pathname + search + hash; +} + +function urlResolve(source, relative) { + return urlFormat(urlResolveObject(source, relative)); +} + +function urlResolveObject(source, relative) { + if (!source) return relative; + + source = urlParse(urlFormat(source), false, true); + relative = urlParse(urlFormat(relative), false, true); + + // hash is always overridden, no matter what. + source.hash = relative.hash; + + if (relative.href === '') return source; + + // hrefs like //foo/bar always cut to the protocol. + if (relative.slashes && !relative.protocol) { + relative.protocol = source.protocol; + return relative; + } + + if (relative.protocol && relative.protocol !== source.protocol) { + // if it's a known url protocol, then changing + // the protocol does weird things + // first, if it's not file:, then we MUST have a host, + // and if there was a path + // to begin with, then we MUST have a path. + // if it is file:, then the host is dropped, + // because that's known to be hostless. + // anything else is assumed to be absolute. + + if (!slashedProtocol[relative.protocol]) return relative; + + source.protocol = relative.protocol; + if (!relative.host && !hostlessProtocol[relative.protocol]) { + var relPath = (relative.pathname || '').split('/'); + while (relPath.length && !(relative.host = relPath.shift())); + if (!relative.host) relative.host = ''; + if (relPath[0] !== '') relPath.unshift(''); + if (relPath.length < 2) relPath.unshift(''); + relative.pathname = relPath.join('/'); + } + source.pathname = relative.pathname; + source.search = relative.search; + source.query = relative.query; + source.host = relative.host || ''; + delete source.auth; + delete source.hostname; + source.port = relative.port; + return source; + } + + var isSourceAbs = (source.pathname && source.pathname.charAt(0) === '/'), + isRelAbs = ( + relative.host !== undefined || + relative.pathname && relative.pathname.charAt(0) === '/' + ), + mustEndAbs = (isRelAbs || isSourceAbs || + (source.host && relative.pathname)), + removeAllDots = mustEndAbs, + srcPath = source.pathname && source.pathname.split('/') || [], + relPath = relative.pathname && relative.pathname.split('/') || [], + psychotic = source.protocol && + !slashedProtocol[source.protocol] && + source.host !== undefined; + + // if the url is a non-slashed url, then relative + // links like ../.. should be able + // to crawl up to the hostname, as well. This is strange. + // source.protocol has already been set by now. + // Later on, put the first path part into the host field. + if (psychotic) { + + delete source.hostname; + delete source.auth; + delete source.port; + if (source.host) { + if (srcPath[0] === '') srcPath[0] = source.host; + else srcPath.unshift(source.host); + } + delete source.host; + + if (relative.protocol) { + delete relative.hostname; + delete relative.auth; + delete relative.port; + if (relative.host) { + if (relPath[0] === '') relPath[0] = relative.host; + else relPath.unshift(relative.host); + } + delete relative.host; + } + mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === ''); + } + + if (isRelAbs) { + // it's absolute. + source.host = (relative.host || relative.host === '') ? + relative.host : source.host; + source.search = relative.search; + source.query = relative.query; + srcPath = relPath; + // fall through to the dot-handling below. + } else if (relPath.length) { + // it's relative + // throw away the existing file, and take the new path instead. + if (!srcPath) srcPath = []; + srcPath.pop(); + srcPath = srcPath.concat(relPath); + source.search = relative.search; + source.query = relative.query; + } else if ('search' in relative) { + // just pull out the search. + // like href='?foo'. + // Put this after the other two cases because it simplifies the booleans + if (psychotic) { + source.host = srcPath.shift(); + } + source.search = relative.search; + source.query = relative.query; + return source; + } + if (!srcPath.length) { + // no path at all. easy. + // we've already handled the other stuff above. + delete source.pathname; + return source; + } + + // if a url ENDs in . or .., then it must get a trailing slash. + // however, if it ends in anything else non-slashy, + // then it must NOT get a trailing slash. + var last = srcPath.slice(-1)[0]; + var hasTrailingSlash = ( + (source.host || relative.host) && (last === '.' || last === '..') || + last === ''); + + // strip single dots, resolve double dots to parent dir + // if the path tries to go above the root, `up` ends up > 0 + var up = 0; + for (var i = srcPath.length; i >= 0; i--) { + last = srcPath[i]; + if (last == '.') { + srcPath.splice(i, 1); + } else if (last === '..') { + srcPath.splice(i, 1); + up++; + } else if (up) { + srcPath.splice(i, 1); + up--; + } + } + + // if the path is allowed to go above the root, restore leading ..s + if (!mustEndAbs && !removeAllDots) { + for (; up--; up) { + srcPath.unshift('..'); + } + } + + if (mustEndAbs && srcPath[0] !== '' && + (!srcPath[0] || srcPath[0].charAt(0) !== '/')) { + srcPath.unshift(''); + } + + if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) { + srcPath.push(''); + } + + var isAbsolute = srcPath[0] === '' || + (srcPath[0] && srcPath[0].charAt(0) === '/'); + + // put the host back + if (psychotic) { + source.host = isAbsolute ? '' : srcPath.shift(); + } + + mustEndAbs = mustEndAbs || (source.host && srcPath.length); + + if (mustEndAbs && !isAbsolute) { + srcPath.unshift(''); + } + + source.pathname = srcPath.join('/'); + + + return source; +} + +function parseHost(host) { + var out = {}; + var at = host.indexOf('@'); + if (at !== -1) { + out.auth = host.substr(0, at); + host = host.substr(at + 1); // drop the @ + } + var port = portPattern.exec(host); + if (port) { + port = port[0]; + out.port = port.substr(1); + host = host.substr(0, host.length - port.length); + } + if (host) out.hostname = host; + return out; +} diff --git a/node_modules/.npm/url/active b/node_modules/.npm/url/active new file mode 120000 index 000000000..eaeff3155 --- /dev/null +++ b/node_modules/.npm/url/active @@ -0,0 +1 @@ +./1.0.0
\ No newline at end of file diff --git a/node_modules/querystring b/node_modules/querystring new file mode 120000 index 000000000..e88de0e4a --- /dev/null +++ b/node_modules/querystring @@ -0,0 +1 @@ +./querystring@1.0.0
\ No newline at end of file diff --git a/node_modules/querystring@1.0.0/index.js b/node_modules/querystring@1.0.0/index.js new file mode 100755 index 000000000..09dc373ad --- /dev/null +++ b/node_modules/querystring@1.0.0/index.js @@ -0,0 +1,20 @@ +#!/usr/bin/env node +// generated by npm, please don't touch! +var dep = require('path').join(__dirname, "./../.npm/querystring/1.0.0/node_modules") +var depMet = require.paths.indexOf(dep) !== -1 +var bundle = dep.replace(/node_modules$/, 'package/node_modules') +var bundleMet = require.paths.indexOf(bundle) !== -1 +var from = "./../.npm/querystring/1.0.0/package/querystring" + +if (!depMet) require.paths.unshift(dep) +if (!bundleMet) require.paths.unshift(bundle) +module.exports = require(from) + +if (!depMet) { + var i = require.paths.indexOf(dep) + if (i !== -1) require.paths.splice(i, 1) +} +if (!bundleMet) { + var i = require.paths.indexOf(bundle) + if (i !== -1) require.paths.slice(i, 1) +} diff --git a/node_modules/querystring@1.0.0/package.json.js b/node_modules/querystring@1.0.0/package.json.js new file mode 100644 index 000000000..ff7ac7145 --- /dev/null +++ b/node_modules/querystring@1.0.0/package.json.js @@ -0,0 +1,152 @@ +module.exports = { + "name": "querystring", + "version": "1.0.0", + "description": "The querystring module from nodejs", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": { + "type": "MIT", + "url": "https://github.com/isaacs/node-querystring/raw/master/LICENSE" + }, + "repositories": [ + { + "type": "git", + "url": "https://github.com/isaacs/node-querystring.git" + } + ], + "scripts": { + "test": "node test-querystring.js" + }, + "_id": "querystring@1.0.0", + "engines": { + "node": "*" + }, + "_engineSupported": true, + "_npmVersion": "0.2.16", + "_nodeVersion": "v0.3.7-pre", + "directories": {}, + "files": [ + "" + ], + "_defaultsLoaded": true, + "dist": { + "shasum": "12c5704c2758b32171a3636d8f732d7cd81906a2", + "tarball": "http://registry.npmjs.org/querystring/-/querystring-1.0.0.tgz" + }, + "_bundledDeps": [], + "_resolvedDeps": [], + "modules": { + "index.js": "querystring" + }, + "_npmConfig": { + "root": "/Users/isaacs/dev-src/js/npm/node_modules", + "binroot": "/Users/isaacs/dev-src/js/npm/node_modules/.bin", + "manroot": null, + "must-install": false, + "showlevel": 1, + "registry": "http://registry.npmjs.org/", + "argv": { + "remain": [ + "url", + "querystring", + "querystring@*" + ], + "cooked": [ + "bundle", + "install", + "url", + "querystring" + ], + "original": [ + "bundle", + "install", + "url", + "querystring" + ] + }, + "email": "i@izs.me", + "package-config:foo": "boo", + "username": "isaacs", + "auto-activate": "always", + "auto-deactivate": true, + "browser": "open", + "color": true, + "description": true, + "dev": false, + "editor": "vim", + "force": false, + "globalconfig": "/usr/local/etc/npmrc", + "gzipbin": "gzip", + "listopts": "", + "logfd": 2, + "loglevel": "info", + "outfd": 1, + "proxy": null, + "rebuild-bundle": true, + "recursive": false, + "tag": "latest", + "tar": "tar", + "tmproot": "/var/folders/R3/R3EA-a2UE2OcM6kNMZeg0E++Lz2/-Tmp-/", + "update-dependents": true, + "userconfig": "/Users/isaacs/.npmrc" + }, + "_env": { + "SVN_RSH": "ssh", + "TERM_PROGRAM": "iTerm.app", + "COMP_WORDBREAKS": " \t\n\"'><;|&(:", + "TERM": "xterm-color", + "SHELL": "/bin/bash", + "HISTSIZE": "10000", + "TMPDIR": "/var/folders/R3/R3EA-a2UE2OcM6kNMZeg0E++Lz2/-Tmp-/", + "Apple_PubSub_Socket_Render": "/tmp/launch-KgS5uC/Render", + "__dir_history": "/Users/isaacs:/Users/isaacs/dev-src/js:/Users/isaacs/dev-src/js/node-url/:/Users/isaacs/dev-src/js:/Users/isaacs/dev-src/js/.node_modules/:/Users/isaacs/dev-src/js:/Users/isaacs/dev-src/js/node-querystring/:/Users/isaacs/dev-src/js/npm", + "QTDIR": "/opt/local/lib/qt3", + "OLDPWD": "/Users/isaacs/dev-src/js/node-querystring", + "CDPATH": ".:..:/Users/isaacs/dev:/Users/isaacs/dev/js:/Users/isaacs", + "HISTFILESIZE": "1000000000", + "USER": "isaacs", + "LD_LIBRARY_PATH": "/Users/isaacs/lib:/usr/local/lib:/usr/lib:/lib", + "COMMAND_MODE": "unix2003", + "SSH_AUTH_SOCK": "/tmp/launch-5O0npo/Listeners", + "__CF_USER_TEXT_ENCODING": "0x5FF1:0:0", + "GIT_AUTHOR_NAME": "isaacs", + "GIT_COMMITTER_NAME": "isaacs", + "histchars": "!:#", + "PATH": "/Users/isaacs/bin:/usr/local/bin:/usr/local/sbin:/usr/local/include:/usr/bin:/usr/sbin:/usr/libexec:/usr/include:/bin:/sbin:/Users/isaacs/dev/js/narwhal/bin:/usr/X11R6/bin:/usr/X11R6/include:/Users/isaacs/.gem/ruby/1.8/bin", + "GIT_COMMITTER_EMAIL": "i@izs.me", + "JOBS": "4", + "INPUTRC": "/Users/isaacs/.inputrc", + "PWD": "/Users/isaacs/dev-src/js/npm", + "EDITOR": "vim", + "LANG": "en_US.UTF-8", + "NODE_PATH": "", + "MANPAGER": "more", + "SHLVL": "1", + "HOME": "/Users/isaacs", + "GITHUB_USER": "isaacs", + "PYTHONPATH": "/Users/isaacs/dev/js/node/deps/v8/tools/:/Users/isaacs/dev/js/node/tools", + "LOGNAME": "isaacs", + "VISUAL": "vim", + "CLASSPATH": "./", + "GITHUB_TOKEN": "8cb1e0c9857304a436b1234e69720e21", + "PKG_CONFIG_PATH": "/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/usr/X11/lib/pkgconfig", + "DISPLAY": "/tmp/launch-Ushwq2/org.x:0", + "GIT_AUTHOR_EMAIL": "i@izs.me", + "RSYNC_RSH": "ssh", + "__dir_index": "7", + "_": "/usr/local/bin/npm", + "COPY_EXTENDED_ATTRIBUTES_DISABLE": "1" + }, + "_npmPaths": { + "root": "/Users/isaacs/dev-src/js/npm/node_modules", + "dir": "/Users/isaacs/dev-src/js/npm/node_modules/.npm", + "cache": "/Users/isaacs/dev-src/js/npm/node_modules/.npm/.cache", + "tmp": "/var/folders/R3/R3EA-a2UE2OcM6kNMZeg0E++Lz2/-Tmp-/npm-1295993817262", + "package": "/Users/isaacs/dev-src/js/npm/node_modules/.npm/querystring/1.0.0/package", + "modules": "/Users/isaacs/dev-src/js/npm/node_modules/querystring@1.0.0", + "dependencies": "/Users/isaacs/dev-src/js/npm/node_modules/.npm/querystring/1.0.0/node_modules" + } +} diff --git a/node_modules/url b/node_modules/url new file mode 120000 index 000000000..1d9b9f307 --- /dev/null +++ b/node_modules/url @@ -0,0 +1 @@ +./url@1.0.0
\ No newline at end of file diff --git a/node_modules/url@1.0.0/index.js b/node_modules/url@1.0.0/index.js new file mode 100755 index 000000000..6d02e4e09 --- /dev/null +++ b/node_modules/url@1.0.0/index.js @@ -0,0 +1,20 @@ +#!/usr/bin/env node +// generated by npm, please don't touch! +var dep = require('path').join(__dirname, "./../.npm/url/1.0.0/node_modules") +var depMet = require.paths.indexOf(dep) !== -1 +var bundle = dep.replace(/node_modules$/, 'package/node_modules') +var bundleMet = require.paths.indexOf(bundle) !== -1 +var from = "./../.npm/url/1.0.0/package/url" + +if (!depMet) require.paths.unshift(dep) +if (!bundleMet) require.paths.unshift(bundle) +module.exports = require(from) + +if (!depMet) { + var i = require.paths.indexOf(dep) + if (i !== -1) require.paths.splice(i, 1) +} +if (!bundleMet) { + var i = require.paths.indexOf(bundle) + if (i !== -1) require.paths.slice(i, 1) +} diff --git a/node_modules/url@1.0.0/package.json.js b/node_modules/url@1.0.0/package.json.js new file mode 100644 index 000000000..fed6f62bb --- /dev/null +++ b/node_modules/url@1.0.0/package.json.js @@ -0,0 +1,160 @@ +module.exports = { + "name": "url", + "version": "1.0.0", + "description": "The url module from nodejs", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": { + "type": "MIT", + "url": "https://github.com/isaacs/node-url/raw/master/LICENSE" + }, + "dependencies": { + "querystring": "*" + }, + "repositories": [ + { + "type": "git", + "url": "https://github.com/isaacs/node-url.git" + } + ], + "scripts": { + "test": "node test-url.js" + }, + "_id": "url@1.0.0", + "engines": { + "node": "*" + }, + "_engineSupported": true, + "_npmVersion": "0.2.16", + "_nodeVersion": "v0.3.7-pre", + "directories": {}, + "files": [ + "" + ], + "_defaultsLoaded": true, + "dist": { + "shasum": "5581c2b8553f555cbe186a78dcd059ea86eeb4f5", + "tarball": "http://registry.npmjs.org/url/-/url-1.0.0.tgz" + }, + "_bundledDeps": [], + "_resolvedDeps": [ + { + "name": "querystring", + "version": "1.0.0" + } + ], + "modules": { + "index.js": "url" + }, + "_npmConfig": { + "root": "/Users/isaacs/dev-src/js/npm/node_modules", + "binroot": "/Users/isaacs/dev-src/js/npm/node_modules/.bin", + "manroot": null, + "must-install": false, + "showlevel": 1, + "registry": "http://registry.npmjs.org/", + "argv": { + "remain": [ + "url", + "querystring", + "querystring@*" + ], + "cooked": [ + "bundle", + "install", + "url", + "querystring" + ], + "original": [ + "bundle", + "install", + "url", + "querystring" + ] + }, + "email": "i@izs.me", + "package-config:foo": "boo", + "username": "isaacs", + "auto-activate": "always", + "auto-deactivate": true, + "browser": "open", + "color": true, + "description": true, + "dev": false, + "editor": "vim", + "force": false, + "globalconfig": "/usr/local/etc/npmrc", + "gzipbin": "gzip", + "listopts": "", + "logfd": 2, + "loglevel": "info", + "outfd": 1, + "proxy": null, + "rebuild-bundle": true, + "recursive": false, + "tag": "latest", + "tar": "tar", + "tmproot": "/var/folders/R3/R3EA-a2UE2OcM6kNMZeg0E++Lz2/-Tmp-/", + "update-dependents": true, + "userconfig": "/Users/isaacs/.npmrc" + }, + "_env": { + "SVN_RSH": "ssh", + "TERM_PROGRAM": "iTerm.app", + "COMP_WORDBREAKS": " \t\n\"'><;|&(:", + "TERM": "xterm-color", + "SHELL": "/bin/bash", + "HISTSIZE": "10000", + "TMPDIR": "/var/folders/R3/R3EA-a2UE2OcM6kNMZeg0E++Lz2/-Tmp-/", + "Apple_PubSub_Socket_Render": "/tmp/launch-KgS5uC/Render", + "__dir_history": "/Users/isaacs:/Users/isaacs/dev-src/js:/Users/isaacs/dev-src/js/node-url/:/Users/isaacs/dev-src/js:/Users/isaacs/dev-src/js/.node_modules/:/Users/isaacs/dev-src/js:/Users/isaacs/dev-src/js/node-querystring/:/Users/isaacs/dev-src/js/npm", + "QTDIR": "/opt/local/lib/qt3", + "OLDPWD": "/Users/isaacs/dev-src/js/node-querystring", + "CDPATH": ".:..:/Users/isaacs/dev:/Users/isaacs/dev/js:/Users/isaacs", + "HISTFILESIZE": "1000000000", + "USER": "isaacs", + "LD_LIBRARY_PATH": "/Users/isaacs/lib:/usr/local/lib:/usr/lib:/lib", + "COMMAND_MODE": "unix2003", + "SSH_AUTH_SOCK": "/tmp/launch-5O0npo/Listeners", + "__CF_USER_TEXT_ENCODING": "0x5FF1:0:0", + "GIT_AUTHOR_NAME": "isaacs", + "GIT_COMMITTER_NAME": "isaacs", + "histchars": "!:#", + "PATH": "/Users/isaacs/bin:/usr/local/bin:/usr/local/sbin:/usr/local/include:/usr/bin:/usr/sbin:/usr/libexec:/usr/include:/bin:/sbin:/Users/isaacs/dev/js/narwhal/bin:/usr/X11R6/bin:/usr/X11R6/include:/Users/isaacs/.gem/ruby/1.8/bin", + "GIT_COMMITTER_EMAIL": "i@izs.me", + "JOBS": "4", + "INPUTRC": "/Users/isaacs/.inputrc", + "PWD": "/Users/isaacs/dev-src/js/npm", + "EDITOR": "vim", + "LANG": "en_US.UTF-8", + "NODE_PATH": "", + "MANPAGER": "more", + "SHLVL": "1", + "HOME": "/Users/isaacs", + "GITHUB_USER": "isaacs", + "PYTHONPATH": "/Users/isaacs/dev/js/node/deps/v8/tools/:/Users/isaacs/dev/js/node/tools", + "LOGNAME": "isaacs", + "VISUAL": "vim", + "CLASSPATH": "./", + "GITHUB_TOKEN": "8cb1e0c9857304a436b1234e69720e21", + "PKG_CONFIG_PATH": "/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/usr/X11/lib/pkgconfig", + "DISPLAY": "/tmp/launch-Ushwq2/org.x:0", + "GIT_AUTHOR_EMAIL": "i@izs.me", + "RSYNC_RSH": "ssh", + "__dir_index": "7", + "_": "/usr/local/bin/npm", + "COPY_EXTENDED_ATTRIBUTES_DISABLE": "1" + }, + "_npmPaths": { + "root": "/Users/isaacs/dev-src/js/npm/node_modules", + "dir": "/Users/isaacs/dev-src/js/npm/node_modules/.npm", + "cache": "/Users/isaacs/dev-src/js/npm/node_modules/.npm/.cache", + "tmp": "/var/folders/R3/R3EA-a2UE2OcM6kNMZeg0E++Lz2/-Tmp-/npm-1295993817262", + "package": "/Users/isaacs/dev-src/js/npm/node_modules/.npm/url/1.0.0/package", + "modules": "/Users/isaacs/dev-src/js/npm/node_modules/url@1.0.0", + "dependencies": "/Users/isaacs/dev-src/js/npm/node_modules/.npm/url/1.0.0/node_modules" + } +} |