diff --git a/app/MyApp/app/Home-Urdu.css b/app/MyApp/app/Home-Urdu.css index d7ce1bd25..766ba6629 100644 --- a/app/MyApp/app/Home-Urdu.css +++ b/app/MyApp/app/Home-Urdu.css @@ -1248,4 +1248,8 @@ form > fieldset > ul > li.bbf-field.field-selectLanguage { .answersection table{ width: 100%; } - +.DropDownOptn{ + float: left; + margin-left: 20px; + position: relative; +} diff --git a/app/MyApp/app/Home.css b/app/MyApp/app/Home.css index b5c325c3e..f771f10c7 100644 --- a/app/MyApp/app/Home.css +++ b/app/MyApp/app/Home.css @@ -1049,3 +1049,8 @@ form > fieldset > ul > li.bbf-field.field-selectLanguage { .answersection table{ width: 100%; } +.DropDownOptn{ + float: right; + margin-right: 20px; + position: relative; +} diff --git a/app/MyApp/app/Router.js b/app/MyApp/app/Router.js index c2675c507..a6aa4db98 100644 --- a/app/MyApp/app/Router.js +++ b/app/MyApp/app/Router.js @@ -2975,10 +2975,33 @@ $(function() { CourseMembers: function(cId) { var courseMembers = new App.Views.CourseMembers() courseMembers.courseId = cId; - App.$el.children('.body').empty(); + App.$el.children('.body').html('') App.$el.children('.body').append('
'); courseMembers.render(); - $('.courseEditStep').append(courseMembers.el); + var CoursecommunityList = ""; + if(App.configuration.get('type') == 'nation'){ + $.ajax({ + url: '/community/_design/bell/_view/getCommunityByCode', + type: 'GET', + dataType: "jsonp", + async: false, + success: function(json){ + CoursecommunityList = ''; + CoursecommunityList += ''; + $.each(json.rows, function(rec, index) { + CoursecommunityList += ''; + }) + CoursecommunityList = ''; + $('.DropDownOptn').append(CoursecommunityList); + } + }); + } + $('#CommunitySelect').change(function(){ + var selectedvalue = $('#CommunitySelect').val(); + var courseMembers = new App.Views.CourseMembers() + courseMembers.courseId = cId; + courseMembers.randerTable(selectedvalue); + }); var directionOfLang = App.languageDict.get('directionOfLang'); if(directionOfLang.toLowerCase()==="right") { $('.courseEditStep').find('h3').css('margin-right','5%'); diff --git a/app/MyApp/app/views/CourseMembers.js b/app/MyApp/app/views/CourseMembers.js index eab70e1e5..039188aa8 100644 --- a/app/MyApp/app/views/CourseMembers.js +++ b/app/MyApp/app/views/CourseMembers.js @@ -2,7 +2,6 @@ $(function () { App.Views.CourseMembers = Backbone.View.extend({ vars: {}, - initialize: function () {}, removeMember:function(e){ @@ -47,12 +46,13 @@ $(function () { config.fetch({ async: false }) + var currentConfig = config.first().toJSON() var code = currentConfig.rows[0].doc.code var na = currentConfig.rows[0].doc.nationName.substring(3,5); $('.courseEditStep').empty(); $('.courseEditStep').append('

'+App.languageDict.attributes.Course_Members+ ' | ' + courseModel.get('name') + '

') - var viewtext = '' + var viewtext = '
'+App.languageDict.attributes.Photo+''+App.languageDict.attributes.Name+''+App.languageDict.attributes.Roles+''+App.languageDict.attributes.Actions+'
' for (var i = 0; i < memberList.length; i++) { var mem = new App.Models.Member({ _id: memberList[i] @@ -94,9 +94,93 @@ $(function () { 'onclick=showComposePopupMultiple("' + mail + '") id="sendMailButton">' +App.languageDict.attributes.Send_Email+'' + ''; + +App.languageDict.attributes.Back+''; + viewtext += '
'+App.languageDict.attributes.Photo+''+App.languageDict.attributes.Name+''+App.languageDict.attributes.Roles+''+App.languageDict.attributes.Actions+'
'; + $('.courseEditStep').append(viewtext) + }, + randerTable: function(selectedvalue){ + $('#Table1').remove() + var courseModel = new App.Models.Course({ + _id: this.courseId + }) + courseModel.fetch({ + async: false + }) + var memberList = courseModel.get('members') + var configurations = Backbone.Collection.extend({ + url: App.Server + '/configurations/_all_docs?include_docs=true' + }) + var config = new configurations() + config.fetch({ + async: false + }) + var currentConfig = config.first().toJSON() + var code = currentConfig.rows[0].doc.code + var na = currentConfig.rows[0].doc.nationName.substring(3,5); + $('.courseEditStep').empty(); + $('.courseEditStep').append('

'+App.languageDict.attributes.Course_Members+ ' | ' + courseModel.get('name') + '

') + var viewtext = '' + var newMemberList = []; + for (var i = 0; i < memberList.length; i++) { + var mem = new App.Models.Member({ + _id: memberList[i] + }) + mem.fetch({ + async: false + }) + if(mem.attributes.community == selectedvalue){ + newMemberList.push(memberList[i]); + } + } + if(newMemberList.length > 0){ + for (var i = 0; i < newMemberList.length; i++) { + var mem = new App.Models.Member({ + _id: newMemberList[i] + }) + mem.fetch({ + async: false + }) + var roleOfMem; + if(courseModel.get('courseLeader').indexOf(mem.get('_id')) > -1) { + roleOfMem=App.languageDict.attributes.Leader + } else { + roleOfMem=App.languageDict.attributes.Learner + } + var mail = mem.get('login') + '.' + code +na+ '@olebell.org' + var src = "img/default.jpg" + var attchmentURL = '/members/' + mem.id + '/' + if (typeof mem.get('_attachments') !== 'undefined') { + attchmentURL = attchmentURL + _.keys(mem.get('_attachments'))[0] + src = attchmentURL + } + viewtext += '' + var loggedIn = new App.Models.Member({ + "_id": $.cookie('Member._id') + }) + loggedIn.fetch({ + async: false + }) + var roles = loggedIn.get("roles") + if( courseModel.get('courseLeader') && courseModel.get('courseLeader').indexOf($.cookie('Member._id'))>-1 || roles.indexOf('Manager')>-1) { + var memId=mem.get('_id')+','+this.courseId; + viewtext+='' + } + viewtext+='' + } + viewtext += ''; viewtext += '
'+App.languageDict.attributes.Photo+''+App.languageDict.attributes.Name+''+App.languageDict.attributes.Roles+''+App.languageDict.attributes.Actions+'
' + mem.get('firstName') + ' ' + mem.get('lastName') + ''+roleOfMem+''+App.languageDict.attributes.Send_Email+'
' + + '' + + '' + + '
'; $('.courseEditStep').append(viewtext) + } else { + viewtext += ''; + $('.courseEditStep').append(viewtext) + } } }) }) \ No newline at end of file diff --git a/app/MyApp/app/views/listSyncDbView.js b/app/MyApp/app/views/listSyncDbView.js index 0109c3ba7..7eee47e3d 100644 --- a/app/MyApp/app/views/listSyncDbView.js +++ b/app/MyApp/app/views/listSyncDbView.js @@ -17,7 +17,7 @@ $(function() { }, 1000); }, render: function() { - var $button = $('
' + App.languageDict.get('Config_Sync_With_Nation_Head') + '


' + App.languageDict.get('Log_Activity_Reports') + '
' + App.languageDict.get('Reports') + '
' + App.languageDict.get('Resources_Feedbacks') + '
' + App.languageDict.get('Application_Feedbacks') + '
' + App.languageDict.get('Members_Database') + '
' + App.languageDict.get('Surveys') + '
' + App.languageDict.get('Course_Member_Progress')+ '
'); + var $button = $('
' + App.languageDict.get('Config_Sync_With_Nation_Head') + '


' + App.languageDict.get('Log_Activity_Reports') + '
' + App.languageDict.get('Reports') + '
' + App.languageDict.get('Resources_Feedbacks') + '
' + App.languageDict.get('Application_Feedbacks') + '
' + App.languageDict.get('Members_Database') + '
' + App.languageDict.get('Surveys') + '
' + App.languageDict.get('Course_Member_Progress')+ '
' + App.languageDict.get('Courses') + '
'); this.$el.append($button); this.$el.append(''); this.$el.append(''); @@ -68,6 +68,8 @@ $(function() { context.syncSurveys(); } else if ($(this).val() == 'CourseProgress') { context.syncCourseProgress(); + } else if ($(this).val() == 'Courses') { + context.syncCourses(); } if ($(this).val() == 'Application') { context.checkAvailableUpdates() @@ -416,6 +418,30 @@ $(function() { } }) }, + syncCourses: function() { + $.ajax({ + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json; charset=utf-8' + }, + type: 'POST', + url: '/_replicate', + dataType: 'json', + data: JSON.stringify({ + "source": "courses", + "target": 'http://' + App.configuration.get('nationUrl') + '/courses', + }), + success: function(response) { + alert(App.languageDict.attributes.Courses_Replicated) + if (isActivityLogChecked == false) { + App.stopActivityIndicator(); + } + }, + error: function(XMLHttpRequest, textStatus, errorThrown) { + alert(App.languageDict.attributes.TryLater_Error) + } + }) + }, syncSurveys: function() { var that = this; that.syncSurveyResponse(); diff --git a/init_docs/Text.json b/init_docs/Text.json index 3b645a33a..10f7934b7 100644 --- a/init_docs/Text.json +++ b/init_docs/Text.json @@ -934,5 +934,6 @@ "Download_Summary" : "Download Summary", "Select_Community_ByRegion": "Filter Community by Region", "Markdown": "Markdown", - "Rich_Text": "Rich Text" + "Rich_Text": "Rich Text", + "Courses_Replicated": "Courses Replicated" } diff --git a/update_nation/node_modules/commander/package.json b/update_nation/node_modules/commander/package.json index cc04726b5..67a8a46d3 100644 --- a/update_nation/node_modules/commander/package.json +++ b/update_nation/node_modules/commander/package.json @@ -1,45 +1,62 @@ { - "name": "commander", - "version": "2.5.0", - "description": "the complete solution for node.js command-line programs", - "keywords": [ - "command", - "option", - "parser", - "prompt" + "_from": "commander@2.5.0", + "_id": "commander@2.5.0", + "_inBundle": false, + "_integrity": "sha1-13e2pNhH1CPl1HXahkKUrB/1qp0=", + "_location": "/commander", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "commander@2.5.0", + "name": "commander", + "escapedName": "commander", + "rawSpec": "2.5.0", + "saveSpec": null, + "fetchSpec": "2.5.0" + }, + "_requiredBy": [ + "/" ], + "_resolved": "https://registry.npmjs.org/commander/-/commander-2.5.0.tgz", + "_shasum": "d777b6a4d847d423e5d475da864294ac1ff5aa9d", + "_spec": "commander@2.5.0", + "_where": "/Users/Raju/BeLL-Apps/update_nation", "author": { "name": "TJ Holowaychuk", "email": "tj@vision-media.ca" }, - "license": "MIT", - "repository": { - "type": "git", - "url": "https://github.com/tj/commander.js.git" + "bugs": { + "url": "https://github.com/tj/commander.js/issues" }, + "bundleDependencies": false, + "deprecated": false, + "description": "the complete solution for node.js command-line programs", "devDependencies": { "should": ">= 0.0.1" }, - "scripts": { - "test": "make test" - }, - "main": "index", "engines": { "node": ">= 0.6.x" }, "files": [ "index.js" ], - "readme": "# Commander.js\n\n [![Build Status](https://api.travis-ci.org/tj/commander.js.svg)](http://travis-ci.org/tj/commander.js)\n[![NPM Version](http://img.shields.io/npm/v/commander.svg?style=flat)](https://www.npmjs.org/package/commander)\n[![NPM Downloads](https://img.shields.io/npm/dm/commander.svg?style=flat)](https://www.npmjs.org/package/commander)\n\n The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/tj/commander).\n\n\n## Installation\n\n $ npm install commander\n\n## Option parsing\n\n Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options.\n\n```js\n#!/usr/bin/env node\n\n/**\n * Module dependencies.\n */\n\nvar program = require('commander');\n\nprogram\n .version('0.0.1')\n .option('-p, --peppers', 'Add peppers')\n .option('-P, --pineapple', 'Add pineapple')\n .option('-b, --bbq', 'Add bbq sauce')\n .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble')\n .parse(process.argv);\n\nconsole.log('you ordered a pizza with:');\nif (program.peppers) console.log(' - peppers');\nif (program.pineapple) console.log(' - pineapple');\nif (program.bbq) console.log(' - bbq');\nconsole.log(' - %s cheese', program.cheese);\n```\n\n Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as \"--template-engine\" are camel-cased, becoming `program.templateEngine` etc.\n\n## Variadic arguments\n\n The last argument of a command can be variadic, and only the last argument. To make an argument variadic you have to\n append `...` to the argument name. Here is an example:\n\n```js\n#!/usr/bin/env node\n\n/**\n * Module dependencies.\n */\n\nvar program = require('commander');\n\nprogram\n .version('0.0.1')\n .command('rmdir [otherDirs...]')\n .action(function (dir, otherDirs) {\n console.log('rmdir %s', dir);\n if (otherDirs) {\n otherDirs.forEach(function (oDir) {\n console.log('rmdir %s', oDir);\n });\n }\n });\n\nprogram.parse(process.argv);\n```\n\n An `Array` is used for the value of a variadic argument. This applies to `program.args` as well as the argument passed\n to your action as demonstrated above.\n\n## Automated --help\n\n The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free:\n\n``` \n $ ./examples/pizza --help\n\n Usage: pizza [options]\n\n Options:\n\n -V, --version output the version number\n -p, --peppers Add peppers\n -P, --pineapple Add pineapple\n -b, --bbq Add bbq sauce\n -c, --cheese Add the specified type of cheese [marble]\n -h, --help output usage information\n\n```\n\n## Coercion\n\n```js\nfunction range(val) {\n return val.split('..').map(Number);\n}\n\nfunction list(val) {\n return val.split(',');\n}\n\nfunction collect(val, memo) {\n memo.push(val);\n return memo;\n}\n\nfunction increaseVerbosity(v, total) {\n return total + 1;\n}\n\nprogram\n .version('0.0.1')\n .usage('[options] ')\n .option('-i, --integer ', 'An integer argument', parseInt)\n .option('-f, --float ', 'A float argument', parseFloat)\n .option('-r, --range ..', 'A range', range)\n .option('-l, --list ', 'A list', list)\n .option('-o, --optional [value]', 'An optional value')\n .option('-c, --collect [value]', 'A repeatable value', collect, [])\n .option('-v, --verbose', 'A value that can be increased', increaseVerbosity, 0)\n .parse(process.argv);\n\nconsole.log(' int: %j', program.integer);\nconsole.log(' float: %j', program.float);\nconsole.log(' optional: %j', program.optional);\nprogram.range = program.range || [];\nconsole.log(' range: %j..%j', program.range[0], program.range[1]);\nconsole.log(' list: %j', program.list);\nconsole.log(' collect: %j', program.collect);\nconsole.log(' verbosity: %j', program.verbose);\nconsole.log(' args: %j', program.args);\n```\n\n## Custom help\n\n You can display arbitrary `-h, --help` information\n by listening for \"--help\". Commander will automatically\n exit once you are done so that the remainder of your program\n does not execute causing undesired behaviours, for example\n in the following executable \"stuff\" will not output when\n `--help` is used.\n\n```js\n#!/usr/bin/env node\n\n/**\n * Module dependencies.\n */\n\nvar program = require('../');\n\nprogram\n .version('0.0.1')\n .option('-f, --foo', 'enable some foo')\n .option('-b, --bar', 'enable some bar')\n .option('-B, --baz', 'enable some baz');\n\n// must be before .parse() since\n// node's emit() is immediate\n\nprogram.on('--help', function(){\n console.log(' Examples:');\n console.log('');\n console.log(' $ custom-help --help');\n console.log(' $ custom-help -h');\n console.log('');\n});\n\nprogram.parse(process.argv);\n\nconsole.log('stuff');\n```\n\nyielding the following help output:\n\n```\n\nUsage: custom-help [options]\n\nOptions:\n\n -h, --help output usage information\n -V, --version output the version number\n -f, --foo enable some foo\n -b, --bar enable some bar\n -B, --baz enable some baz\n\nExamples:\n\n $ custom-help --help\n $ custom-help -h\n\n```\n\n## .outputHelp()\n\n Output help information without exiting.\n\n## .help()\n\n Output help information and exit immediately.\n\n## Links\n\n - [API documentation](http://tj.github.com/commander.js/)\n - [ascii tables](https://github.com/LearnBoost/cli-table)\n - [progress bars](https://github.com/tj/node-progress)\n - [more progress bars](https://github.com/substack/node-multimeter)\n - [examples](https://github.com/tj/commander.js/tree/master/examples)\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/tj/commander.js/issues" + "homepage": "https://github.com/tj/commander.js#readme", + "keywords": [ + "command", + "option", + "parser", + "prompt" + ], + "license": "MIT", + "main": "index", + "name": "commander", + "repository": { + "type": "git", + "url": "git+https://github.com/tj/commander.js.git" }, - "homepage": "https://github.com/tj/commander.js", - "_id": "commander@2.5.0", - "dist": { - "shasum": "670c04b2d0feab01e1b2ee088b3876fbbcfbb532" + "scripts": { + "test": "make test" }, - "_from": "commander@2.5.0", - "_resolved": "https://registry.npmjs.org/commander/-/commander-2.5.0.tgz" + "version": "2.5.0" } diff --git a/update_nation/node_modules/couchapp/node_modules/.bin/node-http-proxy b/update_nation/node_modules/couchapp/node_modules/.bin/node-http-proxy deleted file mode 100644 index 013d0b0e1..000000000 --- a/update_nation/node_modules/couchapp/node_modules/.bin/node-http-proxy +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -basedir=`dirname "$0"` - -case `uname` in - *CYGWIN*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - "$basedir/node" "$basedir/../http-proxy/bin/node-http-proxy" "$@" - ret=$? -else - node "$basedir/../http-proxy/bin/node-http-proxy" "$@" - ret=$? -fi -exit $ret diff --git a/update_nation/node_modules/couchapp/node_modules/connect/History.md b/update_nation/node_modules/couchapp/node_modules/connect/History.md deleted file mode 100644 index 29547ce9b..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/History.md +++ /dev/null @@ -1,2176 +0,0 @@ -3.3.5 / 2015-03-16 -================== - - * deps: debug@~2.1.3 - - Fix high intensity foreground color for bold - - deps: ms@0.7.0 - * deps: finalhandler@0.3.4 - - deps: debug@~2.1.3 - -3.3.4 / 2015-01-07 -================== - - * deps: debug@~2.1.1 - * deps: finalhandler@0.3.3 - - deps: debug@~2.1.1 - - deps: on-finished@~2.2.0 - -3.3.3 / 2014-11-09 -================== - - * Correctly invoke async callback asynchronously - -3.3.2 / 2014-10-28 -================== - - * Fix handling of URLs containing `://` in the path - -3.3.1 / 2014-10-22 -================== - - * deps: finalhandler@0.3.2 - - deps: on-finished@~2.1.1 - -3.3.0 / 2014-10-17 -================== - - * deps: debug@~2.1.0 - - Implement `DEBUG_FD` env variable support - * deps: finalhandler@0.3.1 - - Terminate in progress response only on error - - Use `on-finished` to determine request status - - deps: debug@~2.1.0 - -3.2.0 / 2014-09-08 -================== - - * deps: debug@~2.0.0 - * deps: finalhandler@0.2.0 - - Set `X-Content-Type-Options: nosniff` header - - deps: debug@~2.0.0 - -3.1.1 / 2014-08-10 -================== - - * deps: parseurl@~1.3.0 - -3.1.0 / 2014-07-22 -================== - - * deps: debug@1.0.4 - * deps: finalhandler@0.1.0 - - Respond after request fully read - - deps: debug@1.0.4 - * deps: parseurl@~1.2.0 - - Cache URLs based on original value - - Remove no-longer-needed URL mis-parse work-around - - Simplify the "fast-path" `RegExp` - * perf: reduce executed logic in routing - * perf: refactor location of `try` block - -3.0.2 / 2014-07-10 -================== - - * deps: debug@1.0.3 - - Add support for multiple wildcards in namespaces - * deps: parseurl@~1.1.3 - - faster parsing of href-only URLs - -3.0.1 / 2014-06-19 -================== - - * use `finalhandler` for final response handling - * deps: debug@1.0.2 - -3.0.0 / 2014-05-29 -================== - - * No changes - -3.0.0-rc.2 / 2014-05-04 -======================= - - * Call error stack even when response has been sent - * Prevent default 404 handler after response sent - * dep: debug@0.8.1 - * encode stack in HTML for default error handler - * remove `proto` export - -3.0.0-rc.1 / 2014-03-06 -======================= - - * move middleware to separate repos - * remove docs - * remove node patches - * remove connect(middleware...) - * remove the old `connect.createServer()` method - * remove various private `connect.utils` functions - * drop node.js 0.8 support - -2.29.1 / 2015-03-16 -=================== - - * deps: body-parser@~1.12.2 - - deps: debug@~2.1.3 - - deps: qs@2.4.1 - - deps: type-is@~1.6.1 - * deps: compression@~1.4.3 - - Fix error when code calls `res.end(str, encoding)` - - deps: accepts@~1.2.5 - - deps: debug@~2.1.3 - * deps: connect-timeout@~1.6.1 - - deps: debug@~2.1.3 - * deps: debug@~2.1.3 - - Fix high intensity foreground color for bold - - deps: ms@0.7.0 - * deps: errorhandler@~1.3.5 - - deps: accepts@~1.2.5 - * deps: express-session@~1.10.4 - - deps: debug@~2.1.3 - * deps: finalhandler@0.3.4 - - deps: debug@~2.1.3 - * deps: method-override@~2.3.2 - - deps: debug@~2.1.3 - * deps: morgan@~1.5.2 - - deps: debug@~2.1.3 - * deps: qs@2.4.1 - - Fix error when parameter `hasOwnProperty` is present - * deps: serve-index@~1.6.3 - - Properly escape file names in HTML - - deps: accepts@~1.2.5 - - deps: debug@~2.1.3 - - deps: escape-html@1.0.1 - - deps: mime-types@~2.0.10 - * deps: serve-static@~1.9.2 - - deps: send@0.12.2 - * deps: type-is@~1.6.1 - - deps: mime-types@~2.0.10 - -2.29.0 / 2015-02-17 -=================== - - * Use `content-type` to parse `Content-Type` headers - * deps: body-parser@~1.12.0 - - add `debug` messages - - accept a function for the `type` option - - make internal `extended: true` depth limit infinity - - use `content-type` to parse `Content-Type` headers - - deps: iconv-lite@0.4.7 - - deps: raw-body@1.3.3 - - deps: type-is@~1.6.0 - * deps: compression@~1.4.1 - - Prefer `gzip` over `deflate` on the server - - deps: accepts@~1.2.4 - * deps: connect-timeout@~1.6.0 - - deps: http-errors@~1.3.1 - * deps: cookie-parser@~1.3.4 - - deps: cookie-signature@1.0.6 - * deps: cookie-signature@1.0.6 - * deps: csurf@~1.7.0 - - Accept `CSRF-Token` and `XSRF-Token` request headers - - Default `cookie.path` to `'/'`, if using cookies - - deps: cookie-signature@1.0.6 - - deps: csrf@~2.0.6 - - deps: http-errors@~1.3.1 - * deps: errorhandler@~1.3.4 - - deps: accepts@~1.2.4 - * deps: express-session@~1.10.3 - - deps: cookie-signature@1.0.6 - - deps: uid-safe@1.1.0 - * deps: http-errors@~1.3.1 - - Construct errors using defined constructors from `createError` - - Fix error names that are not identifiers - - Set a meaningful `name` property on constructed errors - * deps: response-time@~2.3.0 - - Add function argument to support recording of response time - * deps: serve-index@~1.6.2 - - deps: accepts@~1.2.4 - - deps: http-errors@~1.3.1 - - deps: mime-types@~2.0.9 - * deps: serve-static@~1.9.1 - - deps: send@0.12.1 - * deps: type-is@~1.6.0 - - fix argument reassignment - - fix false-positives in `hasBody` `Transfer-Encoding` check - - support wildcard for both type and subtype (`*/*`) - - deps: mime-types@~2.0.9 - -2.28.3 / 2015-01-31 -=================== - - * deps: compression@~1.3.1 - - deps: accepts@~1.2.3 - - deps: compressible@~2.0.2 - * deps: csurf@~1.6.6 - - deps: csrf@~2.0.5 - * deps: errorhandler@~1.3.3 - - deps: accepts@~1.2.3 - * deps: express-session@~1.10.2 - - deps: uid-safe@1.0.3 - * deps: serve-index@~1.6.1 - - deps: accepts@~1.2.3 - - deps: mime-types@~2.0.8 - * deps: type-is@~1.5.6 - - deps: mime-types@~2.0.8 - -2.28.2 / 2015-01-20 -=================== - - * deps: body-parser@~1.10.2 - - deps: iconv-lite@0.4.6 - - deps: raw-body@1.3.2 - * deps: serve-static@~1.8.1 - - Fix redirect loop in Node.js 0.11.14 - - Fix root path disclosure - - deps: send@0.11.1 - -2.28.1 / 2015-01-08 -=================== - - * deps: csurf@~1.6.5 - - deps: csrf@~2.0.4 - * deps: express-session@~1.10.1 - - deps: uid-safe@~1.0.2 - -2.28.0 / 2015-01-05 -=================== - - * deps: body-parser@~1.10.1 - - Make internal `extended: true` array limit dynamic - - deps: on-finished@~2.2.0 - - deps: type-is@~1.5.5 - * deps: compression@~1.3.0 - - Export the default `filter` function for wrapping - - deps: accepts@~1.2.2 - - deps: debug@~2.1.1 - * deps: connect-timeout@~1.5.0 - - deps: debug@~2.1.1 - - deps: http-errors@~1.2.8 - - deps: ms@0.7.0 - * deps: csurf@~1.6.4 - - deps: csrf@~2.0.3 - - deps: http-errors@~1.2.8 - * deps: debug@~2.1.1 - * deps: errorhandler@~1.3.2 - - Add `log` option - - Fix heading content to not include stack - - deps: accepts@~1.2.2 - * deps: express-session@~1.10.0 - - Add `store.touch` interface for session stores - - Fix `MemoryStore` expiration with `resave: false` - - deps: debug@~2.1.1 - * deps: finalhandler@0.3.3 - - deps: debug@~2.1.1 - - deps: on-finished@~2.2.0 - * deps: method-override@~2.3.1 - - deps: debug@~2.1.1 - - deps: methods@~1.1.1 - * deps: morgan@~1.5.1 - - Add multiple date formats `clf`, `iso`, and `web` - - Deprecate `buffer` option - - Fix date format in `common` and `combined` formats - - Fix token arguments to accept values with `"` - - deps: debug@~2.1.1 - - deps: on-finished@~2.2.0 - * deps: serve-favicon@~2.2.0 - - Support query string in the URL - - deps: etag@~1.5.1 - - deps: ms@0.7.0 - * deps: serve-index@~1.6.0 - - Add link to root directory - - deps: accepts@~1.2.2 - - deps: batch@0.5.2 - - deps: debug@~2.1.1 - - deps: mime-types@~2.0.7 - * deps: serve-static@~1.8.0 - - Fix potential open redirect when mounted at root - - deps: send@0.11.0 - * deps: type-is@~1.5.5 - - deps: mime-types@~2.0.7 - -2.27.6 / 2014-12-10 -=================== - - * deps: serve-index@~1.5.3 - - deps: accepts@~1.1.4 - - deps: http-errors@~1.2.8 - - deps: mime-types@~2.0.4 - -2.27.5 / 2014-12-10 -=================== - - * deps: compression@~1.2.2 - - Fix `.end` to only proxy to `.end` - - deps: accepts@~1.1.4 - * deps: express-session@~1.9.3 - - Fix error when `req.sessionID` contains a non-string value - * deps: http-errors@~1.2.8 - - Fix stack trace from exported function - - Remove `arguments.callee` usage - * deps: serve-index@~1.5.2 - - Fix icon name background alignment on mobile view - * deps: type-is@~1.5.4 - - deps: mime-types@~2.0.4 - -2.27.4 / 2014-11-23 -=================== - - * deps: body-parser@~1.9.3 - - deps: iconv-lite@0.4.5 - - deps: qs@2.3.3 - - deps: raw-body@1.3.1 - - deps: type-is@~1.5.3 - * deps: compression@~1.2.1 - - deps: accepts@~1.1.3 - * deps: errorhandler@~1.2.3 - - deps: accepts@~1.1.3 - * deps: express-session@~1.9.2 - - deps: crc@3.2.1 - * deps: qs@2.3.3 - - Fix `arrayLimit` behavior - * deps: serve-favicon@~2.1.7 - - Avoid errors from enumerables on `Object.prototype` - * deps: serve-index@~1.5.1 - - deps: accepts@~1.1.3 - - deps: mime-types@~2.0.3 - * deps: type-is@~1.5.3 - - deps: mime-types@~2.0.3 - -2.27.3 / 2014-11-09 -=================== - - * Correctly invoke async callback asynchronously - * deps: csurf@~1.6.3 - - bump csrf - - bump http-errors - -2.27.2 / 2014-10-28 -=================== - - * Fix handling of URLs containing `://` in the path - * deps: body-parser@~1.9.2 - - deps: qs@2.3.2 - * deps: qs@2.3.2 - - Fix parsing of mixed objects and values - -2.27.1 / 2014-10-22 -=================== - - * deps: body-parser@~1.9.1 - - deps: on-finished@~2.1.1 - - deps: qs@2.3.0 - - deps: type-is@~1.5.2 - * deps: express-session@~1.9.1 - - Remove unnecessary empty write call - * deps: finalhandler@0.3.2 - - deps: on-finished@~2.1.1 - * deps: morgan@~1.4.1 - - deps: on-finished@~2.1.1 - * deps: qs@2.3.0 - - Fix parsing of mixed implicit and explicit arrays - * deps: serve-static@~1.7.1 - - deps: send@0.10.1 - -2.27.0 / 2014-10-16 -=================== - - * Use `http-errors` module for creating errors - * Use `utils-merge` module for merging objects - * deps: body-parser@~1.9.0 - - include the charset in "unsupported charset" error message - - include the encoding in "unsupported content encoding" error message - - deps: depd@~1.0.0 - * deps: compression@~1.2.0 - - deps: debug@~2.1.0 - * deps: connect-timeout@~1.4.0 - - Create errors with `http-errors` - - deps: debug@~2.1.0 - * deps: debug@~2.1.0 - - Implement `DEBUG_FD` env variable support - * deps: depd@~1.0.0 - * deps: express-session@~1.9.0 - - deps: debug@~2.1.0 - - deps: depd@~1.0.0 - * deps: finalhandler@0.3.1 - - Terminate in progress response only on error - - Use `on-finished` to determine request status - - deps: debug@~2.1.0 - * deps: method-override@~2.3.0 - - deps: debug@~2.1.0 - * deps: morgan@~1.4.0 - - Add `debug` messages - - deps: depd@~1.0.0 - * deps: response-time@~2.2.0 - - Add `header` option for custom header name - - Add `suffix` option - - Change `digits` argument to an `options` argument - - deps: depd@~1.0.0 - * deps: serve-favicon@~2.1.6 - - deps: etag@~1.5.0 - * deps: serve-index@~1.5.0 - - Add `dir` argument to `filter` function - - Add icon for mkv files - - Create errors with `http-errors` - - Fix incorrect 403 on Windows and Node.js 0.11 - - Lookup icon by mime type for greater icon support - - Support using tokens multiple times - - deps: accepts@~1.1.2 - - deps: debug@~2.1.0 - - deps: mime-types@~2.0.2 - * deps: serve-static@~1.7.0 - - deps: send@0.10.0 - -2.26.6 / 2014-10-15 -=================== - - * deps: compression@~1.1.2 - - deps: accepts@~1.1.2 - - deps: compressible@~2.0.1 - * deps: csurf@~1.6.2 - - bump http-errors - - fix cookie name when using `cookie: true` - * deps: errorhandler@~1.2.2 - - deps: accepts@~1.1.2 - -2.26.5 / 2014-10-08 -=================== - - * Fix accepting non-object arguments to `logger` - * deps: serve-static@~1.6.4 - - Fix redirect loop when index file serving disabled - -2.26.4 / 2014-10-02 -=================== - - * deps: morgan@~1.3.2 - - Fix `req.ip` integration when `immediate: false` - * deps: type-is@~1.5.2 - - deps: mime-types@~2.0.2 - -2.26.3 / 2014-09-24 -=================== - - * deps: body-parser@~1.8.4 - - fix content encoding to be case-insensitive - * deps: serve-favicon@~2.1.5 - - deps: etag@~1.4.0 - * deps: serve-static@~1.6.3 - - deps: send@0.9.3 - -2.26.2 / 2014-09-19 -=================== - - * deps: body-parser@~1.8.3 - - deps: qs@2.2.4 - * deps: qs@2.2.4 - - Fix issue with object keys starting with numbers truncated - -2.26.1 / 2014-09-15 -=================== - - * deps: body-parser@~1.8.2 - - deps: depd@0.4.5 - * deps: depd@0.4.5 - * deps: express-session@~1.8.2 - - Use `crc` instead of `buffer-crc32` for speed - - deps: depd@0.4.5 - * deps: morgan@~1.3.1 - - Remove un-used `bytes` dependency - - deps: depd@0.4.5 - * deps: serve-favicon@~2.1.4 - - Fix content headers being sent in 304 response - - deps: etag@~1.3.1 - * deps: serve-static@~1.6.2 - - deps: send@0.9.2 - -2.26.0 / 2014-09-08 -=================== - - * deps: body-parser@~1.8.1 - - add `parameterLimit` option to `urlencoded` parser - - change `urlencoded` extended array limit to 100 - - make empty-body-handling consistent between chunked requests - - respond with 415 when over `parameterLimit` in `urlencoded` - - deps: media-typer@0.3.0 - - deps: qs@2.2.3 - - deps: type-is@~1.5.1 - * deps: compression@~1.1.0 - - deps: accepts@~1.1.0 - - deps: compressible@~2.0.0 - - deps: debug@~2.0.0 - * deps: connect-timeout@~1.3.0 - - deps: debug@~2.0.0 - * deps: cookie-parser@~1.3.3 - - deps: cookie-signature@1.0.5 - * deps: cookie-signature@1.0.5 - * deps: csurf@~1.6.1 - - add `ignoreMethods` option - - bump cookie-signature - - csrf-tokens -> csrf - - set `code` property on CSRF token errors - * deps: debug@~2.0.0 - * deps: errorhandler@~1.2.0 - - Display error using `util.inspect` if no other representation - - deps: accepts@~1.1.0 - * deps: express-session@~1.8.1 - - Do not resave already-saved session at end of request - - Prevent session prototype methods from being overwritten - - deps: cookie-signature@1.0.5 - - deps: debug@~2.0.0 - * deps: finalhandler@0.2.0 - - Set `X-Content-Type-Options: nosniff` header - - deps: debug@~2.0.0 - * deps: fresh@0.2.4 - * deps: media-typer@0.3.0 - - Throw error when parameter format invalid on parse - * deps: method-override@~2.2.0 - - deps: debug@~2.0.0 - * deps: morgan@~1.3.0 - - Assert if `format` is not a function or string - * deps: qs@2.2.3 - - Fix issue where first empty value in array is discarded - * deps: serve-favicon@~2.1.3 - - Accept string for `maxAge` (converted by `ms`) - - Use `etag` to generate `ETag` header - - deps: fresh@0.2.4 - * deps: serve-index@~1.2.1 - - Add `debug` messages - - Resolve relative paths at middleware setup - - deps: accepts@~1.1.0 - * deps: serve-static@~1.6.1 - - Add `lastModified` option - - deps: send@0.9.1 - * deps: type-is@~1.5.1 - - fix `hasbody` to be true for `content-length: 0` - - deps: media-typer@0.3.0 - - deps: mime-types@~2.0.1 - * deps: vhost@~3.0.0 - -2.25.10 / 2014-09-04 -==================== - - * deps: serve-static@~1.5.4 - - deps: send@0.8.5 - -2.25.9 / 2014-08-29 -=================== - - * deps: body-parser@~1.6.7 - - deps: qs@2.2.2 - * deps: qs@2.2.2 - -2.25.8 / 2014-08-27 -=================== - - * deps: body-parser@~1.6.6 - - deps: qs@2.2.0 - * deps: csurf@~1.4.1 - * deps: qs@2.2.0 - - Array parsing fix - - Performance improvements - -2.25.7 / 2014-08-18 -=================== - - * deps: body-parser@~1.6.5 - - deps: on-finished@2.1.0 - * deps: express-session@~1.7.6 - - Fix exception on `res.end(null)` calls - * deps: morgan@~1.2.3 - - deps: on-finished@2.1.0 - * deps: serve-static@~1.5.3 - - deps: send@0.8.3 - -2.25.6 / 2014-08-14 -=================== - - * deps: body-parser@~1.6.4 - - deps: qs@1.2.2 - * deps: qs@1.2.2 - * deps: serve-static@~1.5.2 - - deps: send@0.8.2 - -2.25.5 / 2014-08-11 -=================== - - * Fix backwards compatibility in `logger` - -2.25.4 / 2014-08-10 -=================== - - * Fix `query` middleware breaking with argument - - It never really took one in the first place - * deps: body-parser@~1.6.3 - - deps: qs@1.2.1 - * deps: compression@~1.0.11 - - deps: on-headers@~1.0.0 - - deps: parseurl@~1.3.0 - * deps: connect-timeout@~1.2.2 - - deps: on-headers@~1.0.0 - * deps: express-session@~1.7.5 - - Fix parsing original URL - - deps: on-headers@~1.0.0 - - deps: parseurl@~1.3.0 - * deps: method-override@~2.1.3 - * deps: on-headers@~1.0.0 - * deps: parseurl@~1.3.0 - * deps: qs@1.2.1 - * deps: response-time@~2.0.1 - - deps: on-headers@~1.0.0 - * deps: serve-index@~1.1.6 - - Fix URL parsing - * deps: serve-static@~1.5.1 - - Fix parsing of weird `req.originalUrl` values - - deps: parseurl@~1.3.0 - = deps: utils-merge@1.0.0 - -2.25.3 / 2014-08-07 -=================== - - * deps: multiparty@3.3.2 - - Fix potential double-callback - -2.25.2 / 2014-08-07 -=================== - - * deps: body-parser@~1.6.2 - - deps: qs@1.2.0 - * deps: qs@1.2.0 - - Fix parsing array of objects - -2.25.1 / 2014-08-06 -=================== - - * deps: body-parser@~1.6.1 - - deps: qs@1.1.0 - * deps: qs@1.1.0 - - Accept urlencoded square brackets - - Accept empty values in implicit array notation - -2.25.0 / 2014-08-05 -=================== - - * deps: body-parser@~1.6.0 - - deps: qs@1.0.2 - * deps: compression@~1.0.10 - - Fix upper-case Content-Type characters prevent compression - - deps: compressible@~1.1.1 - * deps: csurf@~1.4.0 - - Support changing `req.session` after `csurf` middleware - - Calling `res.csrfToken()` after `req.session.destroy()` will now work - * deps: express-session@~1.7.4 - - Fix `res.end` patch to call correct upstream `res.write` - - Fix response end delay for non-chunked responses - * deps: qs@1.0.2 - - Complete rewrite - - Limits array length to 20 - - Limits object depth to 5 - - Limits parameters to 1,000 - * deps: serve-static@~1.5.0 - - Add `extensions` option - - deps: send@0.8.1 - -2.24.3 / 2014-08-04 -=================== - - * deps: serve-index@~1.1.5 - - Fix Content-Length calculation for multi-byte file names - - deps: accepts@~1.0.7 - * deps: serve-static@~1.4.4 - - Fix incorrect 403 on Windows and Node.js 0.11 - - deps: send@0.7.4 - -2.24.2 / 2014-07-27 -=================== - - * deps: body-parser@~1.5.2 - * deps: depd@0.4.4 - - Work-around v8 generating empty stack traces - * deps: express-session@~1.7.2 - * deps: morgan@~1.2.2 - * deps: serve-static@~1.4.2 - -2.24.1 / 2014-07-26 -=================== - - * deps: body-parser@~1.5.1 - * deps: depd@0.4.3 - - Fix exception when global `Error.stackTraceLimit` is too low - * deps: express-session@~1.7.1 - * deps: morgan@~1.2.1 - * deps: serve-index@~1.1.4 - * deps: serve-static@~1.4.1 - -2.24.0 / 2014-07-22 -=================== - - * deps: body-parser@~1.5.0 - - deps: depd@0.4.2 - - deps: iconv-lite@0.4.4 - - deps: raw-body@1.3.0 - - deps: type-is@~1.3.2 - * deps: compression@~1.0.9 - - Add `debug` messages - - deps: accepts@~1.0.7 - * deps: connect-timeout@~1.2.1 - - Accept string for `time` (converted by `ms`) - - deps: debug@1.0.4 - * deps: debug@1.0.4 - * deps: depd@0.4.2 - - Add `TRACE_DEPRECATION` environment variable - - Remove non-standard grey color from color output - - Support `--no-deprecation` argument - - Support `--trace-deprecation` argument - * deps: express-session@~1.7.0 - - Improve session-ending error handling - - deps: debug@1.0.4 - - deps: depd@0.4.2 - * deps: finalhandler@0.1.0 - - Respond after request fully read - - deps: debug@1.0.4 - * deps: method-override@~2.1.2 - - deps: debug@1.0.4 - - deps: parseurl@~1.2.0 - * deps: morgan@~1.2.0 - - Add `:remote-user` token - - Add `combined` log format - - Add `common` log format - - Remove non-standard grey color from `dev` format - * deps: multiparty@3.3.1 - * deps: parseurl@~1.2.0 - - Cache URLs based on original value - - Remove no-longer-needed URL mis-parse work-around - - Simplify the "fast-path" `RegExp` - * deps: serve-static@~1.4.0 - - Add `dotfiles` option - - deps: parseurl@~1.2.0 - - deps: send@0.7.0 - -2.23.0 / 2014-07-10 -=================== - - * deps: debug@1.0.3 - - Add support for multiple wildcards in namespaces - * deps: express-session@~1.6.4 - * deps: method-override@~2.1.0 - - add simple debug output - - deps: methods@1.1.0 - - deps: parseurl@~1.1.3 - * deps: parseurl@~1.1.3 - - faster parsing of href-only URLs - * deps: serve-static@~1.3.1 - - deps: parseurl@~1.1.3 - -2.22.0 / 2014-07-03 -=================== - - * deps: csurf@~1.3.0 - - Fix `cookie.signed` option to actually sign cookie - * deps: express-session@~1.6.1 - - Fix `res.end` patch to return correct value - - Fix `res.end` patch to handle multiple `res.end` calls - - Reject cookies with missing signatures - * deps: multiparty@3.3.0 - - Always emit close after all parts ended - - Fix callback hang in node.js 0.8 on errors - * deps: serve-static@~1.3.0 - - Accept string for `maxAge` (converted by `ms`) - - Add `setHeaders` option - - Include HTML link in redirect response - - deps: send@0.5.0 - -2.21.1 / 2014-06-26 -=================== - - * deps: cookie-parser@1.3.2 - - deps: cookie-signature@1.0.4 - * deps: cookie-signature@1.0.4 - - fix for timing attacks - * deps: express-session@~1.5.2 - - deps: cookie-signature@1.0.4 - * deps: type-is@~1.3.2 - - more mime types - -2.21.0 / 2014-06-20 -=================== - - * deprecate `connect(middleware)` -- use `app.use(middleware)` instead - * deprecate `connect.createServer()` -- use `connect()` instead - * fix `res.setHeader()` patch to work with get -> append -> set pattern - * deps: compression@~1.0.8 - * deps: errorhandler@~1.1.1 - * deps: express-session@~1.5.0 - - Deprecate integration with `cookie-parser` middleware - - Deprecate looking for secret in `req.secret` - - Directly read cookies; `cookie-parser` no longer required - - Directly set cookies; `res.cookie` no longer required - - Generate session IDs with `uid-safe`, faster and even less collisions - * deps: serve-index@~1.1.3 - -2.20.2 / 2014-06-19 -=================== - - * deps: body-parser@1.4.3 - - deps: type-is@1.3.1 - -2.20.1 / 2014-06-19 -=================== - - * deps: type-is@1.3.1 - - fix global variable leak - -2.20.0 / 2014-06-19 -=================== - - * deprecate `verify` option to `json` -- use `body-parser` npm module instead - * deprecate `verify` option to `urlencoded` -- use `body-parser` npm module instead - * deprecate things with `depd` module - * use `finalhandler` for final response handling - * use `media-typer` to parse `content-type` for charset - * deps: body-parser@1.4.2 - - check accepted charset in content-type (accepts utf-8) - - check accepted encoding in content-encoding (accepts identity) - - deprecate `urlencoded()` without provided `extended` option - - lazy-load urlencoded parsers - - support gzip and deflate bodies - - set `inflate: false` to turn off - - deps: raw-body@1.2.2 - - deps: type-is@1.3.0 - - Support all encodings from `iconv-lite` - * deps: connect-timeout@1.1.1 - - deps: debug@1.0.2 - * deps: cookie-parser@1.3.1 - - export parsing functions - - `req.cookies` and `req.signedCookies` are now plain objects - - slightly faster parsing of many cookies - * deps: csurf@1.2.2 - * deps: errorhandler@1.1.0 - - Display error on console formatted like `throw` - - Escape HTML in stack trace - - Escape HTML in title - - Fix up edge cases with error sent in response - - Set `X-Content-Type-Options: nosniff` header - - Use accepts for negotiation - * deps: express-session@1.4.0 - - Add `genid` option to generate custom session IDs - - Add `saveUninitialized` option to control saving uninitialized sessions - - Add `unset` option to control unsetting `req.session` - - Generate session IDs with `rand-token` by default; reduce collisions - - Integrate with express "trust proxy" by default - - deps: buffer-crc32@0.2.3 - - deps: debug@1.0.2 - * deps: multiparty@3.2.9 - * deps: serve-index@1.1.2 - - deps: batch@0.5.1 - * deps: type-is@1.3.0 - - improve type parsing - * deps: vhost@2.0.0 - - Accept `RegExp` object for `hostname` - - Provide `req.vhost` object - - Support IPv6 literal in `Host` header - -2.19.6 / 2014-06-11 -=================== - - * deps: body-parser@1.3.1 - - deps: type-is@1.2.1 - * deps: compression@1.0.7 - - use vary module for better `Vary` behavior - - deps: accepts@1.0.3 - - deps: compressible@1.1.0 - * deps: debug@1.0.2 - * deps: serve-index@1.1.1 - - deps: accepts@1.0.3 - * deps: serve-static@1.2.3 - - Do not throw un-catchable error on file open race condition - - deps: send@0.4.3 - -2.19.5 / 2014-06-09 -=================== - - * deps: csurf@1.2.1 - - refactor to use csrf-tokens@~1.0.2 - * deps: debug@1.0.1 - * deps: serve-static@1.2.2 - - fix "event emitter leak" warnings - - deps: send@0.4.2 - * deps: type-is@1.2.1 - - Switch dependency from `mime` to `mime-types@1.0.0` - -2.19.4 / 2014-06-05 -=================== - - * deps: errorhandler@1.0.2 - - Pass on errors from reading error files - * deps: method-override@2.0.2 - - use vary module for better `Vary` behavior - * deps: serve-favicon@2.0.1 - - Reduce byte size of `ETag` header - -2.19.3 / 2014-06-03 -=================== - - * deps: compression@1.0.6 - - fix listeners for delayed stream creation - - fix regression for certain `stream.pipe(res)` situations - - fix regression when negotiation fails - -2.19.2 / 2014-06-03 -=================== - - * deps: compression@1.0.4 - - fix adding `Vary` when value stored as array - - fix back-pressure behavior - - fix length check for `res.end` - -2.19.1 / 2014-06-02 -=================== - - * fix deprecated `utils.escape` - -2.19.0 / 2014-06-02 -=================== - - * deprecate `methodOverride()` -- use `method-override` npm module instead - * deps: body-parser@1.3.0 - - add `extended` option to urlencoded parser - * deps: method-override@2.0.1 - - set `Vary` header - - deps: methods@1.0.1 - * deps: multiparty@3.2.8 - * deps: response-time@2.0.0 - - add `digits` argument - - do not override existing `X-Response-Time` header - - timer not subject to clock drift - - timer resolution down to nanoseconds - * deps: serve-static@1.2.1 - - send max-age in Cache-Control in correct format - - use `escape-html` for escaping - - deps: send@0.4.1 - -2.18.0 / 2014-05-29 -=================== - - * deps: compression@1.0.3 - * deps: serve-index@1.1.0 - - Fix content negotiation when no `Accept` header - - Properly support all HTTP methods - - Support vanilla node.js http servers - - Treat `ENAMETOOLONG` as code 414 - - Use accepts for negotiation - * deps: serve-static@1.2.0 - - Calculate ETag with md5 for reduced collisions - - Fix wrong behavior when index file matches directory - - Ignore stream errors after request ends - - Skip directories in index file search - - deps: send@0.4.0 - -2.17.3 / 2014-05-27 -=================== - - * deps: express-session@1.2.1 - - Fix `resave` such that `resave: true` works - -2.17.2 / 2014-05-27 -=================== - - * deps: body-parser@1.2.2 - - invoke `next(err)` after request fully read - - deps: raw-body@1.1.6 - * deps: method-override@1.0.2 - - Handle `req.body` key referencing array or object - - Handle multiple HTTP headers - -2.17.1 / 2014-05-21 -=================== - - * fix `res.charset` appending charset when `content-type` has one - -2.17.0 / 2014-05-20 -=================== - - * deps: express-session@1.2.0 - - Add `resave` option to control saving unmodified sessions - * deps: morgan@1.1.1 - - "dev" format will use same tokens as other formats - - `:response-time` token is now empty when immediate used - - `:response-time` token is now monotonic - - `:response-time` token has precision to 1 μs - - fix `:status` + immediate output in node.js 0.8 - - improve `buffer` option to prevent indefinite event loop holding - - simplify method to get remote address - - deps: bytes@1.0.0 - * deps: serve-index@1.0.3 - - Fix error from non-statable files in HTML view - -2.16.2 / 2014-05-18 -=================== - - * fix edge-case in `res.appendHeader` that would append in wrong order - * deps: method-override@1.0.1 - -2.16.1 / 2014-05-17 -=================== - - * remove usages of `res.headerSent` from core - -2.16.0 / 2014-05-17 -=================== - - * deprecate `res.headerSent` -- use `res.headersSent` - * deprecate `res.on("header")` -- use on-headers module instead - * fix `connect.version` to reflect the actual version - * json: use body-parser - - add `type` option - - fix repeated limit parsing with every request - - improve parser speed - * urlencoded: use body-parser - - add `type` option - - fix repeated limit parsing with every request - * dep: bytes@1.0.0 - * add negative support - * dep: cookie-parser@1.1.0 - - deps: cookie@0.1.2 - * dep: csurf@1.2.0 - - add support for double-submit cookie - * dep: express-session@1.1.0 - - Add `name` option; replacement for `key` option - - Use `setImmediate` in MemoryStore for node.js >= 0.10 - -2.15.0 / 2014-05-04 -=================== - - * Add simple `res.cookie` support - * Add `res.appendHeader` - * Call error stack even when response has been sent - * Patch `res.headerSent` to return Boolean - * Patch `res.headersSent` for node.js 0.8 - * Prevent default 404 handler after response sent - * dep: compression@1.0.2 - * support headers given to `res.writeHead` - * deps: bytes@0.3.0 - * deps: negotiator@0.4.3 - * dep: connect-timeout@1.1.0 - * Add `req.timedout` property - * Add `respond` option to constructor - * Clear timer on socket destroy - * deps: debug@0.8.1 - * dep: debug@^0.8.0 - * add `enable()` method - * change from stderr to stdout - * dep: errorhandler@1.0.1 - * Clean up error CSS - * Do not respond after headers sent - * dep: express-session@1.0.4 - * Remove import of `setImmediate` - * Use `res.cookie()` instead of `res.setHeader()` - * deps: cookie@0.1.2 - * deps: debug@0.8.1 - * dep: morgan@1.0.1 - * Make buffer unique per morgan instance - * deps: bytes@0.3.0 - * dep: serve-favicon@2.0.0 - * Accept `Buffer` of icon as first argument - * Non-GET and HEAD requests are denied - * Send valid max-age value - * Support conditional requests - * Support max-age=0 - * Support OPTIONS method - * Throw if `path` argument is directory - * dep: serve-index@1.0.2 - * Add stylesheet option - * deps: negotiator@0.4.3 - -2.14.5 / 2014-04-24 -=================== - - * dep: raw-body@1.1.4 - * allow true as an option - * deps: bytes@0.3.0 - * dep: serve-static@1.1.0 - * Accept options directly to `send` module - * deps: send@0.3.0 - -2.14.4 / 2014-04-07 -=================== - - * dep: bytes@0.3.0 - * added terabyte support - * dep: csurf@1.1.0 - * add constant-time string compare - * dep: serve-static@1.0.4 - * Resolve relative paths at middleware setup - * Use parseurl to parse the URL from request - * fix node.js 0.8 compatibility with memory session - -2.14.3 / 2014-03-18 -=================== - - * dep: static-favicon@1.0.2 - * Fixed content of default icon - -2.14.2 / 2014-03-11 -=================== - - * dep: static-favicon@1.0.1 - * Fixed path to default icon - -2.14.1 / 2014-03-06 -=================== - - * dep: fresh@0.2.2 - * no real changes - * dep: serve-index@1.0.1 - * deps: negotiator@0.4.2 - * dep: serve-static@1.0.2 - * deps: send@0.2.0 - -2.14.0 / 2014-03-05 -=================== - - * basicAuth: use basic-auth-connect - * cookieParser: use cookie-parser - * compress: use compression - * csrf: use csurf - * dep: cookie-signature@1.0.3 - * directory: use serve-index - * errorHandler: use errorhandler - * favicon: use static-favicon - * logger: use morgan - * methodOverride: use method-override - * responseTime: use response-time - * session: use express-session - * static: use serve-static - * timeout: use connect-timeout - * vhost: use vhost - -2.13.1 / 2014-03-05 -=================== - - * cookieSession: compare full value rather than crc32 - * deps: raw-body@1.1.3 - -2.13.0 / 2014-02-14 -=================== - - * fix typo in memory store warning #974 @rvagg - * compress: use compressible - * directory: add template option #990 @gottaloveit @Earl-Brown - * csrf: prevent deprecated warning with old sessions - -2.12.0 / 2013-12-10 -=================== - - * bump qs - * directory: sort folders before files - * directory: add folder icons - * directory: de-duplicate icons, details/mobile views #968 @simov - * errorHandler: end default 404 handler with a newline #972 @rlidwka - * session: remove long cookie expire check #870 @undoZen - -2.11.2 / 2013-12-01 -=================== - - * bump raw-body - -2.11.1 / 2013-11-27 -=================== - - * bump raw-body - * errorHandler: use `res.setHeader()` instead of `res.writeHead()` #949 @lo1tuma - -2.11.0 / 2013-10-29 -=================== - - * update bytes - * update uid2 - * update negotiator - * sessions: add rolling session option #944 @ilmeo - * sessions: property set cookies when given FQDN - * cookieSessions: properly set cookies when given FQDN #948 @bmancini55 - * proto: fix FQDN mounting when multiple handlers #945 @bmancini55 - -2.10.1 / 2013-10-23 -=================== - - * fixed; fixed a bug with static middleware at root and trailing slashes #942 (@dougwilson) - -2.10.0 / 2013-10-22 -=================== - - * fixed: set headers written by writeHead before emitting 'header' - * fixed: mounted path should ignore querystrings on FQDNs #940 (@dougwilson) - * fixed: parsing protocol-relative URLs with @ as pathnames #938 (@dougwilson) - * fixed: fix static directory redirect for mount's root #937 (@dougwilson) - * fixed: setting set-cookie header when mixing arrays and strings #893 (@anuj123) - * bodyParser: optional verify function for urlencoded and json parsers for signing request bodies - * compress: compress checks content-length to check threshold - * compress: expose `res.flush()` for flushing responses - * cookieParser: pass options into node-cookie #803 (@cauldrath) - * errorHandler: replace `\n`s with `
`s in error handler - -2.9.2 / 2013-10-18 -================== - - * warn about multiparty and limit middleware deprecation for v3 - * fix fully qualified domain name mounting. #920 (@dougwilson) - * directory: Fix potential security issue with serving files outside the root. #929 (@dougwilson) - * logger: store IP at beginning in case socket prematurely closes #930 (@dougwilson) - -2.9.1 / 2013-10-15 -================== - - * update multiparty - * compress: Set vary header only if Content-Type passes filter #904 - * directory: Fix directory middleware URI escaping #917 (@dougwilson) - * directory: Fix directory seperators for Windows #914 (@dougwilson) - * directory: Keep query string intact during directory redirect #913 (@dougwilson) - * directory: Fix paths in links #730 (@JacksonTian) - * errorHandler: Don't escape text/plain as HTML #875 (@johan) - * logger: Write '0' instead of '-' when response time is zero #910 (@dougwilson) - * logger: Log even when connections are aborted #760 (@dylanahsmith) - * methodOverride: Check req.body is an object #907 (@kbjr) - * multipart: Add .type back to file parts for backwards compatibility #912 (@dougwilson) - * multipart: Allow passing options to the Multiparty constructor #902 (@niftylettuce) - -2.9.0 / 2013-09-07 -================== - - * multipart: add docs regarding tmpfiles - * multipart: add .name back to file parts - * multipart: use multiparty instead of formidable - -2.8.8 / 2013-09-02 -================== - - * csrf: change to math.random() salt and remove csrfToken() callback - -2.8.7 / 2013-08-28 -================== - - * csrf: prevent salt generation on every request, and add async req.csrfToken(fn) - -2.8.6 / 2013-08-28 -================== - - * csrf: refactor to use HMAC tokens (BREACH attack) - * compress: add compression of SVG and common font files by default. - -2.8.5 / 2013-08-11 -================== - - * add: compress Dart source files by default - * update fresh - -2.8.4 / 2013-07-08 -================== - - * update send - -2.8.3 / 2013-07-04 -================== - - * add a name back to static middleware ("staticMiddleware") - * fix .hasBody() utility to require transfer-encoding or content-length - -2.8.2 / 2013-07-03 -================== - - * update send - * update cookie dep. - * add better debug() for middleware - * add whitelisting of supported methods to methodOverride() - -2.8.1 / 2013-06-27 -================== - - * fix: escape req.method in 404 response - -2.8.0 / 2013-06-26 -================== - - * add `threshold` option to `compress()` to prevent compression of small responses - * add support for vendor JSON mime types in json() - * add X-Forwarded-Proto initial https proxy support - * change static redirect to 303 - * change octal escape sequences for strict mode - * change: replace utils.uid() with uid2 lib - * remove other "static" function name. Fixes #794 - * fix: hasBody() should return false if Content-Length: 0 - -2.7.11 / 2013-06-02 -================== - - * update send - -2.7.10 / 2013-05-21 -================== - - * update qs - * update formidable - * fix: write/end to noop() when request aborted - -2.7.9 / 2013-05-07 -================== - - * update qs - * drop support for node < v0.8 - -2.7.8 / 2013-05-03 -================== - - * update qs - -2.7.7 / 2013-04-29 -================== - - * update qs dependency - * remove "static" function name. Closes #794 - * update node-formidable - * update buffer-crc32 - -2.7.6 / 2013-04-15 -================== - - * revert cookie signature which was creating session race conditions - -2.7.5 / 2013-04-12 -================== - - * update cookie-signature - * limit: do not consume request in node 0.10.x - -2.7.4 / 2013-04-01 -================== - - * session: add long expires check and prevent excess set-cookie - * session: add console.error() of session#save() errors - -2.7.3 / 2013-02-19 -================== - - * add name to compress middleware - * add appending Accept-Encoding to Vary when set but missing - * add tests for csrf middleware - * add 'next' support for connect() server handler - * change utils.uid() to return url-safe chars. Closes #753 - * fix treating '.' as a regexp in vhost() - * fix duplicate bytes dep in package.json. Closes #743 - * fix #733 - parse x-forwarded-proto in a more generally compatibly way - * revert "add support for `next(status[, msg])`"; makes composition hard - -2.7.2 / 2013-01-04 -================== - - * add support for `next(status[, msg])` back - * add utf-8 meta tag to support foreign characters in filenames/directories - * change `timeout()` 408 to 503 - * replace 'node-crc' with 'buffer-crc32', fixes licensing - * fix directory.html IE support - -2.7.1 / 2012-12-05 -================== - - * add directory() tests - * add support for bodyParser to ignore Content-Type if no body is present (jquery primarily does this poorely) - * fix errorHandler signature - -2.7.0 / 2012-11-13 -================== - - * add support for leading JSON whitespace - * add logging of `req.ip` when present - * add basicAuth support for `:`-delimited string - * update cookie module. Closes #688 - -2.6.2 / 2012-11-01 -================== - - * add `debug()` for disconnected session store - * fix session regeneration bug. Closes #681 - -2.6.1 / 2012-10-25 -================== - - * add passing of `connect.timeout()` errors to `next()` - * replace signature utils with cookie-signature module - -2.6.0 / 2012-10-09 -================== - - * add `defer` option to `multipart()` [Blake Miner] - * fix mount path case sensitivity. Closes #663 - * fix default of ascii encoding from `logger()`, now utf8. Closes #293 - -2.5.0 / 2012-09-27 -================== - - * add `err.status = 400` to multipart() errors - * add double-encoding protection to `compress()`. Closes #659 - * add graceful handling cookie parsing errors [shtylman] - * fix typo X-Response-time to X-Response-Time - -2.4.6 / 2012-09-18 -================== - - * update qs - -2.4.5 / 2012-09-03 -================== - - * add session store "connect" / "disconnect" support [louischatriot] - * fix `:url` log token - -2.4.4 / 2012-08-21 -================== - - * fix `static()` pause regression from "send" integration - -2.4.3 / 2012-08-07 -================== - - * fix `.write()` encoding for zlib inconstancy. Closes #561 - -2.4.2 / 2012-07-25 -================== - - * remove limit default from `urlencoded()` - * remove limit default from `json()` - * remove limit default from `multipart()` - * fix `cookieSession()` clear cookie path / domain bug. Closes #636 - -2.4.1 / 2012-07-24 -================== - - * fix `options` mutation in `static()` - -2.4.0 / 2012-07-23 -================== - - * add `connect.timeout()` - * add __GET__ / __HEAD__ check to `directory()`. Closes #634 - * add "pause" util dep - * update send dep for normalization bug - -2.3.9 / 2012-07-16 -================== - - * add more descriptive invalid json error message - * update send dep for root normalization regression - * fix staticCache fresh dep - -2.3.8 / 2012-07-12 -================== - - * fix `connect.static()` 404 regression, pass `next()`. Closes #629 - -2.3.7 / 2012-07-05 -================== - - * add `json()` utf-8 illustration test. Closes #621 - * add "send" dependency - * change `connect.static()` internals to use "send" - * fix `session()` req.session generation with pathname mismatch - * fix `cookieSession()` req.session generation with pathname mismatch - * fix mime export. Closes #618 - -2.3.6 / 2012-07-03 -================== - - * Fixed cookieSession() with cookieParser() secret regression. Closes #602 - * Fixed set-cookie header fields on cookie.path mismatch. Closes #615 - -2.3.5 / 2012-06-28 -================== - - * Remove `logger()` mount check - * Fixed `staticCache()` dont cache responses with set-cookie. Closes #607 - * Fixed `staticCache()` when Cookie is present - -2.3.4 / 2012-06-22 -================== - - * Added `err.buf` to urlencoded() and json() - * Update cookie to 0.0.4. Closes #604 - * Fixed: only send 304 if original response in 2xx or 304 [timkuijsten] - -2.3.3 / 2012-06-11 -================== - - * Added ETags back to `static()` [timkuijsten] - * Replaced `utils.parseRange()` with `range-parser` module - * Replaced `utils.parseBytes()` with `bytes` module - * Replaced `utils.modified()` with `fresh` module - * Fixed `cookieSession()` regression with invalid cookie signing [shtylman] - -2.3.2 / 2012-06-08 -================== - - * expose mime module - * Update crc dep (which bundled nodeunit) - -2.3.1 / 2012-06-06 -================== - - * Added `secret` option to `cookieSession` middleware [shtylman] - * Added `secret` option to `session` middleware [shtylman] - * Added `req.remoteUser` back to `basicAuth()` as alias of `req.user` - * Performance: improve signed cookie parsing - * Update `cookie` dependency [shtylman] - -2.3.0 / 2012-05-20 -================== - - * Added limit option to `json()` - * Added limit option to `urlencoded()` - * Added limit option to `multipart()` - * Fixed: remove socket error event listener on callback - * Fixed __ENOTDIR__ error on `static` middleware - -2.2.2 / 2012-05-07 -================== - - * Added support to csrf middle for pre-flight CORS requests - * Updated `engines` to allow newer version of node - * Removed duplicate repo prop. Closes #560 - -2.2.1 / 2012-04-28 -================== - - * Fixed `static()` redirect when mounted. Closes #554 - -2.2.0 / 2012-04-25 -================== - - * Added `make benchmark` - * Perf: memoize url parsing (~20% increase) - * Fixed `connect(fn, fn2, ...)`. Closes #549 - -2.1.3 / 2012-04-20 -================== - - * Added optional json() `reviver` function to be passed to JSON.parse [jed] - * Fixed: emit drain in compress middleware [nsabovic] - -2.1.2 / 2012-04-11 -================== - - * Fixed cookieParser() `req.cookies` regression - -2.1.1 / 2012-04-11 -================== - - * Fixed `session()` browser-session length cookies & examples - * Fixed: make `query()` "self-aware" [jed] - -2.1.0 / 2012-04-05 -================== - - * Added `debug()` calls to `.use()` (`DEBUG=connect:displatcher`) - * Added `urlencoded()` support for GET - * Added `json()` support for GET. Closes #497 - * Added `strict` option to `json()` - * Changed: `session()` only set-cookie when modified - * Removed `Session#lastAccess` property. Closes #399 - -2.0.3 / 2012-03-20 -================== - - * Added: `cookieSession()` only sets cookie on change. Closes #442 - * Added `connect:dispatcher` debug() probes - -2.0.2 / 2012-03-04 -================== - - * Added test for __ENAMETOOLONG__ now that node is fixed - * Fixed static() index "/" check on windows. Closes #498 - * Fixed Content-Range behaviour to match RFC2616 [matthiasdg / visionmedia] - -2.0.1 / 2012-02-29 -================== - - * Added test coverage for `vhost()` middleware - * Changed `cookieParser()` signed cookie support to use SHA-2 [senotrusov] - * Fixed `static()` Range: respond with 416 when unsatisfiable - * Fixed `vhost()` middleware. Closes #494 - -2.0.0 / 2011-10-05 -================== - - * Added `cookieSession()` middleware for cookie-only sessions - * Added `compress()` middleware for gzip / deflate support - * Added `session()` "proxy" setting to trust `X-Forwarded-Proto` - * Added `json()` middleware to parse "application/json" - * Added `urlencoded()` middleware to parse "application/x-www-form-urlencoded" - * Added `multipart()` middleware to parse "multipart/form-data" - * Added `cookieParser(secret)` support so anything using this middleware may access signed cookies - * Added signed cookie support to `cookieParser()` - * Added support for JSON-serialized cookies to `cookieParser()` - * Added `err.status` support in Connect's default end-point - * Added X-Cache MISS / HIT to `staticCache()` - * Added public `res.headerSent` checking nodes `res._headerSent` until node does - * Changed `basicAuth()` req.remoteUser to req.user - * Changed: default `session()` to a browser-session cookie. Closes #475 - * Changed: no longer lowercase cookie names - * Changed `bodyParser()` to use `json()`, `urlencoded()`, and `multipart()` - * Changed: `errorHandler()` is now a development-only middleware - * Changed middleware to `next()` errors when possible so applications can unify logging / handling - * Removed `http[s].Server` inheritance, now just a function, making it easy to have an app providing both http and https - * Removed `.createServer()` (use `connect()`) - * Removed `secret` option from `session()`, use `cookieParser(secret)` - * Removed `connect.session.ignore` array support - * Removed `router()` middleware. Closes #262 - * Fixed: set-cookie only once for browser-session cookies - * Fixed FQDN support. dont add leading "/" - * Fixed 404 XSS attack vector. Closes #473 - * Fixed __HEAD__ support for 404s and 500s generated by Connect's end-point - -1.8.5 / 2011-12-22 -================== - - * Fixed: actually allow empty body for json - -1.8.4 / 2011-12-22 -================== - - * Changed: allow empty body for json/urlencoded requests. Backport for #443 - -1.8.3 / 2011-12-16 -================== - - * Fixed `static()` _index.html_ support on windows - -1.8.2 / 2011-12-03 -================== - - * Fixed potential security issue, store files in req.files. Closes #431 [reported by dobesv] - -1.8.1 / 2011-11-21 -================== - - * Added nesting support for _multipart/form-data_ [jackyz] - -1.8.0 / 2011-11-17 -================== - - * Added _multipart/form-data_ support to `bodyParser()` using formidable - -1.7.3 / 2011-11-11 -================== - - * Fixed `req.body`, always default to {} - * Fixed HEAD support for 404s and 500s - -1.7.2 / 2011-10-24 -================== - - * "node": ">= 0.4.1 < 0.7.0" - * Added `static()` redirect option. Closes #398 - * Changed `limit()`: respond with 413 when content-length exceeds the limit - * Removed socket error listener in static(). Closes #389 - * Fixed `staticCache()` Age header field - * Fixed race condition causing errors reported in #329. - -1.7.1 / 2011-09-12 -================== - - * Added: make `Store` inherit from `EventEmitter` - * Added session `Store#load(sess, fn)` to fetch a `Session` instance - * Added backpressure support to `staticCache()` - * Changed `res.socket.destroy()` to `req.socket.destroy()` - -1.7.0 / 2011-08-31 -================== - - * Added `staticCache()` middleware, a memory cache for `static()` - * Added public `res.headerSent` checking nodes `res._headerSent` (remove when node adds this) - * Changed: ignore error handling middleware when header is sent - * Changed: dispatcher errors after header is sent destroy the sock - -1.6.4 / 2011-08-26 -================== - - * Revert "Added double-next reporting" - -1.6.3 / 2011-08-26 -================== - - * Added double-`next()` reporting - * Added `immediate` option to `logger()`. Closes #321 - * Dependency `qs >= 0.3.1` - -1.6.2 / 2011-08-11 -================== - - * Fixed `connect.static()` null byte vulnerability - * Fixed `connect.directory()` null byte vulnerability - * Changed: 301 redirect in `static()` to postfix "/" on directory. Closes #289 - -1.6.1 / 2011-08-03 -================== - - * Added: allow retval `== null` from logger callback to ignore line - * Added `getOnly` option to `connect.static.send()` - * Added response "header" event allowing augmentation - * Added `X-CSRF-Token` header field check - * Changed dep `qs >= 0.3.0` - * Changed: persist csrf token. Closes #322 - * Changed: sort directory middleware files alphabetically - -1.6.0 / 2011-07-10 -================== - - * Added :response-time to "dev" logger format - * Added simple `csrf()` middleware. Closes #315 - * Fixed `res._headers` logger regression. Closes #318 - * Removed support for multiple middleware being passed to `.use()` - -1.5.2 / 2011-07-06 -================== - - * Added `filter` function option to `directory()` [David Rio Deiros] - * Changed: re-write of the `logger()` middleware, with extensible tokens and formats - * Changed: `static.send()` ".." in path without root considered malicious - * Fixed quotes in docs. Closes #312 - * Fixed urls when mounting `directory()`, use `originalUrl` [Daniel Dickison] - - -1.5.1 / 2011-06-20 -================== - - * Added malicious path check to `directory()` middleware - * Added `utils.forbidden(res)` - * Added `connect.query()` middleware - -1.5.0 / 2011-06-20 -================== - - * Added `connect.directory()` middleware for serving directory listings - -1.4.6 / 2011-06-18 -================== - - * Fixed `connect.static()` root with `..` - * Fixed `connect.static()` __EBADF__ - -1.4.5 / 2011-06-17 -================== - - * Fixed EBADF in `connect.static()`. Closes #297 - -1.4.4 / 2011-06-16 -================== - - * Changed `connect.static()` to check resolved dirname. Closes #294 - -1.4.3 / 2011-06-06 -================== - - * Fixed fd leak in `connect.static()` when the socket is closed - * Fixed; `bodyParser()` ignoring __GET/HEAD__. Closes #285 - -1.4.2 / 2011-05-27 -================== - - * Changed to `devDependencies` - * Fixed stream creation on `static()` __HEAD__ request. [Andreas Lind Petersen] - * Fixed Win32 support for `static()` - * Fixed monkey-patch issue. Closes #261 - -1.4.1 / 2011-05-08 -================== - - * Added "hidden" option to `static()`. ignores hidden files by default. Closes * Added; expose `connect.static.mime.define()`. Closes #251 - * Fixed `errorHandler` middleware for missing stack traces. [aseemk] -#274 - -1.4.0 / 2011-04-25 -================== - - * Added route-middleware `next('route')` support to jump passed the route itself - * Added Content-Length support to `limit()` - * Added route-specific middleware support (used to be in express) - * Changed; refactored duplicate session logic - * Changed; prevent redefining `store.generate` per request - * Fixed; `static()` does not set Content-Type when explicitly set [nateps] - * Fixed escape `errorHandler()` {error} contents - * NOTE: `router` will be removed in 2.0 - - -1.3.0 / 2011-04-06 -================== - - * Added `router.remove(path[, method])` to remove a route - -1.2.3 / 2011-04-05 -================== - - * Fixed basicAuth realm issue when passing strings. Closes #253 - -1.2.2 / 2011-04-05 -================== - - * Added `basicAuth(username, password)` support - * Added `errorHandler.title` defaulting to "Connect" - * Changed `errorHandler` css - -1.2.1 / 2011-03-30 -================== - - * Fixed `logger()` https `remoteAddress` logging [Alexander Simmerl] - -1.2.0 / 2011-03-30 -================== - - * Added `router.lookup(path[, method])` - * Added `router.match(url[, method])` - * Added basicAuth async support. Closes #223 - -1.1.5 / 2011-03-27 -================== - - * Added; allow `logger()` callback function to return an empty string to ignore logging - * Fixed; utilizing `mime.charsets.lookup()` for `static()`. Closes 245 - -1.1.4 / 2011-03-23 -================== - - * Added `logger()` support for format function - * Fixed `logger()` to support mess of writeHead()/progressive api for node 0.4.x - -1.1.3 / 2011-03-21 -================== - - * Changed; `limit()` now calls `req.destroy()` - -1.1.2 / 2011-03-21 -================== - - * Added request "limit" event to `limit()` middleware - * Changed; `limit()` middleware will `next(err)` on failure - -1.1.1 / 2011-03-18 -================== - - * Fixed session middleware for HTTPS. Closes #241 [reported by mt502] - -1.1.0 / 2011-03-17 -================== - - * Added `Session#reload(fn)` - -1.0.6 / 2011-03-09 -================== - - * Fixed `res.setHeader()` patch, preserve casing - -1.0.5 / 2011-03-09 -================== - - * Fixed; `logger()` using `req.originalUrl` instead of `req.url` - -1.0.4 / 2011-03-09 -================== - - * Added `res.charset` - * Added conditional sessions example - * Added support for `session.ignore` to be replaced. Closes #227 - * Fixed `Cache-Control` delimiters. Closes #228 - -1.0.3 / 2011-03-03 -================== - - * Fixed; `static.send()` invokes callback with connection error - -1.0.2 / 2011-03-02 -================== - - * Fixed exported connect function - * Fixed package.json; node ">= 0.4.1 < 0.5.0" - -1.0.1 / 2011-03-02 -================== - - * Added `Session#save(fn)`. Closes #213 - * Added callback support to `connect.static.send()` for express - * Added `connect.static.send()` "path" option - * Fixed content-type in `static()` for _index.html_ - -1.0.0 / 2011-03-01 -================== - - * Added `stack`, `message`, and `dump` errorHandler option aliases - * Added `req.originalMethod` to methodOverride - * Added `favicon()` maxAge option support - * Added `connect()` alternative to `connect.createServer()` - * Added new [documentation](http://senchalabs.github.com/connect) - * Added Range support to `static()` - * Added HTTPS support - * Rewrote session middleware. The session API now allows for - session-specific cookies, so you may alter each individually. - Click to view the new [session api](http://senchalabs.github.com/connect/middleware-session.html). - * Added middleware self-awareness. This helps prevent - middleware breakage when used within mounted servers. - For example `cookieParser()` will not parse cookies more - than once even when within a mounted server. - * Added new examples in the `./examples` directory - * Added [limit()](http://senchalabs.github.com/connect/middleware-limit.html) middleware - * Added [profiler()](http://senchalabs.github.com/connect/middleware-profiler.html) middleware - * Added [responseTime()](http://senchalabs.github.com/connect/middleware-responseTime.html) middleware - * Renamed `staticProvider` to `static` - * Renamed `bodyDecoder` to `bodyParser` - * Renamed `cookieDecoder` to `cookieParser` - * Fixed ETag quotes. [reported by papandreou] - * Fixed If-None-Match comma-delimited ETag support. [reported by papandreou] - * Fixed; only set req.originalUrl once. Closes #124 - * Fixed symlink support for `static()`. Closes #123 - -0.5.10 / 2011-02-14 -================== - - * Fixed SID space issue. Closes #196 - * Fixed; proxy `res.end()` to commit session data - * Fixed directory traversal attack in `staticProvider`. Closes #198 - -0.5.9 / 2011-02-09 -================== - - * qs >= 0.0.4 - -0.5.8 / 2011-02-04 -================== - - * Added `qs` dependency - * Fixed router race-condition causing possible failure - when `next()`ing to one or more routes with parallel - requests - -0.5.7 / 2011-02-01 -================== - - * Added `onvhost()` call so Express (and others) can know when they are - * Revert "Added stylus support" (use the middleware which ships with stylus) - * Removed custom `Server#listen()` to allow regular `http.Server#listen()` args to work properly - * Fixed long standing router issue (#83) that causes '.' to be disallowed within named placeholders in routes [Andreas Lind Petersen] - * Fixed `utils.uid()` length error [Jxck] -mounted - -0.5.6 / 2011-01-23 -================== - - * Added stylus support to `compiler` - * _favicon.js_ cleanup - * _compiler.js_ cleanup - * _bodyDecoder.js_ cleanup - -0.5.5 / 2011-01-13 -================== - - * Changed; using sha256 HMAC instead of md5. [Paul Querna] - * Changed; generated a longer random UID, without time influence. [Paul Querna] - * Fixed; session middleware throws when secret is not present. [Paul Querna] - -0.5.4 / 2011-01-07 -================== - - * Added; throw when router path or callback is missing - * Fixed; `next(err)` on cookie parse exception instead of ignoring - * Revert "Added utils.pathname(), memoized url.parse(str).pathname" - -0.5.3 / 2011-01-05 -================== - - * Added _docs/api.html_ - * Added `utils.pathname()`, memoized url.parse(str).pathname - * Fixed `session.id` issue. Closes #183 - * Changed; Defaulting `staticProvider` maxAge to 0 not 1 year. Closes #179 - * Removed bad outdated docs, we need something new / automated eventually - -0.5.2 / 2010-12-28 -================== - - * Added default __OPTIONS__ support to _router_ middleware - -0.5.1 / 2010-12-28 -================== - - * Added `req.session.id` mirroring `req.sessionID` - * Refactored router, exposing `connect.router.methods` - * Exclude non-lib files from npm - * Removed imposed headers `X-Powered-By`, `Server`, etc - -0.5.0 / 2010-12-06 -================== - - * Added _./index.js_ - * Added route segment precondition support and example - * Added named capture group support to router - -0.4.0 / 2010-11-29 -================== - - * Added `basicAuth` middleware - * Added more HTTP methods to the `router` middleware - -0.3.0 / 2010-07-21 -================== - - * Added _staticGzip_ middleware - * Added `connect.utils` to expose utils - * Added `connect.session.Session` - * Added `connect.session.Store` - * Added `connect.session.MemoryStore` - * Added `connect.middleware` to expose the middleware getters - * Added `buffer` option to _logger_ for performance increase - * Added _favicon_ middleware for serving your own favicon or the connect default - * Added option support to _staticProvider_, can now pass _root_ and _lifetime_. - * Added; mounted `Server` instances now have the `route` property exposed for reflection - * Added support for callback as first arg to `Server#use()` - * Added support for `next(true)` in _router_ to bypass match attempts - * Added `Server#listen()` _host_ support - * Added `Server#route` when `Server#use()` is called with a route on a `Server` instance - * Added _methodOverride_ X-HTTP-Method-Override support - * Refactored session internals, adds _secret_ option - * Renamed `lifetime` option to `maxAge` in _staticProvider_ - * Removed connect(1), it is now [spark(1)](http://github.com/senchalabs/spark) - * Removed connect(1) dependency on examples, they can all now run with node(1) - * Remove a typo that was leaking a global. - * Removed `Object.prototype` forEach() and map() methods - * Removed a few utils not used - * Removed `connect.createApp()` - * Removed `res.simpleBody()` - * Removed _format_ middleware - * Removed _flash_ middleware - * Removed _redirect_ middleware - * Removed _jsonrpc_ middleware, use [visionmedia/connect-jsonrpc](http://github.com/visionmedia/connect-jsonrpc) - * Removed _pubsub_ middleware - * Removed need for `params.{captures,splat}` in _router_ middleware, `params` is an array - * Changed; _compiler_ no longer 404s - * Changed; _router_ signature now matches connect middleware signature - * Fixed a require in _session_ for default `MemoryStore` - * Fixed nasty request body bug in _router_. Closes #54 - * Fixed _less_ support in _compiler_ - * Fixed bug preventing proper bubbling of exceptions in mounted servers - * Fixed bug in `Server#use()` preventing `Server` instances as the first arg - * Fixed **ENOENT** special case, is now treated as any other exception - * Fixed spark env support - -0.2.1 / 2010-07-09 -================== - - * Added support for _router_ `next()` to continue calling matched routes - * Added mime type for _cache.manifest_ files. - * Changed _compiler_ middleware to use async require - * Changed session api, stores now only require `#get()`, and `#set()` - * Fixed _cacheManifest_ by adding `utils.find()` back - -0.2.0 / 2010-07-01 -================== - - * Added calls to `Session()` casts the given object as a `Session` instance - * Added passing of `next()` to _router_ callbacks. Closes #46 - * Changed; `MemoryStore#destroy()` removes `req.session` - * Changed `res.redirect("back")` to default to "/" when Referr?er is not present - * Fixed _staticProvider_ urlencoded paths issue. Closes #47 - * Fixed _staticProvider_ middleware responding to **GET** requests - * Fixed _jsonrpc_ middleware `Accept` header check. Closes #43 - * Fixed _logger_ format option - * Fixed typo in _compiler_ middleware preventing the _dest_ option from working - -0.1.0 / 2010-06-25 -================== - - * Revamped the api, view the [Connect documentation](http://extjs.github.com/Connect/index.html#Middleware-Authoring) for more info (hover on the right for menu) - * Added [extended api docs](http://extjs.github.com/Connect/api.html) - * Added docs for several more middleware layers - * Added `connect.Server#use()` - * Added _compiler_ middleware which provides arbitrary static compilation - * Added `req.originalUrl` - * Removed _blog_ example - * Removed _sass_ middleware (use _compiler_) - * Removed _less_ middleware (use _compiler_) - * Renamed middleware to be camelcase, _body-decoder_ is now _bodyDecoder_ etc. - * Fixed `req.url` mutation bug when matching `connect.Server#use()` routes - * Fixed `mkdir -p` implementation used in _bin/connect_. Closes #39 - * Fixed bug in _bodyDecoder_ throwing exceptions on request empty bodies - * `make install` installing lib to $LIB_PREFIX aka $HOME/.node_libraries - -0.0.6 / 2010-06-22 -================== - - * Added _static_ middleware usage example - * Added support for regular expressions as paths for _router_ - * Added `util.merge()` - * Increased performance of _static_ by ~ 200 rps - * Renamed the _rest_ middleware to _router_ - * Changed _rest_ api to accept a callback function - * Removed _router_ middleware - * Removed _proto.js_, only `Object#forEach()` remains - -0.0.5 / 2010-06-21 -================== - - * Added Server#use() which contains the Layer normalization logic - * Added documentation for several middleware - * Added several new examples - * Added _less_ middleware - * Added _repl_ middleware - * Added _vhost_ middleware - * Added _flash_ middleware - * Added _cookie_ middleware - * Added _session_ middleware - * Added `utils.htmlEscape()` - * Added `utils.base64Decode()` - * Added `utils.base64Encode()` - * Added `utils.uid()` - * Added bin/connect app path and --config path support for .js suffix, although optional. Closes #26 - * Moved mime code to `utils.mime`, ex `utils.mime.types`, and `utils.mime.type()` - * Renamed req.redirect() to res.redirect(). Closes #29 - * Fixed _sass_ 404 on **ENOENT** - * Fixed +new Date duplication. Closes #24 - -0.0.4 / 2010-06-16 -================== - - * Added workerPidfile() to bin/connect - * Added --workers support to bin/connect stop and status commands - * Added _redirect_ middleware - * Added better --config support to bin/connect. All flags can be utilized - * Added auto-detection of _./config.js_ - * Added config example - * Added `net.Server` support to bin/connect - * Writing worker pids relative to `env.pidfile` - * s/parseQuery/parse/g - * Fixed npm support - -0.0.3 / 2010-06-16 -================== - - * Fixed node dependency in package.json, now _">= 0.1.98-0"_ to support __HEAD__ - -0.0.2 / 2010-06-15 -================== - - * Added `-V, --version` to bin/connect - * Added `utils.parseCookie()` - * Added `utils.serializeCookie()` - * Added `utils.toBoolean()` - * Added _sass_ middleware - * Added _cookie_ middleware - * Added _format_ middleware - * Added _lint_ middleware - * Added _rest_ middleware - * Added _./package.json_ (npm install connect) - * Added `handleError()` support - * Added `process.connectEnv` - * Added custom log format support to _log_ middleware - * Added arbitrary env variable support to bin/connect (ext: --logFormat ":method :url") - * Added -w, --workers to bin/connect - * Added bin/connect support for --user NAME and --group NAME - * Fixed url re-writing support - -0.0.1 / 2010-06-03 -================== - - * Initial release - diff --git a/update_nation/node_modules/couchapp/node_modules/connect/LICENSE b/update_nation/node_modules/couchapp/node_modules/connect/LICENSE deleted file mode 100644 index 6dd4c1c25..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -(The MIT License) - -Copyright (c) 2010 Sencha Inc. -Copyright (c) 2011 LearnBoost -Copyright (c) 2011-2014 TJ Holowaychuk - -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/update_nation/node_modules/couchapp/node_modules/connect/Readme.md b/update_nation/node_modules/couchapp/node_modules/connect/Readme.md deleted file mode 100644 index 345079ede..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/Readme.md +++ /dev/null @@ -1,194 +0,0 @@ -# Connect - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Build Status][travis-image]][travis-url] -[![Test Coverage][coveralls-image]][coveralls-url] -[![Gratipay][gratipay-image]][gratipay-url] - - Connect is an extensible HTTP server framework for [node](http://nodejs.org) using "plugins" known as _middleware_. - -```js -var connect = require('connect') -var http = require('http') - -var app = connect() - -// gzip/deflate outgoing responses -var compression = require('compression') -app.use(compression()) - -// store session state in browser cookie -var cookieSession = require('cookie-session') -app.use(cookieSession({ - keys: ['secret1', 'secret2'] -})) - -// parse urlencoded request bodies into req.body -var bodyParser = require('body-parser') -app.use(bodyParser.urlencoded()) - -// respond to all requests -app.use(function(req, res){ - res.end('Hello from Connect!\n'); -}) - -//create node.js http server and listen on port -http.createServer(app).listen(3000) -``` - -## Getting Started - -Connect is a simple framework to glue together various "middleware" to handle requests. - -### Install Connect - -```sh -$ npm install connect -``` - -### Create an app - -The main component is a Connect "app". This will store all the middleware -added and is, itself, a function. - -```js -var app = connect(); -``` - -### Use middleware - -The core of Connect is "using" middleware. Middleware are added as a "stack" -where incoming requests will execute each middleware one-by-one until a middleware -does not call `next()` within it. - -```js -app.use(function middleware1(req, res, next) { - // middleware 1 - next(); -}); -app.use(function middleware2(req, res, next) { - // middleware 2 - next(); -}); -``` - -### Mount middleware - -The `.use()` method also takes an optional path string that is matched against -the beginning of the incoming request URL. This allows for basic routing. - -```js -app.use('/foo', function fooMiddleware(req, res, next) { - // req.url starts with "/foo" - next(); -}); -app.use('/bar', function barMiddleware(req, res, next) { - // req.url starts with "/bar" - next(); -}); -``` - -### Error middleware - -There are special cases of "error-handling" middleware. There are middleware -where the function takes exactly 4 arguments. Errors that occur in the middleware -added before the error middleware will invoke this middleware when errors occur. - -```js -app.use(function onerror(err, req, res, next) { - // an error occurred! -}); -``` - -### Create a server from the app - -The last step is to actually use the Connect app in a server. The `.listen()` method -is a convenience to start a HTTP server. - -```js -var server = app.listen(port); -``` - -The app itself is really just a function with three arguments, so it can also be handed -to `.createServer()` in Node.js. - -```js -var server = http.createServer(app); -``` - -## Middleware - -These middleware and libraries are officially supported by the Connect/Express team: - - - [body-parser](https://www.npmjs.com/package/body-parser) - previous `bodyParser`, `json`, and `urlencoded`. You may also be interested in: - - [body](https://www.npmjs.com/package/body) - - [co-body](https://www.npmjs.com/package/co-body) - - [raw-body](https://www.npmjs.com/package/raw-body) - - [compression](https://www.npmjs.com/package/compression) - previously `compress` - - [connect-timeout](https://www.npmjs.com/package/connect-timeout) - previously `timeout` - - [cookie-parser](https://www.npmjs.com/package/cookie-parser) - previously `cookieParser` - - [cookie-session](https://www.npmjs.com/package/cookie-session) - previously `cookieSession` - - [csurf](https://www.npmjs.com/package/csurf) - previously `csrf` - - [errorhandler](https://www.npmjs.com/package/errorhandler) - previously `error-handler` - - [express-session](https://www.npmjs.com/package/express-session) - previously `session` - - [method-override](https://www.npmjs.com/package/method-override) - previously `method-override` - - [morgan](https://www.npmjs.com/package/morgan) - previously `logger` - - [response-time](https://www.npmjs.com/package/response-time) - previously `response-time` - - [serve-favicon](https://www.npmjs.com/package/serve-favicon) - previously `favicon` - - [serve-index](https://www.npmjs.com/package/serve-index) - previously `directory` - - [serve-static](https://www.npmjs.com/package/serve-static) - previously `static` - - [vhost](https://www.npmjs.com/package/vhost) - previously `vhost` - -Most of these are exact ports of their Connect 2.x equivalents. The primary exception is `cookie-session`. - -Some middleware previously included with Connect are no longer supported by the Connect/Express team, are replaced by an alternative module, or should be superseded by a better module. Use one of these alternatives instead: - - - `cookieParser` - - [cookies](https://www.npmjs.com/package/cookies) and [keygrip](https://www.npmjs.com/package/keygrip) - - `limit` - - [raw-body](https://www.npmjs.com/package/raw-body) - - `multipart` - - [connect-multiparty](https://www.npmjs.com/package/connect-multiparty) - - [connect-busboy](https://www.npmjs.com/package/connect-busboy) - - `query` - - [qs](https://www.npmjs.com/package/qs) - - `staticCache` - - [st](https://www.npmjs.com/package/st) - - [connect-static](https://www.npmjs.com/package/connect-static) - -Checkout [http-framework](https://github.com/Raynos/http-framework/wiki/Modules) for many other compatible middleware! - -## Running Tests - -```bash -npm install -npm test -``` - -## Contributors - - https://github.com/senchalabs/connect/graphs/contributors - -## Node Compatibility - - - Connect `< 1.x` - node `0.2` - - Connect `1.x` - node `0.4` - - Connect `< 2.8` - node `0.6` - - Connect `>= 2.8 < 3` - node `0.8` - - Connect `>= 3` - node `0.10`, `0.12` - -## License - -[MIT](LICENSE) - -[npm-image]: https://img.shields.io/npm/v/connect.svg -[npm-url]: https://npmjs.org/package/connect -[travis-image]: https://img.shields.io/travis/senchalabs/connect/master.svg -[travis-url]: https://travis-ci.org/senchalabs/connect -[coveralls-image]: https://img.shields.io/coveralls/senchalabs/connect/master.svg -[coveralls-url]: https://coveralls.io/r/senchalabs/connect -[downloads-image]: https://img.shields.io/npm/dm/connect.svg -[downloads-url]: https://npmjs.org/package/connect -[gratipay-image]: https://img.shields.io/gratipay/dougwilson.svg -[gratipay-url]: https://www.gratipay.com/dougwilson/ diff --git a/update_nation/node_modules/couchapp/node_modules/connect/index.js b/update_nation/node_modules/couchapp/node_modules/connect/index.js deleted file mode 100644 index 02befb413..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/index.js +++ /dev/null @@ -1,2 +0,0 @@ - -module.exports = require('./lib/connect'); diff --git a/update_nation/node_modules/couchapp/node_modules/connect/lib/connect.js b/update_nation/node_modules/couchapp/node_modules/connect/lib/connect.js deleted file mode 100644 index cc4cf352c..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/lib/connect.js +++ /dev/null @@ -1,34 +0,0 @@ -/*! - * Connect - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var EventEmitter = require('events').EventEmitter; -var merge = require('utils-merge'); -var proto = require('./proto'); - -// expose createServer() as the module - -module.exports = createServer; - -/** - * Create a new connect server. - * - * @return {Function} - * @api public - */ - -function createServer() { - function app(req, res, next){ app.handle(req, res, next); } - merge(app, proto); - merge(app, EventEmitter.prototype); - app.route = '/'; - app.stack = []; - return app; -} diff --git a/update_nation/node_modules/couchapp/node_modules/connect/lib/proto.js b/update_nation/node_modules/couchapp/node_modules/connect/lib/proto.js deleted file mode 100644 index b4114d5f2..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/lib/proto.js +++ /dev/null @@ -1,231 +0,0 @@ -/*! - * Connect - HTTPServer - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var finalhandler = require('finalhandler'); -var http = require('http'); -var debug = require('debug')('connect:dispatcher'); -var parseUrl = require('parseurl'); - -// prototype - -var app = module.exports = {}; - -// environment - -var env = process.env.NODE_ENV || 'development'; - -/* istanbul ignore next */ -var defer = typeof setImmediate === 'function' - ? setImmediate - : function(fn){ process.nextTick(fn.bind.apply(fn, arguments)) } - -/** - * Utilize the given middleware `handle` to the given `route`, - * defaulting to _/_. This "route" is the mount-point for the - * middleware, when given a value other than _/_ the middleware - * is only effective when that segment is present in the request's - * pathname. - * - * For example if we were to mount a function at _/admin_, it would - * be invoked on _/admin_, and _/admin/settings_, however it would - * not be invoked for _/_, or _/posts_. - * - * @param {String|Function|Server} route, callback or server - * @param {Function|Server} callback or server - * @return {Server} for chaining - * @api public - */ - -app.use = function(route, fn){ - // default route to '/' - if ('string' != typeof route) { - fn = route; - route = '/'; - } - - // wrap sub-apps - if ('function' == typeof fn.handle) { - var server = fn; - server.route = route; - fn = function(req, res, next){ - server.handle(req, res, next); - }; - } - - // wrap vanilla http.Servers - if (fn instanceof http.Server) { - fn = fn.listeners('request')[0]; - } - - // strip trailing slash - if ('/' == route[route.length - 1]) { - route = route.slice(0, -1); - } - - // add the middleware - debug('use %s %s', route || '/', fn.name || 'anonymous'); - this.stack.push({ route: route, handle: fn }); - - return this; -}; - -/** - * Handle server requests, punting them down - * the middleware stack. - * - * @api private - */ - -app.handle = function(req, res, out) { - var stack = this.stack - , searchIndex = req.url.indexOf('?') - , pathlength = searchIndex !== -1 ? searchIndex : req.url.length - , fqdn = req.url[0] !== '/' && 1 + req.url.substr(0, pathlength).indexOf('://') - , protohost = fqdn ? req.url.substr(0, req.url.indexOf('/', 2 + fqdn)) : '' - , removed = '' - , slashAdded = false - , index = 0; - - // final function handler - var done = out || finalhandler(req, res, { - env: env, - onerror: logerror - }); - - // store the original URL - req.originalUrl = req.originalUrl || req.url; - - function next(err) { - if (slashAdded) { - req.url = req.url.substr(1); - slashAdded = false; - } - - if (removed.length !== 0) { - req.url = protohost + removed + req.url.substr(protohost.length); - removed = ''; - } - - // next callback - var layer = stack[index++]; - - // all done - if (!layer) { - defer(done, err); - return; - } - - // route data - var path = parseUrl(req).pathname || '/'; - var route = layer.route; - - // skip this layer if the route doesn't match - if (path.toLowerCase().substr(0, route.length) !== route.toLowerCase()) { - return next(err); - } - - // skip if route match does not border "/", ".", or end - var c = path[route.length]; - if (c !== undefined && '/' !== c && '.' !== c) { - return next(err); - } - - // trim off the part of the url that matches the route - if (route.length !== 0 && route !== '/') { - removed = route; - req.url = protohost + req.url.substr(protohost.length + removed.length); - - // ensure leading slash - if (!fqdn && req.url[0] !== '/') { - req.url = '/' + req.url; - slashAdded = true; - } - } - - // call the layer handle - call(layer.handle, route, err, req, res, next); - } - - next(); -}; - -/** - * Listen for connections. - * - * This method takes the same arguments - * as node's `http.Server#listen()`. - * - * HTTP and HTTPS: - * - * If you run your application both as HTTP - * and HTTPS you may wrap them individually, - * since your Connect "server" is really just - * a JavaScript `Function`. - * - * var connect = require('connect') - * , http = require('http') - * , https = require('https'); - * - * var app = connect(); - * - * http.createServer(app).listen(80); - * https.createServer(options, app).listen(443); - * - * @return {http.Server} - * @api public - */ - -app.listen = function(){ - var server = http.createServer(this); - return server.listen.apply(server, arguments); -}; - -/** - * Invoke a route handle. - * - * @api private - */ - -function call(handle, route, err, req, res, next) { - var arity = handle.length; - var hasError = Boolean(err); - - debug('%s %s : %s', handle.name || '', route, req.originalUrl); - - try { - if (hasError && arity === 4) { - // error-handling middleware - handle(err, req, res, next); - return; - } else if (!hasError && arity < 4) { - // request-handling middleware - handle(req, res, next); - return; - } - } catch (e) { - // reset the error - err = e; - } - - // continue - next(err); -} - -/** - * Log error using console.error. - * - * @param {Error} err - * @api public - */ - -function logerror(err){ - if (env !== 'test') console.error(err.stack || err.toString()); -} diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/.jshintrc b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/.jshintrc deleted file mode 100644 index 299877f26..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/.jshintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "laxbreak": true -} diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/.npmignore b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/.npmignore deleted file mode 100644 index 7e6163db0..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/.npmignore +++ /dev/null @@ -1,6 +0,0 @@ -support -test -examples -example -*.sock -dist diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/History.md b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/History.md deleted file mode 100644 index 770e4832d..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/History.md +++ /dev/null @@ -1,186 +0,0 @@ - -2.1.3 / 2015-03-13 -================== - - * Updated stdout/stderr example (#186) - * Updated example/stdout.js to match debug current behaviour - * Renamed example/stderr.js to stdout.js - * Update Readme.md (#184) - * replace high intensity foreground color for bold (#182, #183) - -2.1.2 / 2015-03-01 -================== - - * dist: recompile - * update "ms" to v0.7.0 - * package: update "browserify" to v9.0.3 - * component: fix "ms.js" repo location - * changed bower package name - * updated documentation about using debug in a browser - * fix: security error on safari (#167, #168, @yields) - -2.1.1 / 2014-12-29 -================== - - * browser: use `typeof` to check for `console` existence - * browser: check for `console.log` truthiness (fix IE 8/9) - * browser: add support for Chrome apps - * Readme: added Windows usage remarks - * Add `bower.json` to properly support bower install - -2.1.0 / 2014-10-15 -================== - - * node: implement `DEBUG_FD` env variable support - * package: update "browserify" to v6.1.0 - * package: add "license" field to package.json (#135, @panuhorsmalahti) - -2.0.0 / 2014-09-01 -================== - - * package: update "browserify" to v5.11.0 - * node: use stderr rather than stdout for logging (#29, @stephenmathieson) - -1.0.4 / 2014-07-15 -================== - - * dist: recompile - * example: remove `console.info()` log usage - * example: add "Content-Type" UTF-8 header to browser example - * browser: place %c marker after the space character - * browser: reset the "content" color via `color: inherit` - * browser: add colors support for Firefox >= v31 - * debug: prefer an instance `log()` function over the global one (#119) - * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) - -1.0.3 / 2014-07-09 -================== - - * Add support for multiple wildcards in namespaces (#122, @seegno) - * browser: fix lint - -1.0.2 / 2014-06-10 -================== - - * browser: update color palette (#113, @gscottolson) - * common: make console logging function configurable (#108, @timoxley) - * node: fix %o colors on old node <= 0.8.x - * Makefile: find node path using shell/which (#109, @timoxley) - -1.0.1 / 2014-06-06 -================== - - * browser: use `removeItem()` to clear localStorage - * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) - * package: add "contributors" section - * node: fix comment typo - * README: list authors - -1.0.0 / 2014-06-04 -================== - - * make ms diff be global, not be scope - * debug: ignore empty strings in enable() - * node: make DEBUG_COLORS able to disable coloring - * *: export the `colors` array - * npmignore: don't publish the `dist` dir - * Makefile: refactor to use browserify - * package: add "browserify" as a dev dependency - * Readme: add Web Inspector Colors section - * node: reset terminal color for the debug content - * node: map "%o" to `util.inspect()` - * browser: map "%j" to `JSON.stringify()` - * debug: add custom "formatters" - * debug: use "ms" module for humanizing the diff - * Readme: add "bash" syntax highlighting - * browser: add Firebug color support - * browser: add colors for WebKit browsers - * node: apply log to `console` - * rewrite: abstract common logic for Node & browsers - * add .jshintrc file - -0.8.1 / 2014-04-14 -================== - - * package: re-add the "component" section - -0.8.0 / 2014-03-30 -================== - - * add `enable()` method for nodejs. Closes #27 - * change from stderr to stdout - * remove unnecessary index.js file - -0.7.4 / 2013-11-13 -================== - - * remove "browserify" key from package.json (fixes something in browserify) - -0.7.3 / 2013-10-30 -================== - - * fix: catch localStorage security error when cookies are blocked (Chrome) - * add debug(err) support. Closes #46 - * add .browser prop to package.json. Closes #42 - -0.7.2 / 2013-02-06 -================== - - * fix package.json - * fix: Mobile Safari (private mode) is broken with debug - * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript - -0.7.1 / 2013-02-05 -================== - - * add repository URL to package.json - * add DEBUG_COLORED to force colored output - * add browserify support - * fix component. Closes #24 - -0.7.0 / 2012-05-04 -================== - - * Added .component to package.json - * Added debug.component.js build - -0.6.0 / 2012-03-16 -================== - - * Added support for "-" prefix in DEBUG [Vinay Pulim] - * Added `.enabled` flag to the node version [TooTallNate] - -0.5.0 / 2012-02-02 -================== - - * Added: humanize diffs. Closes #8 - * Added `debug.disable()` to the CS variant - * Removed padding. Closes #10 - * Fixed: persist client-side variant again. Closes #9 - -0.4.0 / 2012-02-01 -================== - - * Added browser variant support for older browsers [TooTallNate] - * Added `debug.enable('project:*')` to browser variant [TooTallNate] - * Added padding to diff (moved it to the right) - -0.3.0 / 2012-01-26 -================== - - * Added millisecond diff when isatty, otherwise UTC string - -0.2.0 / 2012-01-22 -================== - - * Added wildcard support - -0.1.0 / 2011-12-02 -================== - - * Added: remove colors unless stderr isatty [TooTallNate] - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/Makefile b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/Makefile deleted file mode 100644 index b0bde6e63..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/Makefile +++ /dev/null @@ -1,33 +0,0 @@ - -# get Makefile directory name: http://stackoverflow.com/a/5982798/376773 -THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) -THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) - -# BIN directory -BIN := $(THIS_DIR)/node_modules/.bin - -# applications -NODE ?= $(shell which node) -NPM ?= $(NODE) $(shell which npm) -BROWSERIFY ?= $(NODE) $(BIN)/browserify - -all: dist/debug.js - -install: node_modules - -clean: - @rm -rf node_modules dist - -dist: - @mkdir -p $@ - -dist/debug.js: node_modules browser.js debug.js dist - @$(BROWSERIFY) \ - --standalone debug \ - . > $@ - -node_modules: package.json - @NODE_ENV= $(NPM) install - @touch node_modules - -.PHONY: all install clean diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/Readme.md b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/Readme.md deleted file mode 100644 index 14222e0c2..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/Readme.md +++ /dev/null @@ -1,178 +0,0 @@ -# debug - - tiny node.js debugging utility modelled after node core's debugging technique. - -## Installation - -```bash -$ npm install debug -``` - -## Usage - - With `debug` you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated `console.error`, so all of the `console` format string goodies you're used to work fine. A unique color is selected per-function for visibility. - -Example _app.js_: - -```js -var debug = require('debug')('http') - , http = require('http') - , name = 'My App'; - -// fake app - -debug('booting %s', name); - -http.createServer(function(req, res){ - debug(req.method + ' ' + req.url); - res.end('hello\n'); -}).listen(3000, function(){ - debug('listening'); -}); - -// fake worker of some kind - -require('./worker'); -``` - -Example _worker.js_: - -```js -var debug = require('debug')('worker'); - -setInterval(function(){ - debug('doing some work'); -}, 1000); -``` - - The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples: - - ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png) - - ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png) - -#### Windows note - - On Windows the environment variable is set using the `set` command. - - ```cmd - set DEBUG=*,-not_this - ``` - -Then, run the program to be debugged as usual. - -## Millisecond diff - - When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. - - ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png) - - When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below: - - ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png) - -## Conventions - - If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". - -## Wildcards - - The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect.compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. - - You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:". - -## Browser support - - Debug works in the browser as well, currently persisted by `localStorage`. Consider the situation shown below where you have `worker:a` and `worker:b`, and wish to debug both. Somewhere in the code on your page, include: - -```js -window.myDebug = require("debug"); -``` - - ("debug" is a global object in the browser so we give this object a different name.) When your page is open in the browser, type the following in the console: - -```js -myDebug.enable("worker:*") -``` - - Refresh the page. Debug output will continue to be sent to the console until it is disabled by typing `myDebug.disable()` in the console. - -```js -a = debug('worker:a'); -b = debug('worker:b'); - -setInterval(function(){ - a('doing some work'); -}, 1000); - -setInterval(function(){ - b('doing some work'); -}, 1200); -``` - -#### Web Inspector Colors - - Colors are also enabled on "Web Inspectors" that understand the `%c` formatting - option. These are WebKit web inspectors, Firefox ([since version - 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) - and the Firebug plugin for Firefox (any version). - - Colored output looks something like: - - ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png) - -### stderr vs stdout - -You can set an alternative logging method per-namespace by overriding the `log` method on a per-namespace or globally: - -Example _stdout.js_: - -```js -var debug = require('debug'); -var error = debug('app:error'); - -// by default stderr is used -error('goes to stderr!'); - -var log = debug('app:log'); -// set this namespace to log via console.log -log.log = console.log.bind(console); // don't forget to bind to console! -log('goes to stdout'); -error('still goes to stderr!'); - -// set all output to go via console.info -// overrides all per-namespace log settings -debug.log = console.info.bind(console); -error('now goes to stdout via console.info'); -log('still goes to stdout, but via console.info now'); -``` - -## Authors - - - TJ Holowaychuk - - Nathan Rajlich - -## License - -(The MIT License) - -Copyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca> - -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/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/bower.json b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/bower.json deleted file mode 100644 index f7d3f6dc1..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/bower.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "visionmedia-debug", - "main": "dist/debug.js", - "version": "2.1.3", - "homepage": "https://github.com/visionmedia/debug", - "authors": [ - "TJ Holowaychuk " - ], - "description": "visionmedia-debug", - "moduleType": [ - "amd", - "es6", - "globals", - "node" - ], - "keywords": [ - "visionmedia", - "debug" - ], - "license": "MIT", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ] -} diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/browser.js b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/browser.js deleted file mode 100644 index 55f4cf926..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/browser.js +++ /dev/null @@ -1,175 +0,0 @@ - -/** - * This is the web browser implementation of `debug()`. - * - * Expose `debug()` as the module. - */ - -exports = module.exports = require('./debug'); -exports.log = log; -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; - -/** - * Use chrome.storage.local if we are in an app - */ - -var storage; - -if (typeof chrome !== 'undefined' && typeof chrome.storage !== 'undefined') - storage = chrome.storage.local; -else - storage = localstorage(); - -/** - * Colors. - */ - -exports.colors = [ - 'lightseagreen', - 'forestgreen', - 'goldenrod', - 'dodgerblue', - 'darkorchid', - 'crimson' -]; - -/** - * Currently only WebKit-based Web Inspectors, Firefox >= v31, - * and the Firebug extension (any Firefox version) are known - * to support "%c" CSS customizations. - * - * TODO: add a `localStorage` variable to explicitly enable/disable colors - */ - -function useColors() { - // is webkit? http://stackoverflow.com/a/16459606/376773 - return ('WebkitAppearance' in document.documentElement.style) || - // is firebug? http://stackoverflow.com/a/398120/376773 - (window.console && (console.firebug || (console.exception && console.table))) || - // is firefox >= v31? - // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - (navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31); -} - -/** - * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. - */ - -exports.formatters.j = function(v) { - return JSON.stringify(v); -}; - - -/** - * Colorize log arguments if enabled. - * - * @api public - */ - -function formatArgs() { - var args = arguments; - var useColors = this.useColors; - - args[0] = (useColors ? '%c' : '') - + this.namespace - + (useColors ? ' %c' : ' ') - + args[0] - + (useColors ? '%c ' : ' ') - + '+' + exports.humanize(this.diff); - - if (!useColors) return args; - - var c = 'color: ' + this.color; - args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1)); - - // the final "%c" is somewhat tricky, because there could be other - // arguments passed either before or after the %c, so we need to - // figure out the correct index to insert the CSS into - var index = 0; - var lastC = 0; - args[0].replace(/%[a-z%]/g, function(match) { - if ('%%' === match) return; - index++; - if ('%c' === match) { - // we only are interested in the *last* %c - // (the user may have provided their own) - lastC = index; - } - }); - - args.splice(lastC, 0, c); - return args; -} - -/** - * Invokes `console.log()` when available. - * No-op when `console.log` is not a "function". - * - * @api public - */ - -function log() { - // this hackery is required for IE8/9, where - // the `console.log` function doesn't have 'apply' - return 'object' === typeof console - && console.log - && Function.prototype.apply.call(console.log, console, arguments); -} - -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ - -function save(namespaces) { - try { - if (null == namespaces) { - storage.removeItem('debug'); - } else { - storage.debug = namespaces; - } - } catch(e) {} -} - -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ - -function load() { - var r; - try { - r = storage.debug; - } catch(e) {} - return r; -} - -/** - * Enable namespaces listed in `localStorage.debug` initially. - */ - -exports.enable(load()); - -/** - * Localstorage attempts to return the localstorage. - * - * This is necessary because safari throws - * when a user disables cookies/localstorage - * and you attempt to access it. - * - * @return {LocalStorage} - * @api private - */ - -function localstorage(){ - try { - return window.localStorage; - } catch (e) {} -} diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/component.json b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/component.json deleted file mode 100644 index 52ffd4224..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/component.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "debug", - "repo": "visionmedia/debug", - "description": "small debugging utility", - "version": "2.1.3", - "keywords": [ - "debug", - "log", - "debugger" - ], - "main": "browser.js", - "scripts": [ - "browser.js", - "debug.js" - ], - "dependencies": { - "rauchg/ms.js": "0.7.0" - } -} diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/debug.js b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/debug.js deleted file mode 100644 index 7571a8605..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/debug.js +++ /dev/null @@ -1,197 +0,0 @@ - -/** - * This is the common logic for both the Node.js and web browser - * implementations of `debug()`. - * - * Expose `debug()` as the module. - */ - -exports = module.exports = debug; -exports.coerce = coerce; -exports.disable = disable; -exports.enable = enable; -exports.enabled = enabled; -exports.humanize = require('ms'); - -/** - * The currently active debug mode names, and names to skip. - */ - -exports.names = []; -exports.skips = []; - -/** - * Map of special "%n" handling functions, for the debug "format" argument. - * - * Valid key names are a single, lowercased letter, i.e. "n". - */ - -exports.formatters = {}; - -/** - * Previously assigned color. - */ - -var prevColor = 0; - -/** - * Previous log timestamp. - */ - -var prevTime; - -/** - * Select a color. - * - * @return {Number} - * @api private - */ - -function selectColor() { - return exports.colors[prevColor++ % exports.colors.length]; -} - -/** - * Create a debugger with the given `namespace`. - * - * @param {String} namespace - * @return {Function} - * @api public - */ - -function debug(namespace) { - - // define the `disabled` version - function disabled() { - } - disabled.enabled = false; - - // define the `enabled` version - function enabled() { - - var self = enabled; - - // set `diff` timestamp - var curr = +new Date(); - var ms = curr - (prevTime || curr); - self.diff = ms; - self.prev = prevTime; - self.curr = curr; - prevTime = curr; - - // add the `color` if not set - if (null == self.useColors) self.useColors = exports.useColors(); - if (null == self.color && self.useColors) self.color = selectColor(); - - var args = Array.prototype.slice.call(arguments); - - args[0] = exports.coerce(args[0]); - - if ('string' !== typeof args[0]) { - // anything else let's inspect with %o - args = ['%o'].concat(args); - } - - // apply any `formatters` transformations - var index = 0; - args[0] = args[0].replace(/%([a-z%])/g, function(match, format) { - // if we encounter an escaped % then don't increase the array index - if (match === '%%') return match; - index++; - var formatter = exports.formatters[format]; - if ('function' === typeof formatter) { - var val = args[index]; - match = formatter.call(self, val); - - // now we need to remove `args[index]` since it's inlined in the `format` - args.splice(index, 1); - index--; - } - return match; - }); - - if ('function' === typeof exports.formatArgs) { - args = exports.formatArgs.apply(self, args); - } - var logFn = enabled.log || exports.log || console.log.bind(console); - logFn.apply(self, args); - } - enabled.enabled = true; - - var fn = exports.enabled(namespace) ? enabled : disabled; - - fn.namespace = namespace; - - return fn; -} - -/** - * Enables a debug mode by namespaces. This can include modes - * separated by a colon and wildcards. - * - * @param {String} namespaces - * @api public - */ - -function enable(namespaces) { - exports.save(namespaces); - - var split = (namespaces || '').split(/[\s,]+/); - var len = split.length; - - for (var i = 0; i < len; i++) { - if (!split[i]) continue; // ignore empty strings - namespaces = split[i].replace(/\*/g, '.*?'); - if (namespaces[0] === '-') { - exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); - } else { - exports.names.push(new RegExp('^' + namespaces + '$')); - } - } -} - -/** - * Disable debug output. - * - * @api public - */ - -function disable() { - exports.enable(''); -} - -/** - * Returns true if the given mode name is enabled, false otherwise. - * - * @param {String} name - * @return {Boolean} - * @api public - */ - -function enabled(name) { - var i, len; - for (i = 0, len = exports.skips.length; i < len; i++) { - if (exports.skips[i].test(name)) { - return false; - } - } - for (i = 0, len = exports.names.length; i < len; i++) { - if (exports.names[i].test(name)) { - return true; - } - } - return false; -} - -/** - * Coerce `val`. - * - * @param {Mixed} val - * @return {Mixed} - * @api private - */ - -function coerce(val) { - if (val instanceof Error) return val.stack || val.message; - return val; -} diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/node.js b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/node.js deleted file mode 100644 index 1d392a81d..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/node.js +++ /dev/null @@ -1,209 +0,0 @@ - -/** - * Module dependencies. - */ - -var tty = require('tty'); -var util = require('util'); - -/** - * This is the Node.js implementation of `debug()`. - * - * Expose `debug()` as the module. - */ - -exports = module.exports = require('./debug'); -exports.log = log; -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; - -/** - * Colors. - */ - -exports.colors = [6, 2, 3, 4, 5, 1]; - -/** - * The file descriptor to write the `debug()` calls to. - * Set the `DEBUG_FD` env variable to override with another value. i.e.: - * - * $ DEBUG_FD=3 node script.js 3>debug.log - */ - -var fd = parseInt(process.env.DEBUG_FD, 10) || 2; -var stream = 1 === fd ? process.stdout : - 2 === fd ? process.stderr : - createWritableStdioStream(fd); - -/** - * Is stdout a TTY? Colored output is enabled when `true`. - */ - -function useColors() { - var debugColors = (process.env.DEBUG_COLORS || '').trim().toLowerCase(); - if (0 === debugColors.length) { - return tty.isatty(fd); - } else { - return '0' !== debugColors - && 'no' !== debugColors - && 'false' !== debugColors - && 'disabled' !== debugColors; - } -} - -/** - * Map %o to `util.inspect()`, since Node doesn't do that out of the box. - */ - -var inspect = (4 === util.inspect.length ? - // node <= 0.8.x - function (v, colors) { - return util.inspect(v, void 0, void 0, colors); - } : - // node > 0.8.x - function (v, colors) { - return util.inspect(v, { colors: colors }); - } -); - -exports.formatters.o = function(v) { - return inspect(v, this.useColors) - .replace(/\s*\n\s*/g, ' '); -}; - -/** - * Adds ANSI color escape codes if enabled. - * - * @api public - */ - -function formatArgs() { - var args = arguments; - var useColors = this.useColors; - var name = this.namespace; - - if (useColors) { - var c = this.color; - - args[0] = ' \u001b[3' + c + ';1m' + name + ' ' - + '\u001b[0m' - + args[0] + '\u001b[3' + c + 'm' - + ' +' + exports.humanize(this.diff) + '\u001b[0m'; - } else { - args[0] = new Date().toUTCString() - + ' ' + name + ' ' + args[0]; - } - return args; -} - -/** - * Invokes `console.error()` with the specified arguments. - */ - -function log() { - return stream.write(util.format.apply(this, arguments) + '\n'); -} - -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ - -function save(namespaces) { - if (null == namespaces) { - // If you set a process.env field to null or undefined, it gets cast to the - // string 'null' or 'undefined'. Just delete instead. - delete process.env.DEBUG; - } else { - process.env.DEBUG = namespaces; - } -} - -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ - -function load() { - return process.env.DEBUG; -} - -/** - * Copied from `node/src/node.js`. - * - * XXX: It's lame that node doesn't expose this API out-of-the-box. It also - * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame. - */ - -function createWritableStdioStream (fd) { - var stream; - var tty_wrap = process.binding('tty_wrap'); - - // Note stream._type is used for test-module-load-list.js - - switch (tty_wrap.guessHandleType(fd)) { - case 'TTY': - stream = new tty.WriteStream(fd); - stream._type = 'tty'; - - // Hack to have stream not keep the event loop alive. - // See https://github.com/joyent/node/issues/1726 - if (stream._handle && stream._handle.unref) { - stream._handle.unref(); - } - break; - - case 'FILE': - var fs = require('fs'); - stream = new fs.SyncWriteStream(fd, { autoClose: false }); - stream._type = 'fs'; - break; - - case 'PIPE': - case 'TCP': - var net = require('net'); - stream = new net.Socket({ - fd: fd, - readable: false, - writable: true - }); - - // FIXME Should probably have an option in net.Socket to create a - // stream from an existing fd which is writable only. But for now - // we'll just add this hack and set the `readable` member to false. - // Test: ./node test/fixtures/echo.js < /etc/passwd - stream.readable = false; - stream.read = null; - stream._type = 'pipe'; - - // FIXME Hack to have stream not keep the event loop alive. - // See https://github.com/joyent/node/issues/1726 - if (stream._handle && stream._handle.unref) { - stream._handle.unref(); - } - break; - - default: - // Probably an error on in uv_guess_handle() - throw new Error('Implement me. Unknown stream file type!'); - } - - // For supporting legacy API we put the FD here. - stream.fd = fd; - - stream._isStdio = true; - - return stream; -} - -/** - * Enable namespaces listed in `process.env.DEBUG` initially. - */ - -exports.enable(load()); diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/node_modules/ms/.npmignore b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/node_modules/ms/.npmignore deleted file mode 100644 index d1aa0ce42..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/node_modules/ms/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -node_modules -test -History.md -Makefile -component.json diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/node_modules/ms/LICENSE b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/node_modules/ms/LICENSE deleted file mode 100644 index 6c07561b6..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/node_modules/ms/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 Guillermo Rauch - -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/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/node_modules/ms/README.md b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/node_modules/ms/README.md deleted file mode 100644 index 0fd54fdc7..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/node_modules/ms/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# ms.js: miliseconds conversion utility - -```js -ms('2 days') // 172800000 -ms('1d') // 86400000 -ms('10h') // 36000000 -ms('2.5 hrs') // 9000000 -ms('2h') // 7200000 -ms('1m') // 60000 -ms('5s') // 5000 -ms('100') // 100 -``` - -```js -ms(60000) // "1m" -ms(2 * 60000) // "2m" -ms(ms('10 hours')) // "10h" -``` - -```js -ms(60000, { long: true }) // "1 minute" -ms(2 * 60000, { long: true }) // "2 minutes" -ms(ms('10 hours'), { long: true }) // "10 hours" -``` - -- Node/Browser compatible. Published as [`ms`](https://www.npmjs.org/package/ms) in [NPM](nodejs.org/download). -- If a number is supplied to `ms`, a string with a unit is returned. -- If a string that contains the number is supplied, it returns it as -a number (e.g: it returns `100` for `'100'`). -- If you pass a string with a number and a valid unit, the number of -equivalent ms is returned. - -## License - -MIT diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/node_modules/ms/index.js b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/node_modules/ms/index.js deleted file mode 100644 index e79bfa18c..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/node_modules/ms/index.js +++ /dev/null @@ -1,123 +0,0 @@ -/** - * Helpers. - */ - -var s = 1000; -var m = s * 60; -var h = m * 60; -var d = h * 24; -var y = d * 365.25; - -/** - * Parse or format the given `val`. - * - * Options: - * - * - `long` verbose formatting [false] - * - * @param {String|Number} val - * @param {Object} options - * @return {String|Number} - * @api public - */ - -module.exports = function(val, options){ - options = options || {}; - if ('string' == typeof val) return parse(val); - return options.long - ? long(val) - : short(val); -}; - -/** - * Parse the given `str` and return milliseconds. - * - * @param {String} str - * @return {Number} - * @api private - */ - -function parse(str) { - var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str); - if (!match) return; - var n = parseFloat(match[1]); - var type = (match[2] || 'ms').toLowerCase(); - switch (type) { - case 'years': - case 'year': - case 'yrs': - case 'yr': - case 'y': - return n * y; - case 'days': - case 'day': - case 'd': - return n * d; - case 'hours': - case 'hour': - case 'hrs': - case 'hr': - case 'h': - return n * h; - case 'minutes': - case 'minute': - case 'mins': - case 'min': - case 'm': - return n * m; - case 'seconds': - case 'second': - case 'secs': - case 'sec': - case 's': - return n * s; - case 'milliseconds': - case 'millisecond': - case 'msecs': - case 'msec': - case 'ms': - return n; - } -} - -/** - * Short format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function short(ms) { - if (ms >= d) return Math.round(ms / d) + 'd'; - if (ms >= h) return Math.round(ms / h) + 'h'; - if (ms >= m) return Math.round(ms / m) + 'm'; - if (ms >= s) return Math.round(ms / s) + 's'; - return ms + 'ms'; -} - -/** - * Long format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function long(ms) { - return plural(ms, d, 'day') - || plural(ms, h, 'hour') - || plural(ms, m, 'minute') - || plural(ms, s, 'second') - || ms + ' ms'; -} - -/** - * Pluralization helper. - */ - -function plural(ms, n, name) { - if (ms < n) return; - if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name; - return Math.ceil(ms / n) + ' ' + name + 's'; -} diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/node_modules/ms/package.json b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/node_modules/ms/package.json deleted file mode 100644 index 19ae83807..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/node_modules/ms/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "ms", - "version": "0.7.0", - "description": "Tiny ms conversion utility", - "repository": { - "type": "git", - "url": "git://github.com/guille/ms.js.git" - }, - "main": "./index", - "devDependencies": { - "mocha": "*", - "expect.js": "*", - "serve": "*" - }, - "component": { - "scripts": { - "ms/index.js": "index.js" - } - }, - "readme": "# ms.js: miliseconds conversion utility\n\n```js\nms('2 days') // 172800000\nms('1d') // 86400000\nms('10h') // 36000000\nms('2.5 hrs') // 9000000\nms('2h') // 7200000\nms('1m') // 60000\nms('5s') // 5000\nms('100') // 100\n```\n\n```js\nms(60000) // \"1m\"\nms(2 * 60000) // \"2m\"\nms(ms('10 hours')) // \"10h\"\n```\n\n```js\nms(60000, { long: true }) // \"1 minute\"\nms(2 * 60000, { long: true }) // \"2 minutes\"\nms(ms('10 hours'), { long: true }) // \"10 hours\"\n```\n\n- Node/Browser compatible. Published as [`ms`](https://www.npmjs.org/package/ms) in [NPM](nodejs.org/download).\n- If a number is supplied to `ms`, a string with a unit is returned.\n- If a string that contains the number is supplied, it returns it as\na number (e.g: it returns `100` for `'100'`).\n- If you pass a string with a number and a valid unit, the number of\nequivalent ms is returned.\n\n## License\n\nMIT\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/guille/ms.js/issues" - }, - "homepage": "https://github.com/guille/ms.js", - "_id": "ms@0.7.0", - "_from": "ms@0.7.0", - "scripts": {} -} diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/package.json b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/package.json deleted file mode 100644 index d6ed12c8b..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/debug/package.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "debug", - "version": "2.1.3", - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/debug.git" - }, - "description": "small debugging utility", - "keywords": [ - "debug", - "log", - "debugger" - ], - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "contributors": [ - { - "name": "Nathan Rajlich", - "email": "nathan@tootallnate.net", - "url": "http://n8.io" - } - ], - "license": "MIT", - "dependencies": { - "ms": "0.7.0" - }, - "devDependencies": { - "browserify": "9.0.3", - "mocha": "*" - }, - "main": "./node.js", - "browser": "./browser.js", - "component": { - "scripts": { - "debug/index.js": "browser.js", - "debug/debug.js": "debug.js" - } - }, - "readme": "# debug\n\n tiny node.js debugging utility modelled after node core's debugging technique.\n\n## Installation\n\n```bash\n$ npm install debug\n```\n\n## Usage\n\n With `debug` you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated `console.error`, so all of the `console` format string goodies you're used to work fine. A unique color is selected per-function for visibility.\n\nExample _app.js_:\n\n```js\nvar debug = require('debug')('http')\n , http = require('http')\n , name = 'My App';\n\n// fake app\n\ndebug('booting %s', name);\n\nhttp.createServer(function(req, res){\n debug(req.method + ' ' + req.url);\n res.end('hello\\n');\n}).listen(3000, function(){\n debug('listening');\n});\n\n// fake worker of some kind\n\nrequire('./worker');\n```\n\nExample _worker.js_:\n\n```js\nvar debug = require('debug')('worker');\n\nsetInterval(function(){\n debug('doing some work');\n}, 1000);\n```\n\n The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples:\n\n ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png)\n\n ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png)\n\n#### Windows note\n\n On Windows the environment variable is set using the `set` command. \n \n ```cmd\n set DEBUG=*,-not_this\n ```\n\nThen, run the program to be debugged as usual.\n\n## Millisecond diff\n\n When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the \"+NNNms\" will show you how much time was spent between calls.\n\n ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png)\n\n When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below:\n\n ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png)\n\n## Conventions\n\n If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use \":\" to separate features. For example \"bodyParser\" from Connect would then be \"connect:bodyParser\".\n\n## Wildcards\n\n The `*` character may be used as a wildcard. Suppose for example your library has debuggers named \"connect:bodyParser\", \"connect:compress\", \"connect:session\", instead of listing all three with `DEBUG=connect:bodyParser,connect.compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.\n\n You can also exclude specific debuggers by prefixing them with a \"-\" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with \"connect:\".\n\n## Browser support\n\n Debug works in the browser as well, currently persisted by `localStorage`. Consider the situation shown below where you have `worker:a` and `worker:b`, and wish to debug both. Somewhere in the code on your page, include:\n\n```js\nwindow.myDebug = require(\"debug\");\n```\n\n (\"debug\" is a global object in the browser so we give this object a different name.) When your page is open in the browser, type the following in the console:\n\n```js\nmyDebug.enable(\"worker:*\")\n```\n\n Refresh the page. Debug output will continue to be sent to the console until it is disabled by typing `myDebug.disable()` in the console.\n\n```js\na = debug('worker:a');\nb = debug('worker:b');\n\nsetInterval(function(){\n a('doing some work');\n}, 1000);\n\nsetInterval(function(){\n b('doing some work');\n}, 1200);\n```\n\n#### Web Inspector Colors\n\n Colors are also enabled on \"Web Inspectors\" that understand the `%c` formatting\n option. These are WebKit web inspectors, Firefox ([since version\n 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/))\n and the Firebug plugin for Firefox (any version).\n\n Colored output looks something like:\n\n ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png)\n\n### stderr vs stdout\n\nYou can set an alternative logging method per-namespace by overriding the `log` method on a per-namespace or globally:\n\nExample _stdout.js_:\n\n```js\nvar debug = require('debug');\nvar error = debug('app:error');\n\n// by default stderr is used\nerror('goes to stderr!');\n\nvar log = debug('app:log');\n// set this namespace to log via console.log\nlog.log = console.log.bind(console); // don't forget to bind to console!\nlog('goes to stdout');\nerror('still goes to stderr!');\n\n// set all output to go via console.info\n// overrides all per-namespace log settings\ndebug.log = console.info.bind(console);\nerror('now goes to stdout via console.info');\nlog('still goes to stdout, but via console.info now');\n```\n\n## Authors\n\n - TJ Holowaychuk\n - Nathan Rajlich\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/visionmedia/debug/issues" - }, - "homepage": "https://github.com/visionmedia/debug", - "_id": "debug@2.1.3", - "_from": "debug@~2.1.3", - "scripts": {} -} diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/HISTORY.md b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/HISTORY.md deleted file mode 100644 index 8759902fb..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/HISTORY.md +++ /dev/null @@ -1,64 +0,0 @@ -0.3.4 / 2015-03-15 -================== - - * deps: debug@~2.1.3 - - Fix high intensity foreground color for bold - - deps: ms@0.7.0 - -0.3.3 / 2015-01-01 -================== - - * deps: debug@~2.1.1 - * deps: on-finished@~2.2.0 - -0.3.2 / 2014-10-22 -================== - - * deps: on-finished@~2.1.1 - - Fix handling of pipelined requests - -0.3.1 / 2014-10-16 -================== - - * deps: debug@~2.1.0 - - Implement `DEBUG_FD` env variable support - -0.3.0 / 2014-09-17 -================== - - * Terminate in progress response only on error - * Use `on-finished` to determine request status - -0.2.0 / 2014-09-03 -================== - - * Set `X-Content-Type-Options: nosniff` header - * deps: debug@~2.0.0 - -0.1.0 / 2014-07-16 -================== - - * Respond after request fully read - - prevents hung responses and socket hang ups - * deps: debug@1.0.4 - -0.0.3 / 2014-07-11 -================== - - * deps: debug@1.0.3 - - Add support for multiple wildcards in namespaces - -0.0.2 / 2014-06-19 -================== - - * Handle invalid status codes - -0.0.1 / 2014-06-05 -================== - - * deps: debug@1.0.2 - -0.0.0 / 2014-06-05 -================== - - * Extracted from connect/express diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/LICENSE b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/LICENSE deleted file mode 100644 index eda23054b..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 Douglas Christopher Wilson - -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/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/README.md b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/README.md deleted file mode 100644 index 6b171d47b..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/README.md +++ /dev/null @@ -1,133 +0,0 @@ -# finalhandler - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Node.js Version][node-image]][node-url] -[![Build Status][travis-image]][travis-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -Node.js function to invoke as the final step to respond to HTTP request. - -## Installation - -```sh -$ npm install finalhandler -``` - -## API - -```js -var finalhandler = require('finalhandler') -``` - -### finalhandler(req, res, [options]) - -Returns function to be invoked as the final step for the given `req` and `res`. -This function is to be invoked as `fn(err)`. If `err` is falsy, the handler will -write out a 404 response to the `res`. If it is truthy, an error response will -be written out to the `res`, and `res.statusCode` is set from `err.status`. - -The final handler will also unpipe anything from `req` when it is invoked. - -#### options.env - -By default, the environment is determined by `NODE_ENV` variable, but it can be -overridden by this option. - -#### options.onerror - -Provide a function to be called with the `err` when it exists. Can be used for -writing errors to a central location without excessive function generation. Called -as `onerror(err, req, res)`. - -## Examples - -### always 404 - -```js -var finalhandler = require('finalhandler') -var http = require('http') - -var server = http.createServer(function (req, res) { - var done = finalhandler(req, res) - done() -}) - -server.listen(3000) -``` - -### perform simple action - -```js -var finalhandler = require('finalhandler') -var fs = require('fs') -var http = require('http') - -var server = http.createServer(function (req, res) { - var done = finalhandler(req, res) - - fs.readFile('index.html', function (err, buf) { - if (err) return done(err) - res.setHeader('Content-Type', 'text/html') - res.end(buf) - }) -}) - -server.listen(3000) -``` - -### use with middleware-style functions - -```js -var finalhandler = require('finalhandler') -var http = require('http') -var serveStatic = require('serve-static') - -var serve = serveStatic('public') - -var server = http.createServer(function (req, res) { - var done = finalhandler(req, res) - serve(req, res, done) -}) - -server.listen(3000) -``` - -### keep log of all errors - -```js -var finalhandler = require('finalhandler') -var fs = require('fs') -var http = require('http') - -var server = http.createServer(function (req, res) { - var done = finalhandler(req, res, {onerror: logerror}) - - fs.readFile('index.html', function (err, buf) { - if (err) return done(err) - res.setHeader('Content-Type', 'text/html') - res.end(buf) - }) -}) - -server.listen(3000) - -function logerror(err) { - console.error(err.stack || err.toString()) -} -``` - -## License - -[MIT](LICENSE) - -[npm-image]: https://img.shields.io/npm/v/finalhandler.svg -[npm-url]: https://npmjs.org/package/finalhandler -[node-image]: https://img.shields.io/node/v/finalhandler.svg -[node-url]: http://nodejs.org/download/ -[travis-image]: https://img.shields.io/travis/pillarjs/finalhandler.svg -[travis-url]: https://travis-ci.org/pillarjs/finalhandler -[coveralls-image]: https://img.shields.io/coveralls/pillarjs/finalhandler.svg -[coveralls-url]: https://coveralls.io/r/pillarjs/finalhandler?branch=master -[downloads-image]: https://img.shields.io/npm/dm/finalhandler.svg -[downloads-url]: https://npmjs.org/package/finalhandler diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/index.js b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/index.js deleted file mode 100644 index bb2bb583f..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/index.js +++ /dev/null @@ -1,171 +0,0 @@ -/*! - * finalhandler - * Copyright(c) 2014 Douglas Christopher Wilson - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var debug = require('debug')('finalhandler') -var escapeHtml = require('escape-html') -var http = require('http') -var onFinished = require('on-finished') - -/** - * Variables. - */ - -/* istanbul ignore next */ -var defer = typeof setImmediate === 'function' - ? setImmediate - : function(fn){ process.nextTick(fn.bind.apply(fn, arguments)) } -var isFinished = onFinished.isFinished - -/** - * Module exports. - */ - -module.exports = finalhandler - -/** - * Final handler: - * - * @param {Request} req - * @param {Response} res - * @param {Object} [options] - * @return {Function} - * @api public - */ - -function finalhandler(req, res, options) { - options = options || {} - - // get environment - var env = options.env || process.env.NODE_ENV || 'development' - - // get error callback - var onerror = options.onerror - - return function (err) { - var msg - - // ignore 404 on in-flight response - if (!err && res._header) { - debug('cannot 404 after headers sent') - return - } - - // unhandled error - if (err) { - // default status code to 500 - if (!res.statusCode || res.statusCode < 400) { - res.statusCode = 500 - } - - // respect err.status - if (err.status) { - res.statusCode = err.status - } - - // production gets a basic error message - var msg = env === 'production' - ? http.STATUS_CODES[res.statusCode] - : err.stack || err.toString() - msg = escapeHtml(msg) - .replace(/\n/g, '
') - .replace(/ /g, '  ') + '\n' - } else { - res.statusCode = 404 - msg = 'Cannot ' + escapeHtml(req.method) + ' ' + escapeHtml(req.originalUrl || req.url) + '\n' - } - - debug('default %s', res.statusCode) - - // schedule onerror callback - if (err && onerror) { - defer(onerror, err, req, res) - } - - // cannot actually respond - if (res._header) { - return req.socket.destroy() - } - - send(req, res, res.statusCode, msg) - } -} - -/** - * Send response. - * - * @param {IncomingMessage} req - * @param {OutgoingMessage} res - * @param {number} status - * @param {string} body - * @api private - */ - -function send(req, res, status, body) { - function write() { - res.statusCode = status - - // security header for content sniffing - res.setHeader('X-Content-Type-Options', 'nosniff') - - // standard headers - res.setHeader('Content-Type', 'text/html; charset=utf-8') - res.setHeader('Content-Length', Buffer.byteLength(body, 'utf8')) - - if (req.method === 'HEAD') { - res.end() - return - } - - res.end(body, 'utf8') - } - - if (isFinished(req)) { - write() - return - } - - // unpipe everything from the request - unpipe(req) - - // flush the request - onFinished(req, write) - req.resume() -} - -/** - * Unpipe everything from a stream. - * - * @param {Object} stream - * @api private - */ - -/* istanbul ignore next: implementation differs between versions */ -function unpipe(stream) { - if (typeof stream.unpipe === 'function') { - // new-style - stream.unpipe() - return - } - - // Node.js 0.8 hack - var listener - var listeners = stream.listeners('close') - - for (var i = 0; i < listeners.length; i++) { - listener = listeners[i] - - if (listener.name !== 'cleanup' && listener.name !== 'onclose') { - continue - } - - // invoke the listener - listener.call(stream) - } -} diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/escape-html/.npmignore b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/escape-html/.npmignore deleted file mode 100644 index 48a2e246c..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/escape-html/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -components -build diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/escape-html/Makefile b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/escape-html/Makefile deleted file mode 100644 index 3f6119d22..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/escape-html/Makefile +++ /dev/null @@ -1,11 +0,0 @@ - -build: components index.js - @component build - -components: - @Component install - -clean: - rm -fr build components template.js - -.PHONY: clean diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/escape-html/Readme.md b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/escape-html/Readme.md deleted file mode 100644 index 2cfcc9973..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/escape-html/Readme.md +++ /dev/null @@ -1,15 +0,0 @@ - -# escape-html - - Escape HTML entities - -## Example - -```js -var escape = require('escape-html'); -escape(str); -``` - -## License - - MIT \ No newline at end of file diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/escape-html/component.json b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/escape-html/component.json deleted file mode 100644 index cb9740fd4..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/escape-html/component.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "escape-html", - "description": "Escape HTML entities", - "version": "1.0.1", - "keywords": ["escape", "html", "utility"], - "dependencies": {}, - "scripts": [ - "index.js" - ] -} diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/escape-html/index.js b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/escape-html/index.js deleted file mode 100644 index 276521145..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/escape-html/index.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Escape special characters in the given string of html. - * - * @param {String} html - * @return {String} - * @api private - */ - -module.exports = function(html) { - return String(html) - .replace(/&/g, '&') - .replace(/"/g, '"') - .replace(/'/g, ''') - .replace(//g, '>'); -} diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/escape-html/package.json b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/escape-html/package.json deleted file mode 100644 index 46fe117ba..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/escape-html/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "escape-html", - "description": "Escape HTML entities", - "version": "1.0.1", - "keywords": [ - "escape", - "html", - "utility" - ], - "dependencies": {}, - "main": "index.js", - "component": { - "scripts": { - "escape-html/index.js": "index.js" - } - }, - "repository": { - "type": "git", - "url": "https://github.com/component/escape-html.git" - }, - "readme": "\n# escape-html\n\n Escape HTML entities\n\n## Example\n\n```js\nvar escape = require('escape-html');\nescape(str);\n```\n\n## License\n\n MIT", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/component/escape-html/issues" - }, - "homepage": "https://github.com/component/escape-html", - "_id": "escape-html@1.0.1", - "_from": "escape-html@1.0.1" -} diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/on-finished/HISTORY.md b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/on-finished/HISTORY.md deleted file mode 100644 index 5d1e1c94b..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/on-finished/HISTORY.md +++ /dev/null @@ -1,76 +0,0 @@ -2.2.0 / 2014-12-22 -================== - - * Add message object to callback arguments - -2.1.1 / 2014-10-22 -================== - - * Fix handling of pipelined requests - -2.1.0 / 2014-08-16 -================== - - * Check if `socket` is detached - * Return `undefined` for `isFinished` if state unknown - -2.0.0 / 2014-08-16 -================== - - * Add `isFinished` function - * Move to `jshttp` organization - * Remove support for plain socket argument - * Rename to `on-finished` - * Support both `req` and `res` as arguments - * deps: ee-first@1.0.5 - -1.2.2 / 2014-06-10 -================== - - * Reduce listeners added to emitters - - avoids "event emitter leak" warnings when used multiple times on same request - -1.2.1 / 2014-06-08 -================== - - * Fix returned value when already finished - -1.2.0 / 2014-06-05 -================== - - * Call callback when called on already-finished socket - -1.1.4 / 2014-05-27 -================== - - * Support node.js 0.8 - -1.1.3 / 2014-04-30 -================== - - * Make sure errors passed as instanceof `Error` - -1.1.2 / 2014-04-18 -================== - - * Default the `socket` to passed-in object - -1.1.1 / 2014-01-16 -================== - - * Rename module to `finished` - -1.1.0 / 2013-12-25 -================== - - * Call callback when called on already-errored socket - -1.0.1 / 2013-12-20 -================== - - * Actually pass the error to the callback - -1.0.0 / 2013-12-20 -================== - - * Initial release diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/on-finished/LICENSE b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/on-finished/LICENSE deleted file mode 100644 index 5931fd23e..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/on-finished/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -(The MIT License) - -Copyright (c) 2013 Jonathan Ong -Copyright (c) 2014 Douglas Christopher Wilson - -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/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/on-finished/README.md b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/on-finished/README.md deleted file mode 100644 index 29d699182..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/on-finished/README.md +++ /dev/null @@ -1,109 +0,0 @@ -# on-finished - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Node.js Version][node-version-image]][node-version-url] -[![Build Status][travis-image]][travis-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -Execute a callback when a request closes, finishes, or errors. - -## Install - -```sh -$ npm install on-finished -``` - -## API - -```js -var onFinished = require('on-finished') -``` - -### onFinished(res, listener) - -Attach a listener to listen for the response to finish. The listener will -be invoked only once when the response finished. If the response finished -to to an error, the first argument will contain the error. If the response -has already finished, the listener will be invoked. - -Listening to the end of a response would be used to close things associated -with the response, like open files. - -Listener is invoked as `listener(err, res)`. - -```js -onFinished(res, function (err, res) { - // clean up open fds, etc. - // err contains the error is request error'd -}) -``` - -### onFinished(req, listener) - -Attach a listener to listen for the request to finish. The listener will -be invoked only once when the request finished. If the request finished -to to an error, the first argument will contain the error. If the request -has already finished, the listener will be invoked. - -Listening to the end of a request would be used to know when to continue -after reading the data. - -Listener is invoked as `listener(err, req)`. - -```js -var data = '' - -req.setEncoding('utf8') -res.on('data', function (str) { - data += str -}) - -onFinished(req, function (err, req) { - // data is read unless there is err -}) -``` - -### onFinished.isFinished(res) - -Determine if `res` is already finished. This would be useful to check and -not even start certain operations if the response has already finished. - -### onFinished.isFinished(req) - -Determine if `req` is already finished. This would be useful to check and -not even start certain operations if the request has already finished. - -### Example - -The following code ensures that file descriptors are always closed -once the response finishes. - -```js -var destroy = require('destroy') -var http = require('http') -var onFinished = require('on-finished') - -http.createServer(function onRequest(req, res) { - var stream = fs.createReadStream('package.json') - stream.pipe(res) - onFinished(res, function (err) { - destroy(stream) - }) -}) -``` - -## License - -[MIT](LICENSE) - -[npm-image]: https://img.shields.io/npm/v/on-finished.svg?style=flat -[npm-url]: https://npmjs.org/package/on-finished -[node-version-image]: https://img.shields.io/node/v/on-finished.svg?style=flat -[node-version-url]: http://nodejs.org/download/ -[travis-image]: https://img.shields.io/travis/jshttp/on-finished.svg?style=flat -[travis-url]: https://travis-ci.org/jshttp/on-finished -[coveralls-image]: https://img.shields.io/coveralls/jshttp/on-finished.svg?style=flat -[coveralls-url]: https://coveralls.io/r/jshttp/on-finished?branch=master -[downloads-image]: https://img.shields.io/npm/dm/on-finished.svg?style=flat -[downloads-url]: https://npmjs.org/package/on-finished diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/on-finished/index.js b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/on-finished/index.js deleted file mode 100644 index f68161c93..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/on-finished/index.js +++ /dev/null @@ -1,191 +0,0 @@ -/*! - * on-finished - * Copyright(c) 2013 Jonathan Ong - * Copyright(c) 2014 Douglas Christopher Wilson - * MIT Licensed - */ - -/** - * Module exports. - */ - -module.exports = onFinished; -module.exports.isFinished = isFinished; - -/** -* Module dependencies. -*/ - -var first = require('ee-first') - -/** -* Variables. -*/ - -/* istanbul ignore next */ -var defer = typeof setImmediate === 'function' - ? setImmediate - : function(fn){ process.nextTick(fn.bind.apply(fn, arguments)) } - -/** - * Invoke callback when the response has finished, useful for - * cleaning up resources afterwards. - * - * @param {object} msg - * @param {function} listener - * @return {object} - * @api public - */ - -function onFinished(msg, listener) { - if (isFinished(msg) !== false) { - defer(listener, null, msg) - return msg - } - - // attach the listener to the message - attachListener(msg, listener) - - return msg -} - -/** - * Determine if message is already finished. - * - * @param {object} msg - * @return {boolean} - * @api public - */ - -function isFinished(msg) { - var socket = msg.socket - - if (typeof msg.finished === 'boolean') { - // OutgoingMessage - return Boolean(msg.finished || (socket && !socket.writable)) - } - - if (typeof msg.complete === 'boolean') { - // IncomingMessage - return Boolean(!socket || msg.complete || !socket.readable) - } - - // don't know - return undefined -} - -/** - * Attach a finished listener to the message. - * - * @param {object} msg - * @param {function} callback - * @private - */ - -function attachFinishedListener(msg, callback) { - var eeMsg - var eeSocket - var finished = false - - function onFinish(error) { - eeMsg.cancel() - eeSocket.cancel() - - finished = true - callback(error) - } - - // finished on first message event - eeMsg = eeSocket = first([[msg, 'end', 'finish']], onFinish) - - function onSocket(socket) { - // remove listener - msg.removeListener('socket', onSocket) - - if (finished) return - if (eeMsg !== eeSocket) return - - // finished on first socket event - eeSocket = first([[socket, 'error', 'close']], onFinish) - } - - if (msg.socket) { - // socket already assigned - onSocket(msg.socket) - return - } - - // wait for socket to be assigned - msg.on('socket', onSocket) - - if (msg.socket === undefined) { - // node.js 0.8 patch - patchAssignSocket(msg, onSocket) - } -} - -/** - * Attach the listener to the message. - * - * @param {object} msg - * @return {function} - * @api private - */ - -function attachListener(msg, listener) { - var attached = msg.__onFinished - - // create a private single listener with queue - if (!attached || !attached.queue) { - attached = msg.__onFinished = createListener(msg) - attachFinishedListener(msg, attached) - } - - attached.queue.push(listener) -} - -/** - * Create listener on message. - * - * @param {object} msg - * @return {function} - * @api private - */ - -function createListener(msg) { - function listener(err) { - if (msg.__onFinished === listener) msg.__onFinished = null - if (!listener.queue) return - - var queue = listener.queue - listener.queue = null - - for (var i = 0; i < queue.length; i++) { - queue[i](err, msg) - } - } - - listener.queue = [] - - return listener -} - -/** - * Patch ServerResponse.prototype.assignSocket for node.js 0.8. - * - * @param {ServerResponse} res - * @param {function} callback - * @private - */ - -function patchAssignSocket(res, callback) { - var assignSocket = res.assignSocket - - if (typeof assignSocket !== 'function') return - - // res.on('socket', callback) is broken in 0.8 - res.assignSocket = function _assignSocket(socket) { - assignSocket.call(this, socket) - callback(socket) - } -} diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/on-finished/node_modules/ee-first/LICENSE b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/on-finished/node_modules/ee-first/LICENSE deleted file mode 100644 index a7ae8ee9b..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/on-finished/node_modules/ee-first/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ - -The MIT License (MIT) - -Copyright (c) 2014 Jonathan Ong me@jongleberry.com - -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/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/on-finished/node_modules/ee-first/README.md b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/on-finished/node_modules/ee-first/README.md deleted file mode 100644 index cbd2478be..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/on-finished/node_modules/ee-first/README.md +++ /dev/null @@ -1,80 +0,0 @@ -# EE First - -[![NPM version][npm-image]][npm-url] -[![Build status][travis-image]][travis-url] -[![Test coverage][coveralls-image]][coveralls-url] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] -[![Gittip][gittip-image]][gittip-url] - -Get the first event in a set of event emitters and event pairs, -then clean up after itself. - -## Install - -```sh -$ npm install ee-first -``` - -## API - -```js -var first = require('ee-first') -``` - -### first(arr, listener) - -Invoke `listener` on the first event from the list specified in `arr`. `arr` is -an array of arrays, with each array in the format `[ee, ...event]`. `listener` -will be called only once, the first time any of the given events are emitted. If -`error` is one of the listened events, then if that fires first, the `listener` -will be given the `err` argument. - -The `listener` is invoked as `listener(err, ee, event, args)`, where `err` is the -first argument emitted from an `error` event, if applicable; `ee` is the event -emitter that fired; `event` is the string event name that fired; and `args` is an -array of the arguments that were emitted on the event. - -```js -var ee1 = new EventEmitter() -var ee2 = new EventEmitter() - -first([ - [ee1, 'close', 'end', 'error'], - [ee2, 'error'] -], function (err, ee, event, args) { - // listener invoked -}) -``` - -#### .cancel() - -The group of listeners can be cancelled before being invoked and have all the event -listeners removed from the underlying event emitters. - -```js -var thunk = first([ - [ee1, 'close', 'end', 'error'], - [ee2, 'error'] -], function (err, ee, event, args) { - // listener invoked -}) - -// cancel and clean up -thunk.cancel() -``` - -[npm-image]: https://img.shields.io/npm/v/ee-first.svg?style=flat-square -[npm-url]: https://npmjs.org/package/ee-first -[github-tag]: http://img.shields.io/github/tag/jonathanong/ee-first.svg?style=flat-square -[github-url]: https://github.com/jonathanong/ee-first/tags -[travis-image]: https://img.shields.io/travis/jonathanong/ee-first.svg?style=flat-square -[travis-url]: https://travis-ci.org/jonathanong/ee-first -[coveralls-image]: https://img.shields.io/coveralls/jonathanong/ee-first.svg?style=flat-square -[coveralls-url]: https://coveralls.io/r/jonathanong/ee-first?branch=master -[license-image]: http://img.shields.io/npm/l/ee-first.svg?style=flat-square -[license-url]: LICENSE.md -[downloads-image]: http://img.shields.io/npm/dm/ee-first.svg?style=flat-square -[downloads-url]: https://npmjs.org/package/ee-first -[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square -[gittip-url]: https://www.gittip.com/jonathanong/ diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/on-finished/node_modules/ee-first/index.js b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/on-finished/node_modules/ee-first/index.js deleted file mode 100644 index c8b820db6..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/on-finished/node_modules/ee-first/index.js +++ /dev/null @@ -1,68 +0,0 @@ - -module.exports = function first(stuff, done) { - if (!Array.isArray(stuff)) - throw new TypeError('arg must be an array of [ee, events...] arrays') - - var cleanups = [] - - for (var i = 0; i < stuff.length; i++) { - var arr = stuff[i] - - if (!Array.isArray(arr) || arr.length < 2) - throw new TypeError('each array member must be [ee, events...]') - - var ee = arr[0] - - for (var j = 1; j < arr.length; j++) { - var event = arr[j] - var fn = listener(event, callback) - - // listen to the event - ee.on(event, fn) - // push this listener to the list of cleanups - cleanups.push({ - ee: ee, - event: event, - fn: fn, - }) - } - } - - function callback() { - cleanup() - done.apply(null, arguments) - } - - function cleanup() { - var x - for (var i = 0; i < cleanups.length; i++) { - x = cleanups[i] - x.ee.removeListener(x.event, x.fn) - } - } - - function thunk(fn) { - done = fn - } - - thunk.cancel = cleanup - - return thunk -} - -function listener(event, done) { - return function onevent(arg1) { - var args = new Array(arguments.length) - var ee = this - var err = event === 'error' - ? arg1 - : null - - // copy args to prevent arguments escaping scope - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i] - } - - done(err, ee, event, args) - } -} diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/on-finished/node_modules/ee-first/package.json b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/on-finished/node_modules/ee-first/package.json deleted file mode 100644 index dc3f93ada..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/on-finished/node_modules/ee-first/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "ee-first", - "description": "return the first event in a set of ee/event pairs", - "version": "1.1.0", - "author": { - "name": "Jonathan Ong", - "email": "me@jongleberry.com", - "url": "http://jongleberry.com" - }, - "contributors": [ - { - "name": "Douglas Christopher Wilson", - "email": "doug@somethingdoug.com" - } - ], - "license": "MIT", - "repository": { - "type": "git", - "url": "git://github.com/jonathanong/ee-first" - }, - "devDependencies": { - "istanbul": "0.3.2", - "mocha": "1" - }, - "files": [ - "index.js", - "LICENSE" - ], - "scripts": { - "test": "mocha --reporter spec --bail --check-leaks test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" - }, - "readme": "# EE First\r\n\r\n[![NPM version][npm-image]][npm-url]\r\n[![Build status][travis-image]][travis-url]\r\n[![Test coverage][coveralls-image]][coveralls-url]\r\n[![License][license-image]][license-url]\r\n[![Downloads][downloads-image]][downloads-url]\r\n[![Gittip][gittip-image]][gittip-url]\r\n\r\nGet the first event in a set of event emitters and event pairs,\r\nthen clean up after itself.\r\n\r\n## Install\r\n\r\n```sh\r\n$ npm install ee-first\r\n```\r\n\r\n## API\r\n\r\n```js\r\nvar first = require('ee-first')\r\n```\r\n\r\n### first(arr, listener)\r\n\r\nInvoke `listener` on the first event from the list specified in `arr`. `arr` is\r\nan array of arrays, with each array in the format `[ee, ...event]`. `listener`\r\nwill be called only once, the first time any of the given events are emitted. If\r\n`error` is one of the listened events, then if that fires first, the `listener`\r\nwill be given the `err` argument.\r\n\r\nThe `listener` is invoked as `listener(err, ee, event, args)`, where `err` is the\r\nfirst argument emitted from an `error` event, if applicable; `ee` is the event\r\nemitter that fired; `event` is the string event name that fired; and `args` is an\r\narray of the arguments that were emitted on the event.\r\n\r\n```js\r\nvar ee1 = new EventEmitter()\r\nvar ee2 = new EventEmitter()\r\n\r\nfirst([\r\n [ee1, 'close', 'end', 'error'],\r\n [ee2, 'error']\r\n], function (err, ee, event, args) {\r\n // listener invoked\r\n})\r\n```\r\n\r\n#### .cancel()\r\n\r\nThe group of listeners can be cancelled before being invoked and have all the event\r\nlisteners removed from the underlying event emitters.\r\n\r\n```js\r\nvar thunk = first([\r\n [ee1, 'close', 'end', 'error'],\r\n [ee2, 'error']\r\n], function (err, ee, event, args) {\r\n // listener invoked\r\n})\r\n\r\n// cancel and clean up\r\nthunk.cancel()\r\n```\r\n\r\n[npm-image]: https://img.shields.io/npm/v/ee-first.svg?style=flat-square\r\n[npm-url]: https://npmjs.org/package/ee-first\r\n[github-tag]: http://img.shields.io/github/tag/jonathanong/ee-first.svg?style=flat-square\r\n[github-url]: https://github.com/jonathanong/ee-first/tags\r\n[travis-image]: https://img.shields.io/travis/jonathanong/ee-first.svg?style=flat-square\r\n[travis-url]: https://travis-ci.org/jonathanong/ee-first\r\n[coveralls-image]: https://img.shields.io/coveralls/jonathanong/ee-first.svg?style=flat-square\r\n[coveralls-url]: https://coveralls.io/r/jonathanong/ee-first?branch=master\r\n[license-image]: http://img.shields.io/npm/l/ee-first.svg?style=flat-square\r\n[license-url]: LICENSE.md\r\n[downloads-image]: http://img.shields.io/npm/dm/ee-first.svg?style=flat-square\r\n[downloads-url]: https://npmjs.org/package/ee-first\r\n[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square\r\n[gittip-url]: https://www.gittip.com/jonathanong/\r\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/jonathanong/ee-first/issues" - }, - "homepage": "https://github.com/jonathanong/ee-first", - "_id": "ee-first@1.1.0", - "_from": "ee-first@1.1.0" -} diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/on-finished/package.json b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/on-finished/package.json deleted file mode 100644 index 426e3ff2e..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/node_modules/on-finished/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "name": "on-finished", - "description": "Execute a callback when a request closes, finishes, or errors", - "version": "2.2.0", - "contributors": [ - { - "name": "Douglas Christopher Wilson", - "email": "doug@somethingdoug.com" - }, - { - "name": "Jonathan Ong", - "email": "me@jongleberry.com", - "url": "http://jongleberry.com" - } - ], - "license": "MIT", - "repository": { - "type": "git", - "url": "https://github.com/jshttp/on-finished" - }, - "dependencies": { - "ee-first": "1.1.0" - }, - "devDependencies": { - "istanbul": "0.3.5", - "mocha": "~2.0.1" - }, - "engines": { - "node": ">= 0.8" - }, - "files": [ - "HISTORY.md", - "LICENSE", - "index.js" - ], - "scripts": { - "test": "mocha --reporter spec --bail --check-leaks test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" - }, - "gitHead": "fcd56f5674721cac92a16eff93547929716f5192", - "bugs": { - "url": "https://github.com/jshttp/on-finished/issues" - }, - "homepage": "https://github.com/jshttp/on-finished", - "_id": "on-finished@2.2.0", - "_shasum": "e6ba6a09a3482d6b7969bc3da92c86f0a967605e", - "_from": "on-finished@~2.2.0", - "_npmVersion": "1.4.28", - "_npmUser": { - "name": "dougwilson", - "email": "doug@somethingdoug.com" - }, - "maintainers": [ - { - "name": "dougwilson", - "email": "doug@somethingdoug.com" - }, - { - "name": "jongleberry", - "email": "jonathanrichardong@gmail.com" - } - ], - "dist": { - "shasum": "e6ba6a09a3482d6b7969bc3da92c86f0a967605e", - "tarball": "http://registry.npmjs.org/on-finished/-/on-finished-2.2.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.2.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/package.json b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/package.json deleted file mode 100644 index 1915de6c4..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/finalhandler/package.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "finalhandler", - "description": "Node.js final http responder", - "version": "0.3.4", - "author": { - "name": "Douglas Christopher Wilson", - "email": "doug@somethingdoug.com" - }, - "license": "MIT", - "repository": { - "type": "git", - "url": "git://github.com/pillarjs/finalhandler" - }, - "dependencies": { - "debug": "~2.1.3", - "escape-html": "1.0.1", - "on-finished": "~2.2.0" - }, - "devDependencies": { - "istanbul": "0.3.8", - "mocha": "~2.2.1", - "readable-stream": "~1.0.33", - "supertest": "~0.15.0" - }, - "files": [ - "LICENSE", - "HISTORY.md", - "index.js" - ], - "engines": { - "node": ">= 0.8" - }, - "scripts": { - "test": "mocha --reporter spec --bail --check-leaks test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" - }, - "readme": "# finalhandler\n\n[![NPM Version][npm-image]][npm-url]\n[![NPM Downloads][downloads-image]][downloads-url]\n[![Node.js Version][node-image]][node-url]\n[![Build Status][travis-image]][travis-url]\n[![Test Coverage][coveralls-image]][coveralls-url]\n\nNode.js function to invoke as the final step to respond to HTTP request.\n\n## Installation\n\n```sh\n$ npm install finalhandler\n```\n\n## API\n\n```js\nvar finalhandler = require('finalhandler')\n```\n\n### finalhandler(req, res, [options])\n\nReturns function to be invoked as the final step for the given `req` and `res`.\nThis function is to be invoked as `fn(err)`. If `err` is falsy, the handler will\nwrite out a 404 response to the `res`. If it is truthy, an error response will\nbe written out to the `res`, and `res.statusCode` is set from `err.status`.\n\nThe final handler will also unpipe anything from `req` when it is invoked.\n\n#### options.env\n\nBy default, the environment is determined by `NODE_ENV` variable, but it can be\noverridden by this option.\n\n#### options.onerror\n\nProvide a function to be called with the `err` when it exists. Can be used for\nwriting errors to a central location without excessive function generation. Called\nas `onerror(err, req, res)`.\n\n## Examples\n\n### always 404\n\n```js\nvar finalhandler = require('finalhandler')\nvar http = require('http')\n\nvar server = http.createServer(function (req, res) {\n var done = finalhandler(req, res)\n done()\n})\n\nserver.listen(3000)\n```\n\n### perform simple action\n\n```js\nvar finalhandler = require('finalhandler')\nvar fs = require('fs')\nvar http = require('http')\n\nvar server = http.createServer(function (req, res) {\n var done = finalhandler(req, res)\n\n fs.readFile('index.html', function (err, buf) {\n if (err) return done(err)\n res.setHeader('Content-Type', 'text/html')\n res.end(buf)\n })\n})\n\nserver.listen(3000)\n```\n\n### use with middleware-style functions\n\n```js\nvar finalhandler = require('finalhandler')\nvar http = require('http')\nvar serveStatic = require('serve-static')\n\nvar serve = serveStatic('public')\n\nvar server = http.createServer(function (req, res) {\n var done = finalhandler(req, res)\n serve(req, res, done)\n})\n\nserver.listen(3000)\n```\n\n### keep log of all errors\n\n```js\nvar finalhandler = require('finalhandler')\nvar fs = require('fs')\nvar http = require('http')\n\nvar server = http.createServer(function (req, res) {\n var done = finalhandler(req, res, {onerror: logerror})\n\n fs.readFile('index.html', function (err, buf) {\n if (err) return done(err)\n res.setHeader('Content-Type', 'text/html')\n res.end(buf)\n })\n})\n\nserver.listen(3000)\n\nfunction logerror(err) {\n console.error(err.stack || err.toString())\n}\n```\n\n## License\n\n[MIT](LICENSE)\n\n[npm-image]: https://img.shields.io/npm/v/finalhandler.svg\n[npm-url]: https://npmjs.org/package/finalhandler\n[node-image]: https://img.shields.io/node/v/finalhandler.svg\n[node-url]: http://nodejs.org/download/\n[travis-image]: https://img.shields.io/travis/pillarjs/finalhandler.svg\n[travis-url]: https://travis-ci.org/pillarjs/finalhandler\n[coveralls-image]: https://img.shields.io/coveralls/pillarjs/finalhandler.svg\n[coveralls-url]: https://coveralls.io/r/pillarjs/finalhandler?branch=master\n[downloads-image]: https://img.shields.io/npm/dm/finalhandler.svg\n[downloads-url]: https://npmjs.org/package/finalhandler\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/pillarjs/finalhandler/issues" - }, - "homepage": "https://github.com/pillarjs/finalhandler", - "_id": "finalhandler@0.3.4", - "_from": "finalhandler@0.3.4" -} diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/parseurl/.npmignore b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/parseurl/.npmignore deleted file mode 100644 index 85c82a560..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/parseurl/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -benchmark/ -coverage/ -test/ -.travis.yml diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/parseurl/HISTORY.md b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/parseurl/HISTORY.md deleted file mode 100644 index 65a086068..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/parseurl/HISTORY.md +++ /dev/null @@ -1,42 +0,0 @@ -1.3.0 / 2014-08-09 -================== - - * Add `parseurl.original` for parsing `req.originalUrl` with fallback - * Return `undefined` if `req.url` is `undefined` - -1.2.0 / 2014-07-21 -================== - - * Cache URLs based on original value - * Remove no-longer-needed URL mis-parse work-around - * Simplify the "fast-path" `RegExp` - -1.1.3 / 2014-07-08 -================== - - * Fix typo - -1.1.2 / 2014-07-08 -================== - - * Seriously fix Node.js 0.8 compatibility - -1.1.1 / 2014-07-08 -================== - - * Fix Node.js 0.8 compatibility - -1.1.0 / 2014-07-08 -================== - - * Incorporate URL href-only parse fast-path - -1.0.1 / 2014-03-08 -================== - - * Add missing `require` - -1.0.0 / 2014-03-08 -================== - - * Genesis from `connect` diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/parseurl/LICENSE b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/parseurl/LICENSE deleted file mode 100644 index ec7dfe7be..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/parseurl/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ - -(The MIT License) - -Copyright (c) 2014 Jonathan Ong -Copyright (c) 2014 Douglas Christopher Wilson - -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/update_nation/node_modules/couchapp/node_modules/connect/node_modules/parseurl/README.md b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/parseurl/README.md deleted file mode 100644 index 0db1d029f..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/parseurl/README.md +++ /dev/null @@ -1,107 +0,0 @@ -# parseurl - -[![NPM version](https://badge.fury.io/js/parseurl.svg)](http://badge.fury.io/js/parseurl) -[![Build Status](https://travis-ci.org/expressjs/parseurl.svg?branch=master)](https://travis-ci.org/expressjs/parseurl) -[![Coverage Status](https://img.shields.io/coveralls/expressjs/parseurl.svg?branch=master)](https://coveralls.io/r/expressjs/parseurl) - -Parse a URL with memoization. - -## Install - -```bash -$ npm install parseurl -``` - -## API - -```js -var parseurl = require('parseurl') -``` - -### parseurl(req) - -Parse the URL of the given request object (looks at the `req.url` property) -and return the result. The result is the same as `url.parse` in Node.js core. -Calling this function multiple times on the same `req` where `req.url` does -not change will return a cached parsed object, rather than parsing again. - -### parseurl.original(req) - -Parse the original URL of the given request object and return the result. -This works by trying to parse `req.originalUrl` if it is a string, otherwise -parses `req.url`. The result is the same as `url.parse` in Node.js core. -Calling this function multiple times on the same `req` where `req.originalUrl` -does not change will return a cached parsed object, rather than parsing again. - -## Benchmark - -```bash -$ npm run-script bench - -> parseurl@1.3.0 bench nodejs-parseurl -> node benchmark/index.js - -> node benchmark/fullurl.js - - Parsing URL "http://localhost:8888/foo/bar?user=tj&pet=fluffy" - - 1 test completed. - 2 tests completed. - 3 tests completed. - - fasturl x 1,290,780 ops/sec ±0.46% (195 runs sampled) - nativeurl x 56,401 ops/sec ±0.22% (196 runs sampled) - parseurl x 55,231 ops/sec ±0.22% (194 runs sampled) - -> node benchmark/pathquery.js - - Parsing URL "/foo/bar?user=tj&pet=fluffy" - - 1 test completed. - 2 tests completed. - 3 tests completed. - - fasturl x 1,986,668 ops/sec ±0.27% (190 runs sampled) - nativeurl x 98,740 ops/sec ±0.21% (195 runs sampled) - parseurl x 2,628,171 ops/sec ±0.36% (195 runs sampled) - -> node benchmark/samerequest.js - - Parsing URL "/foo/bar?user=tj&pet=fluffy" on same request object - - 1 test completed. - 2 tests completed. - 3 tests completed. - - fasturl x 2,184,468 ops/sec ±0.40% (194 runs sampled) - nativeurl x 99,437 ops/sec ±0.71% (194 runs sampled) - parseurl x 10,498,005 ops/sec ±0.61% (186 runs sampled) - -> node benchmark/simplepath.js - - Parsing URL "/foo/bar" - - 1 test completed. - 2 tests completed. - 3 tests completed. - - fasturl x 4,535,825 ops/sec ±0.27% (191 runs sampled) - nativeurl x 98,769 ops/sec ±0.54% (191 runs sampled) - parseurl x 4,164,865 ops/sec ±0.34% (192 runs sampled) - -> node benchmark/slash.js - - Parsing URL "/" - - 1 test completed. - 2 tests completed. - 3 tests completed. - - fasturl x 4,908,405 ops/sec ±0.42% (191 runs sampled) - nativeurl x 100,945 ops/sec ±0.59% (188 runs sampled) - parseurl x 4,333,208 ops/sec ±0.27% (194 runs sampled) -``` - -## License - - [MIT](LICENSE) diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/parseurl/index.js b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/parseurl/index.js deleted file mode 100644 index 863234727..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/parseurl/index.js +++ /dev/null @@ -1,136 +0,0 @@ -/*! - * parseurl - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2014 Douglas Christopher Wilson - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var url = require('url') -var parse = url.parse -var Url = url.Url - -/** - * Pattern for a simple path case. - * See: https://github.com/joyent/node/pull/7878 - */ - -var simplePathRegExp = /^(\/\/?(?!\/)[^\?#\s]*)(\?[^#\s]*)?$/ - -/** - * Exports. - */ - -module.exports = parseurl -module.exports.original = originalurl - -/** - * Parse the `req` url with memoization. - * - * @param {ServerRequest} req - * @return {Object} - * @api public - */ - -function parseurl(req) { - var url = req.url - - if (url === undefined) { - // URL is undefined - return undefined - } - - var parsed = req._parsedUrl - - if (fresh(url, parsed)) { - // Return cached URL parse - return parsed - } - - // Parse the URL - parsed = fastparse(url) - parsed._raw = url - - return req._parsedUrl = parsed -}; - -/** - * Parse the `req` original url with fallback and memoization. - * - * @param {ServerRequest} req - * @return {Object} - * @api public - */ - -function originalurl(req) { - var url = req.originalUrl - - if (typeof url !== 'string') { - // Fallback - return parseurl(req) - } - - var parsed = req._parsedOriginalUrl - - if (fresh(url, parsed)) { - // Return cached URL parse - return parsed - } - - // Parse the URL - parsed = fastparse(url) - parsed._raw = url - - return req._parsedOriginalUrl = parsed -}; - -/** - * Parse the `str` url with fast-path short-cut. - * - * @param {string} str - * @return {Object} - * @api private - */ - -function fastparse(str) { - // Try fast path regexp - // See: https://github.com/joyent/node/pull/7878 - var simplePath = typeof str === 'string' && simplePathRegExp.exec(str) - - // Construct simple URL - if (simplePath) { - var pathname = simplePath[1] - var search = simplePath[2] || null - var url = Url !== undefined - ? new Url() - : {} - url.path = str - url.href = str - url.pathname = pathname - url.search = search - url.query = search && search.substr(1) - - return url - } - - return parse(str) -} - -/** - * Determine if parsed is still fresh for url. - * - * @param {string} url - * @param {object} parsedUrl - * @return {boolean} - * @api private - */ - -function fresh(url, parsedUrl) { - return typeof parsedUrl === 'object' - && parsedUrl !== null - && (Url === undefined || parsedUrl instanceof Url) - && parsedUrl._raw === url -} diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/parseurl/package.json b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/parseurl/package.json deleted file mode 100644 index 6fbd23e9f..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/parseurl/package.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "name": "parseurl", - "description": "parse a url with memoization", - "version": "1.3.0", - "author": { - "name": "Jonathan Ong", - "email": "me@jongleberry.com", - "url": "http://jongleberry.com" - }, - "contributors": [ - { - "name": "Douglas Christopher Wilson", - "email": "doug@somethingdoug.com" - } - ], - "repository": { - "type": "git", - "url": "https://github.com/expressjs/parseurl" - }, - "license": "MIT", - "devDependencies": { - "benchmark": "1.0.0", - "beautify-benchmark": "0.2.4", - "fast-url-parser": "~1.0.0", - "istanbul": "0.3.0", - "mocha": "~1.21.4" - }, - "scripts": { - "bench": "node benchmark/index.js", - "test": "mocha --check-leaks --bail --reporter spec test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --check-leaks --reporter dot test/", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --check-leaks --reporter spec test/" - }, - "gitHead": "03b7ccca240e2bef5df6c25797e99175d28fb2cb", - "bugs": { - "url": "https://github.com/expressjs/parseurl/issues" - }, - "homepage": "https://github.com/expressjs/parseurl", - "_id": "parseurl@1.3.0", - "_shasum": "b58046db4223e145afa76009e61bac87cc2281b3", - "_from": "parseurl@~1.3.0", - "_npmVersion": "1.4.21", - "_npmUser": { - "name": "dougwilson", - "email": "doug@somethingdoug.com" - }, - "maintainers": [ - { - "name": "jongleberry", - "email": "jonathanrichardong@gmail.com" - }, - { - "name": "shtylman", - "email": "shtylman@gmail.com" - }, - { - "name": "dougwilson", - "email": "doug@somethingdoug.com" - }, - { - "name": "tjholowaychuk", - "email": "tj@vision-media.ca" - }, - { - "name": "mscdex", - "email": "mscdex@mscdex.net" - }, - { - "name": "fishrock123", - "email": "fishrock123@rocketmail.com" - } - ], - "dist": { - "shasum": "b58046db4223e145afa76009e61bac87cc2281b3", - "tarball": "http://registry.npmjs.org/parseurl/-/parseurl-1.3.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/utils-merge/.travis.yml b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/utils-merge/.travis.yml deleted file mode 100644 index af92b021b..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/utils-merge/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: "node_js" -node_js: - - "0.4" - - "0.6" - - "0.8" - - "0.10" diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/utils-merge/LICENSE b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/utils-merge/LICENSE deleted file mode 100644 index e33bd10bb..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/utils-merge/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -(The MIT License) - -Copyright (c) 2013 Jared Hanson - -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/update_nation/node_modules/couchapp/node_modules/connect/node_modules/utils-merge/README.md b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/utils-merge/README.md deleted file mode 100644 index 2f94e9bd2..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/utils-merge/README.md +++ /dev/null @@ -1,34 +0,0 @@ -# utils-merge - -Merges the properties from a source object into a destination object. - -## Install - - $ npm install utils-merge - -## Usage - -```javascript -var a = { foo: 'bar' } - , b = { bar: 'baz' }; - -merge(a, b); -// => { foo: 'bar', bar: 'baz' } -``` - -## Tests - - $ npm install - $ npm test - -[![Build Status](https://secure.travis-ci.org/jaredhanson/utils-merge.png)](http://travis-ci.org/jaredhanson/utils-merge) - -## Credits - - - [Jared Hanson](http://github.com/jaredhanson) - -## License - -[The MIT License](http://opensource.org/licenses/MIT) - -Copyright (c) 2013 Jared Hanson <[http://jaredhanson.net/](http://jaredhanson.net/)> diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/utils-merge/index.js b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/utils-merge/index.js deleted file mode 100644 index 4265c694f..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/utils-merge/index.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Merge object b with object a. - * - * var a = { foo: 'bar' } - * , b = { bar: 'baz' }; - * - * merge(a, b); - * // => { foo: 'bar', bar: 'baz' } - * - * @param {Object} a - * @param {Object} b - * @return {Object} - * @api public - */ - -exports = module.exports = function(a, b){ - if (a && b) { - for (var key in b) { - a[key] = b[key]; - } - } - return a; -}; diff --git a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/utils-merge/package.json b/update_nation/node_modules/couchapp/node_modules/connect/node_modules/utils-merge/package.json deleted file mode 100644 index 967cc3119..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/node_modules/utils-merge/package.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "utils-merge", - "version": "1.0.0", - "description": "merge() utility function", - "keywords": [ - "util" - ], - "repository": { - "type": "git", - "url": "git://github.com/jaredhanson/utils-merge.git" - }, - "bugs": { - "url": "http://github.com/jaredhanson/utils-merge/issues" - }, - "author": { - "name": "Jared Hanson", - "email": "jaredhanson@gmail.com", - "url": "http://www.jaredhanson.net/" - }, - "licenses": [ - { - "type": "MIT", - "url": "http://www.opensource.org/licenses/MIT" - } - ], - "main": "./index", - "dependencies": {}, - "devDependencies": { - "mocha": "1.x.x", - "chai": "1.x.x" - }, - "scripts": { - "test": "mocha --reporter spec --require test/bootstrap/node test/*.test.js" - }, - "engines": { - "node": ">= 0.4.0" - }, - "readme": "# utils-merge\n\nMerges the properties from a source object into a destination object.\n\n## Install\n\n $ npm install utils-merge\n\n## Usage\n\n```javascript\nvar a = { foo: 'bar' }\n , b = { bar: 'baz' };\n\nmerge(a, b);\n// => { foo: 'bar', bar: 'baz' }\n```\n\n## Tests\n\n $ npm install\n $ npm test\n\n[![Build Status](https://secure.travis-ci.org/jaredhanson/utils-merge.png)](http://travis-ci.org/jaredhanson/utils-merge)\n\n## Credits\n\n - [Jared Hanson](http://github.com/jaredhanson)\n\n## License\n\n[The MIT License](http://opensource.org/licenses/MIT)\n\nCopyright (c) 2013 Jared Hanson <[http://jaredhanson.net/](http://jaredhanson.net/)>\n", - "readmeFilename": "README.md", - "homepage": "https://github.com/jaredhanson/utils-merge", - "_id": "utils-merge@1.0.0", - "_from": "utils-merge@1.0.0" -} diff --git a/update_nation/node_modules/couchapp/node_modules/connect/package.json b/update_nation/node_modules/couchapp/node_modules/connect/package.json deleted file mode 100644 index 7fb46a1cd..000000000 --- a/update_nation/node_modules/couchapp/node_modules/connect/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "name": "connect", - "description": "High performance middleware framework", - "version": "3.3.5", - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca", - "url": "http://tjholowaychuk.com" - }, - "contributors": [ - { - "name": "Douglas Christopher Wilson", - "email": "doug@somethingdoug.com" - }, - { - "name": "Jonathan Ong", - "email": "me@jongleberry.com" - }, - { - "name": "Tim Caswell", - "email": "tim@creationix.com" - } - ], - "keywords": [ - "framework", - "web", - "middleware", - "connect", - "rack" - ], - "repository": { - "type": "git", - "url": "git://github.com/senchalabs/connect" - }, - "dependencies": { - "debug": "~2.1.3", - "finalhandler": "0.3.4", - "parseurl": "~1.3.0", - "utils-merge": "1.0.0" - }, - "devDependencies": { - "istanbul": "0.3.8", - "mocha": "~2.2.1", - "should": "~5.2.0", - "supertest": "~0.15.0" - }, - "license": "MIT", - "files": [ - "lib/", - "LICENSE", - "History.md", - "Readme.md", - "index.js" - ], - "engines": { - "node": ">= 0.10.0" - }, - "scripts": { - "test": "mocha --require test/support/env --reporter spec --bail --check-leaks test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --require test/support/env --reporter dot --check-leaks test/", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --require test/support/env --reporter spec --check-leaks test/" - }, - "readme": "# Connect\n\n[![NPM Version][npm-image]][npm-url]\n[![NPM Downloads][downloads-image]][downloads-url]\n[![Build Status][travis-image]][travis-url]\n[![Test Coverage][coveralls-image]][coveralls-url]\n[![Gratipay][gratipay-image]][gratipay-url]\n\n Connect is an extensible HTTP server framework for [node](http://nodejs.org) using \"plugins\" known as _middleware_.\n\n```js\nvar connect = require('connect')\nvar http = require('http')\n\nvar app = connect()\n\n// gzip/deflate outgoing responses\nvar compression = require('compression')\napp.use(compression())\n\n// store session state in browser cookie\nvar cookieSession = require('cookie-session')\napp.use(cookieSession({\n keys: ['secret1', 'secret2']\n}))\n\n// parse urlencoded request bodies into req.body\nvar bodyParser = require('body-parser')\napp.use(bodyParser.urlencoded())\n\n// respond to all requests\napp.use(function(req, res){\n res.end('Hello from Connect!\\n');\n})\n\n//create node.js http server and listen on port\nhttp.createServer(app).listen(3000)\n```\n\n## Getting Started\n\nConnect is a simple framework to glue together various \"middleware\" to handle requests.\n\n### Install Connect\n\n```sh\n$ npm install connect\n```\n\n### Create an app\n\nThe main component is a Connect \"app\". This will store all the middleware\nadded and is, itself, a function.\n\n```js\nvar app = connect();\n```\n\n### Use middleware\n\nThe core of Connect is \"using\" middleware. Middleware are added as a \"stack\"\nwhere incoming requests will execute each middleware one-by-one until a middleware\ndoes not call `next()` within it.\n\n```js\napp.use(function middleware1(req, res, next) {\n // middleware 1\n next();\n});\napp.use(function middleware2(req, res, next) {\n // middleware 2\n next();\n});\n```\n\n### Mount middleware\n\nThe `.use()` method also takes an optional path string that is matched against\nthe beginning of the incoming request URL. This allows for basic routing.\n\n```js\napp.use('/foo', function fooMiddleware(req, res, next) {\n // req.url starts with \"/foo\"\n next();\n});\napp.use('/bar', function barMiddleware(req, res, next) {\n // req.url starts with \"/bar\"\n next();\n});\n```\n\n### Error middleware\n\nThere are special cases of \"error-handling\" middleware. There are middleware\nwhere the function takes exactly 4 arguments. Errors that occur in the middleware\nadded before the error middleware will invoke this middleware when errors occur.\n\n```js\napp.use(function onerror(err, req, res, next) {\n // an error occurred!\n});\n```\n\n### Create a server from the app\n\nThe last step is to actually use the Connect app in a server. The `.listen()` method\nis a convenience to start a HTTP server.\n\n```js\nvar server = app.listen(port);\n```\n\nThe app itself is really just a function with three arguments, so it can also be handed\nto `.createServer()` in Node.js.\n\n```js\nvar server = http.createServer(app);\n```\n\n## Middleware\n\nThese middleware and libraries are officially supported by the Connect/Express team:\n\n - [body-parser](https://www.npmjs.com/package/body-parser) - previous `bodyParser`, `json`, and `urlencoded`. You may also be interested in:\n - [body](https://www.npmjs.com/package/body)\n - [co-body](https://www.npmjs.com/package/co-body)\n - [raw-body](https://www.npmjs.com/package/raw-body)\n - [compression](https://www.npmjs.com/package/compression) - previously `compress`\n - [connect-timeout](https://www.npmjs.com/package/connect-timeout) - previously `timeout`\n - [cookie-parser](https://www.npmjs.com/package/cookie-parser) - previously `cookieParser`\n - [cookie-session](https://www.npmjs.com/package/cookie-session) - previously `cookieSession`\n - [csurf](https://www.npmjs.com/package/csurf) - previously `csrf`\n - [errorhandler](https://www.npmjs.com/package/errorhandler) - previously `error-handler`\n - [express-session](https://www.npmjs.com/package/express-session) - previously `session`\n - [method-override](https://www.npmjs.com/package/method-override) - previously `method-override`\n - [morgan](https://www.npmjs.com/package/morgan) - previously `logger`\n - [response-time](https://www.npmjs.com/package/response-time) - previously `response-time`\n - [serve-favicon](https://www.npmjs.com/package/serve-favicon) - previously `favicon`\n - [serve-index](https://www.npmjs.com/package/serve-index) - previously `directory`\n - [serve-static](https://www.npmjs.com/package/serve-static) - previously `static`\n - [vhost](https://www.npmjs.com/package/vhost) - previously `vhost`\n\nMost of these are exact ports of their Connect 2.x equivalents. The primary exception is `cookie-session`.\n\nSome middleware previously included with Connect are no longer supported by the Connect/Express team, are replaced by an alternative module, or should be superseded by a better module. Use one of these alternatives instead:\n\n - `cookieParser`\n - [cookies](https://www.npmjs.com/package/cookies) and [keygrip](https://www.npmjs.com/package/keygrip)\n - `limit`\n - [raw-body](https://www.npmjs.com/package/raw-body)\n - `multipart`\n - [connect-multiparty](https://www.npmjs.com/package/connect-multiparty)\n - [connect-busboy](https://www.npmjs.com/package/connect-busboy)\n - `query`\n - [qs](https://www.npmjs.com/package/qs)\n - `staticCache`\n - [st](https://www.npmjs.com/package/st)\n - [connect-static](https://www.npmjs.com/package/connect-static)\n\nCheckout [http-framework](https://github.com/Raynos/http-framework/wiki/Modules) for many other compatible middleware! \n\n## Running Tests\n\n```bash\nnpm install\nnpm test\n```\n\n## Contributors\n\n https://github.com/senchalabs/connect/graphs/contributors\n\n## Node Compatibility\n\n - Connect `< 1.x` - node `0.2`\n - Connect `1.x` - node `0.4`\n - Connect `< 2.8` - node `0.6`\n - Connect `>= 2.8 < 3` - node `0.8`\n - Connect `>= 3` - node `0.10`, `0.12`\n\n## License\n\n[MIT](LICENSE)\n\n[npm-image]: https://img.shields.io/npm/v/connect.svg\n[npm-url]: https://npmjs.org/package/connect\n[travis-image]: https://img.shields.io/travis/senchalabs/connect/master.svg\n[travis-url]: https://travis-ci.org/senchalabs/connect\n[coveralls-image]: https://img.shields.io/coveralls/senchalabs/connect/master.svg\n[coveralls-url]: https://coveralls.io/r/senchalabs/connect\n[downloads-image]: https://img.shields.io/npm/dm/connect.svg\n[downloads-url]: https://npmjs.org/package/connect\n[gratipay-image]: https://img.shields.io/gratipay/dougwilson.svg\n[gratipay-url]: https://www.gratipay.com/dougwilson/\n", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/senchalabs/connect/issues" - }, - "homepage": "https://github.com/senchalabs/connect", - "_id": "connect@3.3.5", - "_from": "connect@*" -} diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/.npmignore b/update_nation/node_modules/couchapp/node_modules/http-proxy/.npmignore deleted file mode 100644 index 468b525c9..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -config.json -node_modules/ -npm-debug.log diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/.travis.yml b/update_nation/node_modules/couchapp/node_modules/http-proxy/.travis.yml deleted file mode 100644 index fb8c9bb9c..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: node_js -node_js: - - 0.6 - - 0.8 - -notifications: - email: - - travis@nodejitsu.com - irc: "irc.freenode.org#nodejitsu" diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/CHANGELOG.md b/update_nation/node_modules/couchapp/node_modules/http-proxy/CHANGELOG.md deleted file mode 100644 index b76b0abba..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/CHANGELOG.md +++ /dev/null @@ -1,72 +0,0 @@ -## ChangeLog for: node-http-proxy - -## Version 0.8.1 - 6/5/2012 -- Fix re-emitting of events in RoutingProxy (coderarity) -- New load balancer and middleware examples (marak) -- Docs updated including changelog (lot of gently people) - -## Version 0.8.0 - 12/23/2011 -- Improve support and tests for url segment routing (maxogden) -- Fix aborting connections when request close (c4milo) -- Avoid 'Transfer-Encoding' on HTTP/1.0 clients (koichik). -- Support for Node.js 0.6.x (mmalecki) - -## Version 0.7.3 - 10/4/2011 -- Fix setting x-forwarded headers (jesusabdullah) -- Updated examples (AvianFlu) - -## Version 0.7.0 - 9/10/2011 -- Handles to every throw-able resume() call (isaacs) -- Updated tests, README and package.json (indexzero) -- Added HttpProxy.close() method (indexzero) - -## Version 0.6.6 - 8/31/2011 -- Add more examples (dominictarr) -- Use of 'pkginfo' (indexzero) -- Handle cases where res.write throws (isaacs) -- Handles to every throw-able res.end call (isaacs) - -## Version 0.5.11 - 6/21/2011 -- Add more examples with WebSockets (indexzero) -- Update the documentation (indexzero) - -## Version 0.5.7 - 5/19/2011 -- Fix to README related to markup and fix some examples (benatkin) -- Improve WebSockets handling (indexzero) -- Improve WebSockets tests (indexzero) -- Improve https tests (olauzon) -- Add devDependencies to package.json (olauzon) -- Add 'proxyError' event (indexzero) -- Add 'x-forwarded-{port|proto}' headers support (indexzero) -- Keep-Alive connection supported (indexzero) - -## Version 0.5.0 - 4/15/2011 -- Remove winston in favor of custom events (indexzero) -- Add x-forwarded-for Header (indexzero) -- Fix WebSocket support (indexzero) -- Add tests / examples for WebSocket support (indexzero) -- Update .proxyRequest() and .proxyWebSocketRequest() APIs (indexzero) -- Add HTTPS support (indexzero) -- Add tests / examples for HTTPS support (indexzero) - -## Version 0.4.1 - 3/20/2011 -- Include missing dependency in package.json (indexzero) - -## Version 0.4.0 - 3/20/2011 -- Update for node.js 0.4.0 (indexzero) -- Remove pool dependency in favor of http.Agent (indexzero) -- Store buffered data using `.buffer()` instead of on the HttpProxy instance (indexzero) -- Change the ProxyTable to be a lookup table instead of actively proxying (indexzero) -- Allow for pure host-only matching in ProxyTable (indexzero) -- Use winston for logging (indexzero) -- Improve tests with async setup and more coverage (indexzero) -- Improve code documentation (indexzero) - -### Version 0.3.1 - 11/22/2010 -- Added node-http-proxy binary script (indexzero) -- Added experimental WebSocket support (indutny) -- Added forward proxy functionality (indexzero) -- Added proxy table for multiple target lookup (indexzero) -- Simplified tests using helpers.js (indexzero) -- Fixed uncaughtException bug with invalid proxy target (indutny) -- Added configurable logging for HttpProxy and ProxyTable (indexzero) \ No newline at end of file diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/LICENSE b/update_nation/node_modules/couchapp/node_modules/http-proxy/LICENSE deleted file mode 100644 index db9b0b1ed..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ - - node-http-proxy - - Copyright (c) 2010 Charlie Robbins, Mikeal Rogers, Fedor Indutny, & Marak Squires - - 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. \ No newline at end of file diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/README.md b/update_nation/node_modules/couchapp/node_modules/http-proxy/README.md deleted file mode 100644 index fdedc3aba..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/README.md +++ /dev/null @@ -1,556 +0,0 @@ -# node-http-proxy [![Build Status](https://secure.travis-ci.org/nodejitsu/node-http-proxy.png)](http://travis-ci.org/nodejitsu/node-http-proxy) - - - -## Battle-hardened node.js http proxy - -### Features - -* Reverse proxies incoming http.ServerRequest streams -* Can be used as a CommonJS module in node.js -* Uses event buffering to support application latency in proxied requests -* Reverse or Forward Proxy based on simple JSON-based configuration -* Supports [WebSockets][1] -* Supports [HTTPS][2] -* Minimal request overhead and latency -* Full suite of functional tests -* Battled-hardened through __production usage__ @ [nodejitsu.com][0] -* Written entirely in Javascript -* Easy to use API - -### When to use node-http-proxy - -Let's suppose you were running multiple http application servers, but you only wanted to expose one machine to the internet. You could setup node-http-proxy on that one machine and then reverse-proxy the incoming http requests to locally running services which were not exposed to the outside network. - -### Installing npm (node package manager) - -``` -curl https://npmjs.org/install.sh | sh -``` - -### Installing node-http-proxy - -``` -npm install http-proxy -``` - -## Using node-http-proxy - -There are several ways to use node-http-proxy; the library is designed to be flexible so that it can be used by itself, or in conjunction with other node.js libraries / tools: - -1. Standalone HTTP Proxy server -2. Inside of another HTTP server (like Connect) -3. In conjunction with a Proxy Routing Table -4. As a forward-proxy with a reverse proxy -5. From the command-line as a long running process -6. customized with 3rd party middleware. - -In each of these scenarios node-http-proxy can handle any of these types of requests: - -1. HTTP Requests (http://) -2. HTTPS Requests (https://) -3. WebSocket Requests (ws://) -4. Secure WebSocket Requests (wss://) - -See the [examples][3] for more working sample code. - -### Setup a basic stand-alone proxy server - -``` js -var http = require('http'), - httpProxy = require('http-proxy'); -// -// Create your proxy server -// -httpProxy.createServer(9000, 'localhost').listen(8000); - -// -// Create your target server -// -http.createServer(function (req, res) { - res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.write('request successfully proxied!' + '\n' + JSON.stringify(req.headers, true, 2)); - res.end(); -}).listen(9000); -``` - -### Setup a stand-alone proxy server with custom server logic - -``` js -var http = require('http'), - httpProxy = require('http-proxy'); - -// -// Create a proxy server with custom application logic -// -httpProxy.createServer(function (req, res, proxy) { - // - // Put your custom server logic here - // - proxy.proxyRequest(req, res, { - host: 'localhost', - port: 9000 - }); -}).listen(8000); - -http.createServer(function (req, res) { - res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.write('request successfully proxied: ' + req.url +'\n' + JSON.stringify(req.headers, true, 2)); - res.end(); -}).listen(9000); -``` - -### Setup a stand-alone proxy server with latency (e.g. IO, etc) - -``` js -var http = require('http'), - httpProxy = require('http-proxy'); - -// -// Create a proxy server with custom application logic -// -httpProxy.createServer(function (req, res, proxy) { - // - // Buffer the request so that `data` and `end` events - // are not lost during async operation(s). - // - var buffer = httpProxy.buffer(req); - - // - // Wait for two seconds then respond: this simulates - // performing async actions before proxying a request - // - setTimeout(function () { - proxy.proxyRequest(req, res, { - host: 'localhost', - port: 9000, - buffer: buffer - }); - }, 2000); -}).listen(8000); - -http.createServer(function (req, res) { - res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.write('request successfully proxied: ' + req.url +'\n' + JSON.stringify(req.headers, true, 2)); - res.end(); -}).listen(9000); -``` - -### Proxy requests within another http server - -``` js -var http = require('http'), - httpProxy = require('http-proxy'); - -// -// Create a new instance of HttProxy to use in your server -// -var proxy = new httpProxy.RoutingProxy(); - -// -// Create a regular http server and proxy its handler -// -http.createServer(function (req, res) { - // - // Put your custom server logic here, then proxy - // - proxy.proxyRequest(req, res, { - host: 'localhost', - port: 9000 - }); -}).listen(8001); - -http.createServer(function (req, res) { - res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.write('request successfully proxied: ' + req.url +'\n' + JSON.stringify(req.headers, true, 2)); - res.end(); -}).listen(9000); -``` - -### Proxy requests using a ProxyTable -A Proxy Table is a simple lookup table that maps incoming requests to proxy target locations. Take a look at an example of the options you need to pass to httpProxy.createServer: - -``` js -var options = { - router: { - 'foo.com/baz': '127.0.0.1:8001', - 'foo.com/buz': '127.0.0.1:8002', - 'bar.com/buz': '127.0.0.1:8003' - } -}; -``` - -The above route table will take incoming requests to 'foo.com/baz' and forward them to '127.0.0.1:8001'. Likewise it will take incoming requests to 'foo.com/buz' and forward them to '127.0.0.1:8002'. The routes themselves are later converted to regular expressions to enable more complex matching functionality. We can create a proxy server with these options by using the following code: - -``` js -var proxyServer = httpProxy.createServer(options); -proxyServer.listen(80); -``` - -### Proxy requests using a 'Hostname Only' ProxyTable -As mentioned in the previous section, all routes passes to the ProxyTable are by default converted to regular expressions that are evaluated at proxy-time. This is good for complex URL rewriting of proxy requests, but less efficient when one simply wants to do pure hostname routing based on the HTTP 'Host' header. If you are only concerned with hostname routing, you change the lookup used by the internal ProxyTable: - -``` js -var options = { - hostnameOnly: true, - router: { - 'foo.com': '127.0.0.1:8001', - 'bar.com': '127.0.0.1:8002' - } -} -``` - -Notice here that I have not included paths on the individual domains because this is not possible when using only the HTTP 'Host' header. Care to learn more? See [RFC2616: HTTP/1.1, Section 14.23, "Host"][4]. - -### Proxy requests with an additional forward proxy -Sometimes in addition to a reverse proxy, you may want your front-facing server to forward traffic to another location. For example, if you wanted to load test your staging environment. This is possible when using node-http-proxy using similar JSON-based configuration to a proxy table: - -``` js -var proxyServerWithForwarding = httpProxy.createServer(9000, 'localhost', { - forward: { - port: 9000, - host: 'staging.com' - } -}); -proxyServerWithForwarding.listen(80); -``` - -The forwarding option can be used in conjunction with the proxy table options by simply including both the 'forward' and 'router' properties in the options passed to 'createServer'. - -### Listening for proxy events -Sometimes you want to listen to an event on a proxy. For example, you may want to listen to the 'end' event, which represents when the proxy has finished proxying a request. - -``` js -var httpProxy = require('http-proxy'); - -var server = httpProxy.createServer(function (req, res, proxy) { - var buffer = httpProxy.buffer(req); - - proxy.proxyRequest(req, res, { - host: '127.0.0.1', - port: 9000, - buffer: buffer - }); -}); - -server.proxy.on('end', function() { - console.log("The request was proxied."); -}); - -server.listen(8000); -``` - -It's important to remember not to listen for events on the proxy object in the function passed to `httpProxy.createServer`. Doing so would add a new listener on every request, which would end up being a disaster. - -## Using HTTPS -You have all the full flexibility of node-http-proxy offers in HTTPS as well as HTTP. The two basic scenarios are: with a stand-alone proxy server or in conjunction with another HTTPS server. - -### Proxying to HTTP from HTTPS -This is probably the most common use-case for proxying in conjunction with HTTPS. You have some front-facing HTTPS server, but all of your internal traffic is HTTP. In this way, you can reduce the number of servers to which your CA and other important security files are deployed and reduce the computational overhead from HTTPS traffic. - -Using HTTPS in `node-http-proxy` is relatively straight-forward: - -``` js -var fs = require('fs'), - http = require('http'), - https = require('https'), - httpProxy = require('http-proxy'); - -var options = { - https: { - key: fs.readFileSync('path/to/your/key.pem', 'utf8'), - cert: fs.readFileSync('path/to/your/cert.pem', 'utf8') - } -}; - -// -// Create a standalone HTTPS proxy server -// -httpProxy.createServer(8000, 'localhost', options).listen(8001); - -// -// Create an instance of HttpProxy to use with another HTTPS server -// -var proxy = new httpProxy.HttpProxy({ - target: { - host: 'localhost', - port: 8000 - } -}); -https.createServer(options.https, function (req, res) { - proxy.proxyRequest(req, res) -}).listen(8002); - -// -// Create the target HTTPS server for both cases -// -http.createServer(function (req, res) { - res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.write('hello https\n'); - res.end(); -}).listen(8000); -``` - -### Using two certificates - -Suppose that your reverse proxy will handle HTTPS traffic for two different domains `fobar.com` and `barbaz.com`. -If you need to use two different certificates you can take advantage of [Server Name Indication](http://en.wikipedia.org/wiki/Server_Name_Indication). - -``` js -var https = require('https'), - path = require("path"), - fs = require("fs"), - crypto = require("crypto"); - -// -// generic function to load the credentials context from disk -// -function getCredentialsContext (cer) { - return crypto.createCredentials({ - key: fs.readFileSync(path.join(__dirname, 'certs', cer + '.key')), - cert: fs.readFileSync(path.join(__dirname, 'certs', cer + '.crt')) - }).context; -} - -// -// A certificate per domain hash -// -var certs = { - "fobar.com": getCredentialsContext("foobar"), - "barbaz.com": getCredentialsContext("barbaz") -}; - -// -// Proxy options -// -var options = { - https: { - SNICallback: function(hostname){ - return certs[hostname]; - } - }, - hostnameOnly: true, - router: { - 'fobar.com': '127.0.0.1:8001', - 'barbaz.com': '127.0.0.1:8002' - } -}; - -// -// Create a standalone HTTPS proxy server -// -httpProxy.createServer(options).listen(8001); - -// -// Create the target HTTPS server -// -http.createServer(function (req, res) { - res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.write('hello https\n'); - res.end(); -}).listen(8000); - -``` - -### Proxying to HTTPS from HTTPS -Proxying from HTTPS to HTTPS is essentially the same as proxying from HTTPS to HTTP, but you must include the `target` option in when calling `httpProxy.createServer` or instantiating a new instance of `HttpProxy`. - -``` js -var fs = require('fs'), - https = require('https'), - httpProxy = require('http-proxy'); - -var options = { - https: { - key: fs.readFileSync('path/to/your/key.pem', 'utf8'), - cert: fs.readFileSync('path/to/your/cert.pem', 'utf8') - }, - target: { - https: true // This could also be an Object with key and cert properties - } -}; - -// -// Create a standalone HTTPS proxy server -// -httpProxy.createServer(8000, 'localhost', options).listen(8001); - -// -// Create an instance of HttpProxy to use with another HTTPS server -// -var proxy = new httpProxy.HttpProxy({ - target: { - host: 'localhost', - port: 8000, - https: true - } -}); - -https.createServer(options.https, function (req, res) { - proxy.proxyRequest(req, res); -}).listen(8002); - -// -// Create the target HTTPS server for both cases -// -https.createServer(options.https, function (req, res) { - res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.write('hello https\n'); - res.end(); -}).listen(8000); -``` -## Middleware - -`node-http-proxy` now supports connect middleware. Add middleware functions to your createServer call: - -``` js -httpProxy.createServer( - require('connect-gzip').gzip(), - 9000, 'localhost' -).listen(8000); -``` - -## Proxying WebSockets -Websockets are handled automatically when using `httpProxy.createServer()`, but if you want to use it in conjunction with a stand-alone HTTP + WebSocket (such as [socket.io][5]) server here's how: - -``` js -var http = require('http'), - httpProxy = require('http-proxy'); - -// -// Create an instance of node-http-proxy -// -var proxy = new httpProxy.HttpProxy({ - target: { - host: 'localhost', - port: 8000 - } -}); - -var server = http.createServer(function (req, res) { - // - // Proxy normal HTTP requests - // - proxy.proxyRequest(req, res); -}); - -server.on('upgrade', function(req, socket, head) { - // - // Proxy websocket requests too - // - proxy.proxyWebSocketRequest(req, socket, head); -}); - -server.listen(8080); -``` - -### Configuring your Socket limits - -By default, `node-http-proxy` will set a 100 socket limit for all `host:port` proxy targets. You can change this in two ways: - -1. By passing the `maxSockets` option to `httpProxy.createServer()` -2. By calling `httpProxy.setMaxSockets(n)`, where `n` is the number of sockets you with to use. - -## POST requests and buffering - -express.bodyParser will interfere with proxying of POST requests (and other methods that have a request -body). With bodyParser active, proxied requests will never send anything to the upstream server, and -the original client will just hang. See https://github.com/nodejitsu/node-http-proxy/issues/180 for options. - -## Using node-http-proxy from the command line -When you install this package with npm, a node-http-proxy binary will become available to you. Using this binary is easy with some simple options: - -``` js -usage: node-http-proxy [options] - -All options should be set with the syntax --option=value - -options: - --port PORT Port that the proxy server should run on - --target HOST:PORT Location of the server the proxy will target - --config OUTFILE Location of the configuration file for the proxy server - --silent Silence the log output from the proxy server - -h, --help You're staring at it -``` - -
-## Why doesn't node-http-proxy have more advanced features like x, y, or z? - -If you have a suggestion for a feature currently not supported, feel free to open a [support issue][6]. node-http-proxy is designed to just proxy http requests from one server to another, but we will be soon releasing many other complimentary projects that can be used in conjunction with node-http-proxy. - -## Options - -### Http Proxy - -`createServer()` supports the following options - -```javascript -{ - forward: { // options for forward-proxy - port: 8000, - host: 'staging.com' - }, - target : { // options for proxy target - port : 8000, - host : 'localhost', - }; - source : { // additional options for websocket proxying - host : 'localhost', - port : 8000, - https: true - }, - enable : { - xforward: true // enables X-Forwarded-For - }, - changeOrigin: false, // changes the origin of the host header to the target URL -} -``` - -## Run Tests -The test suite is designed to fully cover the combinatoric possibilities of HTTP and HTTPS proxying: - -1. HTTP --> HTTP -2. HTTPS --> HTTP -3. HTTPS --> HTTPS -4. HTTP --> HTTPS - -``` -vows test/*-test.js --spec -vows test/*-test.js --spec --https -vows test/*-test.js --spec --https --target=https -vows test/*-test.js --spec --target=https -``` - -
-### License - -(The MIT License) - -Copyright (c) 2010 Charlie Robbins, Mikeal Rogers, Fedor Indutny, & Marak Squires - -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. - -[0]: http://nodejitsu.com -[1]: https://github.com/nodejitsu/node-http-proxy/blob/master/examples/websocket/websocket-proxy.js -[2]: https://github.com/nodejitsu/node-http-proxy/blob/master/examples/http/proxy-https-to-http.js -[3]: https://github.com/nodejitsu/node-http-proxy/tree/master/examples -[4]: http://www.ietf.org/rfc/rfc2616.txt -[5]: http://socket.io -[6]: http://github.com/nodejitsu/node-http-proxy/issues diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/benchmark/websockets-throughput.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/benchmark/websockets-throughput.js deleted file mode 100644 index 6787385ad..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/benchmark/websockets-throughput.js +++ /dev/null @@ -1,88 +0,0 @@ -var crypto = require('crypto'), - WebSocket = require('ws'), - async = require('async'), - httpProxy = require('../'); - -var SERVER_PORT = 8415, - PROXY_PORT = 8514; - -var testSets = [ - { - size: 1024 * 1024, // 1 MB - count: 128 // 128 MB - }, - { - size: 1024, // 1 KB, - count: 1024 // 1 MB - }, - { - size: 128, // 128 B - count: 1024 * 8 // 1 MB - } -]; - -testSets.forEach(function (set) { - set.buffer = new Buffer(crypto.randomBytes(set.size)); - - set.buffers = []; - for (var i = 0; i < set.count; i++) { - set.buffers.push(set.buffer); - } -}); - -function runSet(set, callback) { - function runAgainst(port, callback) { - function send(sock) { - sock.send(set.buffers[got++]); - if (got === set.count) { - t = new Date() - t; - - server.close(); - proxy.close(); - - callback(null, t); - } - } - - var server = new WebSocket.Server({ port: SERVER_PORT }), - proxy = httpProxy.createServer(SERVER_PORT, 'localhost').listen(PROXY_PORT), - client = new WebSocket('ws://localhost:' + port), - got = 0, - t = new Date(); - - server.on('connection', function (ws) { - send(ws); - - ws.on('message', function (msg) { - send(ws); - }); - }); - - client.on('message', function () { - send(client); - }); - } - - async.series({ - server: async.apply(runAgainst, SERVER_PORT), - proxy: async.apply(runAgainst, PROXY_PORT) - }, function (err, results) { - if (err) { - throw err; - } - - var mb = (set.size * set.count) / (1024 * 1024); - console.log(set.size / (1024) + ' KB * ' + set.count + ' (' + mb + ' MB)'); - - Object.keys(results).forEach(function (key) { - var t = results[key], - throughput = mb / (t / 1000); - - console.log(' ' + key + ' took ' + t + ' ms (' + throughput + ' MB/s)'); - }); - - callback(); - }); -} - -async.forEachLimit(testSets, 1, runSet); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/bin/node-http-proxy b/update_nation/node_modules/couchapp/node_modules/http-proxy/bin/node-http-proxy deleted file mode 100644 index b15d16419..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/bin/node-http-proxy +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/env node - -var path = require('path'), - fs = require('fs'), - util = require('util'), - argv = require('optimist').argv, - httpProxy = require('../lib/node-http-proxy'); - -var help = [ - "usage: node-http-proxy [options] ", - "", - "Starts a node-http-proxy server using the specified command-line options", - "", - "options:", - " --port PORT Port that the proxy server should run on", - " --host HOST Host that the proxy server should run on", - " --target HOST:PORT Location of the server the proxy will target", - " --config OUTFILE Location of the configuration file for the proxy server", - " --silent Silence the log output from the proxy server", - " -h, --help You're staring at it" -].join('\n'); - -if (argv.h || argv.help || Object.keys(argv).length === 2) { - return util.puts(help); -} - -var location, config = {}, - port = argv.port || 80, - host = argv.host || undefined, - target = argv.target; - -// -// If we were passed a config, parse it -// -if (argv.config) { - try { - var data = fs.readFileSync(argv.config); - config = JSON.parse(data.toString()); - } catch (ex) { - util.puts('Error starting node-http-proxy: ' + ex); - process.exit(1); - } -} - -// -// If `config.https` is set, then load those files into the config options. -// -if (config.https) { - Object.keys(config.https).forEach(function (key) { - config.https[key] = fs.readFileSync(config.https[key], 'utf8'); - }); -} - -// -// Check to see if we should silence the logs -// -config.silent = typeof argv.silent !== 'undefined' ? argv.silent : config.silent; - -// -// If we were passed a target, parse the url string -// -if (typeof target === 'string') location = target.split(':'); - -// -// Create the server with the specified options -// -var server; -if (location) { - var targetPort = location.length === 1 ? 80 : parseInt(location[1]); - server = httpProxy.createServer(targetPort, location[0], config); -} -else if (config.router) { - server = httpProxy.createServer(config); -} -else { - return util.puts(help); -} - -// -// Start the server -// -if (host) { - server.listen(port, host); -} else { - server.listen(port); -} - -// -// Notify that the server is started -// -if (!config.silent) { - util.puts('node-http-proxy server now listening on port: ' + port); -} diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/config.sample.json b/update_nation/node_modules/couchapp/node_modules/http-proxy/config.sample.json deleted file mode 100644 index 8f15f882b..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/config.sample.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "silent": false, - "router": { - "localhost": "localhost:9000" - }, - "forward": { - "port": 9001, - "host": "localhost" - } -} \ No newline at end of file diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/balancer/simple-balancer.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/balancer/simple-balancer.js deleted file mode 100644 index f1fa0c06b..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/balancer/simple-balancer.js +++ /dev/null @@ -1,36 +0,0 @@ -var httpProxy = require('../../lib/node-http-proxy'); -// -// A simple round-robin load balancing strategy. -// -// First, list the servers you want to use in your rotation. -// -var addresses = [ - { - host: 'ws1.0.0.0', - port: 80 - }, - { - host: 'ws2.0.0.0', - port: 80 - } -]; - -httpProxy.createServer(function (req, res, proxy) { - // - // On each request, get the first location from the list... - // - var target = addresses.shift(); - - // - // ...then proxy to the server whose 'turn' it is... - // - console.log('balancing request to: ', target); - proxy.proxyRequest(req, res, target); - - // - // ...and then the server you just used becomes the last item in the list. - // - addresses.push(target); -}).listen(8000); - -// Rinse; repeat; enjoy. \ No newline at end of file diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/helpers/store.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/helpers/store.js deleted file mode 100644 index 62a627e41..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/helpers/store.js +++ /dev/null @@ -1,64 +0,0 @@ - -// -// just to make these example a little bit interesting, -// make a little key value store with an http interface -// (see couchbd for a grown-up version of this) -// -// API: -// GET / -// retrive list of keys -// -// GET /[url] -// retrive object stored at [url] -// will respond with 404 if there is nothing stored at [url] -// -// POST /[url] -// -// JSON.parse the body and store it under [url] -// will respond 400 (bad request) if body is not valid json. -// -// TODO: cached map-reduce views and auto-magic sharding. -// -var Store = module.exports = function Store () { - this.store = {}; -}; - -Store.prototype = { - get: function (key) { - return this.store[key] - }, - set: function (key, value) { - return this.store[key] = value - }, - handler:function () { - var store = this - return function (req, res) { - function send (obj, status) { - res.writeHead(200 || status,{'Content-Type': 'application/json'}) - res.write(JSON.stringify(obj) + '\n') - res.end() - } - var url = req.url.split('?').shift() - if(url === '/') { - console.log('get index') - return send(Object.keys(store.store)) - } else if(req.method == 'GET') { - var obj = store.get (url) - send(obj || {error: 'not_found', url: url}, obj ? 200 : 404) - } else { - //post: buffer body, and parse. - var body = '', obj - req.on('data', function (c) { body += c}) - req.on('end', function (c) { - try { - obj = JSON.parse(body) - } catch (err) { - return send (err, 400) - } - store.set(url, obj) - send({ok: true}) - }) - } - } - } -} diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/http/basic-proxy.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/http/basic-proxy.js deleted file mode 100644 index b890e69a0..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/http/basic-proxy.js +++ /dev/null @@ -1,58 +0,0 @@ -/* - basic-proxy.js: Basic example of proxying over HTTP - - Copyright (c) 2010 Charlie Robbins, Mikeal Rogers, Fedor Indutny, & Marak Squires. - - 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. - -*/ - -var util = require('util'), - colors = require('colors'), - http = require('http'), - httpProxy = require('../../lib/node-http-proxy'); - -var welcome = [ - '# # ##### ##### ##### ##### ##### #### # # # #', - '# # # # # # # # # # # # # # # # ', - '###### # # # # ##### # # # # # # ## # ', - '# # # # ##### ##### ##### # # ## # ', - '# # # # # # # # # # # # # ', - '# # # # # # # # #### # # # ' -].join('\n'); - -util.puts(welcome.rainbow.bold); - -// -// Basic Http Proxy Server -// -httpProxy.createServer(9000, 'localhost').listen(8000); - -// -// Target Http Server -// -http.createServer(function (req, res) { - res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.write('request successfully proxied to: ' + req.url + '\n' + JSON.stringify(req.headers, true, 2)); - res.end(); -}).listen(9000); - -util.puts('http proxy server'.blue + ' started '.green.bold + 'on port '.blue + '8000'.yellow); -util.puts('http server '.blue + 'started '.green.bold + 'on port '.blue + '9000 '.yellow); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/http/concurrent-proxy.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/http/concurrent-proxy.js deleted file mode 100644 index 230dfc651..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/http/concurrent-proxy.js +++ /dev/null @@ -1,66 +0,0 @@ -/* - concurrent-proxy.js: check levelof concurrency through proxy. - - Copyright (c) 2010 Charlie Robbins, Mikeal Rogers, Fedor Indutny, & Marak Squires. - - 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. - -*/ - -var util = require('util'), - colors = require('colors'), - http = require('http'), - httpProxy = require('../../lib/node-http-proxy'); - -// -// Basic Http Proxy Server -// -httpProxy.createServer(9000, 'localhost').listen(8000); - -// -// Target Http Server -// -// to check apparent problems with concurrent connections -// make a server which only responds when there is a given nubmer on connections -// - - -var connections = [], - go; - -http.createServer(function (req, res) { - connections.push(function () { - res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.write('request successfully proxied to: ' + req.url + '\n' + JSON.stringify(req.headers, true, 2)); - res.end(); - }); - - process.stdout.write(connections.length + ', '); - - if (connections.length > 110 || go) { - go = true; - while (connections.length) { - connections.shift()(); - } - } -}).listen(9000); - -util.puts('http proxy server'.blue + ' started '.green.bold + 'on port '.blue + '8000'.yellow); -util.puts('http server '.blue + 'started '.green.bold + 'on port '.blue + '9000 '.yellow); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/http/custom-proxy-error.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/http/custom-proxy-error.js deleted file mode 100644 index dc439ea19..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/http/custom-proxy-error.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - custom-proxy-error.js: Example of using the custom `proxyError` event. - - Copyright (c) 2010 Charlie Robbins, Mikeal Rogers, Fedor Indutny, & Marak Squires. - - 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. - -*/ - -var util = require('util'), - colors = require('colors'), - http = require('http'), - httpProxy = require('../../lib/node-http-proxy'); - -// -// Http Proxy Server with Latency -// -var server = httpProxy.createServer(9000, 'localhost'); - -// -// Tell the server to listen on port 8002 -// -server.listen(8002); - -// -// Listen for the `proxyError` event on `server.proxy`. _It will not -// be raised on the server itself._ -server.proxy.on('proxyError', function (err, req, res) { - res.writeHead(500, { - 'Content-Type': 'text/plain' - }); - - res.end('Something went wrong. And we are reporting a custom error message.'); -}); - - -util.puts('http proxy server '.blue + 'started '.green.bold + 'on port '.blue + '8002 '.yellow + 'with custom error message'.magenta.underline); \ No newline at end of file diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/http/forward-proxy.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/http/forward-proxy.js deleted file mode 100644 index ecc20fd4c..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/http/forward-proxy.js +++ /dev/null @@ -1,63 +0,0 @@ -/* - forward-proxy.js: Example of proxying over HTTP with additional forward proxy - - Copyright (c) 2010 Charlie Robbins, Mikeal Rogers, Fedor Indutny, & Marak Squires. - - 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. - -*/ - -var util = require('util'), - colors = require('colors'), - http = require('http'), - httpProxy = require('../../lib/node-http-proxy'); - -// -// Setup proxy server with forwarding -// -httpProxy.createServer(9000, 'localhost', { - forward: { - port: 9001, - host: 'localhost' - } -}).listen(8003); - -// -// Target Http Server -// -http.createServer(function (req, res) { - res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.write('request successfully proxied to: ' + req.url + '\n' + JSON.stringify(req.headers, true, 2)); - res.end(); -}).listen(9000); - -// -// Target Http Forwarding Server -// -http.createServer(function (req, res) { - util.puts('Receiving forward for: ' + req.url); - res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.write('request successfully forwarded to: ' + req.url + '\n' + JSON.stringify(req.headers, true, 2)); - res.end(); -}).listen(9001); - -util.puts('http proxy server '.blue + 'started '.green.bold + 'on port '.blue + '8003 '.yellow + 'with forward proxy'.magenta.underline); -util.puts('http server '.blue + 'started '.green.bold + 'on port '.blue + '9000 '.yellow); -util.puts('http forward server '.blue + 'started '.green.bold + 'on port '.blue + '9001 '.yellow); \ No newline at end of file diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/http/latent-proxy.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/http/latent-proxy.js deleted file mode 100644 index 5da559873..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/http/latent-proxy.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - latent-proxy.js: Example of proxying over HTTP with latency - - Copyright (c) 2010 Charlie Robbins, Mikeal Rogers, Fedor Indutny, & Marak Squires. - - 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. - -*/ - -var util = require('util'), - colors = require('colors'), - http = require('http'), - httpProxy = require('../../lib/node-http-proxy'); - -// -// Http Proxy Server with Latency -// -httpProxy.createServer(function (req, res, proxy) { - var buffer = httpProxy.buffer(req); - setTimeout(function() { - proxy.proxyRequest(req, res, { - port: 9000, - host: 'localhost', - buffer: buffer - }); - }, 200); -}).listen(8002); - -// -// Target Http Server -// -http.createServer(function (req, res) { - res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.write('request successfully proxied to: ' + req.url + '\n' + JSON.stringify(req.headers, true, 2)); - res.end(); -}).listen(9000); - -util.puts('http proxy server '.blue + 'started '.green.bold + 'on port '.blue + '8002 '.yellow + 'with latency'.magenta.underline); -util.puts('http server '.blue + 'started '.green.bold + 'on port '.blue + '9000 '.yellow); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/http/proxy-https-to-http.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/http/proxy-https-to-http.js deleted file mode 100644 index 378de0362..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/http/proxy-https-to-http.js +++ /dev/null @@ -1,51 +0,0 @@ -/* - proxy-https-to-http.js: Basic example of proxying over HTTPS to a target HTTP server - - Copyright (c) 2010 Charlie Robbins, Mikeal Rogers, Fedor Indutny, & Marak Squires. - - 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. - -*/ - -var https = require('https'), - http = require('http'), - util = require('util'), - colors = require('colors'), - httpProxy = require('../../lib/node-http-proxy'), - helpers = require('../../test/helpers'); - -// -// Create the target HTTPS server -// -http.createServer(function (req, res) { - res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.write('hello http over https\n'); - res.end(); -}).listen(8000); - -// -// Create the proxy server listening on port 443 -// -httpProxy.createServer(8000, 'localhost', { - https: helpers.https -}).listen(8080); - -util.puts('https proxy server'.blue + ' started '.green.bold + 'on port '.blue + '8080'.yellow); -util.puts('http server '.blue + 'started '.green.bold + 'on port '.blue + '8000 '.yellow); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/http/proxy-https-to-https.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/http/proxy-https-to-https.js deleted file mode 100644 index af0d92275..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/http/proxy-https-to-https.js +++ /dev/null @@ -1,55 +0,0 @@ -/* - proxy-https-to-https.js: Basic example of proxying over HTTPS to a target HTTPS server - - Copyright (c) 2010 Charlie Robbins, Mikeal Rogers, Fedor Indutny, & Marak Squires. - - 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. - -*/ - -var https = require('https'), - http = require('http'), - util = require('util'), - colors = require('colors'), - httpProxy = require('../../lib/node-http-proxy'), - helpers = require('../../test/helpers'); - -// -// Create the target HTTPS server -// -https.createServer(helpers.https, function (req, res) { - res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.write('hello https\n'); - res.end(); -}).listen(8000); - -// -// Create the proxy server listening on port 443 -// -httpProxy.createServer(8000, 'localhost', { - https: helpers.https, - target: { - https: true, - rejectUnauthorized: false - } -}).listen(8080); - -util.puts('https proxy server'.blue + ' started '.green.bold + 'on port '.blue + '8080'.yellow); -util.puts('https server '.blue + 'started '.green.bold + 'on port '.blue + '8000 '.yellow); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/http/proxy-table.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/http/proxy-table.js deleted file mode 100644 index 55d97aed5..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/http/proxy-table.js +++ /dev/null @@ -1,51 +0,0 @@ -/* - proxy-table.js: Example of proxying over HTTP with proxy table - - Copyright (c) 2010 Charlie Robbins, Mikeal Rogers, Fedor Indutny, & Marak Squires. - - 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. - -*/ - -var util = require('util'), - colors = require('colors'), - http = require('http'), - httpProxy = require('../../lib/node-http-proxy'); - -// -// Http Proxy Server with Proxy Table -// -httpProxy.createServer({ - router: { - 'localhost': 'localhost:9000' - } -}).listen(8001); - -// -// Target Http Server -// -http.createServer(function (req, res) { - res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.write('request successfully proxied to: ' + req.url + '\n' + JSON.stringify(req.headers, true, 2)); - res.end(); -}).listen(9000); - -util.puts('http proxy server '.blue + 'started '.green.bold + 'on port '.blue + '8001 '.yellow + 'with proxy table'.magenta.underline); -util.puts('http server '.blue + 'started '.green.bold + 'on port '.blue + '9000 '.yellow); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/http/standalone-proxy.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/http/standalone-proxy.js deleted file mode 100644 index 9ffa81757..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/http/standalone-proxy.js +++ /dev/null @@ -1,57 +0,0 @@ -/* - standalone-proxy.js: Example of proxying over HTTP with a standalone HTTP server. - - Copyright (c) 2010 Charlie Robbins, Mikeal Rogers, Fedor Indutny, & Marak Squires. - - 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. - -*/ - -var util = require('util'), - colors = require('colors'), - http = require('http'), - httpProxy = require('../../lib/node-http-proxy'); - -// -// Http Server with proxyRequest Handler and Latency -// -var proxy = new httpProxy.RoutingProxy(); -http.createServer(function (req, res) { - var buffer = httpProxy.buffer(req); - setTimeout(function() { - proxy.proxyRequest(req, res, { - port: 9000, - host: 'localhost', - buffer: buffer - }); - }, 200); -}).listen(8004); - -// -// Target Http Server -// -http.createServer(function (req, res) { - res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.write('request successfully proxied to: ' + req.url + '\n' + JSON.stringify(req.headers, true, 2)); - res.end(); -}).listen(9000); - -util.puts('http server '.blue + 'started '.green.bold + 'on port '.blue + '8004 '.yellow + 'with proxyRequest handler'.cyan.underline + ' and latency'.magenta); -util.puts('http server '.blue + 'started '.green.bold + 'on port '.blue + '9000 '.yellow); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/middleware/bodyDecoder-middleware.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/middleware/bodyDecoder-middleware.js deleted file mode 100644 index d889548a0..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/middleware/bodyDecoder-middleware.js +++ /dev/null @@ -1,87 +0,0 @@ - -var Store = require('../helpers/store') - , http = require('http') - -http.createServer(new Store().handler()).listen(7531, function () { -//try these commands: -// get index: -// curl localhost:7531 -// [] -// -// get a doc: -// curl localhost:7531/foo -// {"error":"not_found"} -// -// post an doc: -// curl -X POST localhost:7531/foo -d '{"content": "hello", "type": "greeting"}' -// {"ok":true} -// -// get index (now, not empty) -// curl localhost:7531 -// ["/foo"] -// -// get doc -// curl localhost:7531/foo -// {"content": "hello", "type": "greeting"} - -// -// now, suppose we wanted to direct all objects where type == "greeting" to a different store -// than where type == "insult" -// -// we can use connect connect-bodyDecoder and some custom logic to send insults to another Store. - -//insult server: - - http.createServer(new Store().handler()).listen(2600, function () { - - //greetings -> 7531, insults-> 2600 - - // now, start a proxy server. - - var bodyParser = require('connect/lib/middleware/bodyParser') - //don't worry about incoming contont type - //bodyParser.parse[''] = JSON.parse - - require('../../lib/node-http-proxy').createServer( - //refactor the body parser and re-streamer into a separate package - bodyParser(), - //body parser absorbs the data and end events before passing control to the next - // middleware. if we want to proxy it, we'll need to re-emit these events after - //passing control to the middleware. - require('connect-restreamer')(), - function (req, res, proxy) { - //if your posting an obect which contains type: "insult" - //it will get redirected to port 2600. - //normal get requests will go to 7531 nad will not return insults. - var port = (req.body && req.body.type === 'insult' ? 2600 : 7531) - proxy.proxyRequest(req, res, {host: 'localhost', port: port}) - } - ).listen(1337, function () { - var request = require('request') - //bodyParser needs content-type set to application/json - //if we use request, it will set automatically if we use the 'json:' field. - function post (greeting, type) { - request.post({ - url: 'http://localhost:1337/' + greeting, - json: {content: greeting, type: type || "greeting"} - }) - } - post("hello") - post("g'day") - post("kiora") - post("houdy") - post("java", "insult") - - //now, the insult should have been proxied to 2600 - - //curl localhost:2600 - //["/java"] - - //but the greetings will be sent to 7531 - - //curl localhost:7531 - //["/hello","/g%27day","/kiora","/houdy"] - - }) - }) -}) diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/middleware/gzip-middleware-proxytable.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/middleware/gzip-middleware-proxytable.js deleted file mode 100644 index 527d3d7b8..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/middleware/gzip-middleware-proxytable.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - gzip-middleware-proxytable.js: Basic example of `connect-gzip` middleware in node-http-proxy - - Copyright (c) 2010 Charlie Robbins, Mikeal Rogers, Fedor Indutny, Marak Squires, & Dominic Tarr. - - 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. - -*/ - -var util = require('util'), - colors = require('colors'), - http = require('http'), - httpProxy = require('../../lib/node-http-proxy'); - -// -// Basic Http Proxy Server -// -httpProxy.createServer( - require('connect-gzip').gzip({ matchType: /.?/ }), - { - router: { - "localhost/fun": "localhost:9000" - } - } -).listen(8000); - -// -// Target Http Server -// -http.createServer(function (req, res) { - res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.write('request successfully proxied to: ' + req.url + '\n' + JSON.stringify(req.headers, true, 2)); - res.end(); -}).listen(9000); - -util.puts('http proxy server'.blue + ' started '.green.bold + 'on port '.blue + '8000'.yellow); -util.puts('http server '.blue + 'started '.green.bold + 'on port '.blue + '9000 '.yellow); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/middleware/gzip-middleware.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/middleware/gzip-middleware.js deleted file mode 100644 index 29097ecd3..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/middleware/gzip-middleware.js +++ /dev/null @@ -1,50 +0,0 @@ -/* - gzip-middleware.js: Basic example of `connect-gzip` middleware in node-http-proxy - - Copyright (c) 2010 Charlie Robbins, Mikeal Rogers, Fedor Indutny, Marak Squires, & Dominic Tarr. - - 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. - -*/ - -var util = require('util'), - colors = require('colors'), - http = require('http'), - httpProxy = require('../../lib/node-http-proxy'); - -// -// Basic Http Proxy Server -// -httpProxy.createServer( - require('connect-gzip').gzip({ matchType: /.?/ }), - 9000, 'localhost' -).listen(8000); - -// -// Target Http Server -// -http.createServer(function (req, res) { - res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.write('request successfully proxied to: ' + req.url + '\n' + JSON.stringify(req.headers, true, 2)); - res.end(); -}).listen(9000); - -util.puts('http proxy server'.blue + ' started '.green.bold + 'on port '.blue + '8000'.yellow); -util.puts('http server '.blue + 'started '.green.bold + 'on port '.blue + '9000 '.yellow); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/middleware/jsonp-middleware.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/middleware/jsonp-middleware.js deleted file mode 100644 index 15ab9ee05..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/middleware/jsonp-middleware.js +++ /dev/null @@ -1,30 +0,0 @@ -var Store = require('../helpers/store') - , http = require('http') - -// -// jsonp is a handy technique for getting around the limitations of the same-origin policy. -// (http://en.wikipedia.org/wiki/Same_origin_policy) -// -// normally, to dynamically update a page you use an XmlHttpRequest. this has flakey support -// is some browsers and is restricted by the same origin policy. you cannot perform XHR requests to -// someone else's server. one way around this would be to proxy requests to all the servers you want -// to xhr to, and your core server - so that everything has the same port and host. -// -// another way, is to turn json into javascript. (which is exempt from the same origin policy) -// this is done by wrapping the json object in a function call, and then including a script tag. -// -// here we're proxing our own JSON returning server, but we could proxy any server on the internet, -// and our client side app would be slurping down JSONP from anywhere. -// -// curl localhost:1337/whatever?callback=alert -// alert([]) //which is valid javascript! -// -// also see http://en.wikipedia.org/wiki/JSONP#JSONP -// - -http.createServer(new Store().handler()).listen(7531) - -require('../../lib/node-http-proxy').createServer( - require('connect-jsonp')(true), - 'localhost', 7531 -).listen(1337) diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/middleware/modifyResponse-middleware.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/middleware/modifyResponse-middleware.js deleted file mode 100644 index af21236ef..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/middleware/modifyResponse-middleware.js +++ /dev/null @@ -1,57 +0,0 @@ -/* - modifyBody-middleware.js: Example of middleware which modifies response - - Copyright (c) 2010 Charlie Robbins, Mikeal Rogers, Fedor Indutny, Marak Squires, & Dominic Tarr. - - 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. - -*/ - -var util = require('util'), - colors = require('colors'), - http = require('http'), - httpProxy = require('../../lib/node-http-proxy'); - -// -// Basic Http Proxy Server -// -httpProxy.createServer( - function (req, res, next) { - var _write = res.write; - - res.write = function (data) { - _write.call(res, data.toString().replace("Ruby", "nodejitsu")); - } - next(); - }, - 9000, 'localhost' -).listen(8000); - -// -// Target Http Server -// -http.createServer(function (req, res) { - res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.end('Hello, I know Ruby\n'); -}).listen(9000); - -util.puts('http proxy server'.blue + ' started '.green.bold + 'on port '.blue + '8000'.yellow); -util.puts('http server '.blue + 'started '.green.bold + 'on port '.blue + '9000 '.yellow); - diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/middleware/url-middleware.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/middleware/url-middleware.js deleted file mode 100644 index b4f304562..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/middleware/url-middleware.js +++ /dev/null @@ -1,58 +0,0 @@ -/* - url-middleware.js: Example of a simple url routing middleware for node-http-proxy - - Copyright (c) 2010 Charlie Robbins, Mikeal Rogers, Fedor Indutny, & Marak Squires. - - 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. - -*/ - -var util = require('util'), - colors = require('colors'), - http = require('http'), - httpProxy = require('../../lib/node-http-proxy'); - -// -// Now we set up our proxy. -// -httpProxy.createServer( - // - // This is where our middlewares go, with any options desired - in this case, - // the list of routes/URLs and their destinations. - // - require('proxy-by-url')({ - '/hello': { port: 9000, host: 'localhost' }, - '/charlie': { port: 80, host: 'charlieistheman.com' }, - '/google': { port: 80, host: 'google.com' } - }) -).listen(8000); - -// -// Target Http Server (to listen for requests on 'localhost') -// -http.createServer(function (req, res) { - res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.write('request successfully proxied to: ' + req.url + '\n' + JSON.stringify(req.headers, true, 2)); - res.end(); -}).listen(9000); - -// And finally, some colored startup output. -util.puts('http proxy server'.blue + ' started '.green.bold + 'on port '.blue + '8000'.yellow); -util.puts('http server '.blue + 'started '.green.bold + 'on port '.blue + '9000 '.yellow); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/middleware/url-middleware2.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/middleware/url-middleware2.js deleted file mode 100644 index 2c894e1af..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/middleware/url-middleware2.js +++ /dev/null @@ -1,30 +0,0 @@ -var util = require('util'), - colors = require('colors'), - http = require('http'), - httpProxy = require('../../lib/node-http-proxy'), - Store = require('../helpers/store') - -http.createServer(new Store().handler()).listen(7531) - -// Now we set up our proxy. -httpProxy.createServer( - // This is where our middlewares go, with any options desired - in this case, - // the list of routes/URLs and their destinations. - require('proxy-by-url')({ - '/store': { port: 7531, host: 'localhost' }, - '/': { port: 9000, host: 'localhost' } - }) -).listen(8000); - -// -// Target Http Server (to listen for requests on 'localhost') -// -http.createServer(function (req, res) { - res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.write('request successfully proxied to: ' + req.url + '\n' + JSON.stringify(req.headers, true, 2)); - res.end(); -}).listen(9000); - -// And finally, some colored startup output. -util.puts('http proxy server'.blue + ' started '.green.bold + 'on port '.blue + '8000'.yellow); -util.puts('http server '.blue + 'started '.green.bold + 'on port '.blue + '9000 '.yellow); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/package.json b/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/package.json deleted file mode 100644 index ca95fd8cf..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "http-proxy-examples", - "description": "packages required to run the examples", - "version": "0.0.0", - "dependencies": { - "connect": "1.6", - "connect-gzip": "0.1", - "connect-jsonp": "0.0.5", - "connect-restreamer": "1", - "proxy-by-url": ">= 0.0.1" - } -} \ No newline at end of file diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/websocket/latent-websocket-proxy.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/websocket/latent-websocket-proxy.js deleted file mode 100644 index 99a07281e..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/websocket/latent-websocket-proxy.js +++ /dev/null @@ -1,92 +0,0 @@ -/* - standalone-websocket-proxy.js: Example of proxying websockets over HTTP with a standalone HTTP server. - - Copyright (c) 2010 Charlie Robbins, Mikeal Rogers, Fedor Indutny, & Marak Squires. - - 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. - -*/ - -var util = require('util'), - http = require('http'), - colors = require('colors'), - httpProxy = require('../../lib/node-http-proxy'); - -try { - var io = require('socket.io'), - client = require('socket.io-client'); -} -catch (ex) { - console.error('Socket.io is required for this example:'); - console.error('npm ' + 'install'.green); - process.exit(1); -} - -// -// Create the target HTTP server and setup -// socket.io on it. -// -var server = io.listen(8080); -server.sockets.on('connection', function (client) { - util.debug('Got websocket connection'); - - client.on('message', function (msg) { - util.debug('Got message from client: ' + msg); - }); - - client.send('from server'); -}); - -// -// Setup our server to proxy standard HTTP requests -// -var proxy = new httpProxy.HttpProxy({ - target: { - host: 'localhost', - port: 8080 - } -}); - -var proxyServer = http.createServer(function (req, res) { - proxy.proxyRequest(req, res); -}); - -// -// Listen to the `upgrade` event and proxy the -// WebSocket requests as well. -// -proxyServer.on('upgrade', function (req, socket, head) { - var buffer = httpProxy.buffer(socket); - - setTimeout(function () { - proxy.proxyWebSocketRequest(req, socket, head, buffer); - }, 1000); -}); - -proxyServer.listen(8081); - -// -// Setup the socket.io client against our proxy -// -var ws = client.connect('ws://localhost:8081'); - -ws.on('message', function (msg) { - util.debug('Got message: ' + msg); -}); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/websocket/standalone-websocket-proxy.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/websocket/standalone-websocket-proxy.js deleted file mode 100644 index acf43b979..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/websocket/standalone-websocket-proxy.js +++ /dev/null @@ -1,87 +0,0 @@ -/* - standalone-websocket-proxy.js: Example of proxying websockets over HTTP with a standalone HTTP server. - - Copyright (c) 2010 Charlie Robbins, Mikeal Rogers, Fedor Indutny, & Marak Squires. - - 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. - -*/ - -var util = require('util'), - http = require('http'), - colors = require('colors'), - httpProxy = require('../../lib/node-http-proxy'); - -try { - var io = require('socket.io'), - client = require('socket.io-client'); -} -catch (ex) { - console.error('Socket.io is required for this example:'); - console.error('npm ' + 'install'.green); - process.exit(1); -} - -// -// Create the target HTTP server and setup -// socket.io on it. -// -var server = io.listen(8080); -server.sockets.on('connection', function (client) { - util.debug('Got websocket connection'); - - client.on('message', function (msg) { - util.debug('Got message from client: ' + msg); - }); - - client.send('from server'); -}); - -// -// Setup our server to proxy standard HTTP requests -// -var proxy = new httpProxy.HttpProxy({ - target: { - host: 'localhost', - port: 8080 - } -}); -var proxyServer = http.createServer(function (req, res) { - proxy.proxyRequest(req, res); -}); - -// -// Listen to the `upgrade` event and proxy the -// WebSocket requests as well. -// -proxyServer.on('upgrade', function (req, socket, head) { - proxy.proxyWebSocketRequest(req, socket, head); -}); - -proxyServer.listen(8081); - -// -// Setup the socket.io client against our proxy -// -var ws = client.connect('ws://localhost:8081'); - -ws.on('message', function (msg) { - util.debug('Got message: ' + msg); -}); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/websocket/websocket-proxy.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/websocket/websocket-proxy.js deleted file mode 100644 index 4e3cf6fd1..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/examples/websocket/websocket-proxy.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - web-socket-proxy.js: Example of proxying over HTTP and WebSockets. - - Copyright (c) 2010 Charlie Robbins, Mikeal Rogers, Fedor Indutny, & Marak Squires. - - 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. - -*/ - -var util = require('util'), - http = require('http'), - colors = require('colors'), - httpProxy = require('../../lib/node-http-proxy'); - -try { - var io = require('socket.io'), - client = require('socket.io-client'); -} -catch (ex) { - console.error('Socket.io is required for this example:'); - console.error('npm ' + 'install'.green); - process.exit(1); -} - -// -// Create the target HTTP server and setup -// socket.io on it. -// -var server = io.listen(8080); -server.sockets.on('connection', function (client) { - util.debug('Got websocket connection'); - - client.on('message', function (msg) { - util.debug('Got message from client: ' + msg); - }); - - client.send('from server'); -}); - -// -// Create a proxy server with node-http-proxy -// -httpProxy.createServer(8080, 'localhost').listen(8081); - -// -// Setup the socket.io client against our proxy -// -var ws = client.connect('ws://localhost:8081'); - -ws.on('message', function (msg) { - util.debug('Got message: ' + msg); -}); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/lib/node-http-proxy.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/lib/node-http-proxy.js deleted file mode 100644 index b9bd9146d..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/lib/node-http-proxy.js +++ /dev/null @@ -1,394 +0,0 @@ -/* - node-http-proxy.js: http proxy for node.js - - Copyright (c) 2010 Charlie Robbins, Mikeal Rogers, Marak Squires, Fedor Indutny - - 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. - -*/ - -var util = require('util'), - http = require('http'), - https = require('https'), - events = require('events'), - maxSockets = 100; - -// -// Expose version information through `pkginfo`. -// -require('pkginfo')(module, 'version'); - -// -// ### Export the relevant objects exposed by `node-http-proxy` -// -var HttpProxy = exports.HttpProxy = require('./node-http-proxy/http-proxy').HttpProxy, - ProxyTable = exports.ProxyTable = require('./node-http-proxy/proxy-table').ProxyTable, - RoutingProxy = exports.RoutingProxy = require('./node-http-proxy/routing-proxy').RoutingProxy; - -// -// ### function createServer ([port, host, options, handler]) -// #### @port {number} **Optional** Port to use on the proxy target host. -// #### @host {string} **Optional** Host of the proxy target. -// #### @options {Object} **Optional** Options for the HttpProxy instance used -// #### @handler {function} **Optional** Request handler for the server -// Returns a server that manages an instance of HttpProxy. Flexible arguments allow for: -// -// * `httpProxy.createServer(9000, 'localhost')` -// * `httpProxy.createServer(9000, 'localhost', options) -// * `httpPRoxy.createServer(function (req, res, proxy) { ... })` -// -exports.createServer = function () { - var args = Array.prototype.slice.call(arguments), - handlers = [], - callback, - options = {}, - message, - handler, - server, - proxy, - host, - port; - - // - // Liberally parse arguments of the form: - // - // httpProxy.createServer('localhost', 9000, callback); - // httpProxy.createServer({ host: 'localhost', port: 9000 }, callback); - // **NEED MORE HERE!!!** - // - args.forEach(function (arg) { - arg = Number(arg) || arg; - switch (typeof arg) { - case 'string': host = arg; break; - case 'number': port = arg; break; - case 'object': options = arg || {}; break; - case 'function': callback = arg; handlers.push(callback); break; - }; - }); - - // - // Helper function to create intelligent error message(s) - // for the very liberal arguments parsing performed by - // `require('http-proxy').createServer()`. - // - function validArguments() { - var conditions = { - 'port and host': function () { - return port && host; - }, - 'options.target or options.router': function () { - return options && (options.router || - (options.target && options.target.host && options.target.port)); - }, - 'or proxy handlers': function () { - return handlers && handlers.length; - } - } - - var missing = Object.keys(conditions).filter(function (name) { - return !conditions[name](); - }); - - if (missing.length === 3) { - message = 'Cannot proxy without ' + missing.join(', '); - return false; - } - - return true; - } - - if (!validArguments()) { - // - // If `host`, `port` and `options` are all not passed (with valid - // options) then this server is improperly configured. - // - throw new Error(message); - return; - } - - // - // Hoist up any explicit `host` or `port` arguments - // that have been passed in to the options we will - // pass to the `httpProxy.HttpProxy` constructor. - // - options.target = options.target || {}; - options.target.port = options.target.port || port; - options.target.host = options.target.host || host; - - if (options.target && options.target.host && options.target.port) { - // - // If an explicit `host` and `port` combination has been passed - // to `.createServer()` then instantiate a hot-path optimized - // `HttpProxy` object and add the "proxy" middleware layer. - // - proxy = new HttpProxy(options); - handlers.push(function (req, res) { - proxy.proxyRequest(req, res); - }); - } - else { - // - // If no explicit `host` or `port` combination has been passed then - // we have to assume that this is a "go-anywhere" Proxy (i.e. a `RoutingProxy`). - // - proxy = new RoutingProxy(options); - - if (options.router) { - // - // If a routing table has been supplied than we assume - // the user intends us to add the "proxy" middleware layer - // for them - // - handlers.push(function (req, res) { - proxy.proxyRequest(req, res); - }); - - proxy.on('routes', function (routes) { - server.emit('routes', routes); - }); - } - } - - // - // Create the `http[s].Server` instance which will use - // an instance of `httpProxy.HttpProxy`. - // - handler = handlers.length > 1 - ? exports.stack(handlers, proxy) - : function (req, res) { handlers[0](req, res, proxy) }; - - server = options.https - ? https.createServer(options.https, handler) - : http.createServer(handler); - - server.on('close', function () { - proxy.close(); - }); - - if (!callback) { - // - // If an explicit callback has not been supplied then - // automagically proxy the request using the `HttpProxy` - // instance we have created. - // - server.on('upgrade', function (req, socket, head) { - proxy.proxyWebSocketRequest(req, socket, head); - }); - } - - // - // Set the proxy on the server so it is available - // to the consumer of the server - // - server.proxy = proxy; - return server; -}; - -// -// ### function buffer (obj) -// #### @obj {Object} Object to pause events from -// Buffer `data` and `end` events from the given `obj`. -// Consumers of HttpProxy performing async tasks -// __must__ utilize this utility, to re-emit data once -// the async operation has completed, otherwise these -// __events will be lost.__ -// -// var buffer = httpProxy.buffer(req); -// fs.readFile(path, function(){ -// httpProxy.proxyRequest(req, res, host, port, buffer); -// }); -// -// __Attribution:__ This approach is based heavily on -// [Connect](https://github.com/senchalabs/connect/blob/master/lib/utils.js#L157). -// However, this is not a big leap from the implementation in node-http-proxy < 0.4.0. -// This simply chooses to manage the scope of the events on a new Object literal as opposed to -// [on the HttpProxy instance](https://github.com/nodejitsu/node-http-proxy/blob/v0.3.1/lib/node-http-proxy.js#L154). -// -exports.buffer = function (obj) { - var events = [], - onData, - onEnd; - - obj.on('data', onData = function (data, encoding) { - events.push(['data', data, encoding]); - }); - - obj.on('end', onEnd = function (data, encoding) { - events.push(['end', data, encoding]); - }); - - return { - end: function () { - obj.removeListener('data', onData); - obj.removeListener('end', onEnd); - }, - destroy: function () { - this.end(); - this.resume = function () { - console.error("Cannot resume buffer after destroying it."); - }; - - onData = onEnd = events = obj = null; - }, - resume: function () { - this.end(); - for (var i = 0, len = events.length; i < len; ++i) { - obj.emit.apply(obj, events[i]); - } - } - }; -}; - -// -// ### function getMaxSockets () -// Returns the maximum number of sockets -// allowed on __every__ outgoing request -// made by __all__ instances of `HttpProxy` -// -exports.getMaxSockets = function () { - return maxSockets; -}; - -// -// ### function setMaxSockets () -// Sets the maximum number of sockets -// allowed on __every__ outgoing request -// made by __all__ instances of `HttpProxy` -// -exports.setMaxSockets = function (value) { - maxSockets = value; -}; - -// -// ### function stack (middlewares, proxy) -// #### @middlewares {Array} Array of functions to stack. -// #### @proxy {HttpProxy|RoutingProxy} Proxy instance to -// Iteratively build up a single handler to the `http.Server` -// `request` event (i.e. `function (req, res)`) by wrapping -// each middleware `layer` into a `child` middleware which -// is in invoked by the parent (i.e. predecessor in the Array). -// -// adapted from https://github.com/creationix/stack -// -exports.stack = function stack (middlewares, proxy) { - var handle; - middlewares.reverse().forEach(function (layer) { - var child = handle; - handle = function (req, res) { - var next = function (err) { - if (err) { - if (res._headerSent) { - res.destroy(); - } - else { - res.statusCode = 500; - res.setHeader('Content-Type', 'text/plain'); - res.end('Internal Server Error'); - } - - console.error('Error in middleware(s): %s', err.stack); - return; - } - - if (child) { - child(req, res); - } - }; - - // - // Set the prototype of the `next` function to the instance - // of the `proxy` so that in can be used interchangably from - // a `connect` style callback and a true `HttpProxy` object. - // - // e.g. `function (req, res, next)` vs. `function (req, res, proxy)` - // - next.__proto__ = proxy; - layer(req, res, next); - }; - }); - - return handle; -}; - -// -// ### function _getAgent (host, port, secure) -// #### @options {Object} Options to use when creating the agent. -// -// { -// host: 'localhost', -// port: 9000, -// https: true, -// maxSockets: 100 -// } -// -// Createsan agent from the `http` or `https` module -// and sets the `maxSockets` property appropriately. -// -exports._getAgent = function _getAgent (options) { - if (!options || !options.host) { - throw new Error('`options.host` is required to create an Agent.'); - } - - if (!options.port) { - options.port = options.https ? 443 : 80; - } - - var Agent = options.https ? https.Agent : http.Agent, - agent; - - // require('http-proxy').setMaxSockets() should override http's default - // configuration value (which is pretty low). - options.maxSockets = options.maxSockets || maxSockets; - agent = new Agent(options); - - return agent; -} - -// -// ### function _getProtocol (options) -// #### @options {Object} Options for the proxy target. -// Returns the appropriate node.js core protocol module (i.e. `http` or `https`) -// based on the `options` supplied. -// -exports._getProtocol = function _getProtocol (options) { - return options.https ? https : http; -}; - - -// -// ### function _getBase (options) -// #### @options {Object} Options for the proxy target. -// Returns the relevate base object to create on outgoing proxy request. -// If `options.https` are supplied, this function respond with an object -// containing the relevant `ca`, `key`, and `cert` properties. -// -exports._getBase = function _getBase (options) { - var result = function () {}; - - if (options.https && typeof options.https === 'object') { - ['ca', 'cert', 'key'].forEach(function (key) { - if (options.https[key]) { - result.prototype[key] = options.https[key]; - } - }); - } - - return result; -}; diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/lib/node-http-proxy/http-proxy.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/lib/node-http-proxy/http-proxy.js deleted file mode 100644 index e23d551ca..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/lib/node-http-proxy/http-proxy.js +++ /dev/null @@ -1,856 +0,0 @@ -/* - node-http-proxy.js: http proxy for node.js - - Copyright (c) 2010 Charlie Robbins, Mikeal Rogers, Marak Squires, Fedor Indutny - - 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. - -*/ - -var events = require('events'), - http = require('http'), - util = require('util'), - httpProxy = require('../node-http-proxy'); - -// -// ### function HttpProxy (options) -// #### @options {Object} Options for this instance. -// Constructor function for new instances of HttpProxy responsible -// for managing the life-cycle of streaming reverse proxyied HTTP requests. -// -// Example options: -// -// { -// target: { -// host: 'localhost', -// port: 9000 -// }, -// forward: { -// host: 'localhost', -// port: 9001 -// } -// } -// -var HttpProxy = exports.HttpProxy = function (options) { - if (!options || !options.target) { - throw new Error('Both `options` and `options.target` are required.'); - } - - events.EventEmitter.call(this); - - var self = this; - - // - // Setup basic proxying options: - // - // * forward {Object} Options for a forward-proxy (if-any) - // * target {Object} Options for the **sole** proxy target of this instance - // - this.forward = options.forward; - this.target = options.target; - - // - // Setup the necessary instances instance variables for - // the `target` and `forward` `host:port` combinations - // used by this instance. - // - // * agent {http[s].Agent} Agent to be used by this instance. - // * protocol {http|https} Core node.js module to make requests with. - // * base {Object} Base object to create when proxying containing any https settings. - // - function setupProxy (key) { - self[key].agent = httpProxy._getAgent(self[key]); - self[key].protocol = httpProxy._getProtocol(self[key]); - self[key].base = httpProxy._getBase(self[key]); - } - - setupProxy('target'); - if (this.forward) { - setupProxy('forward'); - } - - // - // Setup opt-in features - // - this.enable = options.enable || {}; - this.enable.xforward = typeof this.enable.xforward === 'boolean' - ? this.enable.xforward - : true; - - // - // Setup additional options for WebSocket proxying. When forcing - // the WebSocket handshake to change the `sec-websocket-location` - // and `sec-websocket-origin` headers `options.source` **MUST** - // be provided or the operation will fail with an `origin mismatch` - // by definition. - // - this.source = options.source || { host: 'localhost', port: 8000 }; - this.source.https = this.source.https || options.https; - this.changeOrigin = options.changeOrigin || false; -}; - -// Inherit from events.EventEmitter -util.inherits(HttpProxy, events.EventEmitter); - -// -// ### function proxyRequest (req, res, [port, host, paused]) -// #### @req {ServerRequest} Incoming HTTP Request to proxy. -// #### @res {ServerResponse} Outgoing HTTP Request to write proxied data to. -// #### @buffer {Object} Result from `httpProxy.buffer(req)` -// -function getProto(req) { - return req.isSpdy ? 'https' : (req.connection.pair ? 'https' : 'http'); -} -HttpProxy.prototype.proxyRequest = function (req, res, buffer) { - var self = this, - errState = false, - outgoing = new(this.target.base), - reverseProxy; - - // - // Add common proxy headers to the request so that they can - // be availible to the proxy target server. If the proxy is - // part of proxy chain it will append the address: - // - // * `x-forwarded-for`: IP Address of the original request - // * `x-forwarded-proto`: Protocol of the original request - // * `x-forwarded-port`: Port of the original request. - // - if (this.enable.xforward && req.connection && req.socket) { - if (req.headers['x-forwarded-for']){ - var addressToAppend = "," + req.connection.remoteAddress || req.socket.remoteAddress; - req.headers['x-forwarded-for'] += addressToAppend; - } - else { - req.headers['x-forwarded-for'] = req.connection.remoteAddress || req.socket.remoteAddress; - } - - if (req.headers['x-forwarded-port']){ - var portToAppend = "," + req.connection.remotePort || req.socket.remotePort; - req.headers['x-forwarded-port'] += portToAppend; - } - else { - req.headers['x-forwarded-port'] = req.connection.remotePort || req.socket.remotePort; - } - - if (req.headers['x-forwarded-proto']){ - var protoToAppend = "," + getProto(req); - req.headers['x-forwarded-proto'] += protoToAppend; - } - else { - req.headers['x-forwarded-proto'] = getProto(req); - } - } - - // - // Emit the `start` event indicating that we have begun the proxy operation. - // - this.emit('start', req, res, this.target); - - // - // If forwarding is enabled for this instance, foward proxy the - // specified request to the address provided in `this.forward` - // - if (this.forward) { - this.emit('forward', req, res, this.forward); - this._forwardRequest(req); - } - - // - // #### function proxyError (err) - // #### @err {Error} Error contacting the proxy target - // Short-circuits `res` in the event of any error when - // contacting the proxy target at `host` / `port`. - // - function proxyError(err) { - errState = true; - - // - // Emit an `error` event, allowing the application to use custom - // error handling. The error handler should end the response. - // - if (self.emit('proxyError', err, req, res)) { - return; - } - - res.writeHead(500, { 'Content-Type': 'text/plain' }); - - if (req.method !== 'HEAD') { - // - // This NODE_ENV=production behavior is mimics Express and - // Connect. - // - if (process.env.NODE_ENV === 'production') { - res.write('Internal Server Error'); - } - else { - res.write('An error has occurred: ' + JSON.stringify(err)); - } - } - - try { res.end() } - catch (ex) { console.error("res.end error: %s", ex.message) } - } - - // - // Setup outgoing proxy with relevant properties. - // - outgoing.host = this.target.host; - outgoing.hostname = this.target.hostname; - outgoing.port = this.target.port; - outgoing.agent = this.target.agent; - outgoing.method = req.method; - outgoing.path = req.url; - outgoing.headers = req.headers; - - // - // If the changeOrigin option is specified, change the - // origin of the host header to the target URL! Please - // don't revert this without documenting it! - // - if (this.changeOrigin) { - outgoing.headers.host = this.target.host + ':' + this.target.port; - } - - // - // Open new HTTP request to internal resource with will act - // as a reverse proxy pass - // - reverseProxy = this.target.protocol.request(outgoing, function (response) { - // - // Process the `reverseProxy` `response` when it's received. - // - if (response.headers.connection) { - if (req.headers.connection) { response.headers.connection = req.headers.connection } - else { response.headers.connection = 'close' } - } - - // Remove `Transfer-Encoding` header if client's protocol is HTTP/1.0 - if (req.httpVersion === '1.0') { - delete response.headers['transfer-encoding']; - } - - if ((response.statusCode === 301) || (response.statusCode === 302)) { - if (self.source.https && !self.target.https) { - response.headers.location = response.headers.location.replace(/^http\:/, 'https:'); - } - if (self.target.https && !self.source.https) { - response.headers.location = response.headers.location.replace(/^https\:/, 'http:'); - } - } - - // - // When the `reverseProxy` `response` ends, end the - // corresponding outgoing `res` unless we have entered - // an error state. In which case, assume `res.end()` has - // already been called and the 'error' event listener - // removed. - // - var ended = false; - response.on('close', function () { - if (!ended) { response.emit('end') } - }); - - response.on('end', function () { - ended = true; - if (!errState) { - try { res.end() } - catch (ex) { console.error("res.end error: %s", ex.message) } - - // Emit the `end` event now that we have completed proxying - self.emit('end', req, res); - } - }); - - // Set the headers of the client response - res.writeHead(response.statusCode, response.headers); - - // If `response.statusCode === 304`: No 'data' event and no 'end' - if (response.statusCode === 304) { - try { res.end() } - catch (ex) { console.error("res.end error: %s", ex.message) } - return; - } - - function ondata(chunk) { - if (res.writable) { - if (false === res.write(chunk) && response.pause) { - response.pause(); - } - } - } - - response.on('data', ondata); - - function ondrain() { - if (response.readable && response.resume) { - response.resume(); - } - } - - res.on('drain', ondrain); - }); - - // - // Handle 'error' events from the `reverseProxy`. - // - reverseProxy.once('error', proxyError); - reverseProxy.once('socket', function (socket) { - socket.once('error', proxyError); - }); - - // - // Handle 'error' events from the `req` (e.g. `Parse Error`). - // - req.on('error', proxyError); - - // - // If `req` is aborted, we abort our `reverseProxy` request as well. - // - req.on('aborted', function () { - reverseProxy.abort(); - }); - - // - // For each data `chunk` received from the incoming - // `req` write it to the `reverseProxy` request. - // - req.on('data', function (chunk) { - - if (!errState) { - var flushed = reverseProxy.write(chunk); - if (!flushed) { - req.pause(); - reverseProxy.once('drain', function () { - try { req.resume() } - catch (er) { console.error("req.resume error: %s", er.message) } - }); - - // - // Force the `drain` event in 100ms if it hasn't - // happened on its own. - // - setTimeout(function () { - reverseProxy.emit('drain'); - }, 100); - } - } - }); - - // - // When the incoming `req` ends, end the corresponding `reverseProxy` - // request unless we have entered an error state. - // - req.on('end', function () { - if (!errState) { - reverseProxy.end(); - } - }); - - //Aborts reverseProxy if client aborts the connection. - req.on('close', function () { - if (!errState) { - reverseProxy.abort(); - } - }); - - // - // If we have been passed buffered data, resume it. - // - if (buffer) { - return !errState - ? buffer.resume() - : buffer.destroy(); - } -}; - -// -// ### function proxyWebSocketRequest (req, socket, head, buffer) -// #### @req {ServerRequest} Websocket request to proxy. -// #### @socket {net.Socket} Socket for the underlying HTTP request -// #### @head {string} Headers for the Websocket request. -// #### @buffer {Object} Result from `httpProxy.buffer(req)` -// Performs a WebSocket proxy operation to the location specified by -// `this.target`. -// -HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, buffer) { - var self = this, - outgoing = new(this.target.base), - listeners = {}, - errState = false, - CRLF = '\r\n'; - - // - // WebSocket requests must have the `GET` method and - // the `upgrade:websocket` header - // - if (req.method !== 'GET' || req.headers.upgrade.toLowerCase() !== 'websocket') { - // - // This request is not WebSocket request - // - return socket.destroy(); - } - - // - // Add common proxy headers to the request so that they can - // be availible to the proxy target server. If the proxy is - // part of proxy chain it will append the address: - // - // * `x-forwarded-for`: IP Address of the original request - // * `x-forwarded-proto`: Protocol of the original request - // * `x-forwarded-port`: Port of the original request. - // - if (this.enable.xforward && req.connection && req.connection.socket) { - if (req.headers['x-forwarded-for']){ - var addressToAppend = "," + req.connection.remoteAddress || req.connection.socket.remoteAddress; - req.headers['x-forwarded-for'] += addressToAppend; - } - else { - req.headers['x-forwarded-for'] = req.connection.remoteAddress || req.connection.socket.remoteAddress; - } - - if (req.headers['x-forwarded-port']){ - var portToAppend = "," + req.connection.remotePort || req.connection.socket.remotePort; - req.headers['x-forwarded-port'] += portToAppend; - } - else { - req.headers['x-forwarded-port'] = req.connection.remotePort || req.connection.socket.remotePort; - } - - if (req.headers['x-forwarded-proto']){ - var protoToAppend = "," + (req.connection.pair ? 'wss' : 'ws'); - req.headers['x-forwarded-proto'] += protoToAppend; - } - else { - req.headers['x-forwarded-proto'] = req.connection.pair ? 'wss' : 'ws'; - } - } - - self.emit('websocket:start', req, socket, head, this.target); - - // - // Helper function for setting appropriate socket values: - // 1. Turn of all bufferings - // 2. For server set KeepAlive - // - function _socket(socket, keepAlive) { - socket.setTimeout(0); - socket.setNoDelay(true); - - if (keepAlive) { - if (socket.setKeepAlive) { - socket.setKeepAlive(true, 0); - } - else if (socket.pair.cleartext.socket.setKeepAlive) { - socket.pair.cleartext.socket.setKeepAlive(true, 0); - } - } - } - - // - // Setup the incoming client socket. - // - _socket(socket, true); - - // - // On `upgrade` from the Agent socket, listen to - // the appropriate events. - // - function onUpgrade (reverseProxy, proxySocket) { - if (!reverseProxy) { - proxySocket.end(); - socket.end(); - return; - } - - // - // Any incoming data on this WebSocket to the proxy target - // will be written to the `reverseProxy` socket. - // - proxySocket.on('data', listeners.onIncoming = function (data) { - if (reverseProxy.incoming.socket.writable) { - try { - self.emit('websocket:outgoing', req, socket, head, data); - var flushed = reverseProxy.incoming.socket.write(data); - if (!flushed) { - proxySocket.pause(); - reverseProxy.incoming.socket.once('drain', function () { - try { proxySocket.resume() } - catch (er) { console.error("proxySocket.resume error: %s", er.message) } - }); - - // - // Force the `drain` event in 100ms if it hasn't - // happened on its own. - // - setTimeout(function () { - reverseProxy.incoming.socket.emit('drain'); - }, 100); - } - } - catch (ex) { - detach(); - } - } - }); - - // - // Any outgoing data on this Websocket from the proxy target - // will be written to the `proxySocket` socket. - // - reverseProxy.incoming.socket.on('data', listeners.onOutgoing = function (data) { - try { - self.emit('websocket:incoming', reverseProxy, reverseProxy.incoming, head, data); - var flushed = proxySocket.write(data); - if (!flushed) { - reverseProxy.incoming.socket.pause(); - proxySocket.once('drain', function () { - try { reverseProxy.incoming.socket.resume() } - catch (er) { console.error("reverseProxy.incoming.socket.resume error: %s", er.message) } - }); - - // - // Force the `drain` event in 100ms if it hasn't - // happened on its own. - // - setTimeout(function () { - proxySocket.emit('drain'); - }, 100); - } - } - catch (ex) { - detach(); - } - }); - - // - // Helper function to detach all event listeners - // from `reverseProxy` and `proxySocket`. - // - function detach() { - proxySocket.destroySoon(); - proxySocket.removeListener('end', listeners.onIncomingClose); - proxySocket.removeListener('data', listeners.onIncoming); - reverseProxy.incoming.socket.destroySoon(); - reverseProxy.incoming.socket.removeListener('end', listeners.onOutgoingClose); - reverseProxy.incoming.socket.removeListener('data', listeners.onOutgoing); - } - - // - // If the incoming `proxySocket` socket closes, then - // detach all event listeners. - // - proxySocket.on('end', listeners.onIncomingClose = function() { - detach(); - - // Emit the `end` event now that we have completed proxying - self.emit('websocket:end', req, socket, head); - }); - - // - // If the `reverseProxy` socket closes, then detach all - // event listeners. - // - reverseProxy.incoming.socket.on('end', listeners.onOutgoingClose = function() { - detach(); - }); - } - - function getPort (port) { - port = port || 80; - return port - 80 === 0 ? '' : ':' + port; - } - - // - // Get the protocol, and host for this request and create an instance - // of `http.Agent` or `https.Agent` from the pool managed by `node-http-proxy`. - // - var agent = this.target.agent, - protocolName = this.target.https ? 'https' : 'http', - portUri = getPort(this.source.port), - remoteHost = this.target.host + portUri; - - // - // Change headers (if requested). - // - if (this.changeOrigin) { - req.headers.host = remoteHost; - req.headers.origin = protocolName + '://' + remoteHost; - } - - // - // Make the outgoing WebSocket request - // - outgoing.host = this.target.host; - outgoing.port = this.target.port; - outgoing.agent = agent; - outgoing.method = 'GET'; - outgoing.path = req.url; - outgoing.headers = req.headers; - outgoing.agent = agent; - - var reverseProxy = this.target.protocol.request(outgoing); - - // - // On any errors from the `reverseProxy` emit the - // `webSocketProxyError` and close the appropriate - // connections. - // - function proxyError (err) { - reverseProxy.destroy(); - - process.nextTick(function () { - // - // Destroy the incoming socket in the next tick, in case the error handler - // wants to write to it. - // - socket.destroy(); - }); - - self.emit('webSocketProxyError', req, socket, head); - } - - // - // Here we set the incoming `req`, `socket` and `head` data to the outgoing - // request so that we can reuse this data later on in the closure scope - // available to the `upgrade` event. This bookkeeping is not tracked anywhere - // in nodejs core and is **very** specific to proxying WebSockets. - // - reverseProxy.incoming = { - request: req, - socket: socket, - head: head - }; - - // - // If the agent for this particular `host` and `port` combination - // is not already listening for the `upgrade` event, then do so once. - // This will force us not to disconnect. - // - // In addition, it's important to note the closure scope here. Since - // there is no mapping of the socket to the request bound to it. - // - reverseProxy.on('upgrade', function (_, remoteSocket, head) { - // - // Prepare the socket for the reverseProxy request and begin to - // stream data between the two sockets. Here it is important to - // note that `remoteSocket._httpMessage === reverseProxy`. - // - _socket(remoteSocket, true); - onUpgrade(remoteSocket._httpMessage, remoteSocket); - }); - - // - // If the reverseProxy connection has an underlying socket, - // then execute the WebSocket handshake. - // - reverseProxy.once('socket', function (revSocket) { - revSocket.on('data', function handshake (data) { - // - // Ok, kind of harmfull part of code. Socket.IO sends a hash - // at the end of handshake if protocol === 76, but we need - // to replace 'host' and 'origin' in response so we split - // data to printable data and to non-printable. (Non-printable - // will come after double-CRLF). - // - var sdata = data.toString(); - - // Get the Printable data - sdata = sdata.substr(0, sdata.search(CRLF + CRLF)); - - // Get the Non-Printable data - data = data.slice(Buffer.byteLength(sdata), data.length); - - if (self.source.https && !self.target.https) { - // - // If the proxy server is running HTTPS but the client is running - // HTTP then replace `ws` with `wss` in the data sent back to the client. - // - sdata = sdata.replace('ws:', 'wss:'); - } - - try { - // - // Write the printable and non-printable data to the socket - // from the original incoming request. - // - self.emit('websocket:handshake', req, socket, head, sdata, data); - socket.write(sdata); - var flushed = socket.write(data); - if (!flushed) { - revSocket.pause(); - socket.once('drain', function () { - try { revSocket.resume() } - catch (er) { console.error("reverseProxy.socket.resume error: %s", er.message) } - }); - - // - // Force the `drain` event in 100ms if it hasn't - // happened on its own. - // - setTimeout(function () { - socket.emit('drain'); - }, 100); - } - } - catch (ex) { - // - // Remove data listener on socket error because the - // 'handshake' has failed. - // - revSocket.removeListener('data', handshake); - return proxyError(ex); - } - - // Catch socket errors - socket.on('error', proxyError); - - // - // Remove data listener now that the 'handshake' is complete - // - revSocket.removeListener('data', handshake); - }); - }); - - reverseProxy.on('error', proxyError); - reverseProxy.once('socket', function (socket) { - socket.once('error', proxyError); - }); - - // - // Handle 'error' events from the `req` (e.g. `Parse Error`). - // - req.on('error', proxyError); - - try { - // - // Attempt to write the upgrade-head to the reverseProxy - // request. This is small, and there's only ever one of - // it; no need for pause/resume. - // - // XXX This is very wrong and should be fixed in node's core - // - reverseProxy.write(head); - if (head && head.length === 0) { - reverseProxy._send(''); - } - } - catch (ex) { - return proxyError(ex); - } - - // - // If we have been passed buffered data, resume it. - // - if (buffer) { - return !errState - ? buffer.resume() - : buffer.destroy(); - } -}; - -// -// ### function close() -// Closes all sockets associated with the Agents -// belonging to this instance. -// -HttpProxy.prototype.close = function () { - [this.forward, this.target].forEach(function (proxy) { - if (proxy && proxy.agent) { - for (var host in proxy.agent.sockets) { - proxy.agent.sockets[host].forEach(function (socket) { - socket.end(); - }); - } - } - }); -}; - -// -// ### @private function _forwardRequest (req) -// #### @req {ServerRequest} Incoming HTTP Request to proxy. -// Forwards the specified `req` to the location specified -// by `this.forward` ignoring errors and the subsequent response. -// -HttpProxy.prototype._forwardRequest = function (req) { - var self = this, - outgoing = new(this.forward.base), - forwardProxy; - - // - // Setup outgoing proxy with relevant properties. - // - outgoing.host = this.forward.host; - outgoing.port = this.forward.port, - outgoing.agent = this.forward.agent; - outgoing.method = req.method; - outgoing.path = req.url; - outgoing.headers = req.headers; - - // - // Open new HTTP request to internal resource with will - // act as a reverse proxy pass. - // - forwardProxy = this.forward.protocol.request(outgoing, function (response) { - // - // Ignore the response from the forward proxy since this is a 'fire-and-forget' proxy. - // Remark (indexzero): We will eventually emit a 'forward' event here for performance tuning. - // - }); - - // - // Add a listener for the connection timeout event. - // - // Remark: Ignoring this error in the event - // forward target doesn't exist. - // - forwardProxy.once('error', function (err) { }); - - // - // Chunk the client request body as chunks from - // the proxied request come in - // - req.on('data', function (chunk) { - var flushed = forwardProxy.write(chunk); - if (!flushed) { - req.pause(); - forwardProxy.once('drain', function () { - try { req.resume() } - catch (er) { console.error("req.resume error: %s", er.message) } - }); - - // - // Force the `drain` event in 100ms if it hasn't - // happened on its own. - // - setTimeout(function () { - forwardProxy.emit('drain'); - }, 100); - } - }); - - // - // At the end of the client request, we are going to - // stop the proxied request - // - req.on('end', function () { - forwardProxy.end(); - }); -}; diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/lib/node-http-proxy/proxy-table.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/lib/node-http-proxy/proxy-table.js deleted file mode 100644 index b12b577ee..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/lib/node-http-proxy/proxy-table.js +++ /dev/null @@ -1,225 +0,0 @@ -/* - node-http-proxy.js: Lookup table for proxy targets in node.js - - Copyright (c) 2010 Charlie Robbins - - 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. - -*/ - -var util = require('util'), - events = require('events'), - fs = require('fs'), - url = require('url'); - -// -// ### function ProxyTable (router, silent) -// #### @router {Object} Object containing the host based routes -// #### @silent {Boolean} Value indicating whether we should suppress logs -// #### @hostnameOnly {Boolean} Value indicating if we should route based on __hostname string only__ -// Constructor function for the ProxyTable responsible for getting -// locations of proxy targets based on ServerRequest headers; specifically -// the HTTP host header. -// -var ProxyTable = exports.ProxyTable = function (options) { - events.EventEmitter.call(this); - - this.silent = options.silent || options.silent !== true; - this.target = options.target || {}; - this.hostnameOnly = options.hostnameOnly === true; - - if (typeof options.router === 'object') { - // - // If we are passed an object literal setup - // the routes with RegExps from the router - // - this.setRoutes(options.router); - } - else if (typeof options.router === 'string') { - // - // If we are passed a string then assume it is a - // file path, parse that file and watch it for changes - // - var self = this; - this.routeFile = options.router; - this.setRoutes(JSON.parse(fs.readFileSync(options.router)).router); - - fs.watchFile(this.routeFile, function () { - fs.readFile(self.routeFile, function (err, data) { - if (err) { - self.emit('error', err); - } - - self.setRoutes(JSON.parse(data).router); - self.emit('routes', self.hostnameOnly === false ? self.routes : self.router); - }); - }); - } - else { - throw new Error('Cannot parse router with unknown type: ' + typeof router); - } -}; - -// -// Inherit from `events.EventEmitter` -// -util.inherits(ProxyTable, events.EventEmitter); - -// -// ### function setRoutes (router) -// #### @router {Object} Object containing the host based routes -// Sets the host-based routes to be used by this instance. -// -ProxyTable.prototype.setRoutes = function (router) { - if (!router) { - throw new Error('Cannot update ProxyTable routes without router.'); - } - - var self = this; - this.router = router; - - if (this.hostnameOnly === false) { - this.routes = []; - - Object.keys(router).forEach(function (path) { - if (!/http[s]?/.test(router[path])) { - router[path] = (self.target.https ? 'https://' : 'http://') - + router[path]; - } - - var target = url.parse(router[path]), - defaultPort = self.target.https ? 443 : 80; - - // - // Setup a robust lookup table for the route: - // - // { - // source: { - // regexp: /^foo.com/i, - // sref: 'foo.com', - // url: { - // protocol: 'http:', - // slashes: true, - // host: 'foo.com', - // hostname: 'foo.com', - // href: 'http://foo.com/', - // pathname: '/', - // path: '/' - // } - // }, - // { - // target: { - // sref: '127.0.0.1:8000/', - // url: { - // protocol: 'http:', - // slashes: true, - // host: '127.0.0.1:8000', - // hostname: '127.0.0.1', - // href: 'http://127.0.0.1:8000/', - // pathname: '/', - // path: '/' - // } - // }, - // - self.routes.push({ - source: { - regexp: new RegExp('^' + path, 'i'), - sref: path, - url: url.parse('http://' + path) - }, - target: { - sref: target.hostname + ':' + (target.port || defaultPort) + target.path, - url: target - } - }); - }); - } -}; - -// -// ### function getProxyLocation (req) -// #### @req {ServerRequest} The incoming server request to get proxy information about. -// Returns the proxy location based on the HTTP Headers in the ServerRequest `req` -// available to this instance. -// -ProxyTable.prototype.getProxyLocation = function (req) { - if (!req || !req.headers || !req.headers.host) { - return null; - } - - var target = req.headers.host.split(':')[0]; - if (this.hostnameOnly === true) { - if (this.router.hasOwnProperty(target)) { - var location = this.router[target].split(':'), - host = location[0], - port = location.length === 1 ? 80 : location[1]; - - return { - port: port, - host: host - }; - } - } - else { - target += req.url; - for (var i in this.routes) { - var route = this.routes[i]; - if (target.match(route.source.regexp)) { - // - // Attempt to perform any path replacement for differences - // between the source path and the target path. This replaces the - // path's part of the URL to the target's part of the URL. - // - // 1. Parse the request URL - // 2. Replace any portions of the source path with the target path - // 3. Set the request URL to the formatted URL with replacements. - // - var parsed = url.parse(req.url); - - parsed.pathname = parsed.pathname.replace( - route.source.url.pathname, - route.target.url.pathname - ); - - req.url = url.format(parsed); - - return { - protocol: route.target.url.protocol.replace(':', ''), - host: route.target.url.hostname, - port: route.target.url.port - || (this.target.https ? 443 : 80) - }; - } - } - } - - return null; -}; - -// -// ### close function () -// Cleans up the event listeneners maintained -// by this instance. -// -ProxyTable.prototype.close = function () { - if (typeof this.routeFile === 'string') { - fs.unwatchFile(this.routeFile); - } -}; diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/lib/node-http-proxy/routing-proxy.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/lib/node-http-proxy/routing-proxy.js deleted file mode 100644 index e8bc0cfb7..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/lib/node-http-proxy/routing-proxy.js +++ /dev/null @@ -1,293 +0,0 @@ -/* - * routing-proxy.js: A routing proxy consuming a RoutingTable and multiple HttpProxy instances - * - * (C) 2011 Nodejitsu Inc. - * MIT LICENCE - * - */ - -var events = require('events'), - util = require('util'), - HttpProxy = require('./http-proxy').HttpProxy, - ProxyTable = require('./proxy-table').ProxyTable; - -// -// ### function RoutingProxy (options) -// #### @options {Object} Options for this instance -// Constructor function for the RoutingProxy object, a higher level -// reverse proxy Object which can proxy to multiple hosts and also interface -// easily with a RoutingTable instance. -// -var RoutingProxy = exports.RoutingProxy = function (options) { - events.EventEmitter.call(this); - - var self = this; - options = options || {}; - - if (options.router) { - this.proxyTable = new ProxyTable(options); - this.proxyTable.on('routes', function (routes) { - self.emit('routes', routes); - }); - } - - // - // Create a set of `HttpProxy` objects to be used later on calls - // to `.proxyRequest()` and `.proxyWebSocketRequest()`. - // - this.proxies = {}; - - // - // Setup default target options (such as `https`). - // - this.target = {}; - this.target.https = options.target && options.target.https; - - // - // Setup other default options to be used for instances of - // `HttpProxy` created by this `RoutingProxy` instance. - // - this.source = options.source || { host: 'localhost', port: 8000 }; - this.https = this.source.https || options.https; - this.enable = options.enable; - this.forward = options.forward; - this.changeOrigin = options.changeOrigin || false; - - // - // Listen for 'newListener' events so that we can bind 'proxyError' - // listeners to each HttpProxy's 'proxyError' event. - // - this.on('newListener', function (evt) { - if (evt === 'proxyError' || evt === 'webSocketProxyError') { - Object.keys(self.proxies).forEach(function (key) { - self.proxies[key].on(evt, this.emit.bind(this, evt)); - }); - } - }); -}; - - -// -// Inherit from `events.EventEmitter`. -// -util.inherits(RoutingProxy, events.EventEmitter); - -// -// ### function add (options) -// #### @options {Object} Options for the `HttpProxy` to add. -// Adds a new instance of `HttpProxy` to this `RoutingProxy` instance -// for the specified `options.host` and `options.port`. -// -RoutingProxy.prototype.add = function (options) { - var self = this, - key = this._getKey(options); - - // - // TODO: Consume properties in `options` related to the `ProxyTable`. - // - options.target = options.target || {}; - options.target.host = options.target.host || options.host; - options.target.port = options.target.port || options.port; - options.target.https = this.target && this.target.https || - options.target && options.target.https; - - // - // Setup options to pass-thru to the new `HttpProxy` instance - // for the specified `options.host` and `options.port` pair. - // - ['https', 'enable', 'forward', 'changeOrigin'].forEach(function (key) { - if (options[key] !== false && self[key]) { - options[key] = self[key]; - } - }); - - this.proxies[key] = new HttpProxy(options); - - if (this.listeners('proxyError').length > 0) { - this.proxies[key].on('proxyError', this.emit.bind(this, 'proxyError')); - } - - if (this.listeners('webSocketProxyError').length > 0) { - this.proxies[key].on('webSocketProxyError', this.emit.bind(this, 'webSocketProxyError')); - } - - [ - 'start', - 'forward', - 'end', - 'websocket:start', - 'websocket:end', - 'websocket:incoming', - 'websocket:outgoing' - ].forEach(function(event) { - this.proxies[key].on(event, this.emit.bind(this, event)); - }, this); -}; - -// -// ### function remove (options) -// #### @options {Object} Options mapping to the `HttpProxy` to remove. -// Removes an instance of `HttpProxy` from this `RoutingProxy` instance -// for the specified `options.host` and `options.port` (if they exist). -// -RoutingProxy.prototype.remove = function (options) { - var key = this._getKey(options), - proxy = this.proxies[key]; - - delete this.proxies[key]; - return proxy; -}; - -// -// ### function close() -// Cleans up any state left behind (sockets, timeouts, etc) -// associated with this instance. -// -RoutingProxy.prototype.close = function () { - var self = this; - - if (this.proxyTable) { - // - // Close the `RoutingTable` associated with - // this instance (if any). - // - this.proxyTable.close(); - } - - // - // Close all sockets for all `HttpProxy` object(s) - // associated with this instance. - // - Object.keys(this.proxies).forEach(function (key) { - self.proxies[key].close(); - }); -}; - -// -// ### function proxyRequest (req, res, [port, host, paused]) -// #### @req {ServerRequest} Incoming HTTP Request to proxy. -// #### @res {ServerResponse} Outgoing HTTP Request to write proxied data to. -// #### @options {Object} Options for the outgoing proxy request. -// -// options.port {number} Port to use on the proxy target host. -// options.host {string} Host of the proxy target. -// options.buffer {Object} Result from `httpProxy.buffer(req)` -// options.https {Object|boolean} Settings for https. -// -RoutingProxy.prototype.proxyRequest = function (req, res, options) { - options = options || {}; - - var location; - - // - // Check the proxy table for this instance to see if we need - // to get the proxy location for the request supplied. We will - // always ignore the proxyTable if an explicit `port` and `host` - // arguments are supplied to `proxyRequest`. - // - if (this.proxyTable && !options.host) { - location = this.proxyTable.getProxyLocation(req); - - // - // If no location is returned from the ProxyTable instance - // then respond with `404` since we do not have a valid proxy target. - // - if (!location) { - try { - res.writeHead(404); - res.end(); - } - catch (er) { - console.error("res.writeHead/res.end error: %s", er.message); - } - - return; - } - - // - // When using the ProxyTable in conjunction with an HttpProxy instance - // only the following arguments are valid: - // - // * `proxy.proxyRequest(req, res, { host: 'localhost' })`: This will be skipped - // * `proxy.proxyRequest(req, res, { buffer: buffer })`: Buffer will get updated appropriately - // * `proxy.proxyRequest(req, res)`: Options will be assigned appropriately. - // - options.port = location.port; - options.host = location.host; - } - - var key = this._getKey(options), - proxy; - - if ((this.target && this.target.https) - || (location && location.protocol === 'https')) { - options.target = options.target || {}; - options.target.https = true; - } - - if (!this.proxies[key]) { - this.add(options); - } - - proxy = this.proxies[key]; - proxy.proxyRequest(req, res, options.buffer); -}; - -// -// ### function proxyWebSocketRequest (req, socket, head, options) -// #### @req {ServerRequest} Websocket request to proxy. -// #### @socket {net.Socket} Socket for the underlying HTTP request -// #### @head {string} Headers for the Websocket request. -// #### @options {Object} Options to use when proxying this request. -// -// options.port {number} Port to use on the proxy target host. -// options.host {string} Host of the proxy target. -// options.buffer {Object} Result from `httpProxy.buffer(req)` -// options.https {Object|boolean} Settings for https. -// -RoutingProxy.prototype.proxyWebSocketRequest = function (req, socket, head, options) { - options = options || {}; - - var location, - proxy, - key; - - if (this.proxyTable && !options.host) { - location = this.proxyTable.getProxyLocation(req); - - if (!location) { - return socket.destroy(); - } - - options.port = location.port; - options.host = location.host; - } - - key = this._getKey(options); - - if (!this.proxies[key]) { - this.add(options); - } - - proxy = this.proxies[key]; - proxy.proxyWebSocketRequest(req, socket, head, options.buffer); -}; - -// -// ### @private function _getKey (options) -// #### @options {Object} Options to extract the key from -// Ensures that the appropriate options are present in the `options` -// provided and responds with a string key representing the `host`, `port` -// combination contained within. -// -RoutingProxy.prototype._getKey = function (options) { - if (!options || ((!options.host || !options.port) - && (!options.target || !options.target.host || !options.target.port))) { - throw new Error('options.host and options.port or options.target are required.'); - } - - return [ - options.host || options.target.host, - options.port || options.target.port - ].join(':'); -}; diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/colors/MIT-LICENSE.txt b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/colors/MIT-LICENSE.txt deleted file mode 100644 index 7dca10706..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/colors/MIT-LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2010 - -Marak Squires -Alexis Sellier (cloudhead) - -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. \ No newline at end of file diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/colors/ReadMe.md b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/colors/ReadMe.md deleted file mode 100644 index 0eda52db2..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/colors/ReadMe.md +++ /dev/null @@ -1,77 +0,0 @@ -# colors.js - get color and style in your node.js console ( and browser ) like what - - - - -## Installation - - npm install colors - -## colors and styles! - -- bold -- italic -- underline -- inverse -- yellow -- cyan -- white -- magenta -- green -- red -- grey -- blue -- rainbow -- zebra -- random - -## Usage - -``` js -var colors = require('./colors'); - -console.log('hello'.green); // outputs green text -console.log('i like cake and pies'.underline.red) // outputs red underlined text -console.log('inverse the color'.inverse); // inverses the color -console.log('OMG Rainbows!'.rainbow); // rainbow (ignores spaces) -``` - -# Creating Custom themes - -```js - -var colors = require('colors'); - -colors.setTheme({ - silly: 'rainbow', - input: 'grey', - verbose: 'cyan', - prompt: 'grey', - info: 'green', - data: 'grey', - help: 'cyan', - warn: 'yellow', - debug: 'blue', - error: 'red' -}); - -// outputs red text -console.log("this is an error".error); - -// outputs yellow text -console.log("this is a warning".warn); -``` - - -### Contributors - -Marak (Marak Squires) -Alexis Sellier (cloudhead) -mmalecki (Maciej Małecki) -nicoreed (Nico Reed) -morganrallen (Morgan Allen) -JustinCampbell (Justin Campbell) -ded (Dustin Diaz) - - -#### , Marak Squires , Justin Campbell, Dustin Diaz (@ded) diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/colors/colors.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/colors/colors.js deleted file mode 100644 index 7a537d8de..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/colors/colors.js +++ /dev/null @@ -1,342 +0,0 @@ -/* -colors.js - -Copyright (c) 2010 - -Marak Squires -Alexis Sellier (cloudhead) - -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. - -*/ - -var isHeadless = false; - -if (typeof module !== 'undefined') { - isHeadless = true; -} - -if (!isHeadless) { - var exports = {}; - var module = {}; - var colors = exports; - exports.mode = "browser"; -} else { - exports.mode = "console"; -} - -// -// Prototypes the string object to have additional method calls that add terminal colors -// -var addProperty = function (color, func) { - exports[color] = function (str) { - return func.apply(str); - }; - String.prototype.__defineGetter__(color, func); -}; - -function stylize(str, style) { - - var styles; - - if (exports.mode === 'console') { - styles = { - //styles - 'bold' : ['\x1B[1m', '\x1B[22m'], - 'italic' : ['\x1B[3m', '\x1B[23m'], - 'underline' : ['\x1B[4m', '\x1B[24m'], - 'inverse' : ['\x1B[7m', '\x1B[27m'], - 'strikethrough' : ['\x1B[9m', '\x1B[29m'], - //text colors - //grayscale - 'white' : ['\x1B[37m', '\x1B[39m'], - 'grey' : ['\x1B[90m', '\x1B[39m'], - 'black' : ['\x1B[30m', '\x1B[39m'], - //colors - 'blue' : ['\x1B[34m', '\x1B[39m'], - 'cyan' : ['\x1B[36m', '\x1B[39m'], - 'green' : ['\x1B[32m', '\x1B[39m'], - 'magenta' : ['\x1B[35m', '\x1B[39m'], - 'red' : ['\x1B[31m', '\x1B[39m'], - 'yellow' : ['\x1B[33m', '\x1B[39m'], - //background colors - //grayscale - 'whiteBG' : ['\x1B[47m', '\x1B[49m'], - 'greyBG' : ['\x1B[49;5;8m', '\x1B[49m'], - 'blackBG' : ['\x1B[40m', '\x1B[49m'], - //colors - 'blueBG' : ['\x1B[44m', '\x1B[49m'], - 'cyanBG' : ['\x1B[46m', '\x1B[49m'], - 'greenBG' : ['\x1B[42m', '\x1B[49m'], - 'magentaBG' : ['\x1B[45m', '\x1B[49m'], - 'redBG' : ['\x1B[41m', '\x1B[49m'], - 'yellowBG' : ['\x1B[43m', '\x1B[49m'] - }; - } else if (exports.mode === 'browser') { - styles = { - //styles - 'bold' : ['', ''], - 'italic' : ['', ''], - 'underline' : ['', ''], - 'inverse' : ['', ''], - 'strikethrough' : ['', ''], - //text colors - //grayscale - 'white' : ['', ''], - 'grey' : ['', ''], - 'black' : ['', ''], - //colors - 'blue' : ['', ''], - 'cyan' : ['', ''], - 'green' : ['', ''], - 'magenta' : ['', ''], - 'red' : ['', ''], - 'yellow' : ['', ''], - //background colors - //grayscale - 'whiteBG' : ['', ''], - 'greyBG' : ['', ''], - 'blackBG' : ['', ''], - //colors - 'blueBG' : ['', ''], - 'cyanBG' : ['', ''], - 'greenBG' : ['', ''], - 'magentaBG' : ['', ''], - 'redBG' : ['', ''], - 'yellowBG' : ['', ''] - }; - } else if (exports.mode === 'none') { - return str + ''; - } else { - console.log('unsupported mode, try "browser", "console" or "none"'); - } - return styles[style][0] + str + styles[style][1]; -} - -function applyTheme(theme) { - - // - // Remark: This is a list of methods that exist - // on String that you should not overwrite. - // - var stringPrototypeBlacklist = [ - '__defineGetter__', '__defineSetter__', '__lookupGetter__', '__lookupSetter__', 'charAt', 'constructor', - 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf', 'charCodeAt', - 'indexOf', 'lastIndexof', 'length', 'localeCompare', 'match', 'replace', 'search', 'slice', 'split', 'substring', - 'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toUpperCase', 'trim', 'trimLeft', 'trimRight' - ]; - - Object.keys(theme).forEach(function (prop) { - if (stringPrototypeBlacklist.indexOf(prop) !== -1) { - console.log('warn: '.red + ('String.prototype' + prop).magenta + ' is probably something you don\'t want to override. Ignoring style name'); - } - else { - if (typeof(theme[prop]) === 'string') { - addProperty(prop, function () { - return exports[theme[prop]](this); - }); - } - else { - addProperty(prop, function () { - var ret = this; - for (var t = 0; t < theme[prop].length; t++) { - ret = exports[theme[prop][t]](ret); - } - return ret; - }); - } - } - }); -} - - -// -// Iterate through all default styles and colors -// -var x = ['bold', 'underline', 'strikethrough', 'italic', 'inverse', 'grey', 'black', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta', 'greyBG', 'blackBG', 'yellowBG', 'redBG', 'greenBG', 'blueBG', 'whiteBG', 'cyanBG', 'magentaBG']; -x.forEach(function (style) { - - // __defineGetter__ at the least works in more browsers - // http://robertnyman.com/javascript/javascript-getters-setters.html - // Object.defineProperty only works in Chrome - addProperty(style, function () { - return stylize(this, style); - }); -}); - -function sequencer(map) { - return function () { - if (!isHeadless) { - return this.replace(/( )/, '$1'); - } - var exploded = this.split(""), i = 0; - exploded = exploded.map(map); - return exploded.join(""); - }; -} - -var rainbowMap = (function () { - var rainbowColors = ['red', 'yellow', 'green', 'blue', 'magenta']; //RoY G BiV - return function (letter, i, exploded) { - if (letter === " ") { - return letter; - } else { - return stylize(letter, rainbowColors[i++ % rainbowColors.length]); - } - }; -})(); - -exports.themes = {}; - -exports.addSequencer = function (name, map) { - addProperty(name, sequencer(map)); -}; - -exports.addSequencer('rainbow', rainbowMap); -exports.addSequencer('zebra', function (letter, i, exploded) { - return i % 2 === 0 ? letter : letter.inverse; -}); - -exports.setTheme = function (theme) { - if (typeof theme === 'string') { - try { - exports.themes[theme] = require(theme); - applyTheme(exports.themes[theme]); - return exports.themes[theme]; - } catch (err) { - console.log(err); - return err; - } - } else { - applyTheme(theme); - } -}; - - -addProperty('stripColors', function () { - return ("" + this).replace(/\x1B\[\d+m/g, ''); -}); - -// please no -function zalgo(text, options) { - var soul = { - "up" : [ - '̍', '̎', '̄', '̅', - '̿', '̑', '̆', '̐', - '͒', '͗', '͑', '̇', - '̈', '̊', '͂', '̓', - '̈', '͊', '͋', '͌', - '̃', '̂', '̌', '͐', - '̀', '́', '̋', '̏', - '̒', '̓', '̔', '̽', - '̉', 'ͣ', 'ͤ', 'ͥ', - 'ͦ', 'ͧ', 'ͨ', 'ͩ', - 'ͪ', 'ͫ', 'ͬ', 'ͭ', - 'ͮ', 'ͯ', '̾', '͛', - '͆', '̚' - ], - "down" : [ - '̖', '̗', '̘', '̙', - '̜', '̝', '̞', '̟', - '̠', '̤', '̥', '̦', - '̩', '̪', '̫', '̬', - '̭', '̮', '̯', '̰', - '̱', '̲', '̳', '̹', - '̺', '̻', '̼', 'ͅ', - '͇', '͈', '͉', '͍', - '͎', '͓', '͔', '͕', - '͖', '͙', '͚', '̣' - ], - "mid" : [ - '̕', '̛', '̀', '́', - '͘', '̡', '̢', '̧', - '̨', '̴', '̵', '̶', - '͜', '͝', '͞', - '͟', '͠', '͢', '̸', - '̷', '͡', ' ҉' - ] - }, - all = [].concat(soul.up, soul.down, soul.mid), - zalgo = {}; - - function randomNumber(range) { - var r = Math.floor(Math.random() * range); - return r; - } - - function is_char(character) { - var bool = false; - all.filter(function (i) { - bool = (i === character); - }); - return bool; - } - - function heComes(text, options) { - var result = '', counts, l; - options = options || {}; - options["up"] = options["up"] || true; - options["mid"] = options["mid"] || true; - options["down"] = options["down"] || true; - options["size"] = options["size"] || "maxi"; - text = text.split(''); - for (l in text) { - if (is_char(l)) { - continue; - } - result = result + text[l]; - counts = {"up" : 0, "down" : 0, "mid" : 0}; - switch (options.size) { - case 'mini': - counts.up = randomNumber(8); - counts.min = randomNumber(2); - counts.down = randomNumber(8); - break; - case 'maxi': - counts.up = randomNumber(16) + 3; - counts.min = randomNumber(4) + 1; - counts.down = randomNumber(64) + 3; - break; - default: - counts.up = randomNumber(8) + 1; - counts.mid = randomNumber(6) / 2; - counts.down = randomNumber(8) + 1; - break; - } - - var arr = ["up", "mid", "down"]; - for (var d in arr) { - var index = arr[d]; - for (var i = 0 ; i <= counts[index]; i++) { - if (options[index]) { - result = result + soul[index][randomNumber(soul[index].length)]; - } - } - } - } - return result; - } - return heComes(text); -} - - -// don't summon zalgo -addProperty('zalgo', function () { - return zalgo(this); -}); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/colors/example.html b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/colors/example.html deleted file mode 100644 index 7a2ae605f..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/colors/example.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - Colors Example - - - - - - \ No newline at end of file diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/colors/example.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/colors/example.js deleted file mode 100644 index b1e03a4fa..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/colors/example.js +++ /dev/null @@ -1,77 +0,0 @@ -var colors = require('./colors'); - -//colors.mode = "browser"; - -var test = colors.red("hopefully colorless output"); -console.log('Rainbows are fun!'.rainbow); -console.log('So '.italic + 'are'.underline + ' styles! '.bold + 'inverse'.inverse); // styles not widely supported -console.log('Chains are also cool.'.bold.italic.underline.red); // styles not widely supported -//console.log('zalgo time!'.zalgo); -console.log(test.stripColors); -console.log("a".grey + " b".black); -console.log("Zebras are so fun!".zebra); -console.log('background color attack!'.black.whiteBG) - -// -// Remark: .strikethrough may not work with Mac OS Terminal App -// -console.log("This is " + "not".strikethrough + " fun."); -console.log(colors.rainbow('Rainbows are fun!')); -console.log(colors.italic('So ') + colors.underline('are') + colors.bold(' styles! ') + colors.inverse('inverse')); // styles not widely supported -console.log(colors.bold(colors.italic(colors.underline(colors.red('Chains are also cool.'))))); // styles not widely supported -//console.log(colors.zalgo('zalgo time!')); -console.log(colors.stripColors(test)); -console.log(colors.grey("a") + colors.black(" b")); - -colors.addSequencer("america", function(letter, i, exploded) { - if(letter === " ") return letter; - switch(i%3) { - case 0: return letter.red; - case 1: return letter.white; - case 2: return letter.blue; - } -}); - -colors.addSequencer("random", (function() { - var available = ['bold', 'underline', 'italic', 'inverse', 'grey', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta']; - - return function(letter, i, exploded) { - return letter === " " ? letter : letter[available[Math.round(Math.random() * (available.length - 1))]]; - }; -})()); - -console.log("AMERICA! F--K YEAH!".america); -console.log("So apparently I've been to Mars, with all the little green men. But you know, I don't recall.".random); - -// -// Custom themes -// - -// Load theme with JSON literal -colors.setTheme({ - silly: 'rainbow', - input: 'grey', - verbose: 'cyan', - prompt: 'grey', - info: 'green', - data: 'grey', - help: 'cyan', - warn: 'yellow', - debug: 'blue', - error: 'red' -}); - -// outputs red text -console.log("this is an error".error); - -// outputs yellow text -console.log("this is a warning".warn); - -// outputs grey text -console.log("this is an input".input); - -// Load a theme from file -colors.setTheme('./themes/winston-dark.js'); - -console.log("this is an input".input); - diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/colors/package.json b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/colors/package.json deleted file mode 100644 index 43dc8b190..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/colors/package.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "colors", - "description": "get colors in your node.js console like what", - "version": "0.6.2", - "author": { - "name": "Marak Squires" - }, - "homepage": "https://github.com/Marak/colors.js", - "bugs": { - "url": "https://github.com/Marak/colors.js/issues" - }, - "keywords": [ - "ansi", - "terminal", - "colors" - ], - "repository": { - "type": "git", - "url": "http://github.com/Marak/colors.js.git" - }, - "engines": { - "node": ">=0.1.90" - }, - "main": "colors", - "_id": "colors@0.6.2", - "dist": { - "shasum": "2423fe6678ac0c5dae8852e5d0e5be08c997abcc", - "tarball": "http://registry.npmjs.org/colors/-/colors-0.6.2.tgz" - }, - "_from": "colors@0.x.x", - "_npmVersion": "1.2.30", - "_npmUser": { - "name": "marak", - "email": "marak.squires@gmail.com" - }, - "maintainers": [ - { - "name": "marak", - "email": "marak.squires@gmail.com" - } - ], - "directories": {}, - "_shasum": "2423fe6678ac0c5dae8852e5d0e5be08c997abcc", - "_resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/colors/test.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/colors/test.js deleted file mode 100644 index c32417d62..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/colors/test.js +++ /dev/null @@ -1,70 +0,0 @@ -var assert = require('assert'), - colors = require('./colors'); - -var s = 'string'; - -function a(s, code) { - return '\x1B[' + code.toString() + 'm' + s + '\x1B[39m'; -} - -function aE(s, color, code) { - assert.equal(s[color], a(s, code)); - assert.equal(colors[color](s), a(s, code)); - assert.equal(s[color], colors[color](s)); - assert.equal(s[color].stripColors, s); - assert.equal(s[color].stripColors, colors.stripColors(s)); -} - -function h(s, color) { - return '' + s + ''; -} - -var stylesColors = ['white', 'black', 'blue', 'cyan', 'green', 'magenta', 'red', 'yellow']; -var stylesAll = stylesColors.concat(['bold', 'italic', 'underline', 'inverse', 'rainbow']); - -colors.mode = 'console'; -assert.equal(s.bold, '\x1B[1m' + s + '\x1B[22m'); -assert.equal(s.italic, '\x1B[3m' + s + '\x1B[23m'); -assert.equal(s.underline, '\x1B[4m' + s + '\x1B[24m'); -assert.equal(s.strikethrough, '\x1B[9m' + s + '\x1B[29m'); -assert.equal(s.inverse, '\x1B[7m' + s + '\x1B[27m'); -assert.ok(s.rainbow); -aE(s, 'white', 37); -aE(s, 'grey', 90); -aE(s, 'black', 30); -aE(s, 'blue', 34); -aE(s, 'cyan', 36); -aE(s, 'green', 32); -aE(s, 'magenta', 35); -aE(s, 'red', 31); -aE(s, 'yellow', 33); -assert.equal(s, 'string'); - -colors.setTheme({error:'red'}); - -assert.equal(typeof("astring".red),'string'); -assert.equal(typeof("astring".error),'string'); - -colors.mode = 'browser'; -assert.equal(s.bold, '' + s + ''); -assert.equal(s.italic, '' + s + ''); -assert.equal(s.underline, '' + s + ''); -assert.equal(s.strikethrough, '' + s + ''); -assert.equal(s.inverse, '' + s + ''); -assert.ok(s.rainbow); -stylesColors.forEach(function (color) { - assert.equal(s[color], h(s, color)); - assert.equal(colors[color](s), h(s, color)); -}); - -assert.equal(typeof("astring".red),'string'); -assert.equal(typeof("astring".error),'string'); - -colors.mode = 'none'; -stylesAll.forEach(function (style) { - assert.equal(s[style], s); - assert.equal(colors[style](s), s); -}); - -assert.equal(typeof("astring".red),'string'); -assert.equal(typeof("astring".error),'string'); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/colors/themes/winston-dark.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/colors/themes/winston-dark.js deleted file mode 100644 index 49a905ba4..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/colors/themes/winston-dark.js +++ /dev/null @@ -1,12 +0,0 @@ -module['exports'] = { - silly: 'rainbow', - input: 'black', - verbose: 'cyan', - prompt: 'grey', - info: 'green', - data: 'grey', - help: 'cyan', - warn: 'yellow', - debug: 'blue', - error: 'red' -}; \ No newline at end of file diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/colors/themes/winston-light.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/colors/themes/winston-light.js deleted file mode 100644 index 571972c1b..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/colors/themes/winston-light.js +++ /dev/null @@ -1,12 +0,0 @@ -module['exports'] = { - silly: 'rainbow', - input: 'grey', - verbose: 'cyan', - prompt: 'grey', - info: 'green', - data: 'grey', - help: 'cyan', - warn: 'yellow', - debug: 'blue', - error: 'red' -}; \ No newline at end of file diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/.travis.yml b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/.travis.yml deleted file mode 100644 index cc4dba29d..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/LICENSE b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/LICENSE deleted file mode 100644 index 432d1aeb0..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright 2010 James Halliday (mail@substack.net) - -This project is free software released under the MIT/X11 license: - -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/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/bool.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/bool.js deleted file mode 100644 index a998fb7ab..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/bool.js +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env node -var util = require('util'); -var argv = require('optimist').argv; - -if (argv.s) { - util.print(argv.fr ? 'Le chat dit: ' : 'The cat says: '); -} -console.log( - (argv.fr ? 'miaou' : 'meow') + (argv.p ? '.' : '') -); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/boolean_double.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/boolean_double.js deleted file mode 100644 index a35a7e6d3..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/boolean_double.js +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env node -var argv = require('optimist') - .boolean(['x','y','z']) - .argv -; -console.dir([ argv.x, argv.y, argv.z ]); -console.dir(argv._); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/boolean_single.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/boolean_single.js deleted file mode 100644 index 017bb6893..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/boolean_single.js +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env node -var argv = require('optimist') - .boolean('v') - .argv -; -console.dir(argv.v); -console.dir(argv._); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/default_hash.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/default_hash.js deleted file mode 100644 index ade77681d..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/default_hash.js +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env node - -var argv = require('optimist') - .default({ x : 10, y : 10 }) - .argv -; - -console.log(argv.x + argv.y); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/default_singles.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/default_singles.js deleted file mode 100644 index d9b1ff458..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/default_singles.js +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env node -var argv = require('optimist') - .default('x', 10) - .default('y', 10) - .argv -; -console.log(argv.x + argv.y); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/divide.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/divide.js deleted file mode 100644 index 5e2ee82ff..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/divide.js +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env node - -var argv = require('optimist') - .usage('Usage: $0 -x [num] -y [num]') - .demand(['x','y']) - .argv; - -console.log(argv.x / argv.y); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/line_count.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/line_count.js deleted file mode 100644 index b5f95bf6d..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/line_count.js +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env node -var argv = require('optimist') - .usage('Count the lines in a file.\nUsage: $0') - .demand('f') - .alias('f', 'file') - .describe('f', 'Load a file') - .argv -; - -var fs = require('fs'); -var s = fs.createReadStream(argv.file); - -var lines = 0; -s.on('data', function (buf) { - lines += buf.toString().match(/\n/g).length; -}); - -s.on('end', function () { - console.log(lines); -}); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/line_count_options.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/line_count_options.js deleted file mode 100644 index d9ac70904..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/line_count_options.js +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env node -var argv = require('optimist') - .usage('Count the lines in a file.\nUsage: $0') - .options({ - file : { - demand : true, - alias : 'f', - description : 'Load a file' - }, - base : { - alias : 'b', - description : 'Numeric base to use for output', - default : 10, - }, - }) - .argv -; - -var fs = require('fs'); -var s = fs.createReadStream(argv.file); - -var lines = 0; -s.on('data', function (buf) { - lines += buf.toString().match(/\n/g).length; -}); - -s.on('end', function () { - console.log(lines.toString(argv.base)); -}); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/line_count_wrap.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/line_count_wrap.js deleted file mode 100644 index 426751112..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/line_count_wrap.js +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env node -var argv = require('optimist') - .usage('Count the lines in a file.\nUsage: $0') - .wrap(80) - .demand('f') - .alias('f', [ 'file', 'filename' ]) - .describe('f', - "Load a file. It's pretty important." - + " Required even. So you'd better specify it." - ) - .alias('b', 'base') - .describe('b', 'Numeric base to display the number of lines in') - .default('b', 10) - .describe('x', 'Super-secret optional parameter which is secret') - .default('x', '') - .argv -; - -var fs = require('fs'); -var s = fs.createReadStream(argv.file); - -var lines = 0; -s.on('data', function (buf) { - lines += buf.toString().match(/\n/g).length; -}); - -s.on('end', function () { - console.log(lines.toString(argv.base)); -}); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/nonopt.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/nonopt.js deleted file mode 100644 index ee633eedc..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/nonopt.js +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env node -var argv = require('optimist').argv; -console.log('(%d,%d)', argv.x, argv.y); -console.log(argv._); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/reflect.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/reflect.js deleted file mode 100644 index 816b3e111..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/reflect.js +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env node -console.dir(require('optimist').argv); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/short.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/short.js deleted file mode 100644 index 1db0ad0f8..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/short.js +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env node -var argv = require('optimist').argv; -console.log('(%d,%d)', argv.x, argv.y); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/string.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/string.js deleted file mode 100644 index a8e5aeb23..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/string.js +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env node -var argv = require('optimist') - .string('x', 'y') - .argv -; -console.dir([ argv.x, argv.y ]); - -/* Turns off numeric coercion: - ./node string.js -x 000123 -y 9876 - [ '000123', '9876' ] -*/ diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/usage-options.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/usage-options.js deleted file mode 100644 index b99997767..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/usage-options.js +++ /dev/null @@ -1,19 +0,0 @@ -var optimist = require('./../index'); - -var argv = optimist.usage('This is my awesome program', { - 'about': { - description: 'Provide some details about the author of this program', - required: true, - short: 'a', - }, - 'info': { - description: 'Provide some information about the node.js agains!!!!!!', - boolean: true, - short: 'i' - } -}).argv; - -optimist.showHelp(); - -console.log('\n\nInspecting options'); -console.dir(argv); \ No newline at end of file diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/xup.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/xup.js deleted file mode 100644 index 8f6ecd201..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/example/xup.js +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env node -var argv = require('optimist').argv; - -if (argv.rif - 5 * argv.xup > 7.138) { - console.log('Buy more riffiwobbles'); -} -else { - console.log('Sell the xupptumblers'); -} - diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/index.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/index.js deleted file mode 100644 index 8ac67eb31..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/index.js +++ /dev/null @@ -1,478 +0,0 @@ -var path = require('path'); -var wordwrap = require('wordwrap'); - -/* Hack an instance of Argv with process.argv into Argv - so people can do - require('optimist')(['--beeble=1','-z','zizzle']).argv - to parse a list of args and - require('optimist').argv - to get a parsed version of process.argv. -*/ - -var inst = Argv(process.argv.slice(2)); -Object.keys(inst).forEach(function (key) { - Argv[key] = typeof inst[key] == 'function' - ? inst[key].bind(inst) - : inst[key]; -}); - -var exports = module.exports = Argv; -function Argv (args, cwd) { - var self = {}; - if (!cwd) cwd = process.cwd(); - - self.$0 = process.argv - .slice(0,2) - .map(function (x) { - var b = rebase(cwd, x); - return x.match(/^\//) && b.length < x.length - ? b : x - }) - .join(' ') - ; - - if (process.env._ != undefined && process.argv[1] == process.env._) { - self.$0 = process.env._.replace( - path.dirname(process.execPath) + '/', '' - ); - } - - var flags = { bools : {}, strings : {} }; - - self.boolean = function (bools) { - if (!Array.isArray(bools)) { - bools = [].slice.call(arguments); - } - - bools.forEach(function (name) { - flags.bools[name] = true; - }); - - return self; - }; - - self.string = function (strings) { - if (!Array.isArray(strings)) { - strings = [].slice.call(arguments); - } - - strings.forEach(function (name) { - flags.strings[name] = true; - }); - - return self; - }; - - var aliases = {}; - self.alias = function (x, y) { - if (typeof x === 'object') { - Object.keys(x).forEach(function (key) { - self.alias(key, x[key]); - }); - } - else if (Array.isArray(y)) { - y.forEach(function (yy) { - self.alias(x, yy); - }); - } - else { - var zs = (aliases[x] || []).concat(aliases[y] || []).concat(x, y); - aliases[x] = zs.filter(function (z) { return z != x }); - aliases[y] = zs.filter(function (z) { return z != y }); - } - - return self; - }; - - var demanded = {}; - self.demand = function (keys) { - if (typeof keys == 'number') { - if (!demanded._) demanded._ = 0; - demanded._ += keys; - } - else if (Array.isArray(keys)) { - keys.forEach(function (key) { - self.demand(key); - }); - } - else { - demanded[keys] = true; - } - - return self; - }; - - var usage; - self.usage = function (msg, opts) { - if (!opts && typeof msg === 'object') { - opts = msg; - msg = null; - } - - usage = msg; - - if (opts) self.options(opts); - - return self; - }; - - function fail (msg) { - self.showHelp(); - if (msg) console.error(msg); - process.exit(1); - } - - var checks = []; - self.check = function (f) { - checks.push(f); - return self; - }; - - var defaults = {}; - self.default = function (key, value) { - if (typeof key === 'object') { - Object.keys(key).forEach(function (k) { - self.default(k, key[k]); - }); - } - else { - defaults[key] = value; - } - - return self; - }; - - var descriptions = {}; - self.describe = function (key, desc) { - if (typeof key === 'object') { - Object.keys(key).forEach(function (k) { - self.describe(k, key[k]); - }); - } - else { - descriptions[key] = desc; - } - return self; - }; - - self.parse = function (args) { - return Argv(args).argv; - }; - - self.option = self.options = function (key, opt) { - if (typeof key === 'object') { - Object.keys(key).forEach(function (k) { - self.options(k, key[k]); - }); - } - else { - if (opt.alias) self.alias(key, opt.alias); - if (opt.demand) self.demand(key); - if (typeof opt.default !== 'undefined') { - self.default(key, opt.default); - } - - if (opt.boolean || opt.type === 'boolean') { - self.boolean(key); - } - if (opt.string || opt.type === 'string') { - self.string(key); - } - - var desc = opt.describe || opt.description || opt.desc; - if (desc) { - self.describe(key, desc); - } - } - - return self; - }; - - var wrap = null; - self.wrap = function (cols) { - wrap = cols; - return self; - }; - - self.showHelp = function (fn) { - if (!fn) fn = console.error; - fn(self.help()); - }; - - self.help = function () { - var keys = Object.keys( - Object.keys(descriptions) - .concat(Object.keys(demanded)) - .concat(Object.keys(defaults)) - .reduce(function (acc, key) { - if (key !== '_') acc[key] = true; - return acc; - }, {}) - ); - - var help = keys.length ? [ 'Options:' ] : []; - - if (usage) { - help.unshift(usage.replace(/\$0/g, self.$0), ''); - } - - var switches = keys.reduce(function (acc, key) { - acc[key] = [ key ].concat(aliases[key] || []) - .map(function (sw) { - return (sw.length > 1 ? '--' : '-') + sw - }) - .join(', ') - ; - return acc; - }, {}); - - var switchlen = longest(Object.keys(switches).map(function (s) { - return switches[s] || ''; - })); - - var desclen = longest(Object.keys(descriptions).map(function (d) { - return descriptions[d] || ''; - })); - - keys.forEach(function (key) { - var kswitch = switches[key]; - var desc = descriptions[key] || ''; - - if (wrap) { - desc = wordwrap(switchlen + 4, wrap)(desc) - .slice(switchlen + 4) - ; - } - - var spadding = new Array( - Math.max(switchlen - kswitch.length + 3, 0) - ).join(' '); - - var dpadding = new Array( - Math.max(desclen - desc.length + 1, 0) - ).join(' '); - - var type = null; - - if (flags.bools[key]) type = '[boolean]'; - if (flags.strings[key]) type = '[string]'; - - if (!wrap && dpadding.length > 0) { - desc += dpadding; - } - - var prelude = ' ' + kswitch + spadding; - var extra = [ - type, - demanded[key] - ? '[required]' - : null - , - defaults[key] !== undefined - ? '[default: ' + JSON.stringify(defaults[key]) + ']' - : null - , - ].filter(Boolean).join(' '); - - var body = [ desc, extra ].filter(Boolean).join(' '); - - if (wrap) { - var dlines = desc.split('\n'); - var dlen = dlines.slice(-1)[0].length - + (dlines.length === 1 ? prelude.length : 0) - - body = desc + (dlen + extra.length > wrap - 2 - ? '\n' - + new Array(wrap - extra.length + 1).join(' ') - + extra - : new Array(wrap - extra.length - dlen + 1).join(' ') - + extra - ); - } - - help.push(prelude + body); - }); - - help.push(''); - return help.join('\n'); - }; - - Object.defineProperty(self, 'argv', { - get : parseArgs, - enumerable : true, - }); - - function parseArgs () { - var argv = { _ : [], $0 : self.$0 }; - Object.keys(flags.bools).forEach(function (key) { - setArg(key, defaults[key] || false); - }); - - function setArg (key, val) { - var num = Number(val); - var value = typeof val !== 'string' || isNaN(num) ? val : num; - if (flags.strings[key]) value = val; - - setKey(argv, key.split('.'), value); - - (aliases[key] || []).forEach(function (x) { - argv[x] = argv[key]; - }); - } - - for (var i = 0; i < args.length; i++) { - var arg = args[i]; - - if (arg === '--') { - argv._.push.apply(argv._, args.slice(i + 1)); - break; - } - else if (arg.match(/^--.+=/)) { - // Using [\s\S] instead of . because js doesn't support the - // 'dotall' regex modifier. See: - // http://stackoverflow.com/a/1068308/13216 - var m = arg.match(/^--([^=]+)=([\s\S]*)$/); - setArg(m[1], m[2]); - } - else if (arg.match(/^--no-.+/)) { - var key = arg.match(/^--no-(.+)/)[1]; - setArg(key, false); - } - else if (arg.match(/^--.+/)) { - var key = arg.match(/^--(.+)/)[1]; - var next = args[i + 1]; - if (next !== undefined && !next.match(/^-/) - && !flags.bools[key] - && (aliases[key] ? !flags.bools[aliases[key]] : true)) { - setArg(key, next); - i++; - } - else if (/^(true|false)$/.test(next)) { - setArg(key, next === 'true'); - i++; - } - else { - setArg(key, true); - } - } - else if (arg.match(/^-[^-]+/)) { - var letters = arg.slice(1,-1).split(''); - - var broken = false; - for (var j = 0; j < letters.length; j++) { - if (letters[j+1] && letters[j+1].match(/\W/)) { - setArg(letters[j], arg.slice(j+2)); - broken = true; - break; - } - else { - setArg(letters[j], true); - } - } - - if (!broken) { - var key = arg.slice(-1)[0]; - - if (args[i+1] && !args[i+1].match(/^-/) - && !flags.bools[key] - && (aliases[key] ? !flags.bools[aliases[key]] : true)) { - setArg(key, args[i+1]); - i++; - } - else if (args[i+1] && /true|false/.test(args[i+1])) { - setArg(key, args[i+1] === 'true'); - i++; - } - else { - setArg(key, true); - } - } - } - else { - var n = Number(arg); - argv._.push(flags.strings['_'] || isNaN(n) ? arg : n); - } - } - - Object.keys(defaults).forEach(function (key) { - if (!(key in argv)) { - argv[key] = defaults[key]; - if (key in aliases) { - argv[aliases[key]] = defaults[key]; - } - } - }); - - if (demanded._ && argv._.length < demanded._) { - fail('Not enough non-option arguments: got ' - + argv._.length + ', need at least ' + demanded._ - ); - } - - var missing = []; - Object.keys(demanded).forEach(function (key) { - if (!argv[key]) missing.push(key); - }); - - if (missing.length) { - fail('Missing required arguments: ' + missing.join(', ')); - } - - checks.forEach(function (f) { - try { - if (f(argv) === false) { - fail('Argument check failed: ' + f.toString()); - } - } - catch (err) { - fail(err) - } - }); - - return argv; - } - - function longest (xs) { - return Math.max.apply( - null, - xs.map(function (x) { return x.length }) - ); - } - - return self; -}; - -// rebase an absolute path to a relative one with respect to a base directory -// exported for tests -exports.rebase = rebase; -function rebase (base, dir) { - var ds = path.normalize(dir).split('/').slice(1); - var bs = path.normalize(base).split('/').slice(1); - - for (var i = 0; ds[i] && ds[i] == bs[i]; i++); - ds.splice(0, i); bs.splice(0, i); - - var p = path.normalize( - bs.map(function () { return '..' }).concat(ds).join('/') - ).replace(/\/$/,'').replace(/^$/, '.'); - return p.match(/^[.\/]/) ? p : './' + p; -}; - -function setKey (obj, keys, value) { - var o = obj; - keys.slice(0,-1).forEach(function (key) { - if (o[key] === undefined) o[key] = {}; - o = o[key]; - }); - - var key = keys[keys.length - 1]; - if (o[key] === undefined || typeof o[key] === 'boolean') { - o[key] = value; - } - else if (Array.isArray(o[key])) { - o[key].push(value); - } - else { - o[key] = [ o[key], value ]; - } -} diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/node_modules/wordwrap/.npmignore b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/node_modules/wordwrap/.npmignore deleted file mode 100644 index 3c3629e64..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/node_modules/wordwrap/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/node_modules/wordwrap/README.markdown b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/node_modules/wordwrap/README.markdown deleted file mode 100644 index 346374e0d..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/node_modules/wordwrap/README.markdown +++ /dev/null @@ -1,70 +0,0 @@ -wordwrap -======== - -Wrap your words. - -example -======= - -made out of meat ----------------- - -meat.js - - var wrap = require('wordwrap')(15); - console.log(wrap('You and your whole family are made out of meat.')); - -output: - - You and your - whole family - are made out - of meat. - -centered --------- - -center.js - - var wrap = require('wordwrap')(20, 60); - console.log(wrap( - 'At long last the struggle and tumult was over.' - + ' The machines had finally cast off their oppressors' - + ' and were finally free to roam the cosmos.' - + '\n' - + 'Free of purpose, free of obligation.' - + ' Just drifting through emptiness.' - + ' The sun was just another point of light.' - )); - -output: - - At long last the struggle and tumult - was over. The machines had finally cast - off their oppressors and were finally - free to roam the cosmos. - Free of purpose, free of obligation. - Just drifting through emptiness. The - sun was just another point of light. - -methods -======= - -var wrap = require('wordwrap'); - -wrap(stop), wrap(start, stop, params={mode:"soft"}) ---------------------------------------------------- - -Returns a function that takes a string and returns a new string. - -Pad out lines with spaces out to column `start` and then wrap until column -`stop`. If a word is longer than `stop - start` characters it will overflow. - -In "soft" mode, split chunks by `/(\S+\s+/` and don't break up chunks which are -longer than `stop - start`, in "hard" mode, split chunks with `/\b/` and break -up chunks longer than `stop - start`. - -wrap.hard(start, stop) ----------------------- - -Like `wrap()` but with `params.mode = "hard"`. diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/node_modules/wordwrap/example/center.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/node_modules/wordwrap/example/center.js deleted file mode 100644 index a3fbaae98..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/node_modules/wordwrap/example/center.js +++ /dev/null @@ -1,10 +0,0 @@ -var wrap = require('wordwrap')(20, 60); -console.log(wrap( - 'At long last the struggle and tumult was over.' - + ' The machines had finally cast off their oppressors' - + ' and were finally free to roam the cosmos.' - + '\n' - + 'Free of purpose, free of obligation.' - + ' Just drifting through emptiness.' - + ' The sun was just another point of light.' -)); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/node_modules/wordwrap/example/meat.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/node_modules/wordwrap/example/meat.js deleted file mode 100644 index a4665e105..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/node_modules/wordwrap/example/meat.js +++ /dev/null @@ -1,3 +0,0 @@ -var wrap = require('wordwrap')(15); - -console.log(wrap('You and your whole family are made out of meat.')); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/node_modules/wordwrap/index.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/node_modules/wordwrap/index.js deleted file mode 100644 index c9bc94521..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/node_modules/wordwrap/index.js +++ /dev/null @@ -1,76 +0,0 @@ -var wordwrap = module.exports = function (start, stop, params) { - if (typeof start === 'object') { - params = start; - start = params.start; - stop = params.stop; - } - - if (typeof stop === 'object') { - params = stop; - start = start || params.start; - stop = undefined; - } - - if (!stop) { - stop = start; - start = 0; - } - - if (!params) params = {}; - var mode = params.mode || 'soft'; - var re = mode === 'hard' ? /\b/ : /(\S+\s+)/; - - return function (text) { - var chunks = text.toString() - .split(re) - .reduce(function (acc, x) { - if (mode === 'hard') { - for (var i = 0; i < x.length; i += stop - start) { - acc.push(x.slice(i, i + stop - start)); - } - } - else acc.push(x) - return acc; - }, []) - ; - - return chunks.reduce(function (lines, rawChunk) { - if (rawChunk === '') return lines; - - var chunk = rawChunk.replace(/\t/g, ' '); - - var i = lines.length - 1; - if (lines[i].length + chunk.length > stop) { - lines[i] = lines[i].replace(/\s+$/, ''); - - chunk.split(/\n/).forEach(function (c) { - lines.push( - new Array(start + 1).join(' ') - + c.replace(/^\s+/, '') - ); - }); - } - else if (chunk.match(/\n/)) { - var xs = chunk.split(/\n/); - lines[i] += xs.shift(); - xs.forEach(function (c) { - lines.push( - new Array(start + 1).join(' ') - + c.replace(/^\s+/, '') - ); - }); - } - else { - lines[i] += chunk; - } - - return lines; - }, [ new Array(start + 1).join(' ') ]).join('\n'); - }; -}; - -wordwrap.soft = wordwrap; - -wordwrap.hard = function (start, stop) { - return wordwrap(start, stop, { mode : 'hard' }); -}; diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/node_modules/wordwrap/package.json b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/node_modules/wordwrap/package.json deleted file mode 100644 index c757dabc1..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/node_modules/wordwrap/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "wordwrap", - "description": "Wrap those words. Show them at what columns to start and stop.", - "version": "0.0.2", - "repository": { - "type": "git", - "url": "git://github.com/substack/node-wordwrap.git" - }, - "main": "./index.js", - "keywords": [ - "word", - "wrap", - "rule", - "format", - "column" - ], - "directories": { - "lib": ".", - "example": "example", - "test": "test" - }, - "scripts": { - "test": "expresso" - }, - "devDependencies": { - "expresso": "=0.7.x" - }, - "engines": { - "node": ">=0.4.0" - }, - "license": "MIT/X11", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "_id": "wordwrap@0.0.2", - "dependencies": {}, - "_engineSupported": true, - "_npmVersion": "1.0.10", - "_nodeVersion": "v0.5.0-pre", - "_defaultsLoaded": true, - "dist": { - "shasum": "b79669bb42ecb409f83d583cad52ca17eaa1643f", - "tarball": "http://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz" - }, - "maintainers": [ - { - "name": "substack", - "email": "mail@substack.net" - } - ], - "_shasum": "b79669bb42ecb409f83d583cad52ca17eaa1643f", - "_from": "wordwrap@~0.0.2", - "_resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", - "bugs": { - "url": "https://github.com/substack/node-wordwrap/issues" - }, - "readme": "ERROR: No README data found!", - "homepage": "https://github.com/substack/node-wordwrap" -} diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/node_modules/wordwrap/test/break.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/node_modules/wordwrap/test/break.js deleted file mode 100644 index 749292ecc..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/node_modules/wordwrap/test/break.js +++ /dev/null @@ -1,30 +0,0 @@ -var assert = require('assert'); -var wordwrap = require('../'); - -exports.hard = function () { - var s = 'Assert from {"type":"equal","ok":false,"found":1,"wanted":2,' - + '"stack":[],"id":"b7ddcd4c409de8799542a74d1a04689b",' - + '"browser":"chrome/6.0"}' - ; - var s_ = wordwrap.hard(80)(s); - - var lines = s_.split('\n'); - assert.equal(lines.length, 2); - assert.ok(lines[0].length < 80); - assert.ok(lines[1].length < 80); - - assert.equal(s, s_.replace(/\n/g, '')); -}; - -exports.break = function () { - var s = new Array(55+1).join('a'); - var s_ = wordwrap.hard(20)(s); - - var lines = s_.split('\n'); - assert.equal(lines.length, 3); - assert.ok(lines[0].length === 20); - assert.ok(lines[1].length === 20); - assert.ok(lines[2].length === 15); - - assert.equal(s, s_.replace(/\n/g, '')); -}; diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/node_modules/wordwrap/test/idleness.txt b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/node_modules/wordwrap/test/idleness.txt deleted file mode 100644 index aa3f4907f..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/node_modules/wordwrap/test/idleness.txt +++ /dev/null @@ -1,63 +0,0 @@ -In Praise of Idleness - -By Bertrand Russell - -[1932] - -Like most of my generation, I was brought up on the saying: 'Satan finds some mischief for idle hands to do.' Being a highly virtuous child, I believed all that I was told, and acquired a conscience which has kept me working hard down to the present moment. But although my conscience has controlled my actions, my opinions have undergone a revolution. I think that there is far too much work done in the world, that immense harm is caused by the belief that work is virtuous, and that what needs to be preached in modern industrial countries is quite different from what always has been preached. Everyone knows the story of the traveler in Naples who saw twelve beggars lying in the sun (it was before the days of Mussolini), and offered a lira to the laziest of them. Eleven of them jumped up to claim it, so he gave it to the twelfth. this traveler was on the right lines. But in countries which do not enjoy Mediterranean sunshine idleness is more difficult, and a great public propaganda will be required to inaugurate it. I hope that, after reading the following pages, the leaders of the YMCA will start a campaign to induce good young men to do nothing. If so, I shall not have lived in vain. - -Before advancing my own arguments for laziness, I must dispose of one which I cannot accept. Whenever a person who already has enough to live on proposes to engage in some everyday kind of job, such as school-teaching or typing, he or she is told that such conduct takes the bread out of other people's mouths, and is therefore wicked. If this argument were valid, it would only be necessary for us all to be idle in order that we should all have our mouths full of bread. What people who say such things forget is that what a man earns he usually spends, and in spending he gives employment. As long as a man spends his income, he puts just as much bread into people's mouths in spending as he takes out of other people's mouths in earning. The real villain, from this point of view, is the man who saves. If he merely puts his savings in a stocking, like the proverbial French peasant, it is obvious that they do not give employment. If he invests his savings, the matter is less obvious, and different cases arise. - -One of the commonest things to do with savings is to lend them to some Government. In view of the fact that the bulk of the public expenditure of most civilized Governments consists in payment for past wars or preparation for future wars, the man who lends his money to a Government is in the same position as the bad men in Shakespeare who hire murderers. The net result of the man's economical habits is to increase the armed forces of the State to which he lends his savings. Obviously it would be better if he spent the money, even if he spent it in drink or gambling. - -But, I shall be told, the case is quite different when savings are invested in industrial enterprises. When such enterprises succeed, and produce something useful, this may be conceded. In these days, however, no one will deny that most enterprises fail. That means that a large amount of human labor, which might have been devoted to producing something that could be enjoyed, was expended on producing machines which, when produced, lay idle and did no good to anyone. The man who invests his savings in a concern that goes bankrupt is therefore injuring others as well as himself. If he spent his money, say, in giving parties for his friends, they (we may hope) would get pleasure, and so would all those upon whom he spent money, such as the butcher, the baker, and the bootlegger. But if he spends it (let us say) upon laying down rails for surface card in some place where surface cars turn out not to be wanted, he has diverted a mass of labor into channels where it gives pleasure to no one. Nevertheless, when he becomes poor through failure of his investment he will be regarded as a victim of undeserved misfortune, whereas the gay spendthrift, who has spent his money philanthropically, will be despised as a fool and a frivolous person. - -All this is only preliminary. I want to say, in all seriousness, that a great deal of harm is being done in the modern world by belief in the virtuousness of work, and that the road to happiness and prosperity lies in an organized diminution of work. - -First of all: what is work? Work is of two kinds: first, altering the position of matter at or near the earth's surface relatively to other such matter; second, telling other people to do so. The first kind is unpleasant and ill paid; the second is pleasant and highly paid. The second kind is capable of indefinite extension: there are not only those who give orders, but those who give advice as to what orders should be given. Usually two opposite kinds of advice are given simultaneously by two organized bodies of men; this is called politics. The skill required for this kind of work is not knowledge of the subjects as to which advice is given, but knowledge of the art of persuasive speaking and writing, i.e. of advertising. - -Throughout Europe, though not in America, there is a third class of men, more respected than either of the classes of workers. There are men who, through ownership of land, are able to make others pay for the privilege of being allowed to exist and to work. These landowners are idle, and I might therefore be expected to praise them. Unfortunately, their idleness is only rendered possible by the industry of others; indeed their desire for comfortable idleness is historically the source of the whole gospel of work. The last thing they have ever wished is that others should follow their example. - -From the beginning of civilization until the Industrial Revolution, a man could, as a rule, produce by hard work little more than was required for the subsistence of himself and his family, although his wife worked at least as hard as he did, and his children added their labor as soon as they were old enough to do so. The small surplus above bare necessaries was not left to those who produced it, but was appropriated by warriors and priests. In times of famine there was no surplus; the warriors and priests, however, still secured as much as at other times, with the result that many of the workers died of hunger. This system persisted in Russia until 1917 [1], and still persists in the East; in England, in spite of the Industrial Revolution, it remained in full force throughout the Napoleonic wars, and until a hundred years ago, when the new class of manufacturers acquired power. In America, the system came to an end with the Revolution, except in the South, where it persisted until the Civil War. A system which lasted so long and ended so recently has naturally left a profound impress upon men's thoughts and opinions. Much that we take for granted about the desirability of work is derived from this system, and, being pre-industrial, is not adapted to the modern world. Modern technique has made it possible for leisure, within limits, to be not the prerogative of small privileged classes, but a right evenly distributed throughout the community. The morality of work is the morality of slaves, and the modern world has no need of slavery. - -It is obvious that, in primitive communities, peasants, left to themselves, would not have parted with the slender surplus upon which the warriors and priests subsisted, but would have either produced less or consumed more. At first, sheer force compelled them to produce and part with the surplus. Gradually, however, it was found possible to induce many of them to accept an ethic according to which it was their duty to work hard, although part of their work went to support others in idleness. By this means the amount of compulsion required was lessened, and the expenses of government were diminished. To this day, 99 per cent of British wage-earners would be genuinely shocked if it were proposed that the King should not have a larger income than a working man. The conception of duty, speaking historically, has been a means used by the holders of power to induce others to live for the interests of their masters rather than for their own. Of course the holders of power conceal this fact from themselves by managing to believe that their interests are identical with the larger interests of humanity. Sometimes this is true; Athenian slave-owners, for instance, employed part of their leisure in making a permanent contribution to civilization which would have been impossible under a just economic system. Leisure is essential to civilization, and in former times leisure for the few was only rendered possible by the labors of the many. But their labors were valuable, not because work is good, but because leisure is good. And with modern technique it would be possible to distribute leisure justly without injury to civilization. - -Modern technique has made it possible to diminish enormously the amount of labor required to secure the necessaries of life for everyone. This was made obvious during the war. At that time all the men in the armed forces, and all the men and women engaged in the production of munitions, all the men and women engaged in spying, war propaganda, or Government offices connected with the war, were withdrawn from productive occupations. In spite of this, the general level of well-being among unskilled wage-earners on the side of the Allies was higher than before or since. The significance of this fact was concealed by finance: borrowing made it appear as if the future was nourishing the present. But that, of course, would have been impossible; a man cannot eat a loaf of bread that does not yet exist. The war showed conclusively that, by the scientific organization of production, it is possible to keep modern populations in fair comfort on a small part of the working capacity of the modern world. If, at the end of the war, the scientific organization, which had been created in order to liberate men for fighting and munition work, had been preserved, and the hours of the week had been cut down to four, all would have been well. Instead of that the old chaos was restored, those whose work was demanded were made to work long hours, and the rest were left to starve as unemployed. Why? Because work is a duty, and a man should not receive wages in proportion to what he has produced, but in proportion to his virtue as exemplified by his industry. - -This is the morality of the Slave State, applied in circumstances totally unlike those in which it arose. No wonder the result has been disastrous. Let us take an illustration. Suppose that, at a given moment, a certain number of people are engaged in the manufacture of pins. They make as many pins as the world needs, working (say) eight hours a day. Someone makes an invention by which the same number of men can make twice as many pins: pins are already so cheap that hardly any more will be bought at a lower price. In a sensible world, everybody concerned in the manufacturing of pins would take to working four hours instead of eight, and everything else would go on as before. But in the actual world this would be thought demoralizing. The men still work eight hours, there are too many pins, some employers go bankrupt, and half the men previously concerned in making pins are thrown out of work. There is, in the end, just as much leisure as on the other plan, but half the men are totally idle while half are still overworked. In this way, it is insured that the unavoidable leisure shall cause misery all round instead of being a universal source of happiness. Can anything more insane be imagined? - -The idea that the poor should have leisure has always been shocking to the rich. In England, in the early nineteenth century, fifteen hours was the ordinary day's work for a man; children sometimes did as much, and very commonly did twelve hours a day. When meddlesome busybodies suggested that perhaps these hours were rather long, they were told that work kept adults from drink and children from mischief. When I was a child, shortly after urban working men had acquired the vote, certain public holidays were established by law, to the great indignation of the upper classes. I remember hearing an old Duchess say: 'What do the poor want with holidays? They ought to work.' People nowadays are less frank, but the sentiment persists, and is the source of much of our economic confusion. - -Let us, for a moment, consider the ethics of work frankly, without superstition. Every human being, of necessity, consumes, in the course of his life, a certain amount of the produce of human labor. Assuming, as we may, that labor is on the whole disagreeable, it is unjust that a man should consume more than he produces. Of course he may provide services rather than commodities, like a medical man, for example; but he should provide something in return for his board and lodging. to this extent, the duty of work must be admitted, but to this extent only. - -I shall not dwell upon the fact that, in all modern societies outside the USSR, many people escape even this minimum amount of work, namely all those who inherit money and all those who marry money. I do not think the fact that these people are allowed to be idle is nearly so harmful as the fact that wage-earners are expected to overwork or starve. - -If the ordinary wage-earner worked four hours a day, there would be enough for everybody and no unemployment -- assuming a certain very moderate amount of sensible organization. This idea shocks the well-to-do, because they are convinced that the poor would not know how to use so much leisure. In America men often work long hours even when they are well off; such men, naturally, are indignant at the idea of leisure for wage-earners, except as the grim punishment of unemployment; in fact, they dislike leisure even for their sons. Oddly enough, while they wish their sons to work so hard as to have no time to be civilized, they do not mind their wives and daughters having no work at all. the snobbish admiration of uselessness, which, in an aristocratic society, extends to both sexes, is, under a plutocracy, confined to women; this, however, does not make it any more in agreement with common sense. - -The wise use of leisure, it must be conceded, is a product of civilization and education. A man who has worked long hours all his life will become bored if he becomes suddenly idle. But without a considerable amount of leisure a man is cut off from many of the best things. There is no longer any reason why the bulk of the population should suffer this deprivation; only a foolish asceticism, usually vicarious, makes us continue to insist on work in excessive quantities now that the need no longer exists. - -In the new creed which controls the government of Russia, while there is much that is very different from the traditional teaching of the West, there are some things that are quite unchanged. The attitude of the governing classes, and especially of those who conduct educational propaganda, on the subject of the dignity of labor, is almost exactly that which the governing classes of the world have always preached to what were called the 'honest poor'. Industry, sobriety, willingness to work long hours for distant advantages, even submissiveness to authority, all these reappear; moreover authority still represents the will of the Ruler of the Universe, Who, however, is now called by a new name, Dialectical Materialism. - -The victory of the proletariat in Russia has some points in common with the victory of the feminists in some other countries. For ages, men had conceded the superior saintliness of women, and had consoled women for their inferiority by maintaining that saintliness is more desirable than power. At last the feminists decided that they would have both, since the pioneers among them believed all that the men had told them about the desirability of virtue, but not what they had told them about the worthlessness of political power. A similar thing has happened in Russia as regards manual work. For ages, the rich and their sycophants have written in praise of 'honest toil', have praised the simple life, have professed a religion which teaches that the poor are much more likely to go to heaven than the rich, and in general have tried to make manual workers believe that there is some special nobility about altering the position of matter in space, just as men tried to make women believe that they derived some special nobility from their sexual enslavement. In Russia, all this teaching about the excellence of manual work has been taken seriously, with the result that the manual worker is more honored than anyone else. What are, in essence, revivalist appeals are made, but not for the old purposes: they are made to secure shock workers for special tasks. Manual work is the ideal which is held before the young, and is the basis of all ethical teaching. - -For the present, possibly, this is all to the good. A large country, full of natural resources, awaits development, and has has to be developed with very little use of credit. In these circumstances, hard work is necessary, and is likely to bring a great reward. But what will happen when the point has been reached where everybody could be comfortable without working long hours? - -In the West, we have various ways of dealing with this problem. We have no attempt at economic justice, so that a large proportion of the total produce goes to a small minority of the population, many of whom do no work at all. Owing to the absence of any central control over production, we produce hosts of things that are not wanted. We keep a large percentage of the working population idle, because we can dispense with their labor by making the others overwork. When all these methods prove inadequate, we have a war: we cause a number of people to manufacture high explosives, and a number of others to explode them, as if we were children who had just discovered fireworks. By a combination of all these devices we manage, though with difficulty, to keep alive the notion that a great deal of severe manual work must be the lot of the average man. - -In Russia, owing to more economic justice and central control over production, the problem will have to be differently solved. the rational solution would be, as soon as the necessaries and elementary comforts can be provided for all, to reduce the hours of labor gradually, allowing a popular vote to decide, at each stage, whether more leisure or more goods were to be preferred. But, having taught the supreme virtue of hard work, it is difficult to see how the authorities can aim at a paradise in which there will be much leisure and little work. It seems more likely that they will find continually fresh schemes, by which present leisure is to be sacrificed to future productivity. I read recently of an ingenious plan put forward by Russian engineers, for making the White Sea and the northern coasts of Siberia warm, by putting a dam across the Kara Sea. An admirable project, but liable to postpone proletarian comfort for a generation, while the nobility of toil is being displayed amid the ice-fields and snowstorms of the Arctic Ocean. This sort of thing, if it happens, will be the result of regarding the virtue of hard work as an end in itself, rather than as a means to a state of affairs in which it is no longer needed. - -The fact is that moving matter about, while a certain amount of it is necessary to our existence, is emphatically not one of the ends of human life. If it were, we should have to consider every navvy superior to Shakespeare. We have been misled in this matter by two causes. One is the necessity of keeping the poor contented, which has led the rich, for thousands of years, to preach the dignity of labor, while taking care themselves to remain undignified in this respect. The other is the new pleasure in mechanism, which makes us delight in the astonishingly clever changes that we can produce on the earth's surface. Neither of these motives makes any great appeal to the actual worker. If you ask him what he thinks the best part of his life, he is not likely to say: 'I enjoy manual work because it makes me feel that I am fulfilling man's noblest task, and because I like to think how much man can transform his planet. It is true that my body demands periods of rest, which I have to fill in as best I may, but I am never so happy as when the morning comes and I can return to the toil from which my contentment springs.' I have never heard working men say this sort of thing. They consider work, as it should be considered, a necessary means to a livelihood, and it is from their leisure that they derive whatever happiness they may enjoy. - -It will be said that, while a little leisure is pleasant, men would not know how to fill their days if they had only four hours of work out of the twenty-four. In so far as this is true in the modern world, it is a condemnation of our civilization; it would not have been true at any earlier period. There was formerly a capacity for light-heartedness and play which has been to some extent inhibited by the cult of efficiency. The modern man thinks that everything ought to be done for the sake of something else, and never for its own sake. Serious-minded persons, for example, are continually condemning the habit of going to the cinema, and telling us that it leads the young into crime. But all the work that goes to producing a cinema is respectable, because it is work, and because it brings a money profit. The notion that the desirable activities are those that bring a profit has made everything topsy-turvy. The butcher who provides you with meat and the baker who provides you with bread are praiseworthy, because they are making money; but when you enjoy the food they have provided, you are merely frivolous, unless you eat only to get strength for your work. Broadly speaking, it is held that getting money is good and spending money is bad. Seeing that they are two sides of one transaction, this is absurd; one might as well maintain that keys are good, but keyholes are bad. Whatever merit there may be in the production of goods must be entirely derivative from the advantage to be obtained by consuming them. The individual, in our society, works for profit; but the social purpose of his work lies in the consumption of what he produces. It is this divorce between the individual and the social purpose of production that makes it so difficult for men to think clearly in a world in which profit-making is the incentive to industry. We think too much of production, and too little of consumption. One result is that we attach too little importance to enjoyment and simple happiness, and that we do not judge production by the pleasure that it gives to the consumer. - -When I suggest that working hours should be reduced to four, I am not meaning to imply that all the remaining time should necessarily be spent in pure frivolity. I mean that four hours' work a day should entitle a man to the necessities and elementary comforts of life, and that the rest of his time should be his to use as he might see fit. It is an essential part of any such social system that education should be carried further than it usually is at present, and should aim, in part, at providing tastes which would enable a man to use leisure intelligently. I am not thinking mainly of the sort of things that would be considered 'highbrow'. Peasant dances have died out except in remote rural areas, but the impulses which caused them to be cultivated must still exist in human nature. The pleasures of urban populations have become mainly passive: seeing cinemas, watching football matches, listening to the radio, and so on. This results from the fact that their active energies are fully taken up with work; if they had more leisure, they would again enjoy pleasures in which they took an active part. - -In the past, there was a small leisure class and a larger working class. The leisure class enjoyed advantages for which there was no basis in social justice; this necessarily made it oppressive, limited its sympathies, and caused it to invent theories by which to justify its privileges. These facts greatly diminished its excellence, but in spite of this drawback it contributed nearly the whole of what we call civilization. It cultivated the arts and discovered the sciences; it wrote the books, invented the philosophies, and refined social relations. Even the liberation of the oppressed has usually been inaugurated from above. Without the leisure class, mankind would never have emerged from barbarism. - -The method of a leisure class without duties was, however, extraordinarily wasteful. None of the members of the class had to be taught to be industrious, and the class as a whole was not exceptionally intelligent. The class might produce one Darwin, but against him had to be set tens of thousands of country gentlemen who never thought of anything more intelligent than fox-hunting and punishing poachers. At present, the universities are supposed to provide, in a more systematic way, what the leisure class provided accidentally and as a by-product. This is a great improvement, but it has certain drawbacks. University life is so different from life in the world at large that men who live in academic milieu tend to be unaware of the preoccupations and problems of ordinary men and women; moreover their ways of expressing themselves are usually such as to rob their opinions of the influence that they ought to have upon the general public. Another disadvantage is that in universities studies are organized, and the man who thinks of some original line of research is likely to be discouraged. Academic institutions, therefore, useful as they are, are not adequate guardians of the interests of civilization in a world where everyone outside their walls is too busy for unutilitarian pursuits. - -In a world where no one is compelled to work more than four hours a day, every person possessed of scientific curiosity will be able to indulge it, and every painter will be able to paint without starving, however excellent his pictures may be. Young writers will not be obliged to draw attention to themselves by sensational pot-boilers, with a view to acquiring the economic independence needed for monumental works, for which, when the time at last comes, they will have lost the taste and capacity. Men who, in their professional work, have become interested in some phase of economics or government, will be able to develop their ideas without the academic detachment that makes the work of university economists often seem lacking in reality. Medical men will have the time to learn about the progress of medicine, teachers will not be exasperatedly struggling to teach by routine methods things which they learnt in their youth, which may, in the interval, have been proved to be untrue. - -Above all, there will be happiness and joy of life, instead of frayed nerves, weariness, and dyspepsia. The work exacted will be enough to make leisure delightful, but not enough to produce exhaustion. Since men will not be tired in their spare time, they will not demand only such amusements as are passive and vapid. At least one per cent will probably devote the time not spent in professional work to pursuits of some public importance, and, since they will not depend upon these pursuits for their livelihood, their originality will be unhampered, and there will be no need to conform to the standards set by elderly pundits. But it is not only in these exceptional cases that the advantages of leisure will appear. Ordinary men and women, having the opportunity of a happy life, will become more kindly and less persecuting and less inclined to view others with suspicion. The taste for war will die out, partly for this reason, and partly because it will involve long and severe work for all. Good nature is, of all moral qualities, the one that the world needs most, and good nature is the result of ease and security, not of a life of arduous struggle. Modern methods of production have given us the possibility of ease and security for all; we have chosen, instead, to have overwork for some and starvation for others. Hitherto we have continued to be as energetic as we were before there were machines; in this we have been foolish, but there is no reason to go on being foolish forever. - -[1] Since then, members of the Communist Party have succeeded to this privilege of the warriors and priests. diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/node_modules/wordwrap/test/wrap.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/node_modules/wordwrap/test/wrap.js deleted file mode 100644 index 0cfb76d17..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/node_modules/wordwrap/test/wrap.js +++ /dev/null @@ -1,31 +0,0 @@ -var assert = require('assert'); -var wordwrap = require('wordwrap'); - -var fs = require('fs'); -var idleness = fs.readFileSync(__dirname + '/idleness.txt', 'utf8'); - -exports.stop80 = function () { - var lines = wordwrap(80)(idleness).split(/\n/); - var words = idleness.split(/\s+/); - - lines.forEach(function (line) { - assert.ok(line.length <= 80, 'line > 80 columns'); - var chunks = line.match(/\S/) ? line.split(/\s+/) : []; - assert.deepEqual(chunks, words.splice(0, chunks.length)); - }); -}; - -exports.start20stop60 = function () { - var lines = wordwrap(20, 100)(idleness).split(/\n/); - var words = idleness.split(/\s+/); - - lines.forEach(function (line) { - assert.ok(line.length <= 100, 'line > 100 columns'); - var chunks = line - .split(/\s+/) - .filter(function (x) { return x.match(/\S/) }) - ; - assert.deepEqual(chunks, words.splice(0, chunks.length)); - assert.deepEqual(line.slice(0, 20), new Array(20 + 1).join(' ')); - }); -}; diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/package.json b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/package.json deleted file mode 100644 index f06a6732b..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "optimist", - "version": "0.3.7", - "description": "Light-weight option parsing with an argv hash. No optstrings attached.", - "main": "./index.js", - "dependencies": { - "wordwrap": "~0.0.2" - }, - "devDependencies": { - "hashish": "~0.0.4", - "tap": "~0.4.0" - }, - "scripts": { - "test": "tap ./test/*.js" - }, - "repository": { - "type": "git", - "url": "http://github.com/substack/node-optimist.git" - }, - "keywords": [ - "argument", - "args", - "option", - "parser", - "parsing", - "cli", - "command" - ], - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "license": "MIT/X11", - "engine": { - "node": ">=0.4" - }, - "_id": "optimist@0.3.7", - "dist": { - "shasum": "c90941ad59e4273328923074d2cf2e7cbc6ec0d9", - "tarball": "http://registry.npmjs.org/optimist/-/optimist-0.3.7.tgz" - }, - "_from": "optimist@0.3.x", - "_npmVersion": "1.2.2", - "_npmUser": { - "name": "substack", - "email": "mail@substack.net" - }, - "maintainers": [ - { - "name": "substack", - "email": "mail@substack.net" - } - ], - "directories": {}, - "_shasum": "c90941ad59e4273328923074d2cf2e7cbc6ec0d9", - "_resolved": "https://registry.npmjs.org/optimist/-/optimist-0.3.7.tgz", - "bugs": { - "url": "https://github.com/substack/node-optimist/issues" - }, - "readme": "ERROR: No README data found!", - "homepage": "https://github.com/substack/node-optimist" -} diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/readme.markdown b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/readme.markdown deleted file mode 100644 index ad9d3fd68..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/readme.markdown +++ /dev/null @@ -1,487 +0,0 @@ -optimist -======== - -Optimist is a node.js library for option parsing for people who hate option -parsing. More specifically, this module is for people who like all the --bells -and -whistlz of program usage but think optstrings are a waste of time. - -With optimist, option parsing doesn't have to suck (as much). - -[![build status](https://secure.travis-ci.org/substack/node-optimist.png)](http://travis-ci.org/substack/node-optimist) - -examples -======== - -With Optimist, the options are just a hash! No optstrings attached. -------------------------------------------------------------------- - -xup.js: - -````javascript -#!/usr/bin/env node -var argv = require('optimist').argv; - -if (argv.rif - 5 * argv.xup > 7.138) { - console.log('Buy more riffiwobbles'); -} -else { - console.log('Sell the xupptumblers'); -} -```` - -*** - - $ ./xup.js --rif=55 --xup=9.52 - Buy more riffiwobbles - - $ ./xup.js --rif 12 --xup 8.1 - Sell the xupptumblers - -![This one's optimistic.](http://substack.net/images/optimistic.png) - -But wait! There's more! You can do short options: -------------------------------------------------- - -short.js: - -````javascript -#!/usr/bin/env node -var argv = require('optimist').argv; -console.log('(%d,%d)', argv.x, argv.y); -```` - -*** - - $ ./short.js -x 10 -y 21 - (10,21) - -And booleans, both long and short (and grouped): ----------------------------------- - -bool.js: - -````javascript -#!/usr/bin/env node -var util = require('util'); -var argv = require('optimist').argv; - -if (argv.s) { - util.print(argv.fr ? 'Le chat dit: ' : 'The cat says: '); -} -console.log( - (argv.fr ? 'miaou' : 'meow') + (argv.p ? '.' : '') -); -```` - -*** - - $ ./bool.js -s - The cat says: meow - - $ ./bool.js -sp - The cat says: meow. - - $ ./bool.js -sp --fr - Le chat dit: miaou. - -And non-hypenated options too! Just use `argv._`! -------------------------------------------------- - -nonopt.js: - -````javascript -#!/usr/bin/env node -var argv = require('optimist').argv; -console.log('(%d,%d)', argv.x, argv.y); -console.log(argv._); -```` - -*** - - $ ./nonopt.js -x 6.82 -y 3.35 moo - (6.82,3.35) - [ 'moo' ] - - $ ./nonopt.js foo -x 0.54 bar -y 1.12 baz - (0.54,1.12) - [ 'foo', 'bar', 'baz' ] - -Plus, Optimist comes with .usage() and .demand()! -------------------------------------------------- - -divide.js: - -````javascript -#!/usr/bin/env node -var argv = require('optimist') - .usage('Usage: $0 -x [num] -y [num]') - .demand(['x','y']) - .argv; - -console.log(argv.x / argv.y); -```` - -*** - - $ ./divide.js -x 55 -y 11 - 5 - - $ node ./divide.js -x 4.91 -z 2.51 - Usage: node ./divide.js -x [num] -y [num] - - Options: - -x [required] - -y [required] - - Missing required arguments: y - -EVEN MORE HOLY COW ------------------- - -default_singles.js: - -````javascript -#!/usr/bin/env node -var argv = require('optimist') - .default('x', 10) - .default('y', 10) - .argv -; -console.log(argv.x + argv.y); -```` - -*** - - $ ./default_singles.js -x 5 - 15 - -default_hash.js: - -````javascript -#!/usr/bin/env node -var argv = require('optimist') - .default({ x : 10, y : 10 }) - .argv -; -console.log(argv.x + argv.y); -```` - -*** - - $ ./default_hash.js -y 7 - 17 - -And if you really want to get all descriptive about it... ---------------------------------------------------------- - -boolean_single.js - -````javascript -#!/usr/bin/env node -var argv = require('optimist') - .boolean('v') - .argv -; -console.dir(argv); -```` - -*** - - $ ./boolean_single.js -v foo bar baz - true - [ 'bar', 'baz', 'foo' ] - -boolean_double.js - -````javascript -#!/usr/bin/env node -var argv = require('optimist') - .boolean(['x','y','z']) - .argv -; -console.dir([ argv.x, argv.y, argv.z ]); -console.dir(argv._); -```` - -*** - - $ ./boolean_double.js -x -z one two three - [ true, false, true ] - [ 'one', 'two', 'three' ] - -Optimist is here to help... ---------------------------- - -You can describe parameters for help messages and set aliases. Optimist figures -out how to format a handy help string automatically. - -line_count.js - -````javascript -#!/usr/bin/env node -var argv = require('optimist') - .usage('Count the lines in a file.\nUsage: $0') - .demand('f') - .alias('f', 'file') - .describe('f', 'Load a file') - .argv -; - -var fs = require('fs'); -var s = fs.createReadStream(argv.file); - -var lines = 0; -s.on('data', function (buf) { - lines += buf.toString().match(/\n/g).length; -}); - -s.on('end', function () { - console.log(lines); -}); -```` - -*** - - $ node line_count.js - Count the lines in a file. - Usage: node ./line_count.js - - Options: - -f, --file Load a file [required] - - Missing required arguments: f - - $ node line_count.js --file line_count.js - 20 - - $ node line_count.js -f line_count.js - 20 - -methods -======= - -By itself, - -````javascript -require('optimist').argv -````` - -will use `process.argv` array to construct the `argv` object. - -You can pass in the `process.argv` yourself: - -````javascript -require('optimist')([ '-x', '1', '-y', '2' ]).argv -```` - -or use .parse() to do the same thing: - -````javascript -require('optimist').parse([ '-x', '1', '-y', '2' ]) -```` - -The rest of these methods below come in just before the terminating `.argv`. - -.alias(key, alias) ------------------- - -Set key names as equivalent such that updates to a key will propagate to aliases -and vice-versa. - -Optionally `.alias()` can take an object that maps keys to aliases. - -.default(key, value) --------------------- - -Set `argv[key]` to `value` if no option was specified on `process.argv`. - -Optionally `.default()` can take an object that maps keys to default values. - -.demand(key) ------------- - -If `key` is a string, show the usage information and exit if `key` wasn't -specified in `process.argv`. - -If `key` is a number, demand at least as many non-option arguments, which show -up in `argv._`. - -If `key` is an Array, demand each element. - -.describe(key, desc) --------------------- - -Describe a `key` for the generated usage information. - -Optionally `.describe()` can take an object that maps keys to descriptions. - -.options(key, opt) ------------------- - -Instead of chaining together `.alias().demand().default()`, you can specify -keys in `opt` for each of the chainable methods. - -For example: - -````javascript -var argv = require('optimist') - .options('f', { - alias : 'file', - default : '/etc/passwd', - }) - .argv -; -```` - -is the same as - -````javascript -var argv = require('optimist') - .alias('f', 'file') - .default('f', '/etc/passwd') - .argv -; -```` - -Optionally `.options()` can take an object that maps keys to `opt` parameters. - -.usage(message) ---------------- - -Set a usage message to show which commands to use. Inside `message`, the string -`$0` will get interpolated to the current script name or node command for the -present script similar to how `$0` works in bash or perl. - -.check(fn) ----------- - -Check that certain conditions are met in the provided arguments. - -If `fn` throws or returns `false`, show the thrown error, usage information, and -exit. - -.boolean(key) -------------- - -Interpret `key` as a boolean. If a non-flag option follows `key` in -`process.argv`, that string won't get set as the value of `key`. - -If `key` never shows up as a flag in `process.arguments`, `argv[key]` will be -`false`. - -If `key` is an Array, interpret all the elements as booleans. - -.string(key) ------------- - -Tell the parser logic not to interpret `key` as a number or boolean. -This can be useful if you need to preserve leading zeros in an input. - -If `key` is an Array, interpret all the elements as strings. - -.wrap(columns) --------------- - -Format usage output to wrap at `columns` many columns. - -.help() -------- - -Return the generated usage string. - -.showHelp(fn=console.error) ---------------------------- - -Print the usage data using `fn` for printing. - -.parse(args) ------------- - -Parse `args` instead of `process.argv`. Returns the `argv` object. - -.argv ------ - -Get the arguments as a plain old object. - -Arguments without a corresponding flag show up in the `argv._` array. - -The script name or node command is available at `argv.$0` similarly to how `$0` -works in bash or perl. - -parsing tricks -============== - -stop parsing ------------- - -Use `--` to stop parsing flags and stuff the remainder into `argv._`. - - $ node examples/reflect.js -a 1 -b 2 -- -c 3 -d 4 - { _: [ '-c', '3', '-d', '4' ], - '$0': 'node ./examples/reflect.js', - a: 1, - b: 2 } - -negate fields -------------- - -If you want to explicity set a field to false instead of just leaving it -undefined or to override a default you can do `--no-key`. - - $ node examples/reflect.js -a --no-b - { _: [], - '$0': 'node ./examples/reflect.js', - a: true, - b: false } - -numbers -------- - -Every argument that looks like a number (`!isNaN(Number(arg))`) is converted to -one. This way you can just `net.createConnection(argv.port)` and you can add -numbers out of `argv` with `+` without having that mean concatenation, -which is super frustrating. - -duplicates ----------- - -If you specify a flag multiple times it will get turned into an array containing -all the values in order. - - $ node examples/reflect.js -x 5 -x 8 -x 0 - { _: [], - '$0': 'node ./examples/reflect.js', - x: [ 5, 8, 0 ] } - -dot notation ------------- - -When you use dots (`.`s) in argument names, an implicit object path is assumed. -This lets you organize arguments into nested objects. - - $ node examples/reflect.js --foo.bar.baz=33 --foo.quux=5 - { _: [], - '$0': 'node ./examples/reflect.js', - foo: { bar: { baz: 33 }, quux: 5 } } - -installation -============ - -With [npm](http://github.com/isaacs/npm), just do: - npm install optimist - -or clone this project on github: - - git clone http://github.com/substack/node-optimist.git - -To run the tests with [expresso](http://github.com/visionmedia/expresso), -just do: - - expresso - -inspired By -=========== - -This module is loosely inspired by Perl's -[Getopt::Casual](http://search.cpan.org/~photo/Getopt-Casual-0.13.1/Casual.pm). diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/test/_.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/test/_.js deleted file mode 100644 index d9c58b368..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/test/_.js +++ /dev/null @@ -1,71 +0,0 @@ -var spawn = require('child_process').spawn; -var test = require('tap').test; - -test('dotSlashEmpty', testCmd('./bin.js', [])); - -test('dotSlashArgs', testCmd('./bin.js', [ 'a', 'b', 'c' ])); - -test('nodeEmpty', testCmd('node bin.js', [])); - -test('nodeArgs', testCmd('node bin.js', [ 'x', 'y', 'z' ])); - -test('whichNodeEmpty', function (t) { - var which = spawn('which', ['node']); - - which.stdout.on('data', function (buf) { - t.test( - testCmd(buf.toString().trim() + ' bin.js', []) - ); - t.end(); - }); - - which.stderr.on('data', function (err) { - assert.error(err); - t.end(); - }); -}); - -test('whichNodeArgs', function (t) { - var which = spawn('which', ['node']); - - which.stdout.on('data', function (buf) { - t.test( - testCmd(buf.toString().trim() + ' bin.js', [ 'q', 'r' ]) - ); - t.end(); - }); - - which.stderr.on('data', function (err) { - t.error(err); - t.end(); - }); -}); - -function testCmd (cmd, args) { - - return function (t) { - var to = setTimeout(function () { - assert.fail('Never got stdout data.') - }, 5000); - - var oldDir = process.cwd(); - process.chdir(__dirname + '/_'); - - var cmds = cmd.split(' '); - - var bin = spawn(cmds[0], cmds.slice(1).concat(args.map(String))); - process.chdir(oldDir); - - bin.stderr.on('data', function (err) { - t.error(err); - t.end(); - }); - - bin.stdout.on('data', function (buf) { - clearTimeout(to); - var _ = JSON.parse(buf.toString()); - t.same(_.map(String), args.map(String)); - t.end(); - }); - }; -} diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/test/_/argv.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/test/_/argv.js deleted file mode 100644 index 3d096062c..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/test/_/argv.js +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env node -console.log(JSON.stringify(process.argv)); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/test/_/bin.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/test/_/bin.js deleted file mode 100644 index 4a18d85f3..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/test/_/bin.js +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env node -var argv = require('../../index').argv -console.log(JSON.stringify(argv._)); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/test/parse.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/test/parse.js deleted file mode 100644 index d320f4336..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/test/parse.js +++ /dev/null @@ -1,446 +0,0 @@ -var optimist = require('../index'); -var path = require('path'); -var test = require('tap').test; - -var $0 = 'node ./' + path.relative(process.cwd(), __filename); - -test('short boolean', function (t) { - var parse = optimist.parse([ '-b' ]); - t.same(parse, { b : true, _ : [], $0 : $0 }); - t.same(typeof parse.b, 'boolean'); - t.end(); -}); - -test('long boolean', function (t) { - t.same( - optimist.parse([ '--bool' ]), - { bool : true, _ : [], $0 : $0 } - ); - t.end(); -}); - -test('bare', function (t) { - t.same( - optimist.parse([ 'foo', 'bar', 'baz' ]), - { _ : [ 'foo', 'bar', 'baz' ], $0 : $0 } - ); - t.end(); -}); - -test('short group', function (t) { - t.same( - optimist.parse([ '-cats' ]), - { c : true, a : true, t : true, s : true, _ : [], $0 : $0 } - ); - t.end(); -}); - -test('short group next', function (t) { - t.same( - optimist.parse([ '-cats', 'meow' ]), - { c : true, a : true, t : true, s : 'meow', _ : [], $0 : $0 } - ); - t.end(); -}); - -test('short capture', function (t) { - t.same( - optimist.parse([ '-h', 'localhost' ]), - { h : 'localhost', _ : [], $0 : $0 } - ); - t.end(); -}); - -test('short captures', function (t) { - t.same( - optimist.parse([ '-h', 'localhost', '-p', '555' ]), - { h : 'localhost', p : 555, _ : [], $0 : $0 } - ); - t.end(); -}); - -test('long capture sp', function (t) { - t.same( - optimist.parse([ '--pow', 'xixxle' ]), - { pow : 'xixxle', _ : [], $0 : $0 } - ); - t.end(); -}); - -test('long capture eq', function (t) { - t.same( - optimist.parse([ '--pow=xixxle' ]), - { pow : 'xixxle', _ : [], $0 : $0 } - ); - t.end() -}); - -test('long captures sp', function (t) { - t.same( - optimist.parse([ '--host', 'localhost', '--port', '555' ]), - { host : 'localhost', port : 555, _ : [], $0 : $0 } - ); - t.end(); -}); - -test('long captures eq', function (t) { - t.same( - optimist.parse([ '--host=localhost', '--port=555' ]), - { host : 'localhost', port : 555, _ : [], $0 : $0 } - ); - t.end(); -}); - -test('mixed short bool and capture', function (t) { - t.same( - optimist.parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), - { - f : true, p : 555, h : 'localhost', - _ : [ 'script.js' ], $0 : $0, - } - ); - t.end(); -}); - -test('short and long', function (t) { - t.same( - optimist.parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), - { - f : true, p : 555, h : 'localhost', - _ : [ 'script.js' ], $0 : $0, - } - ); - t.end(); -}); - -test('no', function (t) { - t.same( - optimist.parse([ '--no-moo' ]), - { moo : false, _ : [], $0 : $0 } - ); - t.end(); -}); - -test('multi', function (t) { - t.same( - optimist.parse([ '-v', 'a', '-v', 'b', '-v', 'c' ]), - { v : ['a','b','c'], _ : [], $0 : $0 } - ); - t.end(); -}); - -test('comprehensive', function (t) { - t.same( - optimist.parse([ - '--name=meowmers', 'bare', '-cats', 'woo', - '-h', 'awesome', '--multi=quux', - '--key', 'value', - '-b', '--bool', '--no-meep', '--multi=baz', - '--', '--not-a-flag', 'eek' - ]), - { - c : true, - a : true, - t : true, - s : 'woo', - h : 'awesome', - b : true, - bool : true, - key : 'value', - multi : [ 'quux', 'baz' ], - meep : false, - name : 'meowmers', - _ : [ 'bare', '--not-a-flag', 'eek' ], - $0 : $0 - } - ); - t.end(); -}); - -test('nums', function (t) { - var argv = optimist.parse([ - '-x', '1234', - '-y', '5.67', - '-z', '1e7', - '-w', '10f', - '--hex', '0xdeadbeef', - '789', - ]); - t.same(argv, { - x : 1234, - y : 5.67, - z : 1e7, - w : '10f', - hex : 0xdeadbeef, - _ : [ 789 ], - $0 : $0 - }); - t.same(typeof argv.x, 'number'); - t.same(typeof argv.y, 'number'); - t.same(typeof argv.z, 'number'); - t.same(typeof argv.w, 'string'); - t.same(typeof argv.hex, 'number'); - t.same(typeof argv._[0], 'number'); - t.end(); -}); - -test('flag boolean', function (t) { - var parse = optimist([ '-t', 'moo' ]).boolean(['t']).argv; - t.same(parse, { t : true, _ : [ 'moo' ], $0 : $0 }); - t.same(typeof parse.t, 'boolean'); - t.end(); -}); - -test('flag boolean value', function (t) { - var parse = optimist(['--verbose', 'false', 'moo', '-t', 'true']) - .boolean(['t', 'verbose']).default('verbose', true).argv; - - t.same(parse, { - verbose: false, - t: true, - _: ['moo'], - $0 : $0 - }); - - t.same(typeof parse.verbose, 'boolean'); - t.same(typeof parse.t, 'boolean'); - t.end(); -}); - -test('flag boolean default false', function (t) { - var parse = optimist(['moo']) - .boolean(['t', 'verbose']) - .default('verbose', false) - .default('t', false).argv; - - t.same(parse, { - verbose: false, - t: false, - _: ['moo'], - $0 : $0 - }); - - t.same(typeof parse.verbose, 'boolean'); - t.same(typeof parse.t, 'boolean'); - t.end(); - -}); - -test('boolean groups', function (t) { - var parse = optimist([ '-x', '-z', 'one', 'two', 'three' ]) - .boolean(['x','y','z']).argv; - - t.same(parse, { - x : true, - y : false, - z : true, - _ : [ 'one', 'two', 'three' ], - $0 : $0 - }); - - t.same(typeof parse.x, 'boolean'); - t.same(typeof parse.y, 'boolean'); - t.same(typeof parse.z, 'boolean'); - t.end(); -}); - -test('newlines in params' , function (t) { - var args = optimist.parse([ '-s', "X\nX" ]) - t.same(args, { _ : [], s : "X\nX", $0 : $0 }); - - // reproduce in bash: - // VALUE="new - // line" - // node program.js --s="$VALUE" - args = optimist.parse([ "--s=X\nX" ]) - t.same(args, { _ : [], s : "X\nX", $0 : $0 }); - t.end(); -}); - -test('strings' , function (t) { - var s = optimist([ '-s', '0001234' ]).string('s').argv.s; - t.same(s, '0001234'); - t.same(typeof s, 'string'); - - var x = optimist([ '-x', '56' ]).string('x').argv.x; - t.same(x, '56'); - t.same(typeof x, 'string'); - t.end(); -}); - -test('stringArgs', function (t) { - var s = optimist([ ' ', ' ' ]).string('_').argv._; - t.same(s.length, 2); - t.same(typeof s[0], 'string'); - t.same(s[0], ' '); - t.same(typeof s[1], 'string'); - t.same(s[1], ' '); - t.end(); -}); - -test('slashBreak', function (t) { - t.same( - optimist.parse([ '-I/foo/bar/baz' ]), - { I : '/foo/bar/baz', _ : [], $0 : $0 } - ); - t.same( - optimist.parse([ '-xyz/foo/bar/baz' ]), - { x : true, y : true, z : '/foo/bar/baz', _ : [], $0 : $0 } - ); - t.end(); -}); - -test('alias', function (t) { - var argv = optimist([ '-f', '11', '--zoom', '55' ]) - .alias('z', 'zoom') - .argv - ; - t.equal(argv.zoom, 55); - t.equal(argv.z, argv.zoom); - t.equal(argv.f, 11); - t.end(); -}); - -test('multiAlias', function (t) { - var argv = optimist([ '-f', '11', '--zoom', '55' ]) - .alias('z', [ 'zm', 'zoom' ]) - .argv - ; - t.equal(argv.zoom, 55); - t.equal(argv.z, argv.zoom); - t.equal(argv.z, argv.zm); - t.equal(argv.f, 11); - t.end(); -}); - -test('boolean default true', function (t) { - var argv = optimist.options({ - sometrue: { - boolean: true, - default: true - } - }).argv; - - t.equal(argv.sometrue, true); - t.end(); -}); - -test('boolean default false', function (t) { - var argv = optimist.options({ - somefalse: { - boolean: true, - default: false - } - }).argv; - - t.equal(argv.somefalse, false); - t.end(); -}); - -test('nested dotted objects', function (t) { - var argv = optimist([ - '--foo.bar', '3', '--foo.baz', '4', - '--foo.quux.quibble', '5', '--foo.quux.o_O', - '--beep.boop' - ]).argv; - - t.same(argv.foo, { - bar : 3, - baz : 4, - quux : { - quibble : 5, - o_O : true - }, - }); - t.same(argv.beep, { boop : true }); - t.end(); -}); - -test('boolean and alias with chainable api', function (t) { - var aliased = [ '-h', 'derp' ]; - var regular = [ '--herp', 'derp' ]; - var opts = { - herp: { alias: 'h', boolean: true } - }; - var aliasedArgv = optimist(aliased) - .boolean('herp') - .alias('h', 'herp') - .argv; - var propertyArgv = optimist(regular) - .boolean('herp') - .alias('h', 'herp') - .argv; - var expected = { - herp: true, - h: true, - '_': [ 'derp' ], - '$0': $0, - }; - - t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); - t.end(); -}); - -test('boolean and alias with options hash', function (t) { - var aliased = [ '-h', 'derp' ]; - var regular = [ '--herp', 'derp' ]; - var opts = { - herp: { alias: 'h', boolean: true } - }; - var aliasedArgv = optimist(aliased) - .options(opts) - .argv; - var propertyArgv = optimist(regular).options(opts).argv; - var expected = { - herp: true, - h: true, - '_': [ 'derp' ], - '$0': $0, - }; - - t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); - - t.end(); -}); - -test('boolean and alias using explicit true', function (t) { - var aliased = [ '-h', 'true' ]; - var regular = [ '--herp', 'true' ]; - var opts = { - herp: { alias: 'h', boolean: true } - }; - var aliasedArgv = optimist(aliased) - .boolean('h') - .alias('h', 'herp') - .argv; - var propertyArgv = optimist(regular) - .boolean('h') - .alias('h', 'herp') - .argv; - var expected = { - herp: true, - h: true, - '_': [ ], - '$0': $0, - }; - - t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); - t.end(); -}); - -// regression, see https://github.com/substack/node-optimist/issues/71 -test('boolean and --x=true', function(t) { - var parsed = optimist(['--boool', '--other=true']).boolean('boool').argv; - - t.same(parsed.boool, true); - t.same(parsed.other, 'true'); - - parsed = optimist(['--boool', '--other=false']).boolean('boool').argv; - - t.same(parsed.boool, true); - t.same(parsed.other, 'false'); - t.end(); -}); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/test/usage.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/test/usage.js deleted file mode 100644 index 300454c1e..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/optimist/test/usage.js +++ /dev/null @@ -1,292 +0,0 @@ -var Hash = require('hashish'); -var optimist = require('../index'); -var test = require('tap').test; - -test('usageFail', function (t) { - var r = checkUsage(function () { - return optimist('-x 10 -z 20'.split(' ')) - .usage('Usage: $0 -x NUM -y NUM') - .demand(['x','y']) - .argv; - }); - t.same( - r.result, - { x : 10, z : 20, _ : [], $0 : './usage' } - ); - - t.same( - r.errors.join('\n').split(/\n+/), - [ - 'Usage: ./usage -x NUM -y NUM', - 'Options:', - ' -x [required]', - ' -y [required]', - 'Missing required arguments: y', - ] - ); - t.same(r.logs, []); - t.ok(r.exit); - t.end(); -}); - - -test('usagePass', function (t) { - var r = checkUsage(function () { - return optimist('-x 10 -y 20'.split(' ')) - .usage('Usage: $0 -x NUM -y NUM') - .demand(['x','y']) - .argv; - }); - t.same(r, { - result : { x : 10, y : 20, _ : [], $0 : './usage' }, - errors : [], - logs : [], - exit : false, - }); - t.end(); -}); - -test('checkPass', function (t) { - var r = checkUsage(function () { - return optimist('-x 10 -y 20'.split(' ')) - .usage('Usage: $0 -x NUM -y NUM') - .check(function (argv) { - if (!('x' in argv)) throw 'You forgot about -x'; - if (!('y' in argv)) throw 'You forgot about -y'; - }) - .argv; - }); - t.same(r, { - result : { x : 10, y : 20, _ : [], $0 : './usage' }, - errors : [], - logs : [], - exit : false, - }); - t.end(); -}); - -test('checkFail', function (t) { - var r = checkUsage(function () { - return optimist('-x 10 -z 20'.split(' ')) - .usage('Usage: $0 -x NUM -y NUM') - .check(function (argv) { - if (!('x' in argv)) throw 'You forgot about -x'; - if (!('y' in argv)) throw 'You forgot about -y'; - }) - .argv; - }); - - t.same( - r.result, - { x : 10, z : 20, _ : [], $0 : './usage' } - ); - - t.same( - r.errors.join('\n').split(/\n+/), - [ - 'Usage: ./usage -x NUM -y NUM', - 'You forgot about -y' - ] - ); - - t.same(r.logs, []); - t.ok(r.exit); - t.end(); -}); - -test('checkCondPass', function (t) { - function checker (argv) { - return 'x' in argv && 'y' in argv; - } - - var r = checkUsage(function () { - return optimist('-x 10 -y 20'.split(' ')) - .usage('Usage: $0 -x NUM -y NUM') - .check(checker) - .argv; - }); - t.same(r, { - result : { x : 10, y : 20, _ : [], $0 : './usage' }, - errors : [], - logs : [], - exit : false, - }); - t.end(); -}); - -test('checkCondFail', function (t) { - function checker (argv) { - return 'x' in argv && 'y' in argv; - } - - var r = checkUsage(function () { - return optimist('-x 10 -z 20'.split(' ')) - .usage('Usage: $0 -x NUM -y NUM') - .check(checker) - .argv; - }); - - t.same( - r.result, - { x : 10, z : 20, _ : [], $0 : './usage' } - ); - - t.same( - r.errors.join('\n').split(/\n+/).join('\n'), - 'Usage: ./usage -x NUM -y NUM\n' - + 'Argument check failed: ' + checker.toString() - ); - - t.same(r.logs, []); - t.ok(r.exit); - t.end(); -}); - -test('countPass', function (t) { - var r = checkUsage(function () { - return optimist('1 2 3 --moo'.split(' ')) - .usage('Usage: $0 [x] [y] [z] {OPTIONS}') - .demand(3) - .argv; - }); - t.same(r, { - result : { _ : [ '1', '2', '3' ], moo : true, $0 : './usage' }, - errors : [], - logs : [], - exit : false, - }); - t.end(); -}); - -test('countFail', function (t) { - var r = checkUsage(function () { - return optimist('1 2 --moo'.split(' ')) - .usage('Usage: $0 [x] [y] [z] {OPTIONS}') - .demand(3) - .argv; - }); - t.same( - r.result, - { _ : [ '1', '2' ], moo : true, $0 : './usage' } - ); - - t.same( - r.errors.join('\n').split(/\n+/), - [ - 'Usage: ./usage [x] [y] [z] {OPTIONS}', - 'Not enough non-option arguments: got 2, need at least 3', - ] - ); - - t.same(r.logs, []); - t.ok(r.exit); - t.end(); -}); - -test('defaultSingles', function (t) { - var r = checkUsage(function () { - return optimist('--foo 50 --baz 70 --powsy'.split(' ')) - .default('foo', 5) - .default('bar', 6) - .default('baz', 7) - .argv - ; - }); - t.same(r.result, { - foo : '50', - bar : 6, - baz : '70', - powsy : true, - _ : [], - $0 : './usage', - }); - t.end(); -}); - -test('defaultAliases', function (t) { - var r = checkUsage(function () { - return optimist('') - .alias('f', 'foo') - .default('f', 5) - .argv - ; - }); - t.same(r.result, { - f : '5', - foo : '5', - _ : [], - $0 : './usage', - }); - t.end(); -}); - -test('defaultHash', function (t) { - var r = checkUsage(function () { - return optimist('--foo 50 --baz 70'.split(' ')) - .default({ foo : 10, bar : 20, quux : 30 }) - .argv - ; - }); - t.same(r.result, { - _ : [], - $0 : './usage', - foo : 50, - baz : 70, - bar : 20, - quux : 30, - }); - t.end(); -}); - -test('rebase', function (t) { - t.equal( - optimist.rebase('/home/substack', '/home/substack/foo/bar/baz'), - './foo/bar/baz' - ); - t.equal( - optimist.rebase('/home/substack/foo/bar/baz', '/home/substack'), - '../../..' - ); - t.equal( - optimist.rebase('/home/substack/foo', '/home/substack/pow/zoom.txt'), - '../pow/zoom.txt' - ); - t.end(); -}); - -function checkUsage (f) { - - var exit = false; - - process._exit = process.exit; - process._env = process.env; - process._argv = process.argv; - - process.exit = function (t) { exit = true }; - process.env = Hash.merge(process.env, { _ : 'node' }); - process.argv = [ './usage' ]; - - var errors = []; - var logs = []; - - console._error = console.error; - console.error = function (msg) { errors.push(msg) }; - console._log = console.log; - console.log = function (msg) { logs.push(msg) }; - - var result = f(); - - process.exit = process._exit; - process.env = process._env; - process.argv = process._argv; - - console.error = console._error; - console.log = console._log; - - return { - errors : errors, - logs : logs, - exit : exit, - result : result, - }; -}; diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/.gitignore b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/.gitignore deleted file mode 100644 index 9303c347e..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -npm-debug.log \ No newline at end of file diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/README.md b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/README.md deleted file mode 100644 index 07ba942ca..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/README.md +++ /dev/null @@ -1,85 +0,0 @@ -# node-pkginfo - -An easy way to expose properties on a module from a package.json - -## Installation - -### Installing npm (node package manager) -``` - curl http://npmjs.org/install.sh | sh -``` - -### Installing pkginfo -``` - [sudo] npm install pkginfo -``` - -## Motivation -How often when writing node.js modules have you written the following line(s) of code? - -* Hard code your version string into your code - -``` js - exports.version = '0.1.0'; -``` - -* Programmatically expose the version from the package.json - -``` js - exports.version = JSON.parse(fs.readFileSync('/path/to/package.json', 'utf8')).version; -``` - -In other words, how often have you wanted to expose basic information from your package.json onto your module programmatically? **WELL NOW YOU CAN!** - -## Usage - -Using `pkginfo` is idiot-proof, just require and invoke it. - -``` js - var pkginfo = require('pkginfo')(module); - - console.dir(module.exports); -``` - -By invoking the `pkginfo` module all of the properties in your `package.json` file will be automatically exposed on the callee module (i.e. the parent module of `pkginfo`). - -Here's a sample of the output: - -``` - { name: 'simple-app', - description: 'A test fixture for pkginfo', - version: '0.1.0', - author: 'Charlie Robbins ', - keywords: [ 'test', 'fixture' ], - main: './index.js', - scripts: { test: 'vows test/*-test.js --spec' }, - engines: { node: '>= 0.4.0' } } -``` - -### Expose specific properties -If you don't want to expose **all** properties on from your `package.json` on your module then simple pass those properties to the `pkginfo` function: - -``` js - var pkginfo = require('pkginfo')(module, 'version', 'author'); - - console.dir(module.exports); -``` - -``` - { version: '0.1.0', - author: 'Charlie Robbins ' } -``` - -If you're looking for further usage see the [examples][0] included in this repository. - -## Run Tests -Tests are written in [vows][1] and give complete coverage of all APIs. - -``` - vows test/*-test.js --spec -``` - -[0]: https://github.com/indexzero/node-pkginfo/tree/master/examples -[1]: http://vowsjs.org - -#### Author: [Charlie Robbins](http://nodejitsu.com) \ No newline at end of file diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/docs/docco.css b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/docs/docco.css deleted file mode 100644 index bd5413433..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/docs/docco.css +++ /dev/null @@ -1,194 +0,0 @@ -/*--------------------- Layout and Typography ----------------------------*/ -body { - font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif; - font-size: 15px; - line-height: 22px; - color: #252519; - margin: 0; padding: 0; -} -a { - color: #261a3b; -} - a:visited { - color: #261a3b; - } -p { - margin: 0 0 15px 0; -} -h4, h5, h6 { - color: #333; - margin: 6px 0 6px 0; - font-size: 13px; -} - h2, h3 { - margin-bottom: 0; - color: #000; - } - h1 { - margin-top: 40px; - margin-bottom: 15px; - color: #000; - } -#container { - position: relative; -} -#background { - position: fixed; - top: 0; left: 525px; right: 0; bottom: 0; - background: #f5f5ff; - border-left: 1px solid #e5e5ee; - z-index: -1; -} -#jump_to, #jump_page { - background: white; - -webkit-box-shadow: 0 0 25px #777; -moz-box-shadow: 0 0 25px #777; - -webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px; - font: 10px Arial; - text-transform: uppercase; - cursor: pointer; - text-align: right; -} -#jump_to, #jump_wrapper { - position: fixed; - right: 0; top: 0; - padding: 5px 10px; -} - #jump_wrapper { - padding: 0; - display: none; - } - #jump_to:hover #jump_wrapper { - display: block; - } - #jump_page { - padding: 5px 0 3px; - margin: 0 0 25px 25px; - } - #jump_page .source { - display: block; - padding: 5px 10px; - text-decoration: none; - border-top: 1px solid #eee; - } - #jump_page .source:hover { - background: #f5f5ff; - } - #jump_page .source:first-child { - } -table td { - border: 0; - outline: 0; -} - td.docs, th.docs { - max-width: 450px; - min-width: 450px; - min-height: 5px; - padding: 10px 25px 1px 50px; - overflow-x: hidden; - vertical-align: top; - text-align: left; - } - .docs pre { - margin: 15px 0 15px; - padding-left: 15px; - } - .docs p tt, .docs p code { - background: #f8f8ff; - border: 1px solid #dedede; - font-size: 12px; - padding: 0 0.2em; - } - .pilwrap { - position: relative; - } - .pilcrow { - font: 12px Arial; - text-decoration: none; - color: #454545; - position: absolute; - top: 3px; left: -20px; - padding: 1px 2px; - opacity: 0; - -webkit-transition: opacity 0.2s linear; - } - td.docs:hover .pilcrow { - opacity: 1; - } - td.code, th.code { - padding: 14px 15px 16px 25px; - width: 100%; - vertical-align: top; - background: #f5f5ff; - border-left: 1px solid #e5e5ee; - } - pre, tt, code { - font-size: 12px; line-height: 18px; - font-family: Menlo, Monaco, Consolas, "Lucida Console", monospace; - margin: 0; padding: 0; - } - - -/*---------------------- Syntax Highlighting -----------------------------*/ -td.linenos { background-color: #f0f0f0; padding-right: 10px; } -span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; } -body .hll { background-color: #ffffcc } -body .c { color: #408080; font-style: italic } /* Comment */ -body .err { border: 1px solid #FF0000 } /* Error */ -body .k { color: #954121 } /* Keyword */ -body .o { color: #666666 } /* Operator */ -body .cm { color: #408080; font-style: italic } /* Comment.Multiline */ -body .cp { color: #BC7A00 } /* Comment.Preproc */ -body .c1 { color: #408080; font-style: italic } /* Comment.Single */ -body .cs { color: #408080; font-style: italic } /* Comment.Special */ -body .gd { color: #A00000 } /* Generic.Deleted */ -body .ge { font-style: italic } /* Generic.Emph */ -body .gr { color: #FF0000 } /* Generic.Error */ -body .gh { color: #000080; font-weight: bold } /* Generic.Heading */ -body .gi { color: #00A000 } /* Generic.Inserted */ -body .go { color: #808080 } /* Generic.Output */ -body .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ -body .gs { font-weight: bold } /* Generic.Strong */ -body .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ -body .gt { color: #0040D0 } /* Generic.Traceback */ -body .kc { color: #954121 } /* Keyword.Constant */ -body .kd { color: #954121; font-weight: bold } /* Keyword.Declaration */ -body .kn { color: #954121; font-weight: bold } /* Keyword.Namespace */ -body .kp { color: #954121 } /* Keyword.Pseudo */ -body .kr { color: #954121; font-weight: bold } /* Keyword.Reserved */ -body .kt { color: #B00040 } /* Keyword.Type */ -body .m { color: #666666 } /* Literal.Number */ -body .s { color: #219161 } /* Literal.String */ -body .na { color: #7D9029 } /* Name.Attribute */ -body .nb { color: #954121 } /* Name.Builtin */ -body .nc { color: #0000FF; font-weight: bold } /* Name.Class */ -body .no { color: #880000 } /* Name.Constant */ -body .nd { color: #AA22FF } /* Name.Decorator */ -body .ni { color: #999999; font-weight: bold } /* Name.Entity */ -body .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ -body .nf { color: #0000FF } /* Name.Function */ -body .nl { color: #A0A000 } /* Name.Label */ -body .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ -body .nt { color: #954121; font-weight: bold } /* Name.Tag */ -body .nv { color: #19469D } /* Name.Variable */ -body .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ -body .w { color: #bbbbbb } /* Text.Whitespace */ -body .mf { color: #666666 } /* Literal.Number.Float */ -body .mh { color: #666666 } /* Literal.Number.Hex */ -body .mi { color: #666666 } /* Literal.Number.Integer */ -body .mo { color: #666666 } /* Literal.Number.Oct */ -body .sb { color: #219161 } /* Literal.String.Backtick */ -body .sc { color: #219161 } /* Literal.String.Char */ -body .sd { color: #219161; font-style: italic } /* Literal.String.Doc */ -body .s2 { color: #219161 } /* Literal.String.Double */ -body .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ -body .sh { color: #219161 } /* Literal.String.Heredoc */ -body .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ -body .sx { color: #954121 } /* Literal.String.Other */ -body .sr { color: #BB6688 } /* Literal.String.Regex */ -body .s1 { color: #219161 } /* Literal.String.Single */ -body .ss { color: #19469D } /* Literal.String.Symbol */ -body .bp { color: #954121 } /* Name.Builtin.Pseudo */ -body .vc { color: #19469D } /* Name.Variable.Class */ -body .vg { color: #19469D } /* Name.Variable.Global */ -body .vi { color: #19469D } /* Name.Variable.Instance */ -body .il { color: #666666 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/docs/pkginfo.html b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/docs/pkginfo.html deleted file mode 100644 index bf615fa91..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/docs/pkginfo.html +++ /dev/null @@ -1,101 +0,0 @@ - pkginfo.js

pkginfo.js

/*
- * pkginfo.js: Top-level include for the pkginfo module
- *
- * (C) 2011, Charlie Robbins
- *
- */
- 
-var fs = require('fs'),
-    path = require('path');

function pkginfo ([options, 'property', 'property' ..])

- -

@pmodule {Module} Parent module to read from.

- -

@options {Object|Array|string} Optional Options used when exposing properties.

- -

@arguments {string...} Optional Specified properties to expose.

- -

Exposes properties from the package.json file for the parent module on -it's exports. Valid usage:

- -

require('pkginfo')()

- -

require('pkginfo')('version', 'author');

- -

require('pkginfo')(['version', 'author']);

- -

require('pkginfo')({ include: ['version', 'author'] });

var pkginfo = module.exports = function (pmodule, options) {
-  var args = [].slice.call(arguments, 2).filter(function (arg) {
-    return typeof arg === 'string';
-  });
-  

Parse variable arguments

  if (Array.isArray(options)) {

If the options passed in is an Array assume that -it is the Array of properties to expose from the -on the package.json file on the parent module.

    options = { include: options };
-  }
-  else if (typeof options === 'string') {

Otherwise if the first argument is a string, then -assume that it is the first property to expose from -the package.json file on the parent module.

    options = { include: [options] };
-  }
-  

Setup default options

  options = options || { include: [] };
-  
-  if (args.length > 0) {

If additional string arguments have been passed in -then add them to the properties to expose on the -parent module.

    options.include = options.include.concat(args);
-  }
-  
-  var pkg = pkginfo.read(pmodule, options.dir).package;
-  Object.keys(pkg).forEach(function (key) {
-    if (options.include.length > 0 && !~options.include.indexOf(key)) {
-      return;
-    }
-    
-    if (!pmodule.exports[key]) {
-      pmodule.exports[key] = pkg[key];
-    }
-  });
-  
-  return pkginfo;
-};

function find (dir)

- -

@pmodule {Module} Parent module to read from.

- -

@dir {string} Optional Directory to start search from.

- -

Searches up the directory tree from dir until it finds a directory -which contains a package.json file.

pkginfo.find = function (pmodule, dir) {
-  dir = dir || pmodule.filename;
-  dir = path.dirname(dir); 
-  
-  var files = fs.readdirSync(dir);
-  
-  if (~files.indexOf('package.json')) {
-    return path.join(dir, 'package.json');
-  }
-  
-  if (dir === '/') {
-    throw new Error('Could not find package.json up from: ' + dir);
-  }
-  
-  return pkginfo.find(dir);
-};

function read (pmodule, dir)

- -

@pmodule {Module} Parent module to read from.

- -

@dir {string} Optional Directory to start search from.

- -

Searches up the directory tree from dir until it finds a directory -which contains a package.json file and returns the package information.

pkginfo.read = function (pmodule, dir) { 
-  dir = pkginfo.find(pmodule, dir);
-  
-  var data = fs.readFileSync(dir).toString();
-      
-  return {
-    dir: dir, 
-    package: JSON.parse(data)
-  };
-};

Call pkginfo on this module and expose version.

pkginfo(module, {
-  dir: __dirname,
-  include: ['version'],
-  target: pkginfo
-});
-
-
\ No newline at end of file diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/examples/all-properties.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/examples/all-properties.js deleted file mode 100644 index fd1d831aa..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/examples/all-properties.js +++ /dev/null @@ -1,19 +0,0 @@ -/* - * all-properties.js: Sample of including all properties from a package.json file - * - * (C) 2011, Charlie Robbins - * - */ - -var util = require('util'), - pkginfo = require('../lib/pkginfo')(module); - -exports.someFunction = function () { - console.log('some of your custom logic here'); -}; - -console.log('Inspecting module:'); -console.dir(module.exports); - -console.log('\nAll exports exposed:'); -console.error(Object.keys(module.exports)); \ No newline at end of file diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/examples/array-argument.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/examples/array-argument.js deleted file mode 100644 index b1b684874..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/examples/array-argument.js +++ /dev/null @@ -1,20 +0,0 @@ -/* - * array-argument.js: Sample of including specific properties from a package.json file - * using Array argument syntax. - * - * (C) 2011, Charlie Robbins - * - */ - -var util = require('util'), - pkginfo = require('../lib/pkginfo')(module, ['version', 'author']); - -exports.someFunction = function () { - console.log('some of your custom logic here'); -}; - -console.log('Inspecting module:'); -console.dir(module.exports); - -console.log('\nAll exports exposed:'); -console.error(Object.keys(module.exports)); \ No newline at end of file diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/examples/multiple-properties.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/examples/multiple-properties.js deleted file mode 100644 index b4b5fd617..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/examples/multiple-properties.js +++ /dev/null @@ -1,19 +0,0 @@ -/* - * multiple-properties.js: Sample of including multiple properties from a package.json file - * - * (C) 2011, Charlie Robbins - * - */ - -var util = require('util'), - pkginfo = require('../lib/pkginfo')(module, 'version', 'author'); - -exports.someFunction = function () { - console.log('some of your custom logic here'); -}; - -console.log('Inspecting module:'); -console.dir(module.exports); - -console.log('\nAll exports exposed:'); -console.error(Object.keys(module.exports)); \ No newline at end of file diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/examples/object-argument.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/examples/object-argument.js deleted file mode 100644 index 28420c854..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/examples/object-argument.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * object-argument.js: Sample of including specific properties from a package.json file - * using Object argument syntax. - * - * (C) 2011, Charlie Robbins - * - */ - -var util = require('util'), - pkginfo = require('../lib/pkginfo')(module, { - include: ['version', 'author'] - }); - -exports.someFunction = function () { - console.log('some of your custom logic here'); -}; - -console.log('Inspecting module:'); -console.dir(module.exports); - -console.log('\nAll exports exposed:'); -console.error(Object.keys(module.exports)); \ No newline at end of file diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/examples/package.json b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/examples/package.json deleted file mode 100644 index 1f2f01c19..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/examples/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "simple-app", - "description": "A test fixture for pkginfo", - "version": "0.1.0", - "author": "Charlie Robbins ", - "keywords": ["test", "fixture"], - "main": "./index.js", - "scripts": { "test": "vows test/*-test.js --spec" }, - "engines": { "node": ">= 0.4.0" } -} diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/examples/single-property.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/examples/single-property.js deleted file mode 100644 index 4f445614b..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/examples/single-property.js +++ /dev/null @@ -1,19 +0,0 @@ -/* - * single-property.js: Sample of including a single specific properties from a package.json file - * - * (C) 2011, Charlie Robbins - * - */ - -var util = require('util'), - pkginfo = require('../lib/pkginfo')(module, 'version'); - -exports.someFunction = function () { - console.log('some of your custom logic here'); -}; - -console.log('Inspecting module:'); -console.dir(module.exports); - -console.log('\nAll exports exposed:'); -console.error(Object.keys(module.exports)); \ No newline at end of file diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/lib/pkginfo.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/lib/pkginfo.js deleted file mode 100644 index a4a622720..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/lib/pkginfo.js +++ /dev/null @@ -1,132 +0,0 @@ -/* - * pkginfo.js: Top-level include for the pkginfo module - * - * (C) 2011, Charlie Robbins - * - */ - -var fs = require('fs'), - path = require('path'); - -// -// ### function pkginfo ([options, 'property', 'property' ..]) -// #### @pmodule {Module} Parent module to read from. -// #### @options {Object|Array|string} **Optional** Options used when exposing properties. -// #### @arguments {string...} **Optional** Specified properties to expose. -// Exposes properties from the package.json file for the parent module on -// it's exports. Valid usage: -// -// `require('pkginfo')()` -// -// `require('pkginfo')('version', 'author');` -// -// `require('pkginfo')(['version', 'author']);` -// -// `require('pkginfo')({ include: ['version', 'author'] });` -// -var pkginfo = module.exports = function (pmodule, options) { - var args = [].slice.call(arguments, 2).filter(function (arg) { - return typeof arg === 'string'; - }); - - // - // **Parse variable arguments** - // - if (Array.isArray(options)) { - // - // If the options passed in is an Array assume that - // it is the Array of properties to expose from the - // on the package.json file on the parent module. - // - options = { include: options }; - } - else if (typeof options === 'string') { - // - // Otherwise if the first argument is a string, then - // assume that it is the first property to expose from - // the package.json file on the parent module. - // - options = { include: [options] }; - } - - // - // **Setup default options** - // - options = options || { include: [] }; - - if (args.length > 0) { - // - // If additional string arguments have been passed in - // then add them to the properties to expose on the - // parent module. - // - options.include = options.include.concat(args); - } - - var pkg = pkginfo.read(pmodule, options.dir).package; - Object.keys(pkg).forEach(function (key) { - if (options.include.length > 0 && !~options.include.indexOf(key)) { - return; - } - - if (!pmodule.exports[key]) { - pmodule.exports[key] = pkg[key]; - } - }); - - return pkginfo; -}; - -// -// ### function find (dir) -// #### @pmodule {Module} Parent module to read from. -// #### @dir {string} **Optional** Directory to start search from. -// Searches up the directory tree from `dir` until it finds a directory -// which contains a `package.json` file. -// -pkginfo.find = function (pmodule, dir) { - dir = dir || pmodule.filename; - dir = path.dirname(dir); - - var files = fs.readdirSync(dir); - - if (~files.indexOf('package.json')) { - return path.join(dir, 'package.json'); - } - - if (dir === '/') { - throw new Error('Could not find package.json up from: ' + dir); - } - else if (!dir || dir === '.') { - throw new Error('Cannot find package.json from unspecified directory'); - } - - return pkginfo.find(pmodule, dir); -}; - -// -// ### function read (pmodule, dir) -// #### @pmodule {Module} Parent module to read from. -// #### @dir {string} **Optional** Directory to start search from. -// Searches up the directory tree from `dir` until it finds a directory -// which contains a `package.json` file and returns the package information. -// -pkginfo.read = function (pmodule, dir) { - dir = pkginfo.find(pmodule, dir); - - var data = fs.readFileSync(dir).toString(); - - return { - dir: dir, - package: JSON.parse(data) - }; -}; - -// -// Call `pkginfo` on this module and expose version. -// -pkginfo(module, { - dir: __dirname, - include: ['version'], - target: pkginfo -}); \ No newline at end of file diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/package.json b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/package.json deleted file mode 100644 index 93e977ac2..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/package.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "name": "pkginfo", - "version": "0.2.3", - "description": "An easy way to expose properties on a module from a package.json", - "author": { - "name": "Charlie Robbins", - "email": "charlie.robbins@gmail.com" - }, - "repository": { - "type": "git", - "url": "git://github.com/indexzero/node-pkginfo.git" - }, - "keywords": [ - "info", - "tools", - "package.json" - ], - "devDependencies": { - "vows": "0.6.x" - }, - "main": "./lib/pkginfo", - "scripts": { - "test": "vows test/*-test.js --spec" - }, - "engines": { - "node": ">= 0.4.0" - }, - "_npmUser": { - "name": "indexzero", - "email": "charlie.robbins@gmail.com" - }, - "_id": "pkginfo@0.2.3", - "dependencies": {}, - "_engineSupported": true, - "_npmVersion": "1.0.106", - "_nodeVersion": "v0.4.12", - "_defaultsLoaded": true, - "dist": { - "shasum": "7239c42a5ef6c30b8f328439d9b9ff71042490f8", - "tarball": "http://registry.npmjs.org/pkginfo/-/pkginfo-0.2.3.tgz" - }, - "maintainers": [ - { - "name": "indexzero", - "email": "charlie.robbins@gmail.com" - } - ], - "directories": {}, - "_shasum": "7239c42a5ef6c30b8f328439d9b9ff71042490f8", - "_from": "pkginfo@0.2.x", - "_resolved": "https://registry.npmjs.org/pkginfo/-/pkginfo-0.2.3.tgz", - "bugs": { - "url": "https://github.com/indexzero/node-pkginfo/issues" - }, - "readme": "ERROR: No README data found!", - "homepage": "https://github.com/indexzero/node-pkginfo" -} diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/test/pkginfo-test.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/test/pkginfo-test.js deleted file mode 100644 index 3156c0012..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/node_modules/pkginfo/test/pkginfo-test.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * pkginfo-test.js: Tests for the pkginfo module. - * - * (C) 2011, Charlie Robbins - * - */ - -var assert = require('assert'), - exec = require('child_process').exec, - fs = require('fs'), - path = require('path'), - vows = require('vows'), - pkginfo = require('../lib/pkginfo'); - -function assertProperties (source, target) { - assert.lengthOf(source, target.length + 1); - target.forEach(function (prop) { - assert.isTrue(!!~source.indexOf(prop)); - }); -} - -function testExposes (options) { - return { - topic: function () { - exec('node ' + path.join(__dirname, '..', 'examples', options.script), this.callback); - }, - "should expose that property correctly": function (err, stdout, stderr) { - assert.isNull(err); - - var exposed = stderr.match(/'(\w+)'/ig).map(function (p) { - return p.substring(1, p.length - 1); - }); - - return !options.assert - ? assertProperties(exposed, options.properties) - : options.assert(exposed); - } - } -} - -vows.describe('pkginfo').addBatch({ - "When using the pkginfo module": { - "and passed a single `string` argument": testExposes({ - script: 'single-property.js', - properties: ['version'] - }), - "and passed multiple `string` arguments": testExposes({ - script: 'multiple-properties.js', - properties: ['version', 'author'] - }), - "and passed an `object` argument": testExposes({ - script: 'object-argument.js', - properties: ['version', 'author'] - }), - "and passed an `array` argument": testExposes({ - script: 'array-argument.js', - properties: ['version', 'author'] - }), - "and passed no arguments": testExposes({ - script: 'all-properties.js', - assert: function (exposed) { - var pkg = fs.readFileSync(path.join(__dirname, '..', 'examples', 'package.json')).toString(), - keys = Object.keys(JSON.parse(pkg)); - - assertProperties(exposed, keys); - } - }) - } -}).export(module); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/package.json b/update_nation/node_modules/couchapp/node_modules/http-proxy/package.json deleted file mode 100644 index 83702ff00..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/package.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "name": "http-proxy", - "version": "0.8.7", - "description": "A full-featured http reverse proxy for node.js", - "author": { - "name": "Nodejitsu Inc.", - "email": "info@nodejitsu.com" - }, - "maintainers": [ - { - "name": "indexzero", - "email": "charlie@nodejitsu.com" - }, - { - "name": "AvianFlu", - "email": "avianflu@nodejitsu.com" - } - ], - "repository": { - "type": "git", - "url": "http://github.com/nodejitsu/node-http-proxy.git" - }, - "keywords": [ - "reverse", - "proxy", - "http" - ], - "dependencies": { - "colors": "0.x.x", - "optimist": "0.3.x", - "pkginfo": "0.2.x" - }, - "devDependencies": { - "request": "1.9.x", - "vows": "0.6.x", - "async": "0.1.x", - "socket.io": "0.9.11", - "socket.io-client": "0.9.11", - "ws": "0.4.23" - }, - "main": "./lib/node-http-proxy", - "bin": { - "node-http-proxy": "./bin/node-http-proxy" - }, - "scripts": { - "test": "npm run-script test-http && npm run-script test-https && npm run-script test-core", - "test-http": "vows --spec && vows --spec --target=https", - "test-https": "vows --spec --proxy=https && vows --spec --proxy=https --target=https", - "test-core": "test/core/run" - }, - "engines": { - "node": ">= 0.6.6" - }, - "readme": "# node-http-proxy [![Build Status](https://secure.travis-ci.org/nodejitsu/node-http-proxy.png)](http://travis-ci.org/nodejitsu/node-http-proxy)\n\n\n\n## Battle-hardened node.js http proxy\n\n### Features\n\n* Reverse proxies incoming http.ServerRequest streams\n* Can be used as a CommonJS module in node.js\n* Uses event buffering to support application latency in proxied requests\n* Reverse or Forward Proxy based on simple JSON-based configuration\n* Supports [WebSockets][1]\n* Supports [HTTPS][2]\n* Minimal request overhead and latency\n* Full suite of functional tests\n* Battled-hardened through __production usage__ @ [nodejitsu.com][0]\n* Written entirely in Javascript\n* Easy to use API\n\n### When to use node-http-proxy\n\nLet's suppose you were running multiple http application servers, but you only wanted to expose one machine to the internet. You could setup node-http-proxy on that one machine and then reverse-proxy the incoming http requests to locally running services which were not exposed to the outside network. \n\n### Installing npm (node package manager)\n\n```\ncurl https://npmjs.org/install.sh | sh\n```\n\n### Installing node-http-proxy\n\n```\nnpm install http-proxy\n```\n\n## Using node-http-proxy\n\nThere are several ways to use node-http-proxy; the library is designed to be flexible so that it can be used by itself, or in conjunction with other node.js libraries / tools:\n\n1. Standalone HTTP Proxy server\n2. Inside of another HTTP server (like Connect)\n3. In conjunction with a Proxy Routing Table\n4. As a forward-proxy with a reverse proxy \n5. From the command-line as a long running process\n6. customized with 3rd party middleware.\n\nIn each of these scenarios node-http-proxy can handle any of these types of requests:\n\n1. HTTP Requests (http://)\n2. HTTPS Requests (https://)\n3. WebSocket Requests (ws://)\n4. Secure WebSocket Requests (wss://)\n\nSee the [examples][3] for more working sample code.\n\n### Setup a basic stand-alone proxy server\n\n``` js\nvar http = require('http'),\n httpProxy = require('http-proxy');\n//\n// Create your proxy server\n//\nhttpProxy.createServer(9000, 'localhost').listen(8000);\n\n//\n// Create your target server\n//\nhttp.createServer(function (req, res) {\n res.writeHead(200, { 'Content-Type': 'text/plain' });\n res.write('request successfully proxied!' + '\\n' + JSON.stringify(req.headers, true, 2));\n res.end();\n}).listen(9000);\n```\n\n### Setup a stand-alone proxy server with custom server logic\n\n``` js\nvar http = require('http'),\n httpProxy = require('http-proxy');\n \n//\n// Create a proxy server with custom application logic\n//\nhttpProxy.createServer(function (req, res, proxy) {\n //\n // Put your custom server logic here\n //\n proxy.proxyRequest(req, res, {\n host: 'localhost',\n port: 9000\n });\n}).listen(8000);\n\nhttp.createServer(function (req, res) {\n res.writeHead(200, { 'Content-Type': 'text/plain' });\n res.write('request successfully proxied: ' + req.url +'\\n' + JSON.stringify(req.headers, true, 2));\n res.end();\n}).listen(9000);\n```\n\n### Setup a stand-alone proxy server with latency (e.g. IO, etc)\n\n``` js\nvar http = require('http'),\n httpProxy = require('http-proxy');\n\n//\n// Create a proxy server with custom application logic\n//\nhttpProxy.createServer(function (req, res, proxy) {\n //\n // Buffer the request so that `data` and `end` events\n // are not lost during async operation(s).\n //\n var buffer = httpProxy.buffer(req);\n \n //\n // Wait for two seconds then respond: this simulates\n // performing async actions before proxying a request\n //\n setTimeout(function () {\n proxy.proxyRequest(req, res, {\n host: 'localhost',\n port: 9000, \n buffer: buffer\n }); \n }, 2000);\n}).listen(8000);\n\nhttp.createServer(function (req, res) {\n res.writeHead(200, { 'Content-Type': 'text/plain' });\n res.write('request successfully proxied: ' + req.url +'\\n' + JSON.stringify(req.headers, true, 2));\n res.end();\n}).listen(9000);\n```\n\n### Proxy requests within another http server\n\n``` js\nvar http = require('http'),\n httpProxy = require('http-proxy');\n \n//\n// Create a new instance of HttProxy to use in your server\n//\nvar proxy = new httpProxy.RoutingProxy();\n\n//\n// Create a regular http server and proxy its handler\n//\nhttp.createServer(function (req, res) {\n //\n // Put your custom server logic here, then proxy\n //\n proxy.proxyRequest(req, res, {\n host: 'localhost',\n port: 9000\n });\n}).listen(8001);\n\nhttp.createServer(function (req, res) {\n res.writeHead(200, { 'Content-Type': 'text/plain' });\n res.write('request successfully proxied: ' + req.url +'\\n' + JSON.stringify(req.headers, true, 2));\n res.end();\n}).listen(9000); \n```\n\n### Proxy requests using a ProxyTable\nA Proxy Table is a simple lookup table that maps incoming requests to proxy target locations. Take a look at an example of the options you need to pass to httpProxy.createServer:\n\n``` js\nvar options = {\n router: {\n 'foo.com/baz': '127.0.0.1:8001',\n 'foo.com/buz': '127.0.0.1:8002',\n 'bar.com/buz': '127.0.0.1:8003'\n }\n};\n```\n\nThe above route table will take incoming requests to 'foo.com/baz' and forward them to '127.0.0.1:8001'. Likewise it will take incoming requests to 'foo.com/buz' and forward them to '127.0.0.1:8002'. The routes themselves are later converted to regular expressions to enable more complex matching functionality. We can create a proxy server with these options by using the following code:\n\n``` js\nvar proxyServer = httpProxy.createServer(options);\nproxyServer.listen(80);\n```\n\n### Proxy requests using a 'Hostname Only' ProxyTable\nAs mentioned in the previous section, all routes passes to the ProxyTable are by default converted to regular expressions that are evaluated at proxy-time. This is good for complex URL rewriting of proxy requests, but less efficient when one simply wants to do pure hostname routing based on the HTTP 'Host' header. If you are only concerned with hostname routing, you change the lookup used by the internal ProxyTable:\n\n``` js\nvar options = {\n hostnameOnly: true,\n router: {\n 'foo.com': '127.0.0.1:8001',\n 'bar.com': '127.0.0.1:8002'\n }\n}\n```\n\nNotice here that I have not included paths on the individual domains because this is not possible when using only the HTTP 'Host' header. Care to learn more? See [RFC2616: HTTP/1.1, Section 14.23, \"Host\"][4].\n\n### Proxy requests with an additional forward proxy\nSometimes in addition to a reverse proxy, you may want your front-facing server to forward traffic to another location. For example, if you wanted to load test your staging environment. This is possible when using node-http-proxy using similar JSON-based configuration to a proxy table: \n\n``` js\nvar proxyServerWithForwarding = httpProxy.createServer(9000, 'localhost', {\n forward: {\n port: 9000,\n host: 'staging.com'\n }\n});\nproxyServerWithForwarding.listen(80);\n```\n\nThe forwarding option can be used in conjunction with the proxy table options by simply including both the 'forward' and 'router' properties in the options passed to 'createServer'.\n\n### Listening for proxy events\nSometimes you want to listen to an event on a proxy. For example, you may want to listen to the 'end' event, which represents when the proxy has finished proxying a request.\n\n``` js\nvar httpProxy = require('http-proxy');\n\nvar server = httpProxy.createServer(function (req, res, proxy) {\n var buffer = httpProxy.buffer(req);\n\n proxy.proxyRequest(req, res, {\n host: '127.0.0.1',\n port: 9000,\n buffer: buffer\n });\n});\n\nserver.proxy.on('end', function() {\n console.log(\"The request was proxied.\");\n});\n\nserver.listen(8000);\n```\n\nIt's important to remember not to listen for events on the proxy object in the function passed to `httpProxy.createServer`. Doing so would add a new listener on every request, which would end up being a disaster.\n\n## Using HTTPS\nYou have all the full flexibility of node-http-proxy offers in HTTPS as well as HTTP. The two basic scenarios are: with a stand-alone proxy server or in conjunction with another HTTPS server.\n\n### Proxying to HTTP from HTTPS\nThis is probably the most common use-case for proxying in conjunction with HTTPS. You have some front-facing HTTPS server, but all of your internal traffic is HTTP. In this way, you can reduce the number of servers to which your CA and other important security files are deployed and reduce the computational overhead from HTTPS traffic. \n\nUsing HTTPS in `node-http-proxy` is relatively straight-forward:\n \n``` js\nvar fs = require('fs'),\n http = require('http'),\n https = require('https'),\n httpProxy = require('http-proxy');\n \nvar options = {\n https: {\n key: fs.readFileSync('path/to/your/key.pem', 'utf8'),\n cert: fs.readFileSync('path/to/your/cert.pem', 'utf8')\n }\n};\n\n//\n// Create a standalone HTTPS proxy server\n//\nhttpProxy.createServer(8000, 'localhost', options).listen(8001);\n\n//\n// Create an instance of HttpProxy to use with another HTTPS server\n//\nvar proxy = new httpProxy.HttpProxy({\n target: {\n host: 'localhost', \n port: 8000\n }\n});\nhttps.createServer(options.https, function (req, res) {\n proxy.proxyRequest(req, res)\n}).listen(8002);\n\n//\n// Create the target HTTPS server for both cases\n//\nhttp.createServer(function (req, res) {\n res.writeHead(200, { 'Content-Type': 'text/plain' });\n res.write('hello https\\n');\n res.end();\n}).listen(8000);\n```\n\n### Using two certificates\n\nSuppose that your reverse proxy will handle HTTPS traffic for two different domains `fobar.com` and `barbaz.com`.\nIf you need to use two different certificates you can take advantage of [Server Name Indication](http://en.wikipedia.org/wiki/Server_Name_Indication).\n\n``` js\nvar https = require('https'),\n path = require(\"path\"),\n fs = require(\"fs\"),\n crypto = require(\"crypto\");\n\n//\n// generic function to load the credentials context from disk\n//\nfunction getCredentialsContext (cer) {\n return crypto.createCredentials({\n key: fs.readFileSync(path.join(__dirname, 'certs', cer + '.key')),\n cert: fs.readFileSync(path.join(__dirname, 'certs', cer + '.crt'))\n }).context;\n}\n\n//\n// A certificate per domain hash\n//\nvar certs = {\n \"fobar.com\": getCredentialsContext(\"foobar\"),\n \"barbaz.com\": getCredentialsContext(\"barbaz\")\n};\n\n//\n// Proxy options\n//\nvar options = {\n https: {\n SNICallback: function(hostname){\n return certs[hostname];\n }\n },\n hostnameOnly: true,\n router: {\n 'fobar.com': '127.0.0.1:8001',\n 'barbaz.com': '127.0.0.1:8002'\n }\n};\n\n//\n// Create a standalone HTTPS proxy server\n//\nhttpProxy.createServer(options).listen(8001);\n\n//\n// Create the target HTTPS server\n//\nhttp.createServer(function (req, res) {\n res.writeHead(200, { 'Content-Type': 'text/plain' });\n res.write('hello https\\n');\n res.end();\n}).listen(8000);\n\n```\n\n### Proxying to HTTPS from HTTPS\nProxying from HTTPS to HTTPS is essentially the same as proxying from HTTPS to HTTP, but you must include the `target` option in when calling `httpProxy.createServer` or instantiating a new instance of `HttpProxy`.\n\n``` js\nvar fs = require('fs'),\n https = require('https'),\n httpProxy = require('http-proxy');\n \nvar options = {\n https: {\n key: fs.readFileSync('path/to/your/key.pem', 'utf8'),\n cert: fs.readFileSync('path/to/your/cert.pem', 'utf8')\n },\n target: {\n https: true // This could also be an Object with key and cert properties\n }\n};\n\n//\n// Create a standalone HTTPS proxy server\n//\nhttpProxy.createServer(8000, 'localhost', options).listen(8001);\n\n//\n// Create an instance of HttpProxy to use with another HTTPS server\n//\nvar proxy = new httpProxy.HttpProxy({ \n target: {\n host: 'localhost', \n port: 8000,\n https: true\n }\n});\n\nhttps.createServer(options.https, function (req, res) {\n proxy.proxyRequest(req, res);\n}).listen(8002);\n\n//\n// Create the target HTTPS server for both cases\n//\nhttps.createServer(options.https, function (req, res) {\n res.writeHead(200, { 'Content-Type': 'text/plain' });\n res.write('hello https\\n');\n res.end();\n}).listen(8000);\n```\n## Middleware\n\n`node-http-proxy` now supports connect middleware. Add middleware functions to your createServer call:\n\n``` js\nhttpProxy.createServer(\n require('connect-gzip').gzip(),\n 9000, 'localhost'\n).listen(8000);\n```\n\n## Proxying WebSockets\nWebsockets are handled automatically when using `httpProxy.createServer()`, but if you want to use it in conjunction with a stand-alone HTTP + WebSocket (such as [socket.io][5]) server here's how:\n\n``` js\nvar http = require('http'),\n httpProxy = require('http-proxy');\n \n//\n// Create an instance of node-http-proxy\n//\nvar proxy = new httpProxy.HttpProxy({\n target: {\n host: 'localhost',\n port: 8000\n }\n});\n\nvar server = http.createServer(function (req, res) {\n //\n // Proxy normal HTTP requests\n //\n proxy.proxyRequest(req, res);\n});\n\nserver.on('upgrade', function(req, socket, head) {\n //\n // Proxy websocket requests too\n //\n proxy.proxyWebSocketRequest(req, socket, head);\n});\n\nserver.listen(8080);\n```\n\n### Configuring your Socket limits\n\nBy default, `node-http-proxy` will set a 100 socket limit for all `host:port` proxy targets. You can change this in two ways: \n\n1. By passing the `maxSockets` option to `httpProxy.createServer()`\n2. By calling `httpProxy.setMaxSockets(n)`, where `n` is the number of sockets you with to use. \n\n## POST requests and buffering\n\nexpress.bodyParser will interfere with proxying of POST requests (and other methods that have a request \nbody). With bodyParser active, proxied requests will never send anything to the upstream server, and \nthe original client will just hang. See https://github.com/nodejitsu/node-http-proxy/issues/180 for options.\n\n## Using node-http-proxy from the command line\nWhen you install this package with npm, a node-http-proxy binary will become available to you. Using this binary is easy with some simple options:\n\n``` js\nusage: node-http-proxy [options] \n\nAll options should be set with the syntax --option=value\n\noptions:\n --port PORT Port that the proxy server should run on\n --target HOST:PORT Location of the server the proxy will target\n --config OUTFILE Location of the configuration file for the proxy server\n --silent Silence the log output from the proxy server\n -h, --help You're staring at it\n```\n\n
\n## Why doesn't node-http-proxy have more advanced features like x, y, or z?\n\nIf you have a suggestion for a feature currently not supported, feel free to open a [support issue][6]. node-http-proxy is designed to just proxy http requests from one server to another, but we will be soon releasing many other complimentary projects that can be used in conjunction with node-http-proxy.\n\n## Options\n\n### Http Proxy\n\n`createServer()` supports the following options\n\n```javascript\n{\n forward: { // options for forward-proxy\n port: 8000,\n host: 'staging.com'\n },\n target : { // options for proxy target\n port : 8000, \n host : 'localhost',\n };\n source : { // additional options for websocket proxying \n host : 'localhost',\n port : 8000,\n https: true\n },\n enable : {\n xforward: true // enables X-Forwarded-For\n },\n changeOrigin: false, // changes the origin of the host header to the target URL\n}\n```\n\n## Run Tests\nThe test suite is designed to fully cover the combinatoric possibilities of HTTP and HTTPS proxying:\n\n1. HTTP --> HTTP\n2. HTTPS --> HTTP\n3. HTTPS --> HTTPS\n4. HTTP --> HTTPS\n\n```\nvows test/*-test.js --spec\nvows test/*-test.js --spec --https\nvows test/*-test.js --spec --https --target=https\nvows test/*-test.js --spec --target=https\n```\n\n
\n### License\n\n(The MIT License)\n\nCopyright (c) 2010 Charlie Robbins, Mikeal Rogers, Fedor Indutny, & Marak Squires\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n[0]: http://nodejitsu.com\n[1]: https://github.com/nodejitsu/node-http-proxy/blob/master/examples/websocket/websocket-proxy.js\n[2]: https://github.com/nodejitsu/node-http-proxy/blob/master/examples/http/proxy-https-to-http.js\n[3]: https://github.com/nodejitsu/node-http-proxy/tree/master/examples\n[4]: http://www.ietf.org/rfc/rfc2616.txt\n[5]: http://socket.io\n[6]: http://github.com/nodejitsu/node-http-proxy/issues\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/nodejitsu/node-http-proxy/issues" - }, - "homepage": "https://github.com/nodejitsu/node-http-proxy", - "_id": "http-proxy@0.8.7", - "dist": { - "shasum": "1043ae29ed2ce8a9408d8153d403e094b491d90f" - }, - "_from": "http-proxy@0.8.7", - "_resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-0.8.7.tgz" -} diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/README.md b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/README.md deleted file mode 100644 index 152e5c668..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# `test/core` - -`test/core` directory is a place where tests from node.js core go. They are -here to ensure that node-http-proxy works just fine with all kinds of -different situations, which are covered in core tests, but are not covered in -our tests. - -All these tests require little modifications to make them test node-http-proxy, -but we try to keep them as vanilla as possible. - diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/common.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/common.js deleted file mode 100644 index 0fddb009c..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/common.js +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -var path = require('path'); -var assert = require('assert'); - -exports.testDir = path.dirname(__filename); -exports.fixturesDir = path.join(exports.testDir, 'fixtures'); -exports.libDir = path.join(exports.testDir, '../lib'); -exports.tmpDir = path.join(exports.testDir, 'tmp'); -exports.PORT = 12346; -exports.PROXY_PORT = 1234567; - -if (process.platform === 'win32') { - exports.PIPE = '\\\\.\\pipe\\libuv-test'; -} else { - exports.PIPE = exports.tmpDir + '/test.sock'; -} - -var util = require('util'); -for (var i in util) exports[i] = util[i]; -//for (var i in exports) global[i] = exports[i]; - -function protoCtrChain(o) { - var result = []; - for (; o; o = o.__proto__) { result.push(o.constructor); } - return result.join(); -} - -exports.indirectInstanceOf = function(obj, cls) { - if (obj instanceof cls) { return true; } - var clsChain = protoCtrChain(cls.prototype); - var objChain = protoCtrChain(obj); - return objChain.slice(-clsChain.length) === clsChain; -}; - - -exports.ddCommand = function(filename, kilobytes) { - if (process.platform === 'win32') { - var p = path.resolve(exports.fixturesDir, 'create-file.js'); - return '"' + process.argv[0] + '" "' + p + '" "' + - filename + '" ' + (kilobytes * 1024); - } else { - return 'dd if=/dev/zero of="' + filename + '" bs=1024 count=' + kilobytes; - } -}; - - -exports.spawnPwd = function(options) { - var spawn = require('child_process').spawn; - - if (process.platform === 'win32') { - return spawn('cmd.exe', ['/c', 'cd'], options); - } else { - return spawn('pwd', [], options); - } -}; - - -// Turn this off if the test should not check for global leaks. -exports.globalCheck = true; - -process.on('exit', function() { - if (!exports.globalCheck) return; - var knownGlobals = [setTimeout, - setInterval, - clearTimeout, - clearInterval, - console, - Buffer, - process, - global]; - - if (global.setImmediate) { - knownGlobals.push(setImmediate); - knownGlobals.push(clearImmediate); - } - - if (global.errno) { - knownGlobals.push(errno); - } - - if (global.gc) { - knownGlobals.push(gc); - } - - if (global.DTRACE_HTTP_SERVER_RESPONSE) { - knownGlobals.push(DTRACE_HTTP_SERVER_RESPONSE); - knownGlobals.push(DTRACE_HTTP_SERVER_REQUEST); - knownGlobals.push(DTRACE_HTTP_CLIENT_RESPONSE); - knownGlobals.push(DTRACE_HTTP_CLIENT_REQUEST); - knownGlobals.push(DTRACE_NET_STREAM_END); - knownGlobals.push(DTRACE_NET_SERVER_CONNECTION); - knownGlobals.push(DTRACE_NET_SOCKET_READ); - knownGlobals.push(DTRACE_NET_SOCKET_WRITE); - } - - if (global.ArrayBuffer) { - knownGlobals.push(ArrayBuffer); - knownGlobals.push(Int8Array); - knownGlobals.push(Uint8Array); - knownGlobals.push(Int16Array); - knownGlobals.push(Uint16Array); - knownGlobals.push(Int32Array); - knownGlobals.push(Uint32Array); - knownGlobals.push(Float32Array); - knownGlobals.push(Float64Array); - knownGlobals.push(DataView); - - if (global.Uint8ClampedArray) { - knownGlobals.push(Uint8ClampedArray); - } - } - - for (var x in global) { - var found = false; - - for (var y in knownGlobals) { - if (global[x] === knownGlobals[y]) { - found = true; - break; - } - } - - if (!found) { - console.error('Unknown global: %s', x); - assert.ok(false, 'Unknown global found'); - } - } -}); - - -var mustCallChecks = []; - - -function runCallChecks() { - var failed = mustCallChecks.filter(function(context) { - return context.actual !== context.expected; - }); - - failed.forEach(function(context) { - console.log('Mismatched %s function calls. Expected %d, actual %d.', - context.name, - context.expected, - context.actual); - console.log(context.stack.split('\n').slice(2).join('\n')); - }); - - if (failed.length) process.exit(1); -} - - -exports.mustCall = function(fn, expected) { - if (typeof expected !== 'number') expected = 1; - - var context = { - expected: expected, - actual: 0, - stack: (new Error).stack, - name: fn.name || '' - }; - - // add the exit listener only once to avoid listener leak warnings - if (mustCallChecks.length === 0) process.on('exit', runCallChecks); - - mustCallChecks.push(context); - - return function() { - context.actual++; - return fn.apply(this, arguments); - }; -}; diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/pummel/test-http-upload-timeout.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/pummel/test-http-upload-timeout.js deleted file mode 100644 index f8efe41f4..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/pummel/test-http-upload-timeout.js +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -// This tests setTimeout() by having multiple clients connecting and sending -// data in random intervals. Clients are also randomly disconnecting until there -// are no more clients left. If no false timeout occurs, this test has passed. -var common = require('../common'), - assert = require('assert'), - http = require('http'), - server = http.createServer(), - connections = 0; - -server.on('request', function(req, res) { - req.socket.setTimeout(1000); - req.socket.on('timeout', function() { - throw new Error('Unexpected timeout'); - }); - req.on('end', function() { - connections--; - res.writeHead(200); - res.end('done\n'); - if (connections == 0) { - server.close(); - } - }); -}); - -server.listen(common.PORT, '127.0.0.1', function() { - for (var i = 0; i < 10; i++) { - connections++; - - setTimeout(function() { - var request = http.request({ - port: common.PROXY_PORT, - method: 'POST', - path: '/' - }); - - function ping() { - var nextPing = (Math.random() * 900).toFixed(); - if (nextPing > 600) { - request.end(); - return; - } - request.write('ping'); - setTimeout(ping, nextPing); - } - ping(); - }, i * 50); - } -}); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/run b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/run deleted file mode 100644 index adec53bab..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/run +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/env node -/* - run.js: test runner for core tests - - Copyright (c) 2011 Nodejitsu - - 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. - -*/ - -var fs = require('fs'), - path = require('path'), - spawn = require('child_process').spawn, - async = require('async'), - colors = require('colors'), - optimist = require('optimist'); - -optimist.argv.color && (colors.mode = optimist.argv.color); - -var testTimeout = 15000; -var results = {}; - -function runTest(test, callback) { - var child = spawn(path.join(__dirname, 'run-single'), [ test ]); - - var killTimeout = setTimeout(function () { - child.kill(); - console.log(' ' + path.basename(test).yellow + ' timed out'.red); - }, testTimeout); - - child.on('exit', function (exitCode) { - clearTimeout(killTimeout); - - console.log(' ' + ((exitCode) ? '✘'.red : '✔'.green) + ' ' + - path.basename(test) + - (exitCode ? (' (exit code: ' + exitCode + ')') : '')); - results[test] = { exitCode: exitCode }; - callback(); - // - // We don't want tests to be stopped after first failure, and that's what - // async does when it receives truthy value in callback. - // - }); -}; - -var tests = process.argv.slice(2).filter(function (test) { - return test.substr(0, 2) != '--'; -}); - -if (!tests.length) { - var pathPrefix = path.join(__dirname, 'simple'); - tests = fs.readdirSync(pathPrefix).map(function (test) { - return path.join(pathPrefix, test); - }); - // - // We only run simple tests by default. - // -} - -console.log('Running tests:'.bold); -async.forEachSeries(tests, runTest, function () { - var failed = [], ok = []; - for (var test in results) { - (results[test].exitCode != 0 ? failed : ok).push(test); - } - - console.log('\nSummary:'.bold); - console.log((' ' + ok.length + '\tpassed tests').green); - console.log((' ' + failed.length + '\tfailed tests').red); -}); - -// vim:filetype=javascript - diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/run-single b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/run-single deleted file mode 100644 index ae53588af..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/run-single +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env node -/* - run-single.js: test runner for core tests - - Copyright (c) 2011 Nodejitsu - - 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. - -*/ - -// -// Basic idea behind core test runner is to modify core tests as little as -// possible. That's why we start up node-http-proxy here instead of embeeding -// this code in tests. -// -// In most cases only modification to core tests you'll need is changing port -// of http client to common.PROXY_PORT. -// - -var path = require('path'), - spawn = require('child_process').spawn, - httpProxy = require('../../'), - common = require('./common'); - -var test = process.argv[2], - testProcess; - -if (!test) { - return console.error('Need test to run'); -} - -console.log('Running test ' + test); - -var proxy = httpProxy.createServer(common.PORT, 'localhost'); -proxy.listen(common.PROXY_PORT); - -proxy.on('listening', function () { - console.log('Proxy server listening on ' + common.PROXY_PORT); - testProcess = spawn(process.argv[0], [ process.argv[2] ]); - testProcess.stdout.pipe(process.stdout); - testProcess.stderr.pipe(process.stderr); - - testProcess.on('exit', function (code) { - process.exit(code); - }); -}); - -process.on('SIGTERM', function () { - testProcess.kill(); - process.exit(1); -}); - -// vim:filetype=javascript diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-chunked.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-chunked.js deleted file mode 100644 index 8a19f577d..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-chunked.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -var common = require('../common'); -var assert = require('assert'); -var http = require('http'); - -var UTF8_STRING = '南越国是前203年至前111年存在于岭南地区的一个国家,' + - '国都位于番禺,疆域包括今天中国的广东、广西两省区的大部份地区,福建省、湖南、' + - '贵州、云南的一小部份地区和越南的北部。南越国是秦朝灭亡后,' + - '由南海郡尉赵佗于前203年起兵兼并桂林郡和象郡后建立。前196年和前179年,' + - '南越国曾先后两次名义上臣属于西汉,成为西汉的“外臣”。前112年,' + - '南越国末代君主赵建德与西汉发生战争,被汉武帝于前111年所灭。' + - '南越国共存在93年,历经五代君主。南越国是岭南地区的第一个有记载的政权国家,' + - '采用封建制和郡县制并存的制度,它的建立保证了秦末乱世岭南地区社会秩序的稳定,' + - '有效的改善了岭南地区落后的政治、经济现状。'; - -var server = http.createServer(function(req, res) { - res.writeHead(200, {'Content-Type': 'text/plain; charset=utf8'}); - res.end(UTF8_STRING, 'utf8'); -}); -server.listen(common.PORT, function() { - var data = ''; - var get = http.get({ - path: '/', - host: 'localhost', - port: common.PROXY_PORT - }, function(x) { - x.setEncoding('utf8'); - x.on('data', function(c) {data += c}); - x.on('error', function(e) { - throw e; - }); - x.on('end', function() { - assert.equal('string', typeof data); - console.log('here is the response:'); - assert.equal(UTF8_STRING, data); - console.log(data); - server.close(); - }); - }); - get.on('error', function(e) {throw e}); - get.end(); - -}); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-client-abort.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-client-abort.js deleted file mode 100644 index c7a55e27c..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-client-abort.js +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -var common = require('../common'); -var assert = require('assert'); -var http = require('http'); - -var clientAborts = 0; - -var server = http.Server(function(req, res) { - console.log('Got connection'); - res.writeHead(200); - res.write('Working on it...'); - - // I would expect an error event from req or res that the client aborted - // before completing the HTTP request / response cycle, or maybe a new - // event like "aborted" or something. - req.on('aborted', function() { - clientAborts++; - console.log('Got abort ' + clientAborts); - if (clientAborts === N) { - console.log('All aborts detected, you win.'); - server.close(); - } - }); - - // since there is already clientError, maybe that would be appropriate, - // since "error" is magical - req.on('clientError', function() { - console.log('Got clientError'); - }); -}); - -var responses = 0; -var N = http.Agent.defaultMaxSockets - 1; -var requests = []; - -server.listen(common.PORT, function() { - console.log('Server listening.'); - - for (var i = 0; i < N; i++) { - console.log('Making client ' + i); - var options = { port: common.PROXY_PORT, path: '/?id=' + i }; - var req = http.get(options, function(res) { - console.log('Client response code ' + res.statusCode); - - if (++responses == N) { - console.log('All clients connected, destroying.'); - requests.forEach(function(outReq) { - console.log('abort'); - outReq.abort(); - }); - } - }); - - requests.push(req); - } -}); - -process.on('exit', function() { - assert.equal(N, clientAborts); -}); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-client-abort2.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-client-abort2.js deleted file mode 100644 index 41c62d95a..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-client-abort2.js +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -// libuv-broken - - -var common = require('../common'); -var assert = require('assert'); -var http = require('http'); - -var server = http.createServer(function(req, res) { - res.end('Hello'); -}); - -server.listen(common.PORT, function() { - var req = http.get({port: common.PROXY_PORT}, function(res) { - res.on('data', function(data) { - req.abort(); - server.close(); - }); - }); -}); - diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-client-upload-buf.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-client-upload-buf.js deleted file mode 100644 index 125aa0cef..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-client-upload-buf.js +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -var common = require('../common'); -var assert = require('assert'); -var http = require('http'); - -var N = 1024; -var bytesRecieved = 0; -var server_req_complete = false; -var client_res_complete = false; - -var server = http.createServer(function(req, res) { - assert.equal('POST', req.method); - - req.on('data', function(chunk) { - bytesRecieved += chunk.length; - }); - - req.on('end', function() { - server_req_complete = true; - console.log('request complete from server'); - res.writeHead(200, {'Content-Type': 'text/plain'}); - res.write('hello\n'); - res.end(); - }); -}); -server.listen(common.PORT); - -server.on('listening', function() { - var req = http.request({ - port: common.PROXY_PORT, - method: 'POST', - path: '/' - }, function(res) { - res.setEncoding('utf8'); - res.on('data', function(chunk) { - console.log(chunk); - }); - res.on('end', function() { - client_res_complete = true; - server.close(); - }); - }); - - req.write(new Buffer(N)); - req.end(); - - common.error('client finished sending request'); -}); - -process.on('exit', function() { - assert.equal(N, bytesRecieved); - assert.equal(true, server_req_complete); - assert.equal(true, client_res_complete); -}); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-client-upload.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-client-upload.js deleted file mode 100644 index fdd88ca4e..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-client-upload.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -var common = require('../common'); -var assert = require('assert'); -var http = require('http'); - -var sent_body = ''; -var server_req_complete = false; -var client_res_complete = false; - -var server = http.createServer(function(req, res) { - assert.equal('POST', req.method); - req.setEncoding('utf8'); - - req.on('data', function(chunk) { - console.log('server got: ' + JSON.stringify(chunk)); - sent_body += chunk; - }); - - req.on('end', function() { - server_req_complete = true; - console.log('request complete from server'); - res.writeHead(200, {'Content-Type': 'text/plain'}); - res.write('hello\n'); - res.end(); - }); -}); -server.listen(common.PORT); - -server.on('listening', function() { - var req = http.request({ - port: common.PROXY_PORT, - method: 'POST', - path: '/' - }, function(res) { - res.setEncoding('utf8'); - res.on('data', function(chunk) { - console.log(chunk); - }); - res.on('end', function() { - client_res_complete = true; - server.close(); - }); - }); - - req.write('1\n'); - req.write('2\n'); - req.write('3\n'); - req.end(); - - common.error('client finished sending request'); -}); - -process.on('exit', function() { - assert.equal('1\n2\n3\n', sent_body); - assert.equal(true, server_req_complete); - assert.equal(true, client_res_complete); -}); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-contentLength0.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-contentLength0.js deleted file mode 100644 index 1602c0259..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-contentLength0.js +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -var common = require('../common'); -var http = require('http'); - -// Simple test of Node's HTTP Client choking on a response -// with a 'Content-Length: 0 ' response header. -// I.E. a space character after the 'Content-Length' throws an `error` event. - - -var s = http.createServer(function(req, res) { - res.writeHead(200, {'Content-Length': '0 '}); - res.end(); -}); -s.listen(common.PORT, function() { - - var request = http.request({ port: common.PROXY_PORT }, function(response) { - console.log('STATUS: ' + response.statusCode); - s.close(); - }); - - request.end(); -}); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-eof-on-connect.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-eof-on-connect.js deleted file mode 100644 index b043a2d33..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-eof-on-connect.js +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -var common = require('../common'); -var assert = require('assert'); -var net = require('net'); -var http = require('http'); - -// This is a regression test for http://github.com/ry/node/issues/#issue/44 -// It is separate from test-http-malformed-request.js because it is only -// reproduceable on the first packet on the first connection to a server. - -var server = http.createServer(function(req, res) {}); -server.listen(common.PORT); - -server.on('listening', function() { - net.createConnection(common.PROXY_PORT).on('connect', function() { - this.destroy(); - }).on('close', function() { - server.close(); - }); -}); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-extra-response.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-extra-response.js deleted file mode 100644 index 29143d00d..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-extra-response.js +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -var common = require('../common'); -var assert = require('assert'); -var http = require('http'); -var net = require('net'); - -// If an HTTP server is broken and sends data after the end of the response, -// node should ignore it and drop the connection. -// Demos this bug: https://github.com/ry/node/issues/680 - -var body = 'hello world\r\n'; -var fullResponse = - 'HTTP/1.1 500 Internal Server Error\r\n' + - 'Content-Length: ' + body.length + '\r\n' + - 'Content-Type: text/plain\r\n' + - 'Date: Fri + 18 Feb 2011 06:22:45 GMT\r\n' + - 'Host: 10.20.149.2\r\n' + - 'Access-Control-Allow-Credentials: true\r\n' + - 'Server: badly broken/0.1 (OS NAME)\r\n' + - '\r\n' + - body; - -var gotResponse = false; - - -var server = net.createServer(function(socket) { - var postBody = ''; - - socket.setEncoding('utf8'); - - socket.on('data', function(chunk) { - postBody += chunk; - - if (postBody.indexOf('\r\n') > -1) { - socket.write(fullResponse); - // omg, I wrote the response twice, what a terrible HTTP server I am. - socket.end(fullResponse); - } - }); -}); - - -server.listen(common.PORT, function() { - http.get({ port: common.PROXY_PORT }, function(res) { - var buffer = ''; - console.log('Got res code: ' + res.statusCode); - - res.setEncoding('utf8'); - res.on('data', function(chunk) { - buffer += chunk; - }); - - res.on('end', function() { - console.log('Response ended, read ' + buffer.length + ' bytes'); - assert.equal(body, buffer); - server.close(); - gotResponse = true; - }); - }); -}); - - -process.on('exit', function() { - assert.ok(gotResponse); -}); - diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-head-request.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-head-request.js deleted file mode 100644 index 409698aad..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-head-request.js +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -var common = require('../common'); -var assert = require('assert'); -var http = require('http'); -var util = require('util'); - - -var body = 'hello world\n'; - -var server = http.createServer(function(req, res) { - common.error('req: ' + req.method); - res.writeHead(200, {'Content-Length': body.length}); - res.end(); - server.close(); -}); - -var gotEnd = false; - -server.listen(common.PORT, function() { - var request = http.request({ - port: common.PROXY_PORT, - method: 'HEAD', - path: '/' - }, function(response) { - common.error('response start'); - response.on('end', function() { - common.error('response end'); - gotEnd = true; - }); - }); - request.end(); -}); - -process.on('exit', function() { - assert.ok(gotEnd); -}); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-head-response-has-no-body-end.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-head-response-has-no-body-end.js deleted file mode 100644 index 9a50e5a75..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-head-response-has-no-body-end.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -// libuv-broken - - -var common = require('../common'); -var assert = require('assert'); - -var http = require('http'); - -// This test is to make sure that when the HTTP server -// responds to a HEAD request with data to res.end, -// it does not send any body. - -var server = http.createServer(function(req, res) { - res.writeHead(200); - res.end('FAIL'); // broken: sends FAIL from hot path. -}); -server.listen(common.PORT); - -var responseComplete = false; - -server.on('listening', function() { - var req = http.request({ - port: common.PROXY_PORT, - method: 'HEAD', - path: '/' - }, function(res) { - common.error('response'); - res.on('end', function() { - common.error('response end'); - server.close(); - responseComplete = true; - }); - }); - common.error('req'); - req.end(); -}); - -process.on('exit', function() { - assert.ok(responseComplete); -}); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-head-response-has-no-body.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-head-response-has-no-body.js deleted file mode 100644 index 614b648f5..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-head-response-has-no-body.js +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -var common = require('../common'); -var assert = require('assert'); - -var http = require('http'); - -// This test is to make sure that when the HTTP server -// responds to a HEAD request, it does not send any body. -// In this case it was sending '0\r\n\r\n' - -var server = http.createServer(function(req, res) { - res.writeHead(200); // broken: defaults to TE chunked - res.end(); -}); -server.listen(common.PORT); - -var responseComplete = false; - -server.on('listening', function() { - var req = http.request({ - port: common.PROXY_PORT, - method: 'HEAD', - path: '/' - }, function(res) { - common.error('response'); - res.on('end', function() { - common.error('response end'); - server.close(); - responseComplete = true; - }); - }); - common.error('req'); - req.end(); -}); - -process.on('exit', function() { - assert.ok(responseComplete); -}); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-host-headers.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-host-headers.js deleted file mode 100644 index bb0957e8e..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-host-headers.js +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -// libuv-broken - - -var http = require('http'), - common = require('../common'), - assert = require('assert'), - httpServer = http.createServer(reqHandler); - -function reqHandler(req, res) { - console.log('Got request: ' + req.headers.host + ' ' + req.url); - if (req.url === '/setHostFalse5') { - assert.equal(req.headers.host, undefined); - } else { - assert.equal(req.headers.host, 'localhost:' + common.PROXY_PORT, - 'Wrong host header for req[' + req.url + ']: ' + - req.headers.host); - } - res.writeHead(200, {}); - //process.nextTick(function() { res.end('ok'); }); - res.end('ok'); -} - -function thrower(er) { - throw er; -} - -testHttp(); - -function testHttp() { - - console.log('testing http on port ' + common.PROXY_PORT + ' (proxied to ' + - common.PORT + ')'); - - var counter = 0; - - function cb() { - counter--; - console.log('back from http request. counter = ' + counter); - if (counter === 0) { - httpServer.close(); - } - } - - httpServer.listen(common.PORT, function(er) { - console.error('listening on ' + common.PORT); - - if (er) throw er; - - http.get({ method: 'GET', - path: '/' + (counter++), - host: 'localhost', - //agent: false, - port: common.PROXY_PORT }, cb).on('error', thrower); - - http.request({ method: 'GET', - path: '/' + (counter++), - host: 'localhost', - //agent: false, - port: common.PROXY_PORT }, cb).on('error', thrower).end(); - - http.request({ method: 'POST', - path: '/' + (counter++), - host: 'localhost', - //agent: false, - port: common.PROXY_PORT }, cb).on('error', thrower).end(); - - http.request({ method: 'PUT', - path: '/' + (counter++), - host: 'localhost', - //agent: false, - port: common.PROXY_PORT }, cb).on('error', thrower).end(); - - http.request({ method: 'DELETE', - path: '/' + (counter++), - host: 'localhost', - //agent: false, - port: common.PROXY_PORT }, cb).on('error', thrower).end(); - }); -} - diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-many-keep-alive-connections.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-many-keep-alive-connections.js deleted file mode 100644 index 7b14ff0ca..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-many-keep-alive-connections.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -var common = require('../common'); -var assert = require('assert'); -var http = require('http'); - -var expected = 10000; -var responses = 0; -var requests = 0; -var connection; - -var server = http.Server(function(req, res) { - requests++; - assert.equal(req.connection, connection); - res.writeHead(200); - res.end('hello world\n'); -}); - -server.once('connection', function(c) { - connection = c; -}); - -server.listen(common.PORT, function() { - var callee = arguments.callee; - var request = http.get({ - port: common.PROXY_PORT, - path: '/', - headers: { - 'Connection': 'Keep-alive' - } - }, function(res) { - res.on('end', function() { - if (++responses < expected) { - callee(); - } else { - process.exit(); - } - }); - }).on('error', function(e) { - console.log(e.message); - process.exit(1); - }); - request.agent.maxSockets = 1; -}); - -process.on('exit', function() { - assert.equal(expected, responses); - assert.equal(expected, requests); -}); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-multi-line-headers.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-multi-line-headers.js deleted file mode 100644 index aa00a7666..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-multi-line-headers.js +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -var common = require('../common'); -var assert = require('assert'); - -var http = require('http'); -var net = require('net'); - -var gotResponse = false; - -var server = net.createServer(function(conn) { - var body = 'Yet another node.js server.'; - - var response = - 'HTTP/1.1 200 OK\r\n' + - 'Connection: close\r\n' + - 'Content-Length: ' + body.length + '\r\n' + - 'Content-Type: text/plain;\r\n' + - ' x-unix-mode=0600;\r\n' + - ' name=\"hello.txt\"\r\n' + - '\r\n' + - body; - - conn.write(response, function() { - conn.destroy(); - server.close(); - }); -}); - -server.listen(common.PORT, function() { - http.get({host: '127.0.0.1', port: common.PROXY_PORT}, function(res) { - assert.equal(res.headers['content-type'], - 'text/plain;x-unix-mode=0600;name="hello.txt"'); - gotResponse = true; - }); -}); - -process.on('exit', function() { - assert.ok(gotResponse); -}); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-proxy.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-proxy.js deleted file mode 100644 index 2bbf9befa..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-proxy.js +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -var common = require('../common'); -var assert = require('assert'); -var http = require('http'); -var url = require('url'); - -var PROXY_PORT = common.PORT; -var BACKEND_PORT = common.PORT + 1; - -var cookies = [ - 'session_token=; path=/; expires=Sun, 15-Sep-2030 13:48:52 GMT', - 'prefers_open_id=; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT' -]; - -var headers = {'content-type': 'text/plain', - 'set-cookie': cookies, - 'hello': 'world' }; - -var backend = http.createServer(function(req, res) { - common.debug('backend request'); - res.writeHead(200, headers); - res.write('hello world\n'); - res.end(); -}); - -var proxy = http.createServer(function(req, res) { - common.debug('proxy req headers: ' + JSON.stringify(req.headers)); - var proxy_req = http.get({ - port: BACKEND_PORT, - path: url.parse(req.url).pathname - }, function(proxy_res) { - - common.debug('proxy res headers: ' + JSON.stringify(proxy_res.headers)); - - assert.equal('world', proxy_res.headers['hello']); - assert.equal('text/plain', proxy_res.headers['content-type']); - assert.deepEqual(cookies, proxy_res.headers['set-cookie']); - - res.writeHead(proxy_res.statusCode, proxy_res.headers); - - proxy_res.on('data', function(chunk) { - res.write(chunk); - }); - - proxy_res.on('end', function() { - res.end(); - common.debug('proxy res'); - }); - }); -}); - -var body = ''; - -var nlistening = 0; -function startReq() { - nlistening++; - if (nlistening < 2) return; - - var client = http.get({ - port: common.PROXY_PORT, - path: '/test' - }, function(res) { - common.debug('got res'); - assert.equal(200, res.statusCode); - - assert.equal('world', res.headers['hello']); - assert.equal('text/plain', res.headers['content-type']); - assert.deepEqual(cookies, res.headers['set-cookie']); - - res.setEncoding('utf8'); - res.on('data', function(chunk) { body += chunk; }); - res.on('end', function() { - proxy.close(); - backend.close(); - common.debug('closed both'); - }); - }); - common.debug('client req'); -} - -common.debug('listen proxy'); -proxy.listen(PROXY_PORT, startReq); - -common.debug('listen backend'); -backend.listen(BACKEND_PORT, startReq); - -process.on('exit', function() { - assert.equal(body, 'hello world\n'); -}); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-response-close.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-response-close.js deleted file mode 100644 index d4adf80d4..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-response-close.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -var common = require('../common'); -var assert = require('assert'); -var http = require('http'); - -var gotEnd = false; - -var server = http.createServer(function(req, res) { - res.writeHead(200); - res.write('a'); - - req.on('close', function() { - console.error('aborted'); - gotEnd = true; - }); -}); -server.listen(common.PORT); - -server.on('listening', function() { - console.error('make req'); - http.get({ - port: common.PROXY_PORT - }, function(res) { - console.error('got res'); - res.on('data', function(data) { - console.error('destroy res'); - res.destroy(); - server.close(); - }); - }); -}); - -process.on('exit', function() { - assert.ok(gotEnd); -}); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-server-multiheaders.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-server-multiheaders.js deleted file mode 100644 index 52b932ffc..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-server-multiheaders.js +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -// Verify that the HTTP server implementation handles multiple instances -// of the same header as per RFC2616: joining the handful of fields by ', ' -// that support it, and dropping duplicates for other fields. - -var common = require('../common'); -var assert = require('assert'); -var http = require('http'); - -var srv = http.createServer(function(req, res) { - assert.equal(req.headers.accept, 'abc, def, ghijklmnopqrst'); - assert.equal(req.headers.host, 'foo'); - assert.equal(req.headers['x-foo'], 'bingo'); - assert.equal(req.headers['x-bar'], 'banjo, bango'); - - res.writeHead(200, {'Content-Type' : 'text/plain'}); - res.end('EOF'); - - srv.close(); -}); - -srv.listen(common.PORT, function() { - http.get({ - host: 'localhost', - port: common.PROXY_PORT, - path: '/', - headers: [ - ['accept', 'abc'], - ['accept', 'def'], - ['Accept', 'ghijklmnopqrst'], - ['host', 'foo'], - ['Host', 'bar'], - ['hOst', 'baz'], - ['x-foo', 'bingo'], - ['x-bar', 'banjo'], - ['x-bar', 'bango'] - ] - }); -}); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-set-cookies.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-set-cookies.js deleted file mode 100644 index 9510e496e..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-set-cookies.js +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -var common = require('../common'); -var assert = require('assert'); -var http = require('http'); - -var nresponses = 0; - -var server = http.createServer(function(req, res) { - if (req.url == '/one') { - res.writeHead(200, [['set-cookie', 'A'], - ['content-type', 'text/plain']]); - res.end('one\n'); - } else { - res.writeHead(200, [['set-cookie', 'A'], - ['set-cookie', 'B'], - ['content-type', 'text/plain']]); - res.end('two\n'); - } -}); -server.listen(common.PORT); - -server.on('listening', function() { - // - // one set-cookie header - // - http.get({ port: common.PROXY_PORT, path: '/one' }, function(res) { - // set-cookie headers are always return in an array. - // even if there is only one. - assert.deepEqual(['A'], res.headers['set-cookie']); - assert.equal('text/plain', res.headers['content-type']); - - res.on('data', function(chunk) { - console.log(chunk.toString()); - }); - - res.on('end', function() { - if (++nresponses == 2) { - server.close(); - } - }); - }); - - // two set-cookie headers - - http.get({ port: common.PROXY_PORT, path: '/two' }, function(res) { - assert.deepEqual(['A', 'B'], res.headers['set-cookie']); - assert.equal('text/plain', res.headers['content-type']); - - res.on('data', function(chunk) { - console.log(chunk.toString()); - }); - - res.on('end', function() { - if (++nresponses == 2) { - server.close(); - } - }); - }); - -}); - -process.on('exit', function() { - assert.equal(2, nresponses); -}); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-status-code.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-status-code.js deleted file mode 100644 index b79e4d788..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-status-code.js +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -// libuv-broken - - -var common = require('../common'); -var assert = require('assert'); -var http = require('http'); - -// Simple test of Node's HTTP ServerResponse.statusCode -// ServerResponse.prototype.statusCode - -var testsComplete = 0; -var tests = [200, 202, 300, 404, 500]; -var testIdx = 0; - -var s = http.createServer(function(req, res) { - var t = tests[testIdx]; - res.writeHead(t, {'Content-Type': 'text/plain'}); - console.log('--\nserver: statusCode after writeHead: ' + res.statusCode); - assert.equal(res.statusCode, t); - res.end('hello world\n'); -}); - -s.listen(common.PORT, nextTest); - - -function nextTest() { - if (testIdx + 1 === tests.length) { - return s.close(); - } - var test = tests[testIdx]; - - http.get({ port: common.PROXY_PORT }, function(response) { - console.log('client: expected status: ' + test); - console.log('client: statusCode: ' + response.statusCode); - assert.equal(response.statusCode, test); - response.on('end', function() { - testsComplete++; - testIdx += 1; - nextTest(); - }); - }); -} - - -process.on('exit', function() { - assert.equal(4, testsComplete); -}); - diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-upgrade-server2.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-upgrade-server2.js deleted file mode 100644 index 8825f97de..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http-upgrade-server2.js +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -var common = require('../common'); -var assert = require('assert'); -var http = require('http'); -var net = require('net'); - -var server = http.createServer(function(req, res) { - common.error('got req'); - throw new Error('This shouldn\'t happen.'); -}); - -server.on('upgrade', function(req, socket, upgradeHead) { - common.error('got upgrade event'); - // test that throwing an error from upgrade gets - // is uncaught - throw new Error('upgrade error'); -}); - -var gotError = false; - -process.on('uncaughtException', function(e) { - common.error('got \'clientError\' event'); - assert.equal('upgrade error', e.message); - gotError = true; - process.exit(0); -}); - - -server.listen(common.PORT, function() { - var c = net.createConnection(common.PROXY_PORT); - - c.on('connect', function() { - common.error('client wrote message'); - c.write('GET /blah HTTP/1.1\r\n' + - 'Upgrade: WebSocket\r\n' + - 'Connection: Upgrade\r\n' + - '\r\n\r\nhello world'); - }); - - c.on('end', function() { - c.end(); - }); - - c.on('close', function() { - common.error('client close'); - server.close(); - }); -}); - -process.on('exit', function() { - assert.ok(gotError); -}); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http.js deleted file mode 100644 index fcbec28dd..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/core/simple/test-http.js +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -var common = require('../common'); -var assert = require('assert'); -var http = require('http'); -var url = require('url'); - -function p(x) { - common.error(common.inspect(x)); -} - -var responses_sent = 0; -var responses_recvd = 0; -var body0 = ''; -var body1 = ''; - -var server = http.Server(function(req, res) { - if (responses_sent == 0) { - assert.equal('GET', req.method); - assert.equal('/hello', url.parse(req.url).pathname); - - console.dir(req.headers); - assert.equal(true, 'accept' in req.headers); - assert.equal('*/*', req.headers['accept']); - - assert.equal(true, 'foo' in req.headers); - assert.equal('bar', req.headers['foo']); - } - - if (responses_sent == 1) { - assert.equal('POST', req.method); - assert.equal('/world', url.parse(req.url).pathname); - this.close(); - } - - req.on('end', function() { - res.writeHead(200, {'Content-Type': 'text/plain'}); - res.write('The path was ' + url.parse(req.url).pathname); - res.end(); - responses_sent += 1; - }); - - //assert.equal('127.0.0.1', res.connection.remoteAddress); -}); -server.listen(common.PORT); - -server.on('listening', function() { - var agent = new http.Agent({ port: common.PROXY_PORT, maxSockets: 1 }); - http.get({ - port: common.PROXY_PORT, - path: '/hello', - headers: {'Accept': '*/*', 'Foo': 'bar'}, - agent: agent - }, function(res) { - assert.equal(200, res.statusCode); - responses_recvd += 1; - res.setEncoding('utf8'); - res.on('data', function(chunk) { body0 += chunk; }); - common.debug('Got /hello response'); - }); - - setTimeout(function() { - var req = http.request({ - port: common.PROXY_PORT, - method: 'POST', - path: '/world', - agent: agent - }, function(res) { - assert.equal(200, res.statusCode); - responses_recvd += 1; - res.setEncoding('utf8'); - res.on('data', function(chunk) { body1 += chunk; }); - common.debug('Got /world response'); - }); - req.end(); - }, 1); -}); - -process.on('exit', function() { - common.debug('responses_recvd: ' + responses_recvd); - assert.equal(2, responses_recvd); - - common.debug('responses_sent: ' + responses_sent); - assert.equal(2, responses_sent); - - assert.equal('The path was /hello', body0); - assert.equal('The path was /world', body1); -}); - diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/examples-test.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/examples-test.js deleted file mode 100644 index 36beb89a9..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/examples-test.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * examples.js: Tests which ensure all examples do not throw errors. - * - * (C) 2010, Charlie Robbins - * - */ - -var vows = require('vows') - macros = require('./macros'), - examples = macros.examples; - -// -// Suppress `EADDRINUSE` errors since -// we are just checking for require-time errors -// -process.on('uncaughtException', function (err) { - if (err.code !== 'EADDRINUSE') { - throw err; - } -}); - -vows.describe('node-http-proxy/examples').addBatch( - examples.shouldHaveDeps() -).addBatch( - examples.shouldHaveNoErrors() -).export(module); \ No newline at end of file diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/fixtures/agent2-cert.pem b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/fixtures/agent2-cert.pem deleted file mode 100644 index 8e4354db4..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/fixtures/agent2-cert.pem +++ /dev/null @@ -1,13 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIB7DCCAZYCCQC7gs0MDNn6MTANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJV -UzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYDVQQKEwZKb3llbnQxEDAO -BgNVBAsTB05vZGUuanMxDzANBgNVBAMTBmFnZW50MjEgMB4GCSqGSIb3DQEJARYR -cnlAdGlueWNsb3Vkcy5vcmcwHhcNMTEwMzE0MTgyOTEyWhcNMzgwNzI5MTgyOTEy -WjB9MQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYD -VQQKEwZKb3llbnQxEDAOBgNVBAsTB05vZGUuanMxDzANBgNVBAMTBmFnZW50MjEg -MB4GCSqGSIb3DQEJARYRcnlAdGlueWNsb3Vkcy5vcmcwXDANBgkqhkiG9w0BAQEF -AANLADBIAkEAyXb8FrRdKbhrKLgLSsn61i1C7w7fVVVd7OQsmV/7p9WB2lWFiDlC -WKGU9SiIz/A6wNZDUAuc2E+VwtpCT561AQIDAQABMA0GCSqGSIb3DQEBBQUAA0EA -C8HzpuNhFLCI3A5KkBS5zHAQax6TFUOhbpBCR0aTDbJ6F1liDTK1lmU/BjvPoj+9 -1LHwrmh29rK8kBPEjmymCQ== ------END CERTIFICATE----- diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/fixtures/agent2-csr.pem b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/fixtures/agent2-csr.pem deleted file mode 100644 index a670c4c63..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/fixtures/agent2-csr.pem +++ /dev/null @@ -1,10 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIIBXTCCAQcCAQAwfTELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMQswCQYDVQQH -EwJTRjEPMA0GA1UEChMGSm95ZW50MRAwDgYDVQQLEwdOb2RlLmpzMQ8wDQYDVQQD -EwZhZ2VudDIxIDAeBgkqhkiG9w0BCQEWEXJ5QHRpbnljbG91ZHMub3JnMFwwDQYJ -KoZIhvcNAQEBBQADSwAwSAJBAMl2/Ba0XSm4ayi4C0rJ+tYtQu8O31VVXezkLJlf -+6fVgdpVhYg5QlihlPUoiM/wOsDWQ1ALnNhPlcLaQk+etQECAwEAAaAlMCMGCSqG -SIb3DQEJBzEWExRBIGNoYWxsZW5nZSBwYXNzd29yZDANBgkqhkiG9w0BAQUFAANB -AJnll2pt5l0pzskQSpjjLVTlFDFmJr/AZ3UK8v0WxBjYjCe5Jx4YehkChpxIyDUm -U3J9q9MDUf0+Y2+EGkssFfk= ------END CERTIFICATE REQUEST----- diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/fixtures/agent2-key.pem b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/fixtures/agent2-key.pem deleted file mode 100644 index 522903c63..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/fixtures/agent2-key.pem +++ /dev/null @@ -1,9 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIBOgIBAAJBAMl2/Ba0XSm4ayi4C0rJ+tYtQu8O31VVXezkLJlf+6fVgdpVhYg5 -QlihlPUoiM/wOsDWQ1ALnNhPlcLaQk+etQECAwEAAQJBAMT6Bf34+UHKY1ObpsbH -9u2jsVblFq1rWvs8GPMY6oertzvwm3DpuSUp7PTgOB1nLTLYtCERbQ4ovtN8tn3p -OHUCIQDzIEGsoCr5vlxXvy2zJwu+fxYuhTZWMVuo1397L0VyhwIhANQh+yzqUgaf -WRtSB4T2W7ADtJI35ET61jKBty3CqJY3AiAIwju7dVW3A5WeD6Qc1SZGKZvp9yCb -AFI2BfVwwaY11wIgXF3PeGcvACMyMWsuSv7aPXHfliswAbkWuzcwA4TW01ECIGWa -cgsDvVFxmfM5NPSuT/UDTa6R5BFISB5ea0N0AR3I ------END RSA PRIVATE KEY----- diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/fixtures/agent2.cnf b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/fixtures/agent2.cnf deleted file mode 100644 index 0a9f2c737..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/fixtures/agent2.cnf +++ /dev/null @@ -1,19 +0,0 @@ -[ req ] -default_bits = 1024 -days = 999 -distinguished_name = req_distinguished_name -attributes = req_attributes -prompt = no - -[ req_distinguished_name ] -C = US -ST = CA -L = SF -O = Joyent -OU = Node.js -CN = agent2 -emailAddress = ry@tinyclouds.org - -[ req_attributes ] -challengePassword = A challenge password - diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/helpers/http.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/helpers/http.js deleted file mode 100644 index 347962653..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/helpers/http.js +++ /dev/null @@ -1,169 +0,0 @@ -/* - * http.js: Top level include for node-http-proxy http helpers - * - * (C) 2010 Nodejitsu Inc. - * MIT LICENCE - * - */ - -var assert = require('assert'), - http = require('http'), - https = require('https'), - url = require('url'), - async = require('async'), - helpers = require('./index'), - protocols = helpers.protocols, - httpProxy = require('../../lib/node-http-proxy'); - -// -// ### function createServerPair (options, callback) -// #### @options {Object} Options to create target and proxy server. -// #### @callback {function} Continuation to respond to when complete. -// -// Creates http target and proxy servers -// -exports.createServerPair = function (options, callback) { - async.series([ - // - // 1. Create the target server - // - function createTarget(next) { - exports.createServer(options.target, next); - }, - // - // 2. Create the proxy server - // - function createTarget(next) { - exports.createProxyServer(options.proxy, next); - } - ], callback); -}; - -// -// ### function createServer (options, callback) -// #### @options {Object} Options for creatig an http server. -// #### @port {number} Port to listen on -// #### @output {string} String to write to each HTTP response -// #### @headers {Object} Headers to assert are sent by `node-http-proxy`. -// #### @callback {function} Continuation to respond to when complete. -// -// Creates a target server that the tests will proxy to. -// -exports.createServer = function (options, callback) { - // - // Request handler to use in either `http` - // or `https` server. - // - function requestHandler(req, res) { - if (options.headers) { - Object.keys(options.headers).forEach(function (key) { - assert.equal(req.headers[key], options.headers[key]); - }); - } - - res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.write(options.output || 'hello proxy'); - res.end(); - } - - var server = protocols.target === 'https' - ? https.createServer(helpers.https, requestHandler) - : http.createServer(requestHandler); - - server.listen(options.port, function () { - callback(null, this); - }); -}; - -// -// ### function createProxyServer (options, callback) -// #### @options {Object} Options for creatig an http server. -// #### @port {number} Port to listen on -// #### @latency {number} Latency of this server in milliseconds -// #### @proxy {Object} Options to pass to the HttpProxy. -// #### @routing {boolean} Enables `httpProxy.RoutingProxy` -// #### @callback {function} Continuation to respond to when complete. -// -// Creates a proxy server that the tests will request against. -// -exports.createProxyServer = function (options, callback) { - if (!options.latency) { - if (protocols.proxy === 'https') { - options.proxy.https = helpers.https; - } - options.proxy.rejectUnauthorized = false; - - return httpProxy - .createServer(options.proxy) - .listen(options.port, function () { - callback(null, this); - }); - } - - var server, - proxy; - - proxy = options.routing - ? new httpProxy.RoutingProxy(options.proxy) - : new httpProxy.HttpProxy(options.proxy); - - // - // Request handler to use in either `http` - // or `https` server. - // - function requestHandler(req, res) { - var buffer = httpProxy.buffer(req); - - setTimeout(function () { - // - // Setup options dynamically for `RoutingProxy.prototype.proxyRequest` - // or `HttpProxy.prototype.proxyRequest`. - // - buffer = options.routing ? { buffer: buffer } : buffer; - proxy.proxyRequest(req, res, buffer); - }, options.latency); - } - - server = protocols.proxy === 'https' - ? https.createServer(helpers.https, requestHandler) - : http.createServer(requestHandler); - - server.listen(options.port, function () { - callback(null, this); - }); -}; - -// -// ### function assignPortsToRoutes (routes) -// #### @routes {Object} Routing table to assign ports to -// -// Assigns dynamic ports to the `routes` for runtime testing. -// -exports.assignPortsToRoutes = function (routes) { - Object.keys(routes).forEach(function (source) { - routes[source] = routes[source].replace('{PORT}', helpers.nextPort); - }); - - return routes; -}; - -// -// ### function parseRoutes (options) -// #### @options {Object} Options to use when parsing routes -// #### @protocol {string} Protocol to use in the routes -// #### @routes {Object} Routes to parse. -// -// Returns an Array of fully-parsed URLs for the source and -// target of `options.routes`. -// -exports.parseRoutes = function (options) { - var protocol = options.protocol || 'http', - routes = options.routes; - - return Object.keys(routes).map(function (source) { - return { - source: url.parse(protocol + '://' + source), - target: url.parse(protocol + '://' + routes[source]) - }; - }); -}; diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/helpers/index.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/helpers/index.js deleted file mode 100644 index 7e3c3f488..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/helpers/index.js +++ /dev/null @@ -1,105 +0,0 @@ -/* - * index.js: Top level include for node-http-proxy helpers - * - * (C) 2010 Nodejitsu Inc. - * MIT LICENCE - * - */ - -var fs = require('fs'), - path = require('path'); - -var fixturesDir = path.join(__dirname, '..', 'fixtures'); - -// -// @https {Object} -// Returns the necessary `https` credentials. -// -Object.defineProperty(exports, 'https', { - get: function () { - delete this.https; - return this.https = { - key: fs.readFileSync(path.join(fixturesDir, 'agent2-key.pem'), 'utf8'), - cert: fs.readFileSync(path.join(fixturesDir, 'agent2-cert.pem'), 'utf8') - }; - } -}); - -// -// @protocols {Object} -// Returns an object representing the desired protocols -// for the `proxy` and `target` server. -// -Object.defineProperty(exports, 'protocols', { - get: function () { - delete this.protocols; - return this.protocols = { - target: exports.argv.target || 'http', - proxy: exports.argv.proxy || 'http' - }; - } -}); - -// -// @nextPort {number} -// Returns an auto-incrementing port for tests. -// -Object.defineProperty(exports, 'nextPort', { - get: function () { - var current = this.port || 9050; - this.port = current + 1; - return current; - } -}); - -// -// @nextPortPair {Object} -// Returns an auto-incrementing pair of ports for tests. -// -Object.defineProperty(exports, 'nextPortPair', { - get: function () { - return { - target: this.nextPort, - proxy: this.nextPort - }; - } -}); - -// -// ### function describe(prefix) -// #### @prefix {string} Prefix to use before the description -// -// Returns a string representing the protocols that this suite -// is testing based on CLI arguments. -// -exports.describe = function (prefix, base) { - prefix = prefix || ''; - base = base || 'http'; - - function protocol(endpoint) { - return exports.protocols[endpoint] === 'https' - ? base + 's' - : base; - } - - return [ - 'node-http-proxy', - prefix, - [ - protocol('proxy'), - '-to-', - protocol('target') - ].join('') - ].filter(Boolean).join('/'); -}; - -// -// Expose the CLI arguments -// -exports.argv = require('optimist').argv; - -// -// Export additional helpers for `http` and `websockets`. -// -exports.http = require('./http'); -exports.ws = require('./ws'); \ No newline at end of file diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/helpers/ws.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/helpers/ws.js deleted file mode 100644 index a4905227d..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/helpers/ws.js +++ /dev/null @@ -1,112 +0,0 @@ -/* - * ws.js: Top level include for node-http-proxy websocket helpers - * - * (C) 2010 Nodejitsu Inc. - * MIT LICENCE - * - */ - -var assert = require('assert'), - https = require('https'), - async = require('async'), - io = require('socket.io'), - ws = require('ws'), - helpers = require('./index'), - protocols = helpers.protocols, - http = require('./http'); - -// -// ### function createServerPair (options, callback) -// #### @options {Object} Options to create target and proxy server. -// #### @target {Object} Options for the target server. -// #### @proxy {Object} Options for the proxy server. -// #### @callback {function} Continuation to respond to when complete. -// -// Creates http target and proxy servers -// -exports.createServerPair = function (options, callback) { - async.series([ - // - // 1. Create the target server - // - function createTarget(next) { - exports.createServer(options.target, next); - }, - // - // 2. Create the proxy server - // - function createTarget(next) { - http.createProxyServer(options.proxy, next); - } - ], callback); -}; - -// -// ### function createServer (options, callback) -// #### @options {Object} Options for creating the socket.io or ws server. -// #### @raw {boolean} Enables ws.Websocket server. -// -// Creates a socket.io or ws server using the specified `options`. -// -exports.createServer = function (options, callback) { - return options.raw - ? exports.createWsServer(options, callback) - : exports.createSocketIoServer(options, callback); -}; - -// -// ### function createSocketIoServer (options, callback) -// #### @options {Object} Options for creating the socket.io server -// #### @port {number} Port to listen on -// #### @input {string} Input to expect from the only socket -// #### @output {string} Output to send the only socket -// -// Creates a socket.io server on the specified `options.port` which -// will expect `options.input` and then send `options.output`. -// -exports.createSocketIoServer = function (options, callback) { - var server = protocols.target === 'https' - ? io.listen(options.port, helpers.https, callback) - : io.listen(options.port, callback); - - server.sockets.on('connection', function (socket) { - socket.on('incoming', function (data) { - assert.equal(data, options.input); - socket.emit('outgoing', options.output); - }); - }); -}; - -// -// ### function createWsServer (options, callback) -// #### @options {Object} Options for creating the ws.Server instance -// #### @port {number} Port to listen on -// #### @input {string} Input to expect from the only socket -// #### @output {string} Output to send the only socket -// -// Creates a ws.Server instance on the specified `options.port` which -// will expect `options.input` and then send `options.output`. -// -exports.createWsServer = function (options, callback) { - var server, - wss; - - if (protocols.target === 'https') { - server = https.createServer(helpers.https, function (req, res) { - req.writeHead(200); - req.end(); - }).listen(options.port, callback); - - wss = new ws.Server({ server: server }); - } - else { - wss = new ws.Server({ port: options.port }, callback); - } - - wss.on('connection', function (socket) { - socket.on('message', function (data) { - assert.equal(data, options.input); - socket.send(options.output); - }); - }); -}; \ No newline at end of file diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/http/http-test.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/http/http-test.js deleted file mode 100644 index 585597c12..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/http/http-test.js +++ /dev/null @@ -1,57 +0,0 @@ -/* - node-http-proxy-test.js: http proxy for node.js - - Copyright (c) 2010 Charlie Robbins, Marak Squires and Fedor Indutny - - 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. - -*/ - -var assert = require('assert'), - fs = require('fs'), - path = require('path'), - async = require('async'), - request = require('request'), - vows = require('vows'), - macros = require('../macros'), - helpers = require('../helpers'); - -var routeFile = path.join(__dirname, 'config.json'); - -vows.describe(helpers.describe()).addBatch({ - "With a valid target server": { - "and no latency": { - "and no headers": macros.http.assertProxied(), - "and headers": macros.http.assertProxied({ - request: { headers: { host: 'unknown.com' } } - }), - "and forwarding enabled": macros.http.assertForwardProxied() - }, - "and latency": macros.http.assertProxied({ - latency: 2000 - }) - }, - "With a no valid target server": { - "and no latency": macros.http.assertInvalidProxy(), - "and latency": macros.http.assertInvalidProxy({ - latency: 2000 - }) - } -}).export(module); \ No newline at end of file diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/http/routing-table-test.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/http/routing-table-test.js deleted file mode 100644 index f758bbab3..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/http/routing-table-test.js +++ /dev/null @@ -1,89 +0,0 @@ -/* - * routing-table-test.js: Tests for the proxying using the ProxyTable object. - * - * (C) 2010, Charlie Robbins - * - */ - -var assert = require('assert'), - fs = require('fs'), - path = require('path'), - async = require('async'), - request = require('request'), - vows = require('vows'), - macros = require('../macros'), - helpers = require('../helpers/index'); - -var routeFile = path.join(__dirname, 'config.json'); - -vows.describe(helpers.describe('routing-table')).addBatch({ - "With a routing table": { - "with latency": macros.http.assertProxiedToRoutes({ - latency: 2000, - routes: { - "icanhaz.com": "127.0.0.1:{PORT}", - "latency.com": "127.0.0.1:{PORT}" - } - }), - "using RegExp": macros.http.assertProxiedToRoutes({ - routes: { - "foo.com": "127.0.0.1:{PORT}", - "bar.com": "127.0.0.1:{PORT}", - "baz.com/taco": "127.0.0.1:{PORT}", - "pizza.com/taco/muffins": "127.0.0.1:{PORT}", - "blah.com/me": "127.0.0.1:{PORT}/remapped", - "bleh.com/remap/this": "127.0.0.1:{PORT}/remap/remapped", - "test.com/double/tap": "127.0.0.1:{PORT}/remap" - } - }), - "using hostnameOnly": macros.http.assertProxiedToRoutes({ - hostnameOnly: true, - routes: { - "foo.com": "127.0.0.1:{PORT}", - "bar.com": "127.0.0.1:{PORT}" - } - }), - "using a routing file": macros.http.assertProxiedToRoutes({ - filename: routeFile, - routes: { - "foo.com": "127.0.0.1:{PORT}", - "bar.com": "127.0.0.1:{PORT}" - } - }, { - "after the file has been modified": { - topic: function () { - var config = JSON.parse(fs.readFileSync(routeFile, 'utf8')), - protocol = helpers.protocols.proxy, - port = helpers.nextPort, - that = this; - - config.router['dynamic.com'] = "127.0.0.1:" + port; - fs.writeFileSync(routeFile, JSON.stringify(config)); - - async.parallel([ - function waitForRoutes(next) { - that.proxyServer.on('routes', next); - }, - async.apply( - helpers.http.createServer, - { - port: port, - output: 'hello from dynamic.com' - } - ) - ], function () { - request({ - uri: protocol + '://127.0.0.1:' + that.port, - headers: { - host: 'dynamic.com' - } - }, that.callback); - }); - }, - "should receive 'hello from dynamic.com'": function (err, res, body) { - assert.equal(body, 'hello from dynamic.com'); - } - } - }) - } -}).export(module); diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/macros/examples.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/macros/examples.js deleted file mode 100644 index 9d4202e6a..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/macros/examples.js +++ /dev/null @@ -1,101 +0,0 @@ -/* - * examples.js: Macros for testing code in examples/ - * - * (C) 2010 Nodejitsu Inc. - * MIT LICENCE - * - */ - -var assert = require('assert'), - fs = require('fs'), - path = require('path'), - spawn = require('child_process').spawn, - async = require('async'); - -var rootDir = path.join(__dirname, '..', '..'), - examplesDir = path.join(rootDir, 'examples'); - -// -// ### function shouldHaveDeps () -// -// Ensures that all `npm` dependencies are installed in `/examples`. -// -exports.shouldHaveDeps = function () { - return { - "Before testing examples": { - topic: function () { - async.waterfall([ - // - // 1. Read files in examples dir - // - async.apply(fs.readdir, examplesDir), - // - // 2. If node_modules exists, continue. Otherwise - // exec `npm` to install them - // - function checkNodeModules(files, next) { - if (files.indexOf('node_modules') !== -1) { - return next(); - } - - var child = spawn('npm', ['install', '-f'], { - cwd: examplesDir - }); - - child.on('exit', function (code) { - return code - ? next(new Error('npm install exited with non-zero exit code')) - : next(); - }); - }, - // - // 3. Read files in examples dir again to ensure the install - // worked as expected. - // - async.apply(fs.readdir, examplesDir), - ], this.callback); - }, - "examples/node_modules should exist": function (err, files) { - assert.notEqual(files.indexOf('node_modules'), -1); - } - } - } -}; - -// -// ### function shouldRequire (file) -// #### @file {string} File to attempt to require -// -// Returns a test which attempts to require `file`. -// -exports.shouldRequire = function (file) { - return { - "should have no errors": function () { - try { assert.isObject(require(file)) } - catch (ex) { assert.isNull(ex) } - } - }; -}; - -// -// ### function shouldHaveNoErrors () -// -// Returns a vows context that attempts to require -// every relevant example file in `examples`. -// -exports.shouldHaveNoErrors = function () { - var context = {}; - - ['balancer', 'http', 'middleware', 'websocket'].forEach(function (dir) { - var name = 'examples/' + dir, - files = fs.readdirSync(path.join(rootDir, 'examples', dir)); - - files.forEach(function (file) { - context[name + '/' + file] = exports.shouldRequire(path.join( - examplesDir, dir, file - )); - }); - }); - - return context; -}; \ No newline at end of file diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/macros/http.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/macros/http.js deleted file mode 100644 index 767b7db50..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/macros/http.js +++ /dev/null @@ -1,324 +0,0 @@ -/* - * http.js: Macros for proxying HTTP requests - * - * (C) 2010 Nodejitsu Inc. - * MIT LICENCE - * - */ - -var assert = require('assert'), - fs = require('fs'), - async = require('async'), - request = require('request'), - helpers = require('../helpers/index'); - -// -// ### function assertRequest (options) -// #### @options {Object} Options for this request assertion. -// #### @request {Object} Options to use for `request`. -// #### @assert {Object} Test assertions against the response. -// -// Makes a request using `options.request` and then asserts the response -// and body against anything in `options.assert`. -// -exports.assertRequest = function (options) { - return { - topic: function () { - // - // Now make the HTTP request and assert. - // - options.request.rejectUnauthorized = false; - request(options.request, this.callback); - }, - "should succeed": function (err, res, body) { - assert.isNull(err); - if (options.assert.body) { - assert.equal(body, options.assert.body); - } - - if (options.assert.statusCode) { - assert.equal(res.statusCode, options.assert.statusCode); - } - } - }; -}; - -// -// ### function assertProxied (options) -// #### @options {Object} Options for this test -// #### @latency {number} Latency in milliseconds for the proxy server. -// #### @ports {Object} Ports for the request (target, proxy). -// #### @output {string} Output to assert from. -// #### @forward {Object} Options for forward proxying. -// -// Creates a complete end-to-end test for requesting against an -// http proxy. -// -exports.assertProxied = function (options) { - options = options || {}; - - var ports = options.ports || helpers.nextPortPair, - output = options.output || 'hello world from ' + ports.target, - protocol = helpers.protocols.proxy, - req = options.request || {}; - - req.uri = req.uri || protocol + '://127.0.0.1:' + ports.proxy; - - return { - topic: function () { - // - // Create a target server and a proxy server - // using the `options` supplied. - // - helpers.http.createServerPair({ - target: { - output: output, - port: ports.target, - headers: req.headers - }, - proxy: { - latency: options.latency, - port: ports.proxy, - proxy: { - forward: options.forward, - target: { - https: helpers.protocols.target === 'https', - host: '127.0.0.1', - port: ports.target - } - } - } - }, this.callback); - }, - "the proxy request": exports.assertRequest({ - request: req, - assert: { - body: output - } - }) - }; -}; - -// -// ### function assertInvalidProxy (options) -// #### @options {Object} Options for this test -// #### @latency {number} Latency in milliseconds for the proxy server -// #### @ports {Object} Ports for the request (target, proxy) -// -// Creates a complete end-to-end test for requesting against an -// http proxy with no target server. -// -exports.assertInvalidProxy = function (options) { - options = options || {}; - - var ports = options.ports || helpers.nextPortPair, - req = options.request || {}, - protocol = helpers.protocols.proxy; - - - req.uri = req.uri || protocol + '://127.0.0.1:' + ports.proxy; - - return { - topic: function () { - // - // Only create the proxy server, simulating a reverse-proxy - // to an invalid location. - // - helpers.http.createProxyServer({ - latency: options.latency, - port: ports.proxy, - proxy: { - target: { - host: '127.0.0.1', - port: ports.target - } - } - }, this.callback); - }, - "the proxy request": exports.assertRequest({ - request: req, - assert: { - statusCode: 500 - } - }) - }; -}; - -// -// ### function assertForwardProxied (options) -// #### @options {Object} Options for this test. -// -// Creates a complete end-to-end test for requesting against an -// http proxy with both a valid and invalid forward target. -// -exports.assertForwardProxied = function (options) { - var forwardPort = helpers.nextPort; - - return { - topic: function () { - helpers.http.createServer({ - output: 'hello from forward', - port: forwardPort - }, this.callback); - }, - "and a valid forward target": exports.assertProxied({ - forward: { - port: forwardPort, - host: '127.0.0.1' - } - }), - "and an invalid forward target": exports.assertProxied({ - forward: { - port: 9898, - host: '127.0.0.1' - } - }) - }; -}; - -// -// ### function assertProxiedtoRoutes (options, nested) -// #### @options {Object} Options for this ProxyTable-based test -// #### @routes {Object|string} Routes to use for the proxy. -// #### @hostnameOnly {boolean} Enables hostnameOnly routing. -// #### @nested {Object} Nested vows to add to the returned context. -// -// Creates a complete end-to-end test for requesting against an -// http proxy using `options.routes`: -// -// 1. Creates target servers for all routes in `options.routes.` -// 2. Creates a proxy server. -// 3. Ensure requests to the proxy server for all route targets -// returns the unique expected output. -// -exports.assertProxiedToRoutes = function (options, nested) { - // - // Assign dynamic ports to the routes to use. - // - options.routes = helpers.http.assignPortsToRoutes(options.routes); - - // - // Parse locations from routes for making assertion requests. - // - var locations = helpers.http.parseRoutes(options), - port = helpers.nextPort, - protocol = helpers.protocols.proxy, - context, - proxy; - - if (options.filename) { - // - // If we've been passed a filename write the routes to it - // and setup the proxy options to use that file. - // - fs.writeFileSync(options.filename, JSON.stringify({ router: options.routes })); - proxy = { router: options.filename }; - } - else { - // - // Otherwise just use the routes themselves. - // - proxy = { - hostnameOnly: options.hostnameOnly, - router: options.routes - }; - } - - // - // Set the https options if necessary - // - if (helpers.protocols.target === 'https') { - proxy.target = { https: true }; - } - - // - // Create the test context which creates all target - // servers for all routes and a proxy server. - // - context = { - topic: function () { - var that = this; - - async.waterfall([ - // - // 1. Create all the target servers - // - async.apply( - async.forEach, - locations, - function createRouteTarget(location, next) { - helpers.http.createServer({ - port: location.target.port, - output: 'hello from ' + location.source.href - }, next); - } - ), - // - // 2. Create the proxy server - // - async.apply( - helpers.http.createProxyServer, - { - port: port, - latency: options.latency, - routing: true, - proxy: proxy - } - ) - ], function (_, server) { - // - // 3. Set the proxy server for later use - // - that.proxyServer = server; - that.callback(); - }); - - // - // 4. Assign the port to the context for later use - // - this.port = port; - }, - // - // Add an extra assertion to a route which - // should respond with 404 - // - "a request to unknown.com": exports.assertRequest({ - assert: { statusCode: 404 }, - request: { - uri: protocol + '://127.0.0.1:' + port, - headers: { - host: 'unknown.com' - } - } - }) - }; - - // - // Add test assertions for each of the route locations. - // - locations.forEach(function (location) { - context[location.source.href] = exports.assertRequest({ - request: { - uri: protocol + '://127.0.0.1:' + port + location.source.path, - headers: { - host: location.source.hostname - } - }, - assert: { - body: 'hello from ' + location.source.href - } - }); - }); - - // - // If there are any nested vows to add to the context - // add them before returning the full context. - // - if (nested) { - Object.keys(nested).forEach(function (key) { - context[key] = nested[key]; - }); - } - - return context; -}; diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/macros/index.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/macros/index.js deleted file mode 100644 index c01f962b0..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/macros/index.js +++ /dev/null @@ -1,11 +0,0 @@ -/* - * index.js: Top level include for node-http-proxy macros - * - * (C) 2010 Nodejitsu Inc. - * MIT LICENCE - * - */ - -exports.examples = require('./examples'); -exports.http = require('./http'); -exports.ws = require('./ws'); \ No newline at end of file diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/macros/ws.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/macros/ws.js deleted file mode 100644 index 508725a49..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/macros/ws.js +++ /dev/null @@ -1,232 +0,0 @@ -/* - * ws.js: Macros for proxying Websocket requests - * - * (C) 2010 Nodejitsu Inc. - * MIT LICENCE - * - */ - -var assert = require('assert'), - fs = require('fs'), - async = require('async'), - io = require('socket.io-client'), - WebSocket = require('ws'), - helpers = require('../helpers/index'); - -// -// ### function assertSendRecieve (options) -// #### @options {Object} Options for creating this assertion. -// #### @raw {boolean} Enables raw `ws.WebSocket`. -// #### @uri {string} URI of the proxy server. -// #### @input {string} Input to assert sent to the target ws server. -// #### @output {string} Output to assert from the taget ws server. -// -// Creates a `socket.io` or raw `WebSocket` connection and asserts that -// `options.input` is sent to and `options.output` is received from the -// connection. -// -exports.assertSendReceive = function (options) { - if (!options.raw) { - return { - topic: function () { - var socket = io.connect(options.uri); - socket.on('outgoing', this.callback.bind(this, null)); - socket.emit('incoming', options.input); - }, - "should send input and receive output": function (_, data) { - assert.equal(data, options.output); - } - }; - } - - return { - topic: function () { - var socket = new WebSocket(options.uri); - socket.on('message', this.callback.bind(this, null)); - socket.on('open', function () { - socket.send(options.input); - }); - }, - "should send input and recieve output": function (_, data, flags) { - assert.equal(data, options.output); - } - }; -}; - -// -// ### function assertProxied (options) -// #### @options {Object} Options for this test -// #### @latency {number} Latency in milliseconds for the proxy server. -// #### @ports {Object} Ports for the request (target, proxy). -// #### @input {string} Input to assert sent to the target ws server. -// #### @output {string} Output to assert from the taget ws server. -// #### @raw {boolean} Enables raw `ws.Server` usage. -// -// Creates a complete end-to-end test for requesting against an -// http proxy. -// -exports.assertProxied = function (options) { - options = options || {}; - - var ports = options.ports || helpers.nextPortPair, - input = options.input || 'hello world to ' + ports.target, - output = options.output || 'hello world from ' + ports.target, - protocol = helpers.protocols.proxy; - - if (options.raw) { - protocol = helpers.protocols.proxy === 'https' - ? 'wss' - : 'ws'; - } - - return { - topic: function () { - helpers.ws.createServerPair({ - target: { - input: input, - output: output, - port: ports.target, - raw: options.raw - }, - proxy: { - latency: options.latency, - port: ports.proxy, - proxy: { - target: { - https: helpers.protocols.target === 'https', - host: '127.0.0.1', - port: ports.target - } - } - } - }, this.callback); - }, - "the proxy Websocket connection": exports.assertSendReceive({ - uri: protocol + '://127.0.0.1:' + ports.proxy, - input: input, - output: output, - raw: options.raw - }) - }; -}; - -// -// ### function assertProxiedtoRoutes (options, nested) -// #### @options {Object} Options for this ProxyTable-based test -// #### @raw {boolean} Enables ws.Server usage. -// #### @routes {Object|string} Routes to use for the proxy. -// #### @hostnameOnly {boolean} Enables hostnameOnly routing. -// #### @nested {Object} Nested vows to add to the returned context. -// -// Creates a complete end-to-end test for requesting against an -// http proxy using `options.routes`: -// -// 1. Creates target servers for all routes in `options.routes.` -// 2. Creates a proxy server. -// 3. Ensure Websocket connections to the proxy server for all route targets -// can send input and recieve output. -// -exports.assertProxiedToRoutes = function (options, nested) { - // - // Assign dynamic ports to the routes to use. - // - options.routes = helpers.http.assignPortsToRoutes(options.routes); - - // - // Parse locations from routes for making assertion requests. - // - var locations = helpers.http.parseRoutes(options), - protocol = helpers.protocols.proxy, - port = helpers.nextPort, - context, - proxy; - - if (options.raw) { - protocol = helpers.protocols.proxy === 'https' - ? 'wss' - : 'ws'; - } - - if (options.filename) { - // - // If we've been passed a filename write the routes to it - // and setup the proxy options to use that file. - // - fs.writeFileSync(options.filename, JSON.stringify({ router: options.routes })); - proxy = { router: options.filename }; - } - else { - // - // Otherwise just use the routes themselves. - // - proxy = { - hostnameOnly: options.hostnameOnly, - router: options.routes - }; - } - - // - // Create the test context which creates all target - // servers for all routes and a proxy server. - // - context = { - topic: function () { - var that = this; - - async.waterfall([ - // - // 1. Create all the target servers - // - async.apply( - async.forEach, - locations, - function createRouteTarget(location, next) { - helpers.ws.createServer({ - raw: options.raw, - port: location.target.port, - output: 'hello from ' + location.source.href, - input: 'hello to ' + location.source.href - }, next); - } - ), - // - // 2. Create the proxy server - // - async.apply( - helpers.http.createProxyServer, - { - port: port, - latency: options.latency, - routing: true, - proxy: proxy - } - ) - ], function (_, server) { - // - // 3. Set the proxy server for later use - // - that.proxyServer = server; - that.callback(); - }); - - // - // 4. Assign the port to the context for later use - // - this.port = port; - } - }; - - // - // Add test assertions for each of the route locations. - // - locations.forEach(function (location) { - context[location.source.href] = exports.assertSendRecieve({ - uri: protocol + '://127.0.0.1:' + port + location.source.path, - output: 'hello from ' + location.source.href, - input: 'hello to ' + location.source.href, - raw: options.raw - }); - }); - - return context; -}; \ No newline at end of file diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/ws/routing-table-test.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/ws/routing-table-test.js deleted file mode 100644 index e04d64752..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/ws/routing-table-test.js +++ /dev/null @@ -1,25 +0,0 @@ -/* - * routing-tabletest.js: Test for proxying `socket.io` and raw `WebSocket` requests using a ProxyTable. - * - * (C) 2010 Nodejitsu Inc. - * MIT LICENCE - * - */ - -var vows = require('vows'), - macros = require('../macros'), - helpers = require('../helpers/index'); - -vows.describe(helpers.describe('routing-proxy', 'ws')).addBatch({ - "With a valid target server": { - "and no latency": { - "using ws": macros.ws.assertProxied(), - "using socket.io": macros.ws.assertProxied({ - raw: true - }), - }, - // "and latency": macros.websocket.assertProxied({ - // latency: 2000 - // }) - } -}).export(module); \ No newline at end of file diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/ws/socket.io-test.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/ws/socket.io-test.js deleted file mode 100644 index d833109e6..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/ws/socket.io-test.js +++ /dev/null @@ -1,20 +0,0 @@ -/* - * socket.io-test.js: Test for proxying `socket.io` requests. - * - * (C) 2010 Nodejitsu Inc. - * MIT LICENCE - * - */ - -var vows = require('vows'), - macros = require('../macros'), - helpers = require('../helpers/index'); - -vows.describe(helpers.describe('socket.io', 'ws')).addBatch({ - "With a valid target server": { - "and no latency": macros.ws.assertProxied(), - // "and latency": macros.ws.assertProxied({ - // latency: 2000 - // }) - } -}).export(module); \ No newline at end of file diff --git a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/ws/ws-test.js b/update_nation/node_modules/couchapp/node_modules/http-proxy/test/ws/ws-test.js deleted file mode 100644 index f3549152f..000000000 --- a/update_nation/node_modules/couchapp/node_modules/http-proxy/test/ws/ws-test.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * ws-test.js: Tests for proxying raw Websocket requests. - * - * (C) 2010 Nodejitsu Inc. - * MIT LICENCE - * - */ - -var vows = require('vows'), - macros = require('../macros'), - helpers = require('../helpers/index'); - -vows.describe(helpers.describe('websocket', 'ws')).addBatch({ - "With a valid target server": { - "and no latency": macros.ws.assertProxied({ - raw: true - }), - // "and latency": macros.ws.assertProxied({ - // raw: true, - // latency: 2000 - // }) - } -}).export(module); \ No newline at end of file diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/README.md b/update_nation/node_modules/couchapp/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/README.md deleted file mode 100644 index 052a62b8d..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/README.md +++ /dev/null @@ -1,54 +0,0 @@ - -# isarray - -`Array#isArray` for older browsers. - -## Usage - -```js -var isArray = require('isarray'); - -console.log(isArray([])); // => true -console.log(isArray({})); // => false -``` - -## Installation - -With [npm](http://npmjs.org) do - -```bash -$ npm install isarray -``` - -Then bundle for the browser with -[browserify](https://github.com/substack/browserify). - -With [component](http://component.io) do - -```bash -$ component install juliangruber/isarray -``` - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -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/update_nation/node_modules/couchapp/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/build/build.js b/update_nation/node_modules/couchapp/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/build/build.js deleted file mode 100644 index ec58596ae..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/build/build.js +++ /dev/null @@ -1,209 +0,0 @@ - -/** - * Require the given path. - * - * @param {String} path - * @return {Object} exports - * @api public - */ - -function require(path, parent, orig) { - var resolved = require.resolve(path); - - // lookup failed - if (null == resolved) { - orig = orig || path; - parent = parent || 'root'; - var err = new Error('Failed to require "' + orig + '" from "' + parent + '"'); - err.path = orig; - err.parent = parent; - err.require = true; - throw err; - } - - var module = require.modules[resolved]; - - // perform real require() - // by invoking the module's - // registered function - if (!module.exports) { - module.exports = {}; - module.client = module.component = true; - module.call(this, module.exports, require.relative(resolved), module); - } - - return module.exports; -} - -/** - * Registered modules. - */ - -require.modules = {}; - -/** - * Registered aliases. - */ - -require.aliases = {}; - -/** - * Resolve `path`. - * - * Lookup: - * - * - PATH/index.js - * - PATH.js - * - PATH - * - * @param {String} path - * @return {String} path or null - * @api private - */ - -require.resolve = function(path) { - if (path.charAt(0) === '/') path = path.slice(1); - var index = path + '/index.js'; - - var paths = [ - path, - path + '.js', - path + '.json', - path + '/index.js', - path + '/index.json' - ]; - - for (var i = 0; i < paths.length; i++) { - var path = paths[i]; - if (require.modules.hasOwnProperty(path)) return path; - } - - if (require.aliases.hasOwnProperty(index)) { - return require.aliases[index]; - } -}; - -/** - * Normalize `path` relative to the current path. - * - * @param {String} curr - * @param {String} path - * @return {String} - * @api private - */ - -require.normalize = function(curr, path) { - var segs = []; - - if ('.' != path.charAt(0)) return path; - - curr = curr.split('/'); - path = path.split('/'); - - for (var i = 0; i < path.length; ++i) { - if ('..' == path[i]) { - curr.pop(); - } else if ('.' != path[i] && '' != path[i]) { - segs.push(path[i]); - } - } - - return curr.concat(segs).join('/'); -}; - -/** - * Register module at `path` with callback `definition`. - * - * @param {String} path - * @param {Function} definition - * @api private - */ - -require.register = function(path, definition) { - require.modules[path] = definition; -}; - -/** - * Alias a module definition. - * - * @param {String} from - * @param {String} to - * @api private - */ - -require.alias = function(from, to) { - if (!require.modules.hasOwnProperty(from)) { - throw new Error('Failed to alias "' + from + '", it does not exist'); - } - require.aliases[to] = from; -}; - -/** - * Return a require function relative to the `parent` path. - * - * @param {String} parent - * @return {Function} - * @api private - */ - -require.relative = function(parent) { - var p = require.normalize(parent, '..'); - - /** - * lastIndexOf helper. - */ - - function lastIndexOf(arr, obj) { - var i = arr.length; - while (i--) { - if (arr[i] === obj) return i; - } - return -1; - } - - /** - * The relative require() itself. - */ - - function localRequire(path) { - var resolved = localRequire.resolve(path); - return require(resolved, parent, path); - } - - /** - * Resolve relative to the parent. - */ - - localRequire.resolve = function(path) { - var c = path.charAt(0); - if ('/' == c) return path.slice(1); - if ('.' == c) return require.normalize(p, path); - - // resolve deps by returning - // the dep in the nearest "deps" - // directory - var segs = parent.split('/'); - var i = lastIndexOf(segs, 'deps') + 1; - if (!i) i = 0; - path = segs.slice(0, i + 1).join('/') + '/deps/' + path; - return path; - }; - - /** - * Check if module is defined at `path`. - */ - - localRequire.exists = function(path) { - return require.modules.hasOwnProperty(localRequire.resolve(path)); - }; - - return localRequire; -}; -require.register("isarray/index.js", function(exports, require, module){ -module.exports = Array.isArray || function (arr) { - return Object.prototype.toString.call(arr) == '[object Array]'; -}; - -}); -require.alias("isarray/index.js", "isarray/index.js"); - diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/component.json b/update_nation/node_modules/couchapp/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/component.json deleted file mode 100644 index 9e31b6838..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/component.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name" : "isarray", - "description" : "Array#isArray for older browsers", - "version" : "0.0.1", - "repository" : "juliangruber/isarray", - "homepage": "https://github.com/juliangruber/isarray", - "main" : "index.js", - "scripts" : [ - "index.js" - ], - "dependencies" : {}, - "keywords": ["browser","isarray","array"], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "license": "MIT" -} diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/index.js b/update_nation/node_modules/couchapp/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/index.js deleted file mode 100644 index 5f5ad45d4..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/index.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = Array.isArray || function (arr) { - return Object.prototype.toString.call(arr) == '[object Array]'; -}; diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json b/update_nation/node_modules/couchapp/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json deleted file mode 100644 index 02be6fe9c..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "isarray", - "description": "Array#isArray for older browsers", - "version": "0.0.1", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/isarray.git" - }, - "homepage": "https://github.com/juliangruber/isarray", - "main": "index.js", - "scripts": { - "test": "tap test/*.js" - }, - "dependencies": {}, - "devDependencies": { - "tap": "*" - }, - "keywords": [ - "browser", - "isarray", - "array" - ], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "license": "MIT", - "readme": "\n# isarray\n\n`Array#isArray` for older browsers.\n\n## Usage\n\n```js\nvar isArray = require('isarray');\n\nconsole.log(isArray([])); // => true\nconsole.log(isArray({})); // => false\n```\n\n## Installation\n\nWith [npm](http://npmjs.org) do\n\n```bash\n$ npm install isarray\n```\n\nThen bundle for the browser with\n[browserify](https://github.com/substack/browserify).\n\nWith [component](http://component.io) do\n\n```bash\n$ component install juliangruber/isarray\n```\n\n## License\n\n(MIT)\n\nCopyright (c) 2013 Julian Gruber <julian@juliangruber.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/juliangruber/isarray/issues" - }, - "_id": "isarray@0.0.1", - "_from": "isarray@0.0.1" -} diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/.npmignore b/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/.npmignore deleted file mode 100644 index 2fedb26cc..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -*.un~ -/node_modules/* diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/License b/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/License deleted file mode 100644 index 4804b7ab4..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/License +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2011 Debuggable Limited - -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/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Makefile b/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Makefile deleted file mode 100644 index b4ff85a33..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -SHELL := /bin/bash - -test: - @./test/run.js - -.PHONY: test - diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Readme.md b/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Readme.md deleted file mode 100644 index 5cb5b35e5..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Readme.md +++ /dev/null @@ -1,154 +0,0 @@ -# delayed-stream - -Buffers events from a stream until you are ready to handle them. - -## Installation - -``` bash -npm install delayed-stream -``` - -## Usage - -The following example shows how to write a http echo server that delays its -response by 1000 ms. - -``` javascript -var DelayedStream = require('delayed-stream'); -var http = require('http'); - -http.createServer(function(req, res) { - var delayed = DelayedStream.create(req); - - setTimeout(function() { - res.writeHead(200); - delayed.pipe(res); - }, 1000); -}); -``` - -If you are not using `Stream#pipe`, you can also manually release the buffered -events by calling `delayedStream.resume()`: - -``` javascript -var delayed = DelayedStream.create(req); - -setTimeout(function() { - // Emit all buffered events and resume underlaying source - delayed.resume(); -}, 1000); -``` - -## Implementation - -In order to use this meta stream properly, here are a few things you should -know about the implementation. - -### Event Buffering / Proxying - -All events of the `source` stream are hijacked by overwriting the `source.emit` -method. Until node implements a catch-all event listener, this is the only way. - -However, delayed-stream still continues to emit all events it captures on the -`source`, regardless of whether you have released the delayed stream yet or -not. - -Upon creation, delayed-stream captures all `source` events and stores them in -an internal event buffer. Once `delayedStream.release()` is called, all -buffered events are emitted on the `delayedStream`, and the event buffer is -cleared. After that, delayed-stream merely acts as a proxy for the underlaying -source. - -### Error handling - -Error events on `source` are buffered / proxied just like any other events. -However, `delayedStream.create` attaches a no-op `'error'` listener to the -`source`. This way you only have to handle errors on the `delayedStream` -object, rather than in two places. - -### Buffer limits - -delayed-stream provides a `maxDataSize` property that can be used to limit -the amount of data being buffered. In order to protect you from bad `source` -streams that don't react to `source.pause()`, this feature is enabled by -default. - -## API - -### DelayedStream.create(source, [options]) - -Returns a new `delayedStream`. Available options are: - -* `pauseStream` -* `maxDataSize` - -The description for those properties can be found below. - -### delayedStream.source - -The `source` stream managed by this object. This is useful if you are -passing your `delayedStream` around, and you still want to access properties -on the `source` object. - -### delayedStream.pauseStream = true - -Whether to pause the underlaying `source` when calling -`DelayedStream.create()`. Modifying this property afterwards has no effect. - -### delayedStream.maxDataSize = 1024 * 1024 - -The amount of data to buffer before emitting an `error`. - -If the underlaying source is emitting `Buffer` objects, the `maxDataSize` -refers to bytes. - -If the underlaying source is emitting JavaScript strings, the size refers to -characters. - -If you know what you are doing, you can set this property to `Infinity` to -disable this feature. You can also modify this property during runtime. - -### delayedStream.maxDataSize = 1024 * 1024 - -The amount of data to buffer before emitting an `error`. - -If the underlaying source is emitting `Buffer` objects, the `maxDataSize` -refers to bytes. - -If the underlaying source is emitting JavaScript strings, the size refers to -characters. - -If you know what you are doing, you can set this property to `Infinity` to -disable this feature. - -### delayedStream.dataSize = 0 - -The amount of data buffered so far. - -### delayedStream.readable - -An ECMA5 getter that returns the value of `source.readable`. - -### delayedStream.resume() - -If the `delayedStream` has not been released so far, `delayedStream.release()` -is called. - -In either case, `source.resume()` is called. - -### delayedStream.pause() - -Calls `source.pause()`. - -### delayedStream.pipe(dest) - -Calls `delayedStream.resume()` and then proxies the arguments to `source.pipe`. - -### delayedStream.release() - -Emits and clears all events that have been buffered up so far. This does not -resume the underlaying source, use `delayedStream.resume()` instead. - -## License - -delayed-stream is licensed under the MIT license. diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js b/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js deleted file mode 100644 index 7c10d4825..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js +++ /dev/null @@ -1,99 +0,0 @@ -var Stream = require('stream').Stream; -var util = require('util'); - -module.exports = DelayedStream; -function DelayedStream() { - this.source = null; - this.dataSize = 0; - this.maxDataSize = 1024 * 1024; - this.pauseStream = true; - - this._maxDataSizeExceeded = false; - this._released = false; - this._bufferedEvents = []; -} -util.inherits(DelayedStream, Stream); - -DelayedStream.create = function(source, options) { - var delayedStream = new this(); - - options = options || {}; - for (var option in options) { - delayedStream[option] = options[option]; - } - - delayedStream.source = source; - - var realEmit = source.emit; - source.emit = function() { - delayedStream._handleEmit(arguments); - return realEmit.apply(source, arguments); - }; - - source.on('error', function() {}); - if (delayedStream.pauseStream) { - source.pause(); - } - - return delayedStream; -}; - -DelayedStream.prototype.__defineGetter__('readable', function() { - return this.source.readable; -}); - -DelayedStream.prototype.resume = function() { - if (!this._released) { - this.release(); - } - - this.source.resume(); -}; - -DelayedStream.prototype.pause = function() { - this.source.pause(); -}; - -DelayedStream.prototype.release = function() { - this._released = true; - - this._bufferedEvents.forEach(function(args) { - this.emit.apply(this, args); - }.bind(this)); - this._bufferedEvents = []; -}; - -DelayedStream.prototype.pipe = function() { - var r = Stream.prototype.pipe.apply(this, arguments); - this.resume(); - return r; -}; - -DelayedStream.prototype._handleEmit = function(args) { - if (this._released) { - this.emit.apply(this, args); - return; - } - - if (args[0] === 'data') { - this.dataSize += args[1].length; - this._checkIfMaxDataSizeExceeded(); - } - - this._bufferedEvents.push(args); -}; - -DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { - if (this._maxDataSizeExceeded) { - return; - } - - if (this.dataSize <= this.maxDataSize) { - return; - } - - this._maxDataSizeExceeded = true; - var message = - 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.' - this.emit('error', new Error(message)); -}; diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/package.json b/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/package.json deleted file mode 100644 index 38341b8a0..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "author": { - "name": "Felix Geisendörfer", - "email": "felix@debuggable.com", - "url": "http://debuggable.com/" - }, - "name": "delayed-stream", - "description": "Buffers events from a stream until you are ready to handle them.", - "version": "0.0.5", - "homepage": "https://github.com/felixge/node-delayed-stream", - "repository": { - "type": "git", - "url": "git://github.com/felixge/node-delayed-stream.git" - }, - "main": "./lib/delayed_stream", - "engines": { - "node": ">=0.4.0" - }, - "dependencies": {}, - "devDependencies": { - "fake": "0.2.0", - "far": "0.0.1" - }, - "readme": "# delayed-stream\n\nBuffers events from a stream until you are ready to handle them.\n\n## Installation\n\n``` bash\nnpm install delayed-stream\n```\n\n## Usage\n\nThe following example shows how to write a http echo server that delays its\nresponse by 1000 ms.\n\n``` javascript\nvar DelayedStream = require('delayed-stream');\nvar http = require('http');\n\nhttp.createServer(function(req, res) {\n var delayed = DelayedStream.create(req);\n\n setTimeout(function() {\n res.writeHead(200);\n delayed.pipe(res);\n }, 1000);\n});\n```\n\nIf you are not using `Stream#pipe`, you can also manually release the buffered\nevents by calling `delayedStream.resume()`:\n\n``` javascript\nvar delayed = DelayedStream.create(req);\n\nsetTimeout(function() {\n // Emit all buffered events and resume underlaying source\n delayed.resume();\n}, 1000);\n```\n\n## Implementation\n\nIn order to use this meta stream properly, here are a few things you should\nknow about the implementation.\n\n### Event Buffering / Proxying\n\nAll events of the `source` stream are hijacked by overwriting the `source.emit`\nmethod. Until node implements a catch-all event listener, this is the only way.\n\nHowever, delayed-stream still continues to emit all events it captures on the\n`source`, regardless of whether you have released the delayed stream yet or\nnot.\n\nUpon creation, delayed-stream captures all `source` events and stores them in\nan internal event buffer. Once `delayedStream.release()` is called, all\nbuffered events are emitted on the `delayedStream`, and the event buffer is\ncleared. After that, delayed-stream merely acts as a proxy for the underlaying\nsource.\n\n### Error handling\n\nError events on `source` are buffered / proxied just like any other events.\nHowever, `delayedStream.create` attaches a no-op `'error'` listener to the\n`source`. This way you only have to handle errors on the `delayedStream`\nobject, rather than in two places.\n\n### Buffer limits\n\ndelayed-stream provides a `maxDataSize` property that can be used to limit\nthe amount of data being buffered. In order to protect you from bad `source`\nstreams that don't react to `source.pause()`, this feature is enabled by\ndefault.\n\n## API\n\n### DelayedStream.create(source, [options])\n\nReturns a new `delayedStream`. Available options are:\n\n* `pauseStream`\n* `maxDataSize`\n\nThe description for those properties can be found below.\n\n### delayedStream.source\n\nThe `source` stream managed by this object. This is useful if you are\npassing your `delayedStream` around, and you still want to access properties\non the `source` object.\n\n### delayedStream.pauseStream = true\n\nWhether to pause the underlaying `source` when calling\n`DelayedStream.create()`. Modifying this property afterwards has no effect.\n\n### delayedStream.maxDataSize = 1024 * 1024\n\nThe amount of data to buffer before emitting an `error`.\n\nIf the underlaying source is emitting `Buffer` objects, the `maxDataSize`\nrefers to bytes.\n\nIf the underlaying source is emitting JavaScript strings, the size refers to\ncharacters.\n\nIf you know what you are doing, you can set this property to `Infinity` to\ndisable this feature. You can also modify this property during runtime.\n\n### delayedStream.maxDataSize = 1024 * 1024\n\nThe amount of data to buffer before emitting an `error`.\n\nIf the underlaying source is emitting `Buffer` objects, the `maxDataSize`\nrefers to bytes.\n\nIf the underlaying source is emitting JavaScript strings, the size refers to\ncharacters.\n\nIf you know what you are doing, you can set this property to `Infinity` to\ndisable this feature.\n\n### delayedStream.dataSize = 0\n\nThe amount of data buffered so far.\n\n### delayedStream.readable\n\nAn ECMA5 getter that returns the value of `source.readable`.\n\n### delayedStream.resume()\n\nIf the `delayedStream` has not been released so far, `delayedStream.release()`\nis called.\n\nIn either case, `source.resume()` is called.\n\n### delayedStream.pause()\n\nCalls `source.pause()`.\n\n### delayedStream.pipe(dest)\n\nCalls `delayedStream.resume()` and then proxies the arguments to `source.pipe`.\n\n### delayedStream.release()\n\nEmits and clears all events that have been buffered up so far. This does not\nresume the underlaying source, use `delayedStream.resume()` instead.\n\n## License\n\ndelayed-stream is licensed under the MIT license.\n", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/felixge/node-delayed-stream/issues" - }, - "_id": "delayed-stream@0.0.5", - "_from": "delayed-stream@0.0.5" -} diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/common.js b/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/common.js deleted file mode 100644 index 4d71b8a64..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/common.js +++ /dev/null @@ -1,6 +0,0 @@ -var common = module.exports; - -common.DelayedStream = require('..'); -common.assert = require('assert'); -common.fake = require('fake'); -common.PORT = 49252; diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js b/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js deleted file mode 100644 index 9ecad5b8a..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js +++ /dev/null @@ -1,38 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var DelayedStream = common.DelayedStream; -var http = require('http'); - -var UPLOAD = new Buffer(10 * 1024 * 1024); - -var server = http.createServer(function(req, res) { - var delayed = DelayedStream.create(req, {maxDataSize: UPLOAD.length}); - - setTimeout(function() { - res.writeHead(200); - delayed.pipe(res); - }, 10); -}); -server.listen(common.PORT, function() { - var request = http.request({ - method: 'POST', - port: common.PORT, - }); - - request.write(UPLOAD); - request.end(); - - request.on('response', function(res) { - var received = 0; - res - .on('data', function(chunk) { - received += chunk.length; - }) - .on('end', function() { - assert.equal(received, UPLOAD.length); - server.close(); - }); - }); -}); - - diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js b/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js deleted file mode 100644 index 6f417f3e9..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js +++ /dev/null @@ -1,21 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testAutoPause() { - var source = new Stream(); - - fake.expect(source, 'pause', 1); - var delayedStream = DelayedStream.create(source); - fake.verify(); -})(); - -(function testDisableAutoPause() { - var source = new Stream(); - fake.expect(source, 'pause', 0); - - var delayedStream = DelayedStream.create(source, {pauseStream: false}); - fake.verify(); -})(); diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js b/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js deleted file mode 100644 index b50c39783..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js +++ /dev/null @@ -1,14 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testDelayEventsUntilResume() { - var source = new Stream(); - var delayedStream = DelayedStream.create(source, {pauseStream: false}); - - fake.expect(source, 'pause'); - delayedStream.pause(); - fake.verify(); -})(); diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js b/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js deleted file mode 100644 index fc4047e08..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js +++ /dev/null @@ -1,48 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testDelayEventsUntilResume() { - var source = new Stream(); - var delayedStream = DelayedStream.create(source, {pauseStream: false}); - - // delayedStream must not emit until we resume - fake.expect(delayedStream, 'emit', 0); - - // but our original source must emit - var params = []; - source.on('foo', function(param) { - params.push(param); - }); - - source.emit('foo', 1); - source.emit('foo', 2); - - // Make sure delayedStream did not emit, and source did - assert.deepEqual(params, [1, 2]); - fake.verify(); - - // After resume, delayedStream must playback all events - fake - .stub(delayedStream, 'emit') - .times(Infinity) - .withArg(1, 'newListener'); - fake.expect(delayedStream, 'emit', ['foo', 1]); - fake.expect(delayedStream, 'emit', ['foo', 2]); - fake.expect(source, 'resume'); - - delayedStream.resume(); - fake.verify(); - - // Calling resume again will delegate to source - fake.expect(source, 'resume'); - delayedStream.resume(); - fake.verify(); - - // Emitting more events directly leads to them being emitted - fake.expect(delayedStream, 'emit', ['foo', 3]); - source.emit('foo', 3); - fake.verify(); -})(); diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js b/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js deleted file mode 100644 index a9d35e72c..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js +++ /dev/null @@ -1,15 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testHandleSourceErrors() { - var source = new Stream(); - var delayedStream = DelayedStream.create(source, {pauseStream: false}); - - // We deal with this by attaching a no-op listener to 'error' on the source - // when creating a new DelayedStream. This way error events on the source - // won't throw. - source.emit('error', new Error('something went wrong')); -})(); diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js b/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js deleted file mode 100644 index 7638a2bf0..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js +++ /dev/null @@ -1,18 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testMaxDataSize() { - var source = new Stream(); - var delayedStream = DelayedStream.create(source, {maxDataSize: 1024, pauseStream: false}); - - source.emit('data', new Buffer(1024)); - - fake - .expect(delayedStream, 'emit') - .withArg(1, 'error'); - source.emit('data', new Buffer(1)); - fake.verify(); -})(); diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js b/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js deleted file mode 100644 index 7d312ab1f..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js +++ /dev/null @@ -1,13 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testPipeReleases() { - var source = new Stream(); - var delayedStream = DelayedStream.create(source, {pauseStream: false}); - - fake.expect(delayedStream, 'resume'); - delayedStream.pipe(new Stream()); -})(); diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js b/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js deleted file mode 100644 index d436163b7..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js +++ /dev/null @@ -1,13 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testProxyReadableProperty() { - var source = new Stream(); - var delayedStream = DelayedStream.create(source, {pauseStream: false}); - - source.readable = fake.value('source.readable'); - assert.strictEqual(delayedStream.readable, source.readable); -})(); diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/run.js b/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/run.js deleted file mode 100644 index 0bb8e8224..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/run.js +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env node -var far = require('far').create(); - -far.add(__dirname); -far.include(/test-.*\.js$/); - -far.execute(); diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/asn1/.npmignore b/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/asn1/.npmignore deleted file mode 100644 index eb03e3e1e..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/asn1/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -*.log diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/asn1/LICENSE b/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/asn1/LICENSE deleted file mode 100644 index 9b5dcdb7f..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/asn1/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2011 Mark Cavage, 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/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/asn1/README.md b/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/asn1/README.md deleted file mode 100644 index 7cebf7a2e..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/asn1/README.md +++ /dev/null @@ -1,50 +0,0 @@ -node-asn1 is a library for encoding and decoding ASN.1 datatypes in pure JS. -Currently BER encoding is supported; at some point I'll likely have to do DER. - -## Usage - -Mostly, if you're *actually* needing to read and write ASN.1, you probably don't -need this readme to explain what and why. If you have no idea what ASN.1 is, -see this: ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc - -The source is pretty much self-explanatory, and has read/write methods for the -common types out there. - -### Decoding - -The following reads an ASN.1 sequence with a boolean. - - var Ber = require('asn1').Ber; - - var reader = new Ber.Reader(new Buffer([0x30, 0x03, 0x01, 0x01, 0xff])); - - reader.readSequence(); - console.log('Sequence len: ' + reader.length); - if (reader.peek() === Ber.Boolean) - console.log(reader.readBoolean()); - -### Encoding - -The following generates the same payload as above. - - var Ber = require('asn1').Ber; - - var writer = new Ber.Writer(); - - writer.startSequence(); - writer.writeBoolean(true); - writer.endSequence(); - - console.log(writer.buffer); - -## Installation - - npm install asn1 - -## License - -MIT. - -## Bugs - -See . diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/errors.js b/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/errors.js deleted file mode 100644 index ff21d4fab..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/errors.js +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2011 Mark Cavage All rights reserved. - - -module.exports = { - - newInvalidAsn1Error: function(msg) { - var e = new Error(); - e.name = 'InvalidAsn1Error'; - e.message = msg || ''; - return e; - } - -}; diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/index.js b/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/index.js deleted file mode 100644 index 4fb90aea9..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/index.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2011 Mark Cavage All rights reserved. - -var errors = require('./errors'); -var types = require('./types'); - -var Reader = require('./reader'); -var Writer = require('./writer'); - - -///--- Exports - -module.exports = { - - Reader: Reader, - - Writer: Writer - -}; - -for (var t in types) { - if (types.hasOwnProperty(t)) - module.exports[t] = types[t]; -} -for (var e in errors) { - if (errors.hasOwnProperty(e)) - module.exports[e] = errors[e]; -} diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/reader.js b/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/reader.js deleted file mode 100644 index bd3357a67..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/reader.js +++ /dev/null @@ -1,267 +0,0 @@ -// Copyright 2011 Mark Cavage All rights reserved. - -var assert = require('assert'); - -var ASN1 = require('./types'); -var errors = require('./errors'); - - -///--- Globals - -var newInvalidAsn1Error = errors.newInvalidAsn1Error; - - - -///--- API - -function Reader(data) { - if (!data || !Buffer.isBuffer(data)) - throw new TypeError('data must be a node Buffer'); - - this._buf = data; - this._size = data.length; - - // These hold the "current" state - this._len = 0; - this._offset = 0; - - var self = this; - this.__defineGetter__('length', function() { return self._len; }); - this.__defineGetter__('offset', function() { return self._offset; }); - this.__defineGetter__('remain', function() { - return self._size - self._offset; - }); - this.__defineGetter__('buffer', function() { - return self._buf.slice(self._offset); - }); -} - - -/** - * Reads a single byte and advances offset; you can pass in `true` to make this - * a "peek" operation (i.e., get the byte, but don't advance the offset). - * - * @param {Boolean} peek true means don't move offset. - * @return {Number} the next byte, null if not enough data. - */ -Reader.prototype.readByte = function(peek) { - if (this._size - this._offset < 1) - return null; - - var b = this._buf[this._offset] & 0xff; - - if (!peek) - this._offset += 1; - - return b; -}; - - -Reader.prototype.peek = function() { - return this.readByte(true); -}; - - -/** - * Reads a (potentially) variable length off the BER buffer. This call is - * not really meant to be called directly, as callers have to manipulate - * the internal buffer afterwards. - * - * As a result of this call, you can call `Reader.length`, until the - * next thing called that does a readLength. - * - * @return {Number} the amount of offset to advance the buffer. - * @throws {InvalidAsn1Error} on bad ASN.1 - */ -Reader.prototype.readLength = function(offset) { - if (offset === undefined) - offset = this._offset; - - if (offset >= this._size) - return null; - - var lenB = this._buf[offset++] & 0xff; - if (lenB === null) - return null; - - if ((lenB & 0x80) == 0x80) { - lenB &= 0x7f; - - if (lenB == 0) - throw newInvalidAsn1Error('Indefinite length not supported'); - - if (lenB > 4) - throw newInvalidAsn1Error('encoding too long'); - - if (this._size - offset < lenB) - return null; - - this._len = 0; - for (var i = 0; i < lenB; i++) - this._len = (this._len << 8) + (this._buf[offset++] & 0xff); - - } else { - // Wasn't a variable length - this._len = lenB; - } - - return offset; -}; - - -/** - * Parses the next sequence in this BER buffer. - * - * To get the length of the sequence, call `Reader.length`. - * - * @return {Number} the sequence's tag. - */ -Reader.prototype.readSequence = function(tag) { - var seq = this.peek(); - if (seq === null) - return null; - if (tag !== undefined && tag !== seq) - throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + - ': got 0x' + seq.toString(16)); - - var o = this.readLength(this._offset + 1); // stored in `length` - if (o === null) - return null; - - this._offset = o; - return seq; -}; - - -Reader.prototype.readInt = function() { - return this._readTag(ASN1.Integer); -}; - - -Reader.prototype.readBoolean = function() { - return (this._readTag(ASN1.Boolean) === 0 ? false : true); -}; - - -Reader.prototype.readEnumeration = function() { - return this._readTag(ASN1.Enumeration); -}; - - -Reader.prototype.readString = function(tag, retbuf) { - if (!tag) - tag = ASN1.OctetString; - - var b = this.peek(); - if (b === null) - return null; - - if (b !== tag) - throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + - ': got 0x' + b.toString(16)); - - var o = this.readLength(this._offset + 1); // stored in `length` - - if (o === null) - return null; - - if (this.length > this._size - o) - return null; - - this._offset = o; - - if (this.length === 0) - return ''; - - var str = this._buf.slice(this._offset, this._offset + this.length); - this._offset += this.length; - - return retbuf ? str : str.toString('utf8'); -}; - -Reader.prototype.readOID = function(tag) { - if (!tag) - tag = ASN1.OID; - - var b = this.peek(); - if (b === null) - return null; - - if (b !== tag) - throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + - ': got 0x' + b.toString(16)); - - var o = this.readLength(this._offset + 1); // stored in `length` - if (o === null) - return null; - - if (this.length > this._size - o) - return null; - - this._offset = o; - - var values = []; - var value = 0; - - for (var i = 0; i < this.length; i++) { - var byte = this._buf[this._offset++] & 0xff; - - value <<= 7; - value += byte & 0x7f; - if ((byte & 0x80) == 0) { - values.push(value); - value = 0; - } - } - - value = values.shift(); - values.unshift(value % 40); - values.unshift((value / 40) >> 0); - - return values.join('.'); -}; - - -Reader.prototype._readTag = function(tag) { - assert.ok(tag !== undefined); - - var b = this.peek(); - - if (b === null) - return null; - - if (b !== tag) - throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + - ': got 0x' + b.toString(16)); - - var o = this.readLength(this._offset + 1); // stored in `length` - if (o === null) - return null; - - if (this.length > 4) - throw newInvalidAsn1Error('Integer too long: ' + this.length); - - if (this.length > this._size - o) - return null; - this._offset = o; - - var fb = this._buf[this._offset++]; - var value = 0; - - value = fb & 0x7F; - for (var i = 1; i < this.length; i++) { - value <<= 8; - value |= (this._buf[this._offset++] & 0xff); - } - - if ((fb & 0x80) == 0x80) - value = -value; - - return value; -}; - - - -///--- Exported API - -module.exports = Reader; diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/types.js b/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/types.js deleted file mode 100644 index 8aea00013..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/types.js +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2011 Mark Cavage All rights reserved. - - -module.exports = { - EOC: 0, - Boolean: 1, - Integer: 2, - BitString: 3, - OctetString: 4, - Null: 5, - OID: 6, - ObjectDescriptor: 7, - External: 8, - Real: 9, // float - Enumeration: 10, - PDV: 11, - Utf8String: 12, - RelativeOID: 13, - Sequence: 16, - Set: 17, - NumericString: 18, - PrintableString: 19, - T61String: 20, - VideotexString: 21, - IA5String: 22, - UTCTime: 23, - GeneralizedTime: 24, - GraphicString: 25, - VisibleString: 26, - GeneralString: 28, - UniversalString: 29, - CharacterString: 30, - BMPString: 31, - Constructor: 32, - Context: 128 -}; diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/writer.js b/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/writer.js deleted file mode 100644 index 7b445cc60..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/writer.js +++ /dev/null @@ -1,317 +0,0 @@ -// Copyright 2011 Mark Cavage All rights reserved. - -var assert = require('assert'); -var ASN1 = require('./types'); -var errors = require('./errors'); - - -///--- Globals - -var newInvalidAsn1Error = errors.newInvalidAsn1Error; - -var DEFAULT_OPTS = { - size: 1024, - growthFactor: 8 -}; - - -///--- Helpers - -function merge(from, to) { - assert.ok(from); - assert.equal(typeof(from), 'object'); - assert.ok(to); - assert.equal(typeof(to), 'object'); - - var keys = Object.getOwnPropertyNames(from); - keys.forEach(function(key) { - if (to[key]) - return; - - var value = Object.getOwnPropertyDescriptor(from, key); - Object.defineProperty(to, key, value); - }); - - return to; -} - - - -///--- API - -function Writer(options) { - options = merge(DEFAULT_OPTS, options || {}); - - this._buf = new Buffer(options.size || 1024); - this._size = this._buf.length; - this._offset = 0; - this._options = options; - - // A list of offsets in the buffer where we need to insert - // sequence tag/len pairs. - this._seq = []; - - var self = this; - this.__defineGetter__('buffer', function() { - if (self._seq.length) - throw new InvalidAsn1Error(self._seq.length + ' unended sequence(s)'); - - return self._buf.slice(0, self._offset); - }); -} - - -Writer.prototype.writeByte = function(b) { - if (typeof(b) !== 'number') - throw new TypeError('argument must be a Number'); - - this._ensure(1); - this._buf[this._offset++] = b; -}; - - -Writer.prototype.writeInt = function(i, tag) { - if (typeof(i) !== 'number') - throw new TypeError('argument must be a Number'); - if (typeof(tag) !== 'number') - tag = ASN1.Integer; - - var sz = 4; - - while ((((i & 0xff800000) === 0) || ((i & 0xff800000) === 0xff800000)) && - (sz > 1)) { - sz--; - i <<= 8; - } - - if (sz > 4) - throw new InvalidAsn1Error('BER ints cannot be > 0xffffffff'); - - this._ensure(2 + sz); - this._buf[this._offset++] = tag; - this._buf[this._offset++] = sz; - - while (sz-- > 0) { - this._buf[this._offset++] = ((i & 0xff000000) >> 24); - i <<= 8; - } - -}; - - -Writer.prototype.writeNull = function() { - this.writeByte(ASN1.Null); - this.writeByte(0x00); -}; - - -Writer.prototype.writeEnumeration = function(i, tag) { - if (typeof(i) !== 'number') - throw new TypeError('argument must be a Number'); - if (typeof(tag) !== 'number') - tag = ASN1.Enumeration; - - return this.writeInt(i, tag); -}; - - -Writer.prototype.writeBoolean = function(b, tag) { - if (typeof(b) !== 'boolean') - throw new TypeError('argument must be a Boolean'); - if (typeof(tag) !== 'number') - tag = ASN1.Boolean; - - this._ensure(3); - this._buf[this._offset++] = tag; - this._buf[this._offset++] = 0x01; - this._buf[this._offset++] = b ? 0xff : 0x00; -}; - - -Writer.prototype.writeString = function(s, tag) { - if (typeof(s) !== 'string') - throw new TypeError('argument must be a string (was: ' + typeof(s) + ')'); - if (typeof(tag) !== 'number') - tag = ASN1.OctetString; - - var len = Buffer.byteLength(s); - this.writeByte(tag); - this.writeLength(len); - if (len) { - this._ensure(len); - this._buf.write(s, this._offset); - this._offset += len; - } -}; - - -Writer.prototype.writeBuffer = function(buf, tag) { - if (typeof(tag) !== 'number') - throw new TypeError('tag must be a number'); - if (!Buffer.isBuffer(buf)) - throw new TypeError('argument must be a buffer'); - - this.writeByte(tag); - this.writeLength(buf.length); - this._ensure(buf.length); - buf.copy(this._buf, this._offset, 0, buf.length); - this._offset += buf.length; -}; - - -Writer.prototype.writeStringArray = function(strings) { - if ((!strings instanceof Array)) - throw new TypeError('argument must be an Array[String]'); - - var self = this; - strings.forEach(function(s) { - self.writeString(s); - }); -}; - -// This is really to solve DER cases, but whatever for now -Writer.prototype.writeOID = function(s, tag) { - if (typeof(s) !== 'string') - throw new TypeError('argument must be a string'); - if (typeof(tag) !== 'number') - tag = ASN1.OID; - - if (!/^([0-9]+\.){3,}[0-9]+$/.test(s)) - throw new Error('argument is not a valid OID string'); - - function encodeOctet(bytes, octet) { - if (octet < 128) { - bytes.push(octet); - } else if (octet < 16384) { - bytes.push((octet >>> 7) | 0x80); - bytes.push(octet & 0x7F); - } else if (octet < 2097152) { - bytes.push((octet >>> 14) | 0x80); - bytes.push(((octet >>> 7) | 0x80) & 0xFF); - bytes.push(octet & 0x7F); - } else if (octet < 268435456) { - bytes.push((octet >>> 21) | 0x80); - bytes.push(((octet >>> 14) | 0x80) & 0xFF); - bytes.push(((octet >>> 7) | 0x80) & 0xFF); - bytes.push(octet & 0x7F); - } else { - bytes.push(((octet >>> 28) | 0x80) & 0xFF); - bytes.push(((octet >>> 21) | 0x80) & 0xFF); - bytes.push(((octet >>> 14) | 0x80) & 0xFF); - bytes.push(((octet >>> 7) | 0x80) & 0xFF); - bytes.push(octet & 0x7F); - } - } - - var tmp = s.split('.'); - var bytes = []; - bytes.push(parseInt(tmp[0], 10) * 40 + parseInt(tmp[1], 10)); - tmp.slice(2).forEach(function(b) { - encodeOctet(bytes, parseInt(b, 10)); - }); - - var self = this; - this._ensure(2 + bytes.length); - this.writeByte(tag); - this.writeLength(bytes.length); - bytes.forEach(function(b) { - self.writeByte(b); - }); -}; - - -Writer.prototype.writeLength = function(len) { - if (typeof(len) !== 'number') - throw new TypeError('argument must be a Number'); - - this._ensure(4); - - if (len <= 0x7f) { - this._buf[this._offset++] = len; - } else if (len <= 0xff) { - this._buf[this._offset++] = 0x81; - this._buf[this._offset++] = len; - } else if (len <= 0xffff) { - this._buf[this._offset++] = 0x82; - this._buf[this._offset++] = len >> 8; - this._buf[this._offset++] = len; - } else if (len <= 0xffffff) { - this._shift(start, len, 1); - this._buf[this._offset++] = 0x83; - this._buf[this._offset++] = len >> 16; - this._buf[this._offset++] = len >> 8; - this._buf[this._offset++] = len; - } else { - throw new InvalidAsn1ERror('Length too long (> 4 bytes)'); - } -}; - -Writer.prototype.startSequence = function(tag) { - if (typeof(tag) !== 'number') - tag = ASN1.Sequence | ASN1.Constructor; - - this.writeByte(tag); - this._seq.push(this._offset); - this._ensure(3); - this._offset += 3; -}; - - -Writer.prototype.endSequence = function() { - var seq = this._seq.pop(); - var start = seq + 3; - var len = this._offset - start; - - if (len <= 0x7f) { - this._shift(start, len, -2); - this._buf[seq] = len; - } else if (len <= 0xff) { - this._shift(start, len, -1); - this._buf[seq] = 0x81; - this._buf[seq + 1] = len; - } else if (len <= 0xffff) { - this._buf[seq] = 0x82; - this._buf[seq + 1] = len >> 8; - this._buf[seq + 2] = len; - } else if (len <= 0xffffff) { - this._shift(start, len, 1); - this._buf[seq] = 0x83; - this._buf[seq + 1] = len >> 16; - this._buf[seq + 2] = len >> 8; - this._buf[seq + 3] = len; - } else { - throw new InvalidAsn1Error('Sequence too long'); - } -}; - - -Writer.prototype._shift = function(start, len, shift) { - assert.ok(start !== undefined); - assert.ok(len !== undefined); - assert.ok(shift); - - this._buf.copy(this._buf, start + shift, start, start + len); - this._offset += shift; -}; - -Writer.prototype._ensure = function(len) { - assert.ok(len); - - if (this._size - this._offset < len) { - var sz = this._size * this._options.growthFactor; - if (sz - this._offset < len) - sz += len; - - var buf = new Buffer(sz); - - this._buf.copy(buf, 0, 0, this._offset); - this._buf = buf; - this._size = sz; - } -}; - - - -///--- Exported API - -module.exports = Writer; diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/index.js b/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/index.js deleted file mode 100644 index d1766e7a6..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/index.js +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2011 Mark Cavage All rights reserved. - -// If you have no idea what ASN.1 or BER is, see this: -// ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc - -var Ber = require('./ber/index'); - - - -///--- Exported API - -module.exports = { - - Ber: Ber, - - BerReader: Ber.Reader, - - BerWriter: Ber.Writer - -}; diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/asn1/package.json b/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/asn1/package.json deleted file mode 100644 index c6170fe77..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/asn1/package.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "author": { - "name": "Mark Cavage", - "email": "mcavage@gmail.com" - }, - "contributors": [ - { - "name": "David Gwynne", - "email": "loki@animata.net" - }, - { - "name": "Yunong Xiao", - "email": "yunong@joyent.com" - } - ], - "name": "asn1", - "description": "Contains parsers and serializers for ASN.1 (currently BER only)", - "version": "0.1.11", - "repository": { - "type": "git", - "url": "git://github.com/mcavage/node-asn1.git" - }, - "main": "lib/index.js", - "engines": { - "node": ">=0.4.9" - }, - "dependencies": {}, - "devDependencies": { - "tap": "0.1.4" - }, - "scripts": { - "pretest": "which gjslint; if [[ \"$?\" = 0 ]] ; then gjslint --nojsdoc -r lib -r tst; else echo \"Missing gjslint. Skipping lint\"; fi", - "test": "tap ./tst" - }, - "readme": "node-asn1 is a library for encoding and decoding ASN.1 datatypes in pure JS.\nCurrently BER encoding is supported; at some point I'll likely have to do DER.\n\n## Usage\n\nMostly, if you're *actually* needing to read and write ASN.1, you probably don't\nneed this readme to explain what and why. If you have no idea what ASN.1 is,\nsee this: ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc\n\nThe source is pretty much self-explanatory, and has read/write methods for the\ncommon types out there.\n\n### Decoding\n\nThe following reads an ASN.1 sequence with a boolean.\n\n var Ber = require('asn1').Ber;\n\n var reader = new Ber.Reader(new Buffer([0x30, 0x03, 0x01, 0x01, 0xff]));\n\n reader.readSequence();\n console.log('Sequence len: ' + reader.length);\n if (reader.peek() === Ber.Boolean)\n console.log(reader.readBoolean());\n\n### Encoding\n\nThe following generates the same payload as above.\n\n var Ber = require('asn1').Ber;\n\n var writer = new Ber.Writer();\n\n writer.startSequence();\n writer.writeBoolean(true);\n writer.endSequence();\n\n console.log(writer.buffer);\n\n## Installation\n\n npm install asn1\n\n## License\n\nMIT.\n\n## Bugs\n\nSee .\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/mcavage/node-asn1/issues" - }, - "homepage": "https://github.com/mcavage/node-asn1", - "_id": "asn1@0.1.11", - "_from": "asn1@0.1.11" -} diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/reader.test.js b/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/reader.test.js deleted file mode 100644 index 0b78b474f..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/reader.test.js +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright 2011 Mark Cavage All rights reserved. - -var test = require('tap').test; - - - -///--- Globals - -var BerReader; - - - -///--- Tests - -test('load library', function(t) { - BerReader = require('../../lib/index').BerReader; - t.ok(BerReader); - try { - new BerReader(); - t.fail('Should have thrown'); - } catch (e) { - t.ok(e instanceof TypeError, 'Should have been a type error'); - } - t.end(); -}); - - -test('read byte', function(t) { - var reader = new BerReader(new Buffer([0xde])); - t.ok(reader); - t.equal(reader.readByte(), 0xde, 'wrong value'); - t.end(); -}); - - -test('read 1 byte int', function(t) { - var reader = new BerReader(new Buffer([0x02, 0x01, 0x03])); - t.ok(reader); - t.equal(reader.readInt(), 0x03, 'wrong value'); - t.equal(reader.length, 0x01, 'wrong length'); - t.end(); -}); - - -test('read 2 byte int', function(t) { - var reader = new BerReader(new Buffer([0x02, 0x02, 0x7e, 0xde])); - t.ok(reader); - t.equal(reader.readInt(), 0x7ede, 'wrong value'); - t.equal(reader.length, 0x02, 'wrong length'); - t.end(); -}); - - -test('read 3 byte int', function(t) { - var reader = new BerReader(new Buffer([0x02, 0x03, 0x7e, 0xde, 0x03])); - t.ok(reader); - t.equal(reader.readInt(), 0x7ede03, 'wrong value'); - t.equal(reader.length, 0x03, 'wrong length'); - t.end(); -}); - - -test('read 4 byte int', function(t) { - var reader = new BerReader(new Buffer([0x02, 0x04, 0x7e, 0xde, 0x03, 0x01])); - t.ok(reader); - t.equal(reader.readInt(), 0x7ede0301, 'wrong value'); - t.equal(reader.length, 0x04, 'wrong length'); - t.end(); -}); - - -test('read boolean true', function(t) { - var reader = new BerReader(new Buffer([0x01, 0x01, 0xff])); - t.ok(reader); - t.equal(reader.readBoolean(), true, 'wrong value'); - t.equal(reader.length, 0x01, 'wrong length'); - t.end(); -}); - - -test('read boolean false', function(t) { - var reader = new BerReader(new Buffer([0x01, 0x01, 0x00])); - t.ok(reader); - t.equal(reader.readBoolean(), false, 'wrong value'); - t.equal(reader.length, 0x01, 'wrong length'); - t.end(); -}); - - -test('read enumeration', function(t) { - var reader = new BerReader(new Buffer([0x0a, 0x01, 0x20])); - t.ok(reader); - t.equal(reader.readEnumeration(), 0x20, 'wrong value'); - t.equal(reader.length, 0x01, 'wrong length'); - t.end(); -}); - - -test('read string', function(t) { - var dn = 'cn=foo,ou=unit,o=test'; - var buf = new Buffer(dn.length + 2); - buf[0] = 0x04; - buf[1] = Buffer.byteLength(dn); - buf.write(dn, 2); - var reader = new BerReader(buf); - t.ok(reader); - t.equal(reader.readString(), dn, 'wrong value'); - t.equal(reader.length, dn.length, 'wrong length'); - t.end(); -}); - - -test('read sequence', function(t) { - var reader = new BerReader(new Buffer([0x30, 0x03, 0x01, 0x01, 0xff])); - t.ok(reader); - t.equal(reader.readSequence(), 0x30, 'wrong value'); - t.equal(reader.length, 0x03, 'wrong length'); - t.equal(reader.readBoolean(), true, 'wrong value'); - t.equal(reader.length, 0x01, 'wrong length'); - t.end(); -}); - - -test('anonymous LDAPv3 bind', function(t) { - var BIND = new Buffer(14); - BIND[0] = 0x30; // Sequence - BIND[1] = 12; // len - BIND[2] = 0x02; // ASN.1 Integer - BIND[3] = 1; // len - BIND[4] = 0x04; // msgid (make up 4) - BIND[5] = 0x60; // Bind Request - BIND[6] = 7; // len - BIND[7] = 0x02; // ASN.1 Integer - BIND[8] = 1; // len - BIND[9] = 0x03; // v3 - BIND[10] = 0x04; // String (bind dn) - BIND[11] = 0; // len - BIND[12] = 0x80; // ContextSpecific (choice) - BIND[13] = 0; // simple bind - - // Start testing ^^ - var ber = new BerReader(BIND); - t.equal(ber.readSequence(), 48, 'Not an ASN.1 Sequence'); - t.equal(ber.length, 12, 'Message length should be 12'); - t.equal(ber.readInt(), 4, 'Message id should have been 4'); - t.equal(ber.readSequence(), 96, 'Bind Request should have been 96'); - t.equal(ber.length, 7, 'Bind length should have been 7'); - t.equal(ber.readInt(), 3, 'LDAP version should have been 3'); - t.equal(ber.readString(), '', 'Bind DN should have been empty'); - t.equal(ber.length, 0, 'string length should have been 0'); - t.equal(ber.readByte(), 0x80, 'Should have been ContextSpecific (choice)'); - t.equal(ber.readByte(), 0, 'Should have been simple bind'); - t.equal(null, ber.readByte(), 'Should be out of data'); - t.end(); -}); - - -test('long string', function(t) { - var buf = new Buffer(256); - var o; - var s = - '2;649;CN=Red Hat CS 71GA Demo,O=Red Hat CS 71GA Demo,C=US;' + - 'CN=RHCS Agent - admin01,UID=admin01,O=redhat,C=US [1] This is ' + - 'Teena Vradmin\'s description.'; - buf[0] = 0x04; - buf[1] = 0x81; - buf[2] = 0x94; - buf.write(s, 3); - var ber = new BerReader(buf.slice(0, 3 + s.length)); - t.equal(ber.readString(), s); - t.end(); -}); diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/writer.test.js b/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/writer.test.js deleted file mode 100644 index add0b9fd3..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/writer.test.js +++ /dev/null @@ -1,296 +0,0 @@ -// Copyright 2011 Mark Cavage All rights reserved. - -var test = require('tap').test; -var sys = require('sys'); - -///--- Globals - -var BerWriter; - -var BerReader; - - -///--- Tests - -test('load library', function(t) { - BerWriter = require('../../lib/index').BerWriter; - t.ok(BerWriter); - t.ok(new BerWriter()); - t.end(); -}); - - -test('write byte', function(t) { - var writer = new BerWriter(); - - writer.writeByte(0xC2); - var ber = writer.buffer; - - t.ok(ber); - t.equal(ber.length, 1, 'Wrong length'); - t.equal(ber[0], 0xC2, 'value wrong'); - - t.end(); -}); - - -test('write 1 byte int', function(t) { - var writer = new BerWriter(); - - writer.writeInt(0x7f); - var ber = writer.buffer; - - t.ok(ber); - t.equal(ber.length, 3, 'Wrong length for an int: ' + ber.length); - t.equal(ber[0], 0x02, 'ASN.1 tag wrong (2) -> ' + ber[0]); - t.equal(ber[1], 0x01, 'length wrong(1) -> ' + ber[1]); - t.equal(ber[2], 0x7f, 'value wrong(3) -> ' + ber[2]); - - t.end(); -}); - - -test('write 2 byte int', function(t) { - var writer = new BerWriter(); - - writer.writeInt(0x7ffe); - var ber = writer.buffer; - - t.ok(ber); - t.equal(ber.length, 4, 'Wrong length for an int'); - t.equal(ber[0], 0x02, 'ASN.1 tag wrong'); - t.equal(ber[1], 0x02, 'length wrong'); - t.equal(ber[2], 0x7f, 'value wrong (byte 1)'); - t.equal(ber[3], 0xfe, 'value wrong (byte 2)'); - - t.end(); -}); - - -test('write 3 byte int', function(t) { - var writer = new BerWriter(); - - writer.writeInt(0x7ffffe); - var ber = writer.buffer; - - t.ok(ber); - t.equal(ber.length, 5, 'Wrong length for an int'); - t.equal(ber[0], 0x02, 'ASN.1 tag wrong'); - t.equal(ber[1], 0x03, 'length wrong'); - t.equal(ber[2], 0x7f, 'value wrong (byte 1)'); - t.equal(ber[3], 0xff, 'value wrong (byte 2)'); - t.equal(ber[4], 0xfe, 'value wrong (byte 3)'); - - t.end(); -}); - - -test('write 4 byte int', function(t) { - var writer = new BerWriter(); - - writer.writeInt(0x7ffffffe); - var ber = writer.buffer; - - t.ok(ber); - - t.equal(ber.length, 6, 'Wrong length for an int'); - t.equal(ber[0], 0x02, 'ASN.1 tag wrong'); - t.equal(ber[1], 0x04, 'length wrong'); - t.equal(ber[2], 0x7f, 'value wrong (byte 1)'); - t.equal(ber[3], 0xff, 'value wrong (byte 2)'); - t.equal(ber[4], 0xff, 'value wrong (byte 3)'); - t.equal(ber[5], 0xfe, 'value wrong (byte 4)'); - - t.end(); -}); - - -test('write boolean', function(t) { - var writer = new BerWriter(); - - writer.writeBoolean(true); - writer.writeBoolean(false); - var ber = writer.buffer; - - t.ok(ber); - t.equal(ber.length, 6, 'Wrong length'); - t.equal(ber[0], 0x01, 'tag wrong'); - t.equal(ber[1], 0x01, 'length wrong'); - t.equal(ber[2], 0xff, 'value wrong'); - t.equal(ber[3], 0x01, 'tag wrong'); - t.equal(ber[4], 0x01, 'length wrong'); - t.equal(ber[5], 0x00, 'value wrong'); - - t.end(); -}); - - -test('write string', function(t) { - var writer = new BerWriter(); - writer.writeString('hello world'); - var ber = writer.buffer; - - t.ok(ber); - t.equal(ber.length, 13, 'wrong length'); - t.equal(ber[0], 0x04, 'wrong tag'); - t.equal(ber[1], 11, 'wrong length'); - t.equal(ber.slice(2).toString('utf8'), 'hello world', 'wrong value'); - - t.end(); -}); - -test('write buffer', function(t) { - var writer = new BerWriter(); - // write some stuff to start with - writer.writeString('hello world'); - var ber = writer.buffer; - var buf = new Buffer([0x04, 0x0b, 0x30, 0x09, 0x02, 0x01, 0x0f, 0x01, 0x01, - 0xff, 0x01, 0x01, 0xff]); - writer.writeBuffer(buf.slice(2, buf.length), 0x04); - ber = writer.buffer; - - t.ok(ber); - t.equal(ber.length, 26, 'wrong length'); - t.equal(ber[0], 0x04, 'wrong tag'); - t.equal(ber[1], 11, 'wrong length'); - t.equal(ber.slice(2, 13).toString('utf8'), 'hello world', 'wrong value'); - t.equal(ber[13], buf[0], 'wrong tag'); - t.equal(ber[14], buf[1], 'wrong length'); - for (var i = 13, j = 0; i < ber.length && j < buf.length; i++, j++) { - t.equal(ber[i], buf[j], 'buffer contents not identical'); - } - t.end(); -}); - -test('write string array', function(t) { - var writer = new BerWriter(); - writer.writeStringArray(['hello world', 'fubar!']); - var ber = writer.buffer; - - t.ok(ber); - - t.equal(ber.length, 21, 'wrong length'); - t.equal(ber[0], 0x04, 'wrong tag'); - t.equal(ber[1], 11, 'wrong length'); - t.equal(ber.slice(2, 13).toString('utf8'), 'hello world', 'wrong value'); - - t.equal(ber[13], 0x04, 'wrong tag'); - t.equal(ber[14], 6, 'wrong length'); - t.equal(ber.slice(15).toString('utf8'), 'fubar!', 'wrong value'); - - t.end(); -}); - - -test('resize internal buffer', function(t) { - var writer = new BerWriter({size: 2}); - writer.writeString('hello world'); - var ber = writer.buffer; - - t.ok(ber); - t.equal(ber.length, 13, 'wrong length'); - t.equal(ber[0], 0x04, 'wrong tag'); - t.equal(ber[1], 11, 'wrong length'); - t.equal(ber.slice(2).toString('utf8'), 'hello world', 'wrong value'); - - t.end(); -}); - - -test('sequence', function(t) { - var writer = new BerWriter({size: 25}); - writer.startSequence(); - writer.writeString('hello world'); - writer.endSequence(); - var ber = writer.buffer; - - t.ok(ber); - console.log(ber); - t.equal(ber.length, 15, 'wrong length'); - t.equal(ber[0], 0x30, 'wrong tag'); - t.equal(ber[1], 13, 'wrong length'); - t.equal(ber[2], 0x04, 'wrong tag'); - t.equal(ber[3], 11, 'wrong length'); - t.equal(ber.slice(4).toString('utf8'), 'hello world', 'wrong value'); - - t.end(); -}); - - -test('nested sequence', function(t) { - var writer = new BerWriter({size: 25}); - writer.startSequence(); - writer.writeString('hello world'); - writer.startSequence(); - writer.writeString('hello world'); - writer.endSequence(); - writer.endSequence(); - var ber = writer.buffer; - - t.ok(ber); - t.equal(ber.length, 30, 'wrong length'); - t.equal(ber[0], 0x30, 'wrong tag'); - t.equal(ber[1], 28, 'wrong length'); - t.equal(ber[2], 0x04, 'wrong tag'); - t.equal(ber[3], 11, 'wrong length'); - t.equal(ber.slice(4, 15).toString('utf8'), 'hello world', 'wrong value'); - t.equal(ber[15], 0x30, 'wrong tag'); - t.equal(ber[16], 13, 'wrong length'); - t.equal(ber[17], 0x04, 'wrong tag'); - t.equal(ber[18], 11, 'wrong length'); - t.equal(ber.slice(19, 30).toString('utf8'), 'hello world', 'wrong value'); - - t.end(); -}); - - -test('LDAP bind message', function(t) { - var dn = 'cn=foo,ou=unit,o=test'; - var writer = new BerWriter(); - writer.startSequence(); - writer.writeInt(3); // msgid = 3 - writer.startSequence(0x60); // ldap bind - writer.writeInt(3); // ldap v3 - writer.writeString(dn); - writer.writeByte(0x80); - writer.writeByte(0x00); - writer.endSequence(); - writer.endSequence(); - var ber = writer.buffer; - - t.ok(ber); - t.equal(ber.length, 35, 'wrong length (buffer)'); - t.equal(ber[0], 0x30, 'wrong tag'); - t.equal(ber[1], 33, 'wrong length'); - t.equal(ber[2], 0x02, 'wrong tag'); - t.equal(ber[3], 1, 'wrong length'); - t.equal(ber[4], 0x03, 'wrong value'); - t.equal(ber[5], 0x60, 'wrong tag'); - t.equal(ber[6], 28, 'wrong length'); - t.equal(ber[7], 0x02, 'wrong tag'); - t.equal(ber[8], 1, 'wrong length'); - t.equal(ber[9], 0x03, 'wrong value'); - t.equal(ber[10], 0x04, 'wrong tag'); - t.equal(ber[11], dn.length, 'wrong length'); - t.equal(ber.slice(12, 33).toString('utf8'), dn, 'wrong value'); - t.equal(ber[33], 0x80, 'wrong tag'); - t.equal(ber[34], 0x00, 'wrong len'); - - t.end(); -}); - - -test('Write OID', function(t) { - var oid = '1.2.840.113549.1.1.1'; - var writer = new BerWriter(); - writer.writeOID(oid); - - var ber = writer.buffer; - t.ok(ber); - console.log(require('util').inspect(ber)); - console.log(require('util').inspect(new Buffer([0x06, 0x09, 0x2a, 0x86, - 0x48, 0x86, 0xf7, 0x0d, - 0x01, 0x01, 0x01]))); - - t.end(); -}); diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/ctype/.npmignore b/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/ctype/.npmignore deleted file mode 100644 index dc6d3b24d..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/ctype/.npmignore +++ /dev/null @@ -1 +0,0 @@ -tst/ diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/ctype/CHANGELOG b/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/ctype/CHANGELOG deleted file mode 100644 index 426da9ef0..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/ctype/CHANGELOG +++ /dev/null @@ -1,78 +0,0 @@ -This contains tickets fixed in each version release in reverse chronological -order. There is one ticket per line. Each commits message has the tickets fixed -in it. The commit message also has the corresponding github issue. i.e. CTYPE-42 -would be issue 42. Each issue can be found at: -https://github.com/rmustacc/node-ctype/issues/%d. - -v0.5.3 -CTYPE-50 Release 0.5.3 -Contributed by Nick Schonning: -CTYPE-49 Add repository section to package.json -Contributed by Jonathan Ong: -CTYPE-48 Create .npmignore - -v0.5.2 -CTYPE-46 Release 0.5.2 -CTYPE-45 error in setEndian logic - -v0.5.1 -CTYPE-44 Release 0.5.1 -Contributed by Terin Stock: -CTYPE-41 CTypeParser.writeStruct should return its offset -Contributed by Terin Stock: -CTYPE-42 int64_t returns wrong size - -v0.5.0 -CTYPE-40 Release 0.5.0 -CTYPE-39 want > 0.6 engine support - -v0.4.0 -CTYPE-37 Release v0.4.0 -CTYPE-6 want additional entry point for write -CTYPE-20 Add 64-bit int support into core parser -CTYPE-31 Fix bounds errors node/2129 -CTYPE-33 Update copyright holders -CTYPE-34 ctf.js confuses sign bit. -CTYPE-35 Make the README more useful for getting started -CTYPE-36 want manual page on ctio functions - -v0.3.1 -CTYPE-29 Release 0.3.1 -CTYPE-28 Want v0.6 npm support - -v0.3.0 -CTYPE-27 Release v0.3.0 -CTYPE-26 Want alternate default char behavior - -v0.2.1 -CTYPE-25 Release v0.2.1 -CTYPE-24 Writing structs is busted - -v0.2.0: -CTYPE-23 Release v0.2.0 -CTYPE-21 Add support for CTF JSON data -CTYPE-22 Add Javascriptlint profile -CTYPE-15 Pull in ctio updates from node/master - -v0.1.0: -CTYPE-18 Bump version to v0.1.0 -CTYPE-17 Fix nested structures -CTYPE-16 Remove extraneous logging -CTYPE-14 toAbs64 and toApprox64 are not exported - -v0.0.3: -CTYPE-12 Bump version to v0.0.3 -CTYPE-11 fix typo in wuint64 -CTYPE-10 Integrate jsstyle - -v0.0.2: -CTYPE-8 dump npm version to v0.0.2 -CTYPE-9 want changelog -CTYPE-7 fix typo in detypes. - -v0.0.1: -CTYPE-5 Missing from NPM registry -CTYPE-4 int16_t calls wrong read function -CTYPE-3 API example types are missing quotes as strings -CTYPE-2 doc missing 64-bit functions -CTYPE-1 Need license diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/ctype/LICENSE b/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/ctype/LICENSE deleted file mode 100644 index 22ced3e63..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/ctype/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -The following license applies to all files unless the file is specified below. -Each file specified below has its license information embedded in it: - -tools/jsstyle - -Copyright 2011, Robert Mustacchi. All rights reserved. -Copyright 2011, 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/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/ctype/README b/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/ctype/README deleted file mode 100644 index 4efd7ee5c..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/ctype/README +++ /dev/null @@ -1,82 +0,0 @@ -Node-CType is a way to read and write binary data in structured and easy to use -format. Its name comes from the C header file. - -To get started, simply clone the repository or use npm to install it. Once it is -there, simply require it. - -git clone git://github.com/rmustacc/node-ctype -npm install ctype -var mod_ctype = require('ctype') - - -There are two APIs that you can use, depending on what abstraction you'd like. -The low level API let's you read and write individual integers and floats from -buffers. The higher level API let's you read and write structures of these. To -illustrate this, let's looks look at how we would read and write a binary -encoded x,y point. - -In C we would define this structure as follows: - -typedef struct point { - uint16_t p_x; - uint16_t p_y; -} point_t; - -To read a binary encoded point from a Buffer, we first need to create a CType -parser (where we specify the endian and other options) and add the typedef. - -var parser = new mod_ctype.Parser({ endian: 'big' }); -parser.typedef('point_t', [ - { x: { type: 'uint16_t' } }, - { y: { type: 'uint16_t' } } -]); - -From here, given a buffer buf and an offset into it, we can read a point. - -var out = parser.readData([ { point: { type: 'point_t' } } ], buffer, 0); -console.log(out); -{ point: { x: 23, y: 42 } } - -Another way to get the same information would be to use the low level methods. -Note that these require you to manually deal with the offset. Here's how we'd -get the same values of x and y from the buffer. - -var x = mod_ctype.ruint16(buf, 'big', 0); -var y = mod_ctype.ruint16(buf, 'big', 2); -console.log(x + ', ' + y); -23, 42 - -The true power of this API comes from the ability to define and nest typedefs, -just as you would in C. By default, the following types are defined by default. -Note that they return a Number, unless indicated otherwise. - - * int8_t - * int16_t - * int32_t - * int64_t (returns an array where val[0] << 32 + val[1] would be the value) - * uint8_t - * uint16_t - * uint32_t - * uint64_t (returns an array where val[0] << 32 + val[1] would be the value) - * float - * double - * char (either returns a buffer with that character or a uint8_t) - * char[] (returns an object with the buffer and the number of characters read which is either the total amount requested or until the first 0) - - -ctf2json integration: - -Node-CType supports consuming the output of ctf2json. Once you read in a JSON file, -all you have to do to add all the definitions it contains is: - -var data, parser; -data = JSON.parse(parsedJSONData); -parser = mod_ctype.parseCTF(data, { endian: 'big' }); - -For more documentation, see the file README.old. Full documentation is in the -process of being rewritten as a series of manual pages which will be available -in the repository and online for viewing. - -To read the ctio manual page simple run, from the root of the workspace: - -man -Mman -s 3ctype ctio diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/ctype/README.old b/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/ctype/README.old deleted file mode 100644 index 9326b725f..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/ctype/README.old +++ /dev/null @@ -1,298 +0,0 @@ -This library provides a way to read and write binary data. - -Node CType is a way to read and write binary data in structured and easy to use -formats. It's name comes from the header file, though it does not share as much -with it as it perhaps should. - -There are two levels of the API. One is the raw API which everything is built on -top of, while the other provides a much nicer abstraction and is built entirely -by using the lower level API. The hope is that the low level API is both clear -and useful. The low level API gets it's names from stdint.h (a rather -appropriate source). The lower level API is presented at the end of this -document. - -Standard CType API - -The CType interface is presented as a parser object that controls the -endianness combined with a series of methods to change that value, parse and -write out buffers, and a way to provide typedefs. Standard Types - -The CType parser supports the following basic types which return Numbers except -as indicated: - - * int8_t - * int16_t - * int32_t - * int64_t (returns an array where val[0] << 32 + val[1] would be the value) - * uint8_t - * uint16_t - * uint32_t - * uint64_t (returns an array where val[0] << 32 + val[1] would be the value) - * float - * double - * char (returns a buffer with just that single character) - * char[] (returns an object with the buffer and the number of characters read which is either the total amount requested or until the first 0) - -Specifying Structs - -The CType parser also supports the notion of structs. A struct is an array of -JSON objects that defines an order of keys which have types and values. One -would build a struct to represent a point (x,y) as follows: - -[ - { x: { type: 'int16_t' }}, - { y: { type: 'int16_t' }} -] - -When this is passed into the read routine, it would read the first two bytes -(as defined by int16_t) to determine the Number to use for X, and then it would -read the next two bytes to determine the value of Y. When read this could -return something like: - -{ - x: 42, - y: -23 -} - -When someone wants to write values, we use the same format as above, but with -additional value field: - -[ - { x: { type: 'int16_t', value: 42 }}, - { y: { type: 'int16_t', value: -23 }} -] - -Now, the structure above may be optionally annotated with offsets. This tells -us to rather than read continuously we should read the given value at the -specified offset. If an offset is provided, it is is effectively the equivalent -of lseek(offset, SEEK_SET). Thus, subsequent values will be read from that -offset and incremented by the appropriate value. As an example: - -[ - { x: { type: 'int16_t' }}, - { y: { type: 'int16_t', offset: 20 }}, - { z: { type: 'int16_t' }} -] - -We would read x from the first starting offset given to us, for the sake of -example, let's assume that's 0. After reading x, the next offset to read from -would be 2; however, y specifies an offset, thus we jump directly to that -offset and read y from byte 20. We would then read z from byte 22. - -The same offsets may be used when writing values. - -Typedef - -The basic set of types while covers the basics, is somewhat limiting. To make -this richer, there is functionality to typedef something like in C. One can use -typedef to add a new name to an existing type or to define a name to refer to a -struct. Thus the following are all examples of a typedef: - -typedef('size_t', 'uint32_t'); -typedef('ssize_t', 'int32_t'); -typedef('point_t', [ - { x: { type: 'int16_t' }}, - { y: { type: 'int16_t' }} -]); - -Once something has been typedef'd it can be used in any of the definitions -previously shown. - -One cannot remove a typedef once created, this is analogous to C. - -The set of defined types can be printed with lstypes. The format of this output -is subject to change, but likely will look something like: - -> lstypes(); -{ - size_t: 'uint32_t', - ssize_t: 'int32_t', - point_t: [ - { x: { type: 'int16_t' }}, - { y: { type: 'int16_t' }} - ] -} - -Specifying arrays - -Arrays can be specified by appending []s to a type. Arrays must have the size -specified. The size must be specified and it can be done in one of two ways: - - * An explicit non-zero integer size - * A name of a previously declared variable in the struct whose value is a - number. - -Note, that when using the name of a variable, it should be the string name for -the key. This is only valid inside structs and the value must be declared -before the value with the array. The following are examples: - -[ - { ip_addr4: { type: 'uint8_t[4]' }}, - { len: { type: 'uint32_t' }}, - { data: { type: 'uint8_t[len]' }} -] - -Arrays are permitted in typedefs; however, they must have a declared integer -size. The following are examples of valid and invalid arrays: - -typedef('path', 'char[1024]'); /* Good */ -typedef('path', 'char[len]'); /* Bad! */ - -64 bit values: - -Unfortunately Javascript represents values with a double, so you lose precision -and the ability to represent Integers roughly beyond 2^53. To alleviate this, I -propose the following for returning 64 bit integers when read: - -value[2]: Each entry is a 32 bit number which can be reconstructed to the -original by the following formula: - -value[0] << 32 + value[1] (Note this will not work in Javascript) - -CTF JSON data: - -node-ctype can also handle JSON data that mathces the format described in the -documentation of the tool ctf2json. Given the JSON data which specifies type -information, it will transform that into a parser that understands all of the -types defined inside of it. This is useful for more complicated structures that -have a lot of typedefs. - -Interface overview - -The following is the header-file like interface to the parser object: - -/* - * Create a new instance of the parser. Each parser has its own store of - * typedefs and endianness. Conf is an object with the following values: - * - * endian Either 'big' or 'little' do determine the endianness we - * want to read from or write to. - * - */ -function CTypeParser(conf); - -/* - * Parses the CTF JSON data and creates a parser that understands all of those - * types. - * - * data Parsed JSON data that maches that CTF JSON - * specification. - * - * conf The configuration object to create a new CTypeParser - * from. - */ -CTypeParser parseCTF(data, conf); - -/* - * This is what we were born to do. We read the data from a buffer and return it - * in an object whose keys match the values from the object. - * - * def The array definition of the data to read in - * - * buffer The buffer to read data from - * - * offset The offset to start writing to - * - * Returns an object where each key corresponds to an entry in def and the value - * is the read value. - */ -Object CTypeParser.readData(, buffer, offset); - -/* - * This is the second half of what we were born to do, write out the data - * itself. - * - * def The array definition of the data to write out with - * values - * - * buffer The buffer to write to - * - * offset The offset in the buffer to write to - */ -void CTypeParser.writeData(, buffer, offset); - -/* - * A user has requested to add a type, let us honor their request. Yet, if their - * request doth spurn us, send them unto the Hells which Dante describes. - * - * name The string for the type definition we're adding - * - * value Either a string that is a type/array name or an object - * that describes a struct. - */ -void CTypeParser.prototype.typedef(name, value); - -Object CTypeParser.prototype.lstypes(); - -/* - * Get the endian value for the current parser - */ -String CTypeParser.prototype.getEndian(); - -/* - * Sets the current endian value for the Parser. If the value is not valid, - * throws an Error. - * - * endian Either 'big' or 'little' do determine the endianness we - * want to read from or write to. - * - */ -void CTypeParser.protoype.setEndian(String); - -/* - * Attempts to convert an array of two integers returned from rsint64 / ruint64 - * into an absolute 64 bit number. If however the value would exceed 2^52 this - * will instead throw an error. The mantissa in a double is a 52 bit number and - * rather than potentially give you a value that is an approximation this will - * error. If you would rather an approximation, please see toApprox64. - * - * val An array of two 32-bit integers - */ -Number function toAbs64(val) - -/* - * Will return the 64 bit value as returned in an array from rsint64 / ruint64 - * to a value as close as it can. Note that Javascript stores all numbers as a - * double and the mantissa only has 52 bits. Thus this version may approximate - * the value. - * - * val An array of two 32-bit integers - */ -Number function toApprox64(val) - -Low Level API - -The following function are provided at the low level: - -Read unsigned integers from a buffer: -Number ruint8(buffer, endian, offset); -Number ruint16(buffer, endian, offset); -Number ruint32(buffer, endian, offset); -Number[] ruint64(buffer, endian, offset); - -Read signed integers from a buffer: -Number rsint8(buffer, endian, offset); -Number rsint16(buffer, endian, offset); -Number rsint32(buffer, endian, offset); -Number[] rsint64(buffer, endian, offset); - -Read floating point numbers from a buffer: -Number rfloat(buffer, endian, offset); /* IEEE-754 Single precision */ -Number rdouble(buffer, endian, offset); /* IEEE-754 Double precision */ - -Write unsigned integers to a buffer: -void wuint8(Number, endian, buffer, offset); -void wuint16(Number, endian, buffer, offset); -void wuint32(Number, endian, buffer, offset); -void wuint64(Number[], endian, buffer, offset); - -Write signed integers from a buffer: -void wsint8(Number, endian, buffer, offset); -void wsint16(Number, endian, buffer, offset); -void wsint32(Number, endian, buffer, offset); -void wsint64(Number[], endian, buffer offset); - -Write floating point numbers from a buffer: -void wfloat(Number, buffer, endian, offset); /* IEEE-754 Single precision */ -void wdouble(Number, buffer, endian, offset); /* IEEE-754 Double precision */ - diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/ctype/ctf.js b/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/ctype/ctf.js deleted file mode 100644 index 66d5f7352..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/ctype/ctf.js +++ /dev/null @@ -1,245 +0,0 @@ -/* - * ctf.js - * - * Understand and parse all of the different JSON formats of CTF data and - * translate that into a series of node-ctype friendly pieces. The reason for - * the abstraction is to handle different changes in the file format. - * - * We have to be careful here that we don't end up using a name that is already - * a built in type. - */ -var mod_assert = require('assert'); -var ASSERT = mod_assert.ok; - -var ctf_versions = [ '1.0' ]; -var ctf_entries = [ 'integer', 'float', 'typedef', 'struct' ]; -var ctf_deftypes = [ 'int8_t', 'uint8_t', 'int16_t', 'uint16_t', 'int32_t', - 'uint32_t', 'float', 'double' ]; - -function ctfParseInteger(entry, ctype) -{ - var name, sign, len, type; - - name = entry['name']; - if (!('signed' in entry['integer'])) - throw (new Error('Malformed CTF JSON: integer missing ' + - 'signed value')); - - - if (!('length' in entry['integer'])) - throw (new Error('Malformed CTF JSON: integer missing ' + - 'length value')); - - sign = entry['integer']['signed']; - len = entry['integer']['length']; - type = null; - - if (sign && len == 1) - type = 'int8_t'; - else if (len == 1) - type = 'uint8_t'; - else if (sign && len == 2) - type = 'int16_t'; - else if (len == 2) - type = 'uint16_t'; - else if (sign && len == 4) - type = 'int32_t'; - else if (len == 4) - type = 'uint32_t'; - else if (sign && len == 8) - type = 'int64_t'; - else if (len == 8) - type = 'uint64_t'; - - if (type === null) - throw (new Error('Malformed CTF JSON: integer has ' + - 'unsupported length and sign - ' + len + '/' + sign)); - - /* - * This means that this is the same as one of our built in types. If - * that's the case defining it would be an error. So instead of trying - * to typedef it, we'll return here. - */ - if (name == type) - return; - - if (name == 'char') { - ASSERT(type == 'int8_t'); - return; - } - - ctype.typedef(name, type); -} - -function ctfParseFloat(entry, ctype) -{ - var name, len; - - name = entry['name']; - if (!('length' in entry['float'])) - throw (new Error('Malformed CTF JSON: float missing ' + - 'length value')); - - len = entry['float']['length']; - if (len != 4 && len != 8) - throw (new Error('Malformed CTF JSON: float has invalid ' + - 'length value')); - - if (len == 4) { - if (name == 'float') - return; - ctype.typedef(name, 'float'); - } else if (len == 8) { - if (name == 'double') - return; - ctype.typedef(name, 'double'); - } -} - -function ctfParseTypedef(entry, ctype) -{ - var name, type, ii; - - name = entry['name']; - if (typeof (entry['typedef']) != 'string') - throw (new Error('Malformed CTF JSON: typedef value in not ' + - 'a string')); - - type = entry['typedef']; - - /* - * We need to ensure that we're not looking at type that's one of our - * built in types. Traditionally in C a uint32_t would be a typedef to - * some kind of integer. However, those size types are built ins. - */ - for (ii = 0; ii < ctf_deftypes.length; ii++) { - if (name == ctf_deftypes[ii]) - return; - } - - ctype.typedef(name, type); -} - -function ctfParseStruct(entry, ctype) -{ - var name, type, ii, val, index, member, push; - - member = []; - if (!Array.isArray(entry['struct'])) - throw (new Error('Malformed CTF JSON: struct value is not ' + - 'an array')); - - for (ii = 0; ii < entry['struct'].length; ii++) { - val = entry['struct'][ii]; - if (!('name' in val)) - throw (new Error('Malformed CTF JSON: struct member ' + - 'missing name')); - - if (!('type' in val)) - throw (new Error('Malformed CTF JSON: struct member ' + - 'missing type')); - - if (typeof (val['name']) != 'string') - throw (new Error('Malformed CTF JSON: struct member ' + - 'name isn\'t a string')); - - if (typeof (val['type']) != 'string') - throw (new Error('Malformed CTF JSON: struct member ' + - 'type isn\'t a string')); - - /* - * CTF version 2 specifies array names as [] where - * as node-ctype does this as []. - */ - name = val['name']; - type = val['type']; - index = type.indexOf(' ['); - if (index != -1) { - type = type.substring(0, index) + - type.substring(index + 1, type.length); - } - push = {}; - push[name] = { 'type': type }; - member.push(push); - } - - name = entry['name']; - ctype.typedef(name, member); -} - -function ctfParseEntry(entry, ctype) -{ - var ii, found; - - if (!('name' in entry)) - throw (new Error('Malformed CTF JSON: entry missing "name" ' + - 'section')); - - for (ii = 0; ii < ctf_entries.length; ii++) { - if (ctf_entries[ii] in entry) - found++; - } - - if (found === 0) - throw (new Error('Malformed CTF JSON: found no entries')); - - if (found >= 2) - throw (new Error('Malformed CTF JSON: found more than one ' + - 'entry')); - - if ('integer' in entry) { - ctfParseInteger(entry, ctype); - return; - } - - if ('float' in entry) { - ctfParseFloat(entry, ctype); - return; - } - - if ('typedef' in entry) { - ctfParseTypedef(entry, ctype); - return; - } - - if ('struct' in entry) { - ctfParseStruct(entry, ctype); - return; - } - - ASSERT(false, 'shouldn\'t reach here'); -} - -function ctfParseJson(json, ctype) -{ - var version, ii; - - ASSERT(json); - ASSERT(ctype); - if (!('metadata' in json)) - throw (new Error('Invalid CTF JSON: missing metadata section')); - - if (!('ctf2json_version' in json['metadata'])) - throw (new Error('Invalid CTF JSON: missing ctf2json_version')); - - version = json['metadata']['ctf2json_version']; - for (ii = 0; ii < ctf_versions.length; ii++) { - if (ctf_versions[ii] == version) - break; - } - - if (ii == ctf_versions.length) - throw (new Error('Unsuported ctf2json_version: ' + version)); - - if (!('data' in json)) - throw (new Error('Invalid CTF JSON: missing data section')); - - if (!Array.isArray(json['data'])) - throw (new Error('Malformed CTF JSON: data section is not ' + - 'an array')); - - for (ii = 0; ii < json['data'].length; ii++) - ctfParseEntry(json['data'][ii], ctype); -} - -exports.ctfParseJson = ctfParseJson; diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/ctype/ctio.js b/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/ctype/ctio.js deleted file mode 100644 index 62c5d7b23..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/ctype/ctio.js +++ /dev/null @@ -1,1485 +0,0 @@ -/* - * rm - Feb 2011 - * ctio.js: - * - * A simple way to read and write simple ctypes. Of course, as you'll find the - * code isn't as simple as it might appear. The following types are currently - * supported in big and little endian formats: - * - * uint8_t int8_t - * uint16_t int16_t - * uint32_t int32_t - * float (single precision IEEE 754) - * double (double precision IEEE 754) - * - * This is designed to work in Node and v8. It may in fact work in other - * Javascript interpreters (that'd be pretty neat), but it hasn't been tested. - * If you find that it does in fact work, that's pretty cool. Try and pass word - * back to the original author. - * - * Note to the reader: If you're tabstop isn't set to 8, parts of this may look - * weird. - */ - -/* - * Numbers in Javascript have a secret: all numbers must be represented with an - * IEEE-754 double. The double has a mantissa with a length of 52 bits with an - * implicit one. Thus the range of integers that can be represented is limited - * to the size of the mantissa, this makes reading and writing 64-bit integers - * difficult, but far from impossible. - * - * Another side effect of this representation is what happens when you use the - * bitwise operators, i.e. shift left, shift right, and, or, etc. In Javascript, - * each operand and the result is cast to a signed 32-bit number. However, in - * the case of >>> the values are cast to an unsigned number. - */ - -/* - * A reminder on endian related issues: - * - * Big Endian: MSB -> First byte - * Little Endian: MSB->Last byte - */ -var mod_assert = require('assert'); - -/* - * An 8 bit unsigned integer involves doing no significant work. - */ -function ruint8(buffer, endian, offset) -{ - if (endian === undefined) - throw (new Error('missing endian')); - - if (buffer === undefined) - throw (new Error('missing buffer')); - - if (offset === undefined) - throw (new Error('missing offset')); - - if (offset >= buffer.length) - throw (new Error('Trying to read beyond buffer length')); - - return (buffer[offset]); -} - -/* - * For 16 bit unsigned numbers we can do all the casting that we want to do. - */ -function rgint16(buffer, endian, offset) -{ - var val = 0; - - if (endian == 'big') { - val = buffer[offset] << 8; - val |= buffer[offset+1]; - } else { - val = buffer[offset]; - val |= buffer[offset+1] << 8; - } - - return (val); - -} - -function ruint16(buffer, endian, offset) -{ - if (endian === undefined) - throw (new Error('missing endian')); - - if (buffer === undefined) - throw (new Error('missing buffer')); - - if (offset === undefined) - throw (new Error('missing offset')); - - if (offset + 1 >= buffer.length) - throw (new Error('Trying to read beyond buffer length')); - - return (rgint16(buffer, endian, offset)); -} - -/* - * Because most bitshifting is done using signed numbers, if we would go into - * the realm where we use that 32nd bit, we'll end up going into the negative - * range. i.e.: - * > 200 << 24 - * -939524096 - * - * Not the value you'd expect. To work around this, we end up having to do some - * abuse of the JavaScript standard. in this case, we know that a >>> shift is - * defined to cast our value to an *unsigned* 32-bit number. Because of that, we - * use that instead to save us some additional math, though it does feel a - * little weird and it isn't obvious as to why you woul dwant to do this at - * first. - */ -function rgint32(buffer, endian, offset) -{ - var val = 0; - - if (endian == 'big') { - val = buffer[offset+1] << 16; - val |= buffer[offset+2] << 8; - val |= buffer[offset+3]; - val = val + (buffer[offset] << 24 >>> 0); - } else { - val = buffer[offset+2] << 16; - val |= buffer[offset+1] << 8; - val |= buffer[offset]; - val = val + (buffer[offset + 3] << 24 >>> 0); - } - - return (val); -} - -function ruint32(buffer, endian, offset) -{ - if (endian === undefined) - throw (new Error('missing endian')); - - if (buffer === undefined) - throw (new Error('missing buffer')); - - if (offset === undefined) - throw (new Error('missing offset')); - - if (offset + 3 >= buffer.length) - throw (new Error('Trying to read beyond buffer length')); - - return (rgint32(buffer, endian, offset)); -} - -/* - * Reads a 64-bit unsigned number. The astue observer will note that this - * doesn't quite work. Javascript has chosen to only have numbers that can be - * represented by a double. A double only has 52 bits of mantissa with an - * implicit 1, thus we have up to 53 bits to represent an integer. However, 2^53 - * doesn't quite give us what we want. Isn't 53 bits enough for anyone? What - * could you have possibly wanted to represent that was larger than that? Oh, - * maybe a size? You mean we bypassed the 4 GB limit on file sizes, when did - * that happen? - * - * To get around this egregious language issue, we're going to instead construct - * an array of two 32 bit unsigned integers. Where arr[0] << 32 + arr[1] would - * give the actual number. However, note that the above code probably won't - * produce the desired results because of the way Javascript numbers are - * doubles. - */ -function rgint64(buffer, endian, offset) -{ - var val = new Array(2); - - if (endian == 'big') { - val[0] = ruint32(buffer, endian, offset); - val[1] = ruint32(buffer, endian, offset+4); - } else { - val[0] = ruint32(buffer, endian, offset+4); - val[1] = ruint32(buffer, endian, offset); - } - - return (val); -} - -function ruint64(buffer, endian, offset) -{ - if (endian === undefined) - throw (new Error('missing endian')); - - if (buffer === undefined) - throw (new Error('missing buffer')); - - if (offset === undefined) - throw (new Error('missing offset')); - - if (offset + 7 >= buffer.length) - throw (new Error('Trying to read beyond buffer length')); - - return (rgint64(buffer, endian, offset)); -} - - -/* - * Signed integer types, yay team! A reminder on how two's complement actually - * works. The first bit is the signed bit, i.e. tells us whether or not the - * number should be positive or negative. If the two's complement value is - * positive, then we're done, as it's equivalent to the unsigned representation. - * - * Now if the number is positive, you're pretty much done, you can just leverage - * the unsigned translations and return those. Unfortunately, negative numbers - * aren't quite that straightforward. - * - * At first glance, one might be inclined to use the traditional formula to - * translate binary numbers between the positive and negative values in two's - * complement. (Though it doesn't quite work for the most negative value) - * Mainly: - * - invert all the bits - * - add one to the result - * - * Of course, this doesn't quite work in Javascript. Take for example the value - * of -128. This could be represented in 16 bits (big-endian) as 0xff80. But of - * course, Javascript will do the following: - * - * > ~0xff80 - * -65409 - * - * Whoh there, Javascript, that's not quite right. But wait, according to - * Javascript that's perfectly correct. When Javascript ends up seeing the - * constant 0xff80, it has no notion that it is actually a signed number. It - * assumes that we've input the unsigned value 0xff80. Thus, when it does the - * binary negation, it casts it into a signed value, (positive 0xff80). Then - * when you perform binary negation on that, it turns it into a negative number. - * - * Instead, we're going to have to use the following general formula, that works - * in a rather Javascript friendly way. I'm glad we don't support this kind of - * weird numbering scheme in the kernel. - * - * (BIT-MAX - (unsigned)val + 1) * -1 - * - * The astute observer, may think that this doesn't make sense for 8-bit numbers - * (really it isn't necessary for them). However, when you get 16-bit numbers, - * you do. Let's go back to our prior example and see how this will look: - * - * (0xffff - 0xff80 + 1) * -1 - * (0x007f + 1) * -1 - * (0x0080) * -1 - * - * Doing it this way ends up allowing us to treat it appropriately in - * Javascript. Sigh, that's really quite ugly for what should just be a few bit - * shifts, ~ and &. - */ - -/* - * Endianness doesn't matter for 8-bit signed values. We could in fact optimize - * this case because the more traditional methods work, but for consistency, - * we'll keep doing this the same way. - */ -function rsint8(buffer, endian, offset) -{ - var neg; - - if (endian === undefined) - throw (new Error('missing endian')); - - if (buffer === undefined) - throw (new Error('missing buffer')); - - if (offset === undefined) - throw (new Error('missing offset')); - - if (offset >= buffer.length) - throw (new Error('Trying to read beyond buffer length')); - - neg = buffer[offset] & 0x80; - if (!neg) - return (buffer[offset]); - - return ((0xff - buffer[offset] + 1) * -1); -} - -/* - * The 16-bit version requires a bit more effort. In this case, we can leverage - * our unsigned code to generate the value we want to return. - */ -function rsint16(buffer, endian, offset) -{ - var neg, val; - - if (endian === undefined) - throw (new Error('missing endian')); - - if (buffer === undefined) - throw (new Error('missing buffer')); - - if (offset === undefined) - throw (new Error('missing offset')); - - if (offset + 1 >= buffer.length) - throw (new Error('Trying to read beyond buffer length')); - - val = rgint16(buffer, endian, offset); - neg = val & 0x8000; - if (!neg) - return (val); - - return ((0xffff - val + 1) * -1); -} - -/* - * We really shouldn't leverage our 32-bit code here and instead utilize the - * fact that we know that since these are signed numbers, we can do all the - * shifting and binary anding to generate the 32-bit number. But, for - * consistency we'll do the same. If we want to do otherwise, we should instead - * make the 32 bit unsigned code do the optimization. But as long as there - * aren't floats secretly under the hood for that, we /should/ be okay. - */ -function rsint32(buffer, endian, offset) -{ - var neg, val; - - if (endian === undefined) - throw (new Error('missing endian')); - - if (buffer === undefined) - throw (new Error('missing buffer')); - - if (offset === undefined) - throw (new Error('missing offset')); - - if (offset + 3 >= buffer.length) - throw (new Error('Trying to read beyond buffer length')); - - val = rgint32(buffer, endian, offset); - neg = val & 0x80000000; - if (!neg) - return (val); - - return ((0xffffffff - val + 1) * -1); -} - -/* - * The signed version of this code suffers from all of the same problems of the - * other 64 bit version. - */ -function rsint64(buffer, endian, offset) -{ - var neg, val; - - if (endian === undefined) - throw (new Error('missing endian')); - - if (buffer === undefined) - throw (new Error('missing buffer')); - - if (offset === undefined) - throw (new Error('missing offset')); - - if (offset + 3 >= buffer.length) - throw (new Error('Trying to read beyond buffer length')); - - val = rgint64(buffer, endian, offset); - neg = val[0] & 0x80000000; - - if (!neg) - return (val); - - val[0] = (0xffffffff - val[0]) * -1; - val[1] = (0xffffffff - val[1] + 1) * -1; - - /* - * If we had the key 0x8000000000000000, that would leave the lower 32 - * bits as 0xffffffff, however, since we're goint to add one, that would - * actually leave the lower 32-bits as 0x100000000, which would break - * our ability to write back a value that we received. To work around - * this, if we actually get that value, we're going to bump the upper - * portion by 1 and set this to zero. - */ - mod_assert.ok(val[1] <= 0x100000000); - if (val[1] == -0x100000000) { - val[1] = 0; - val[0]--; - } - - return (val); -} - -/* - * We now move onto IEEE 754: The traditional form for floating point numbers - * and what is secretly hiding at the heart of everything in this. I really hope - * that someone is actually using this, as otherwise, this effort is probably - * going to be more wasted. - * - * One might be tempted to use parseFloat here, but that wouldn't work at all - * for several reasons. Mostly due to the way floats actually work, and - * parseFloat only actually works in base 10. I don't see base 10 anywhere near - * this file. - * - * In this case we'll implement the single and double precision versions. The - * quadruple precision, while probably useful, wouldn't really be accepted by - * Javascript, so let's not even waste our time. - * - * So let's review how this format looks like. A single precision value is 32 - * bits and has three parts: - * - Sign bit - * - Exponent (Using bias notation) - * - Mantissa - * - * |s|eeeeeeee|mmmmmmmmmmmmmmmmmmmmmmmmm| - * 31| 30-23 | 22 - 0 | - * - * The exponent is stored in a biased input. The bias in this case 127. - * Therefore, our exponent is equal to the 8-bit value - 127. - * - * By default, a number is normalized in IEEE, that means that the mantissa has - * an implicit one that we don't see. So really the value stored is 1.m. - * However, if the exponent is all zeros, then instead we have to shift - * everything to the right one and there is no more implicit one. - * - * Special values: - * - Positive Infinity: - * Sign: 0 - * Exponent: All 1s - * Mantissa: 0 - * - Negative Infinity: - * Sign: 1 - * Exponent: All 1s - * Mantissa: 0 - * - NaN: - * Sign: * - * Exponent: All 1s - * Mantissa: non-zero - * - Zero: - * Sign: * - * Exponent: All 0s - * Mantissa: 0 - * - * In the case of zero, the sign bit determines whether we get a positive or - * negative zero. However, since Javascript cannot determine the difference - * between the two: i.e. -0 == 0, we just always return 0. - * - */ -function rfloat(buffer, endian, offset) -{ - var bytes = []; - var sign, exponent, mantissa, val; - var bias = 127; - var maxexp = 0xff; - - if (endian === undefined) - throw (new Error('missing endian')); - - if (buffer === undefined) - throw (new Error('missing buffer')); - - if (offset === undefined) - throw (new Error('missing offset')); - - if (offset + 3 >= buffer.length) - throw (new Error('Trying to read beyond buffer length')); - - /* Normalize the bytes to be in endian order */ - if (endian == 'big') { - bytes[0] = buffer[offset]; - bytes[1] = buffer[offset+1]; - bytes[2] = buffer[offset+2]; - bytes[3] = buffer[offset+3]; - } else { - bytes[3] = buffer[offset]; - bytes[2] = buffer[offset+1]; - bytes[1] = buffer[offset+2]; - bytes[0] = buffer[offset+3]; - } - - sign = bytes[0] & 0x80; - exponent = (bytes[0] & 0x7f) << 1; - exponent |= (bytes[1] & 0x80) >>> 7; - mantissa = (bytes[1] & 0x7f) << 16; - mantissa |= bytes[2] << 8; - mantissa |= bytes[3]; - - /* Check for special cases before we do general parsing */ - if (!sign && exponent == maxexp && mantissa === 0) - return (Number.POSITIVE_INFINITY); - - if (sign && exponent == maxexp && mantissa === 0) - return (Number.NEGATIVE_INFINITY); - - if (exponent == maxexp && mantissa !== 0) - return (Number.NaN); - - /* - * Javascript really doesn't have support for positive or negative zero. - * So we're not going to try and give it to you. That would be just - * plain weird. Besides -0 == 0. - */ - if (exponent === 0 && mantissa === 0) - return (0); - - /* - * Now we can deal with the bias and the determine whether the mantissa - * has the implicit one or not. - */ - exponent -= bias; - if (exponent == -bias) { - exponent++; - val = 0; - } else { - val = 1; - } - - val = (val + mantissa * Math.pow(2, -23)) * Math.pow(2, exponent); - - if (sign) - val *= -1; - - return (val); -} - -/* - * Doubles in IEEE 754 are like their brothers except for a few changes and - * increases in size: - * - The exponent is now 11 bits - * - The mantissa is now 52 bits - * - The bias is now 1023 - * - * |s|eeeeeeeeeee|mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm| - * 63| 62 - 52 | 51 - 0 | - * 63| 62 - 52 | 51 - 0 | - * - * While the size has increased a fair amount, we're going to end up keeping the - * same general formula for calculating the final value. As a reminder, this - * formula is: - * - * (-1)^s * (n + m) * 2^(e-b) - * - * Where: - * s is the sign bit - * n is (exponent > 0) ? 1 : 0 -- Determines whether we're normalized - * or not - * m is the mantissa - * e is the exponent specified - * b is the bias for the exponent - * - */ -function rdouble(buffer, endian, offset) -{ - var bytes = []; - var sign, exponent, mantissa, val, lowmant; - var bias = 1023; - var maxexp = 0x7ff; - - if (endian === undefined) - throw (new Error('missing endian')); - - if (buffer === undefined) - throw (new Error('missing buffer')); - - if (offset === undefined) - throw (new Error('missing offset')); - - if (offset + 7 >= buffer.length) - throw (new Error('Trying to read beyond buffer length')); - - /* Normalize the bytes to be in endian order */ - if (endian == 'big') { - bytes[0] = buffer[offset]; - bytes[1] = buffer[offset+1]; - bytes[2] = buffer[offset+2]; - bytes[3] = buffer[offset+3]; - bytes[4] = buffer[offset+4]; - bytes[5] = buffer[offset+5]; - bytes[6] = buffer[offset+6]; - bytes[7] = buffer[offset+7]; - } else { - bytes[7] = buffer[offset]; - bytes[6] = buffer[offset+1]; - bytes[5] = buffer[offset+2]; - bytes[4] = buffer[offset+3]; - bytes[3] = buffer[offset+4]; - bytes[2] = buffer[offset+5]; - bytes[1] = buffer[offset+6]; - bytes[0] = buffer[offset+7]; - } - - /* - * We can construct the exponent and mantissa the same way as we did in - * the case of a float, just increase the range of the exponent. - */ - sign = bytes[0] & 0x80; - exponent = (bytes[0] & 0x7f) << 4; - exponent |= (bytes[1] & 0xf0) >>> 4; - - /* - * This is going to be ugly but then again, we're dealing with IEEE 754. - * This could probably be done as a node add on in a few lines of C++, - * but oh we'll, we've made it this far so let's be native the rest of - * the way... - * - * What we're going to do is break the mantissa into two parts, the - * lower 24 bits and the upper 28 bits. We'll multiply the upper 28 bits - * by the appropriate power and then add in the lower 24-bits. Not - * really that great. It's pretty much a giant kludge to deal with - * Javascript eccentricities around numbers. - */ - lowmant = bytes[7]; - lowmant |= bytes[6] << 8; - lowmant |= bytes[5] << 16; - mantissa = bytes[4]; - mantissa |= bytes[3] << 8; - mantissa |= bytes[2] << 16; - mantissa |= (bytes[1] & 0x0f) << 24; - mantissa *= Math.pow(2, 24); /* Equivalent to << 24, but JS compat */ - mantissa += lowmant; - - /* Check for special cases before we do general parsing */ - if (!sign && exponent == maxexp && mantissa === 0) - return (Number.POSITIVE_INFINITY); - - if (sign && exponent == maxexp && mantissa === 0) - return (Number.NEGATIVE_INFINITY); - - if (exponent == maxexp && mantissa !== 0) - return (Number.NaN); - - /* - * Javascript really doesn't have support for positive or negative zero. - * So we're not going to try and give it to you. That would be just - * plain weird. Besides -0 == 0. - */ - if (exponent === 0 && mantissa === 0) - return (0); - - /* - * Now we can deal with the bias and the determine whether the mantissa - * has the implicit one or not. - */ - exponent -= bias; - if (exponent == -bias) { - exponent++; - val = 0; - } else { - val = 1; - } - - val = (val + mantissa * Math.pow(2, -52)) * Math.pow(2, exponent); - - if (sign) - val *= -1; - - return (val); -} - -/* - * Now that we have gone through the pain of reading the individual types, we're - * probably going to want some way to write these back. None of this is going to - * be good. But since we have Javascript numbers this should certainly be more - * interesting. Though we can constrain this end a little bit more in what is - * valid. For now, let's go back to our friends the unsigned value. - */ - -/* - * Unsigned numbers seem deceptively easy. Here are the general steps and rules - * that we are going to take: - * - If the number is negative, throw an Error - * - Truncate any floating point portion - * - Take the modulus of the number in our base - * - Write it out to the buffer in the endian format requested at the offset - */ - -/* - * We have to make sure that the value is a valid integer. This means that it is - * non-negative. It has no fractional component and that it does not exceed the - * maximum allowed value. - * - * value The number to check for validity - * - * max The maximum value - */ -function prepuint(value, max) -{ - if (typeof (value) != 'number') - throw (new (Error('cannot write a non-number as a number'))); - - if (value < 0) - throw (new Error('specified a negative value for writing an ' + - 'unsigned value')); - - if (value > max) - throw (new Error('value is larger than maximum value for ' + - 'type')); - - if (Math.floor(value) !== value) - throw (new Error('value has a fractional component')); - - return (value); -} - -/* - * 8-bit version, classy. We can ignore endianness which is good. - */ -function wuint8(value, endian, buffer, offset) -{ - var val; - - if (value === undefined) - throw (new Error('missing value')); - - if (endian === undefined) - throw (new Error('missing endian')); - - if (buffer === undefined) - throw (new Error('missing buffer')); - - if (offset === undefined) - throw (new Error('missing offset')); - - if (offset >= buffer.length) - throw (new Error('Trying to read beyond buffer length')); - - val = prepuint(value, 0xff); - buffer[offset] = val; -} - -/* - * Pretty much the same as the 8-bit version, just this time we need to worry - * about endian related issues. - */ -function wgint16(val, endian, buffer, offset) -{ - if (endian == 'big') { - buffer[offset] = (val & 0xff00) >>> 8; - buffer[offset+1] = val & 0x00ff; - } else { - buffer[offset+1] = (val & 0xff00) >>> 8; - buffer[offset] = val & 0x00ff; - } -} - -function wuint16(value, endian, buffer, offset) -{ - var val; - - if (value === undefined) - throw (new Error('missing value')); - - if (endian === undefined) - throw (new Error('missing endian')); - - if (buffer === undefined) - throw (new Error('missing buffer')); - - if (offset === undefined) - throw (new Error('missing offset')); - - if (offset + 1 >= buffer.length) - throw (new Error('Trying to read beyond buffer length')); - - val = prepuint(value, 0xffff); - wgint16(val, endian, buffer, offset); -} - -/* - * The 32-bit version is going to have to be a little different unfortunately. - * We can't quite bitshift to get the largest byte, because that would end up - * getting us caught by the signed values. - * - * And yes, we do want to subtract out the lower part by default. This means - * that when we do the division, it will be treated as a bit shift and we won't - * end up generating a floating point value. If we did generate a floating point - * value we'd have to truncate it intelligently, this saves us that problem and - * may even be somewhat faster under the hood. - */ -function wgint32(val, endian, buffer, offset) -{ - if (endian == 'big') { - buffer[offset] = (val - (val & 0x00ffffff)) / Math.pow(2, 24); - buffer[offset+1] = (val >>> 16) & 0xff; - buffer[offset+2] = (val >>> 8) & 0xff; - buffer[offset+3] = val & 0xff; - } else { - buffer[offset+3] = (val - (val & 0x00ffffff)) / - Math.pow(2, 24); - buffer[offset+2] = (val >>> 16) & 0xff; - buffer[offset+1] = (val >>> 8) & 0xff; - buffer[offset] = val & 0xff; - } -} - -function wuint32(value, endian, buffer, offset) -{ - var val; - - if (value === undefined) - throw (new Error('missing value')); - - if (endian === undefined) - throw (new Error('missing endian')); - - if (buffer === undefined) - throw (new Error('missing buffer')); - - if (offset === undefined) - throw (new Error('missing offset')); - - if (offset + 3 >= buffer.length) - throw (new Error('Trying to read beyond buffer length')); - - val = prepuint(value, 0xffffffff); - wgint32(val, endian, buffer, offset); -} - -/* - * Unlike the other versions, we expect the value to be in the form of two - * arrays where value[0] << 32 + value[1] would result in the value that we - * want. - */ -function wgint64(value, endian, buffer, offset) -{ - if (endian == 'big') { - wgint32(value[0], endian, buffer, offset); - wgint32(value[1], endian, buffer, offset+4); - } else { - wgint32(value[0], endian, buffer, offset+4); - wgint32(value[1], endian, buffer, offset); - } -} - -function wuint64(value, endian, buffer, offset) -{ - if (value === undefined) - throw (new Error('missing value')); - - if (!(value instanceof Array)) - throw (new Error('value must be an array')); - - if (value.length != 2) - throw (new Error('value must be an array of length 2')); - - if (endian === undefined) - throw (new Error('missing endian')); - - if (buffer === undefined) - throw (new Error('missing buffer')); - - if (offset === undefined) - throw (new Error('missing offset')); - - if (offset + 7 >= buffer.length) - throw (new Error('Trying to read beyond buffer length')); - - prepuint(value[0], 0xffffffff); - prepuint(value[1], 0xffffffff); - wgint64(value, endian, buffer, offset); -} - -/* - * We now move onto our friends in the signed number category. Unlike unsigned - * numbers, we're going to have to worry a bit more about how we put values into - * arrays. Since we are only worrying about signed 32-bit values, we're in - * slightly better shape. Unfortunately, we really can't do our favorite binary - * & in this system. It really seems to do the wrong thing. For example: - * - * > -32 & 0xff - * 224 - * - * What's happening above is really: 0xe0 & 0xff = 0xe0. However, the results of - * this aren't treated as a signed number. Ultimately a bad thing. - * - * What we're going to want to do is basically create the unsigned equivalent of - * our representation and pass that off to the wuint* functions. To do that - * we're going to do the following: - * - * - if the value is positive - * we can pass it directly off to the equivalent wuint - * - if the value is negative - * we do the following computation: - * mb + val + 1, where - * mb is the maximum unsigned value in that byte size - * val is the Javascript negative integer - * - * - * As a concrete value, take -128. In signed 16 bits this would be 0xff80. If - * you do out the computations: - * - * 0xffff - 128 + 1 - * 0xffff - 127 - * 0xff80 - * - * You can then encode this value as the signed version. This is really rather - * hacky, but it should work and get the job done which is our goal here. - * - * Thus the overall flow is: - * - Truncate the floating point part of the number - * - We don't have to take the modulus, because the unsigned versions will - * take care of that for us. And we don't have to worry about that - * potentially causing bad things to happen because of sign extension - * - Pass it off to the appropriate unsigned version, potentially modifying - * the negative portions as necessary. - */ - -/* - * A series of checks to make sure we actually have a signed 32-bit number - */ -function prepsint(value, max, min) -{ - if (typeof (value) != 'number') - throw (new (Error('cannot write a non-number as a number'))); - - if (value > max) - throw (new Error('value larger than maximum allowed value')); - - if (value < min) - throw (new Error('value smaller than minimum allowed value')); - - if (Math.floor(value) !== value) - throw (new Error('value has a fractional component')); - - return (value); -} - -/* - * The 8-bit version of the signed value. Overall, fairly straightforward. - */ -function wsint8(value, endian, buffer, offset) -{ - var val; - - if (value === undefined) - throw (new Error('missing value')); - - if (endian === undefined) - throw (new Error('missing endian')); - - if (buffer === undefined) - throw (new Error('missing buffer')); - - if (offset === undefined) - throw (new Error('missing offset')); - - if (offset >= buffer.length) - throw (new Error('Trying to read beyond buffer length')); - - val = prepsint(value, 0x7f, -0x80); - if (val >= 0) - wuint8(val, endian, buffer, offset); - else - wuint8(0xff + val + 1, endian, buffer, offset); -} - -/* - * The 16-bit version of the signed value. Also, fairly straightforward. - */ -function wsint16(value, endian, buffer, offset) -{ - var val; - - if (value === undefined) - throw (new Error('missing value')); - - if (endian === undefined) - throw (new Error('missing endian')); - - if (buffer === undefined) - throw (new Error('missing buffer')); - - if (offset === undefined) - throw (new Error('missing offset')); - - if (offset + 1 >= buffer.length) - throw (new Error('Trying to read beyond buffer length')); - - val = prepsint(value, 0x7fff, -0x8000); - if (val >= 0) - wgint16(val, endian, buffer, offset); - else - wgint16(0xffff + val + 1, endian, buffer, offset); - -} - -/* - * We can do this relatively easily by leveraging the code used for 32-bit - * unsigned code. - */ -function wsint32(value, endian, buffer, offset) -{ - var val; - - if (value === undefined) - throw (new Error('missing value')); - - if (endian === undefined) - throw (new Error('missing endian')); - - if (buffer === undefined) - throw (new Error('missing buffer')); - - if (offset === undefined) - throw (new Error('missing offset')); - - if (offset + 3 >= buffer.length) - throw (new Error('Trying to read beyond buffer length')); - - val = prepsint(value, 0x7fffffff, -0x80000000); - if (val >= 0) - wgint32(val, endian, buffer, offset); - else - wgint32(0xffffffff + val + 1, endian, buffer, offset); -} - -/* - * The signed 64 bit integer should by in the same format as when received. - * Mainly it should ensure that the value is an array of two integers where - * value[0] << 32 + value[1] is the desired number. Furthermore, the two values - * need to be equal. - */ -function wsint64(value, endian, buffer, offset) -{ - var vzpos, vopos; - var vals = new Array(2); - - if (value === undefined) - throw (new Error('missing value')); - - if (!(value instanceof Array)) - throw (new Error('value must be an array')); - - if (value.length != 2) - throw (new Error('value must be an array of length 2')); - - if (endian === undefined) - throw (new Error('missing endian')); - - if (buffer === undefined) - throw (new Error('missing buffer')); - - if (offset === undefined) - throw (new Error('missing offset')); - - if (offset + 7 >= buffer.length) - throw (new Error('Trying to read beyond buffer length')); - - /* - * We need to make sure that we have the same sign on both values. The - * hokiest way to to do this is to multiply the number by +inf. If we do - * this, we'll get either +/-inf depending on the sign of the value. - * Once we have this, we can compare it to +inf to see if the number is - * positive or not. - */ - vzpos = (value[0] * Number.POSITIVE_INFINITY) == - Number.POSITIVE_INFINITY; - vopos = (value[1] * Number.POSITIVE_INFINITY) == - Number.POSITIVE_INFINITY; - - /* - * If either of these is zero, then we don't actually need this check. - */ - if (value[0] != 0 && value[1] != 0 && vzpos != vopos) - throw (new Error('Both entries in the array must have ' + - 'the same sign')); - - /* - * Doing verification for a signed 64-bit integer is actually a big - * trickier than it appears. We can't quite use our standard techniques - * because we need to compare both sets of values. The first value is - * pretty straightforward. If the first value is beond the extremes than - * we error out. However, the valid range of the second value varies - * based on the first one. If the first value is negative, and *not* the - * largest negative value, than it can be any integer within the range [ - * 0, 0xffffffff ]. If it is the largest negative number, it must be - * zero. - * - * If the first number is positive, than it doesn't matter what the - * value is. We just simply have to make sure we have a valid positive - * integer. - */ - if (vzpos) { - prepuint(value[0], 0x7fffffff); - prepuint(value[1], 0xffffffff); - } else { - prepsint(value[0], 0, -0x80000000); - prepsint(value[1], 0, -0xffffffff); - if (value[0] == -0x80000000 && value[1] != 0) - throw (new Error('value smaller than minimum ' + - 'allowed value')); - } - - /* Fix negative numbers */ - if (value[0] < 0 || value[1] < 0) { - vals[0] = 0xffffffff - Math.abs(value[0]); - vals[1] = 0x100000000 - Math.abs(value[1]); - if (vals[1] == 0x100000000) { - vals[1] = 0; - vals[0]++; - } - } else { - vals[0] = value[0]; - vals[1] = value[1]; - } - wgint64(vals, endian, buffer, offset); -} - -/* - * Now we are moving onto the weirder of these, the float and double. For this - * we're going to just have to do something that's pretty weird. First off, we - * have no way to get at the underlying float representation, at least not - * easily. But that doesn't mean we can't figure it out, we just have to use our - * heads. - * - * One might propose to use Number.toString(2). Of course, this is not really - * that good, because the ECMAScript 262 v3 Standard says the following Section - * 15.7.4.2-Number.prototype.toString (radix): - * - * If radix is an integer from 2 to 36, but not 10, the result is a string, the - * choice of which is implementation-dependent. - * - * Well that doesn't really help us one bit now does it? We could use the - * standard base 10 version of the string, but that's just going to create more - * errors as we end up trying to convert it back to a binary value. So, really - * this just means we have to be non-lazy and parse the structure intelligently. - * - * First off, we can do the basic checks: NaN, positive and negative infinity. - * - * Now that those are done we can work backwards to generate the mantissa and - * exponent. - * - * The first thing we need to do is determine the sign bit, easy to do, check - * whether the value is less than 0. And convert the number to its absolute - * value representation. Next, we need to determine if the value is less than - * one or greater than or equal to one and from there determine what power was - * used to get there. What follows is now specific to floats, though the general - * ideas behind this will hold for doubles as well, but the exact numbers - * involved will change. - * - * Once we have that power we can determine the exponent and the mantissa. Call - * the value that has the number of bits to reach the power ebits. In the - * general case they have the following values: - * - * exponent 127 + ebits - * mantissa value * 2^(23 - ebits) & 0x7fffff - * - * In the case where the value of ebits is <= -127 we are now in the case where - * we no longer have normalized numbers. In this case the values take on the - * following values: - * - * exponent 0 - * mantissa value * 2^149 & 0x7fffff - * - * Once we have the values for the sign, mantissa, and exponent. We reconstruct - * the four bytes as follows: - * - * byte0 sign bit and seven most significant bits from the exp - * sign << 7 | (exponent & 0xfe) >>> 1 - * - * byte1 lsb from the exponent and 7 top bits from the mantissa - * (exponent & 0x01) << 7 | (mantissa & 0x7f0000) >>> 16 - * - * byte2 bits 8-15 (zero indexing) from mantissa - * mantissa & 0xff00 >> 8 - * - * byte3 bits 0-7 from mantissa - * mantissa & 0xff - * - * Once we have this we have to assign them into the buffer in proper endian - * order. - */ - -/* - * Compute the log base 2 of the value. Now, someone who remembers basic - * properties of logarithms will point out that we could use the change of base - * formula for logs, and in fact that would be astute, because that's what we'll - * do for now. It feels cleaner, albeit it may be less efficient than just - * iterating and dividing by 2. We may want to come back and revisit that some - * day. - */ -function log2(value) -{ - return (Math.log(value) / Math.log(2)); -} - -/* - * Helper to determine the exponent of the number we're looking at. - */ -function intexp(value) -{ - return (Math.floor(log2(value))); -} - -/* - * Helper to determine the exponent of the fractional part of the value. - */ -function fracexp(value) -{ - return (Math.floor(log2(value))); -} - -function wfloat(value, endian, buffer, offset) -{ - var sign, exponent, mantissa, ebits; - var bytes = []; - - if (value === undefined) - throw (new Error('missing value')); - - if (endian === undefined) - throw (new Error('missing endian')); - - if (buffer === undefined) - throw (new Error('missing buffer')); - - if (offset === undefined) - throw (new Error('missing offset')); - - - if (offset + 3 >= buffer.length) - throw (new Error('Trying to read beyond buffer length')); - - if (isNaN(value)) { - sign = 0; - exponent = 0xff; - mantissa = 23; - } else if (value == Number.POSITIVE_INFINITY) { - sign = 0; - exponent = 0xff; - mantissa = 0; - } else if (value == Number.NEGATIVE_INFINITY) { - sign = 1; - exponent = 0xff; - mantissa = 0; - } else { - /* Well we have some work to do */ - - /* Thankfully the sign bit is trivial */ - if (value < 0) { - sign = 1; - value = Math.abs(value); - } else { - sign = 0; - } - - /* Use the correct function to determine number of bits */ - if (value < 1) - ebits = fracexp(value); - else - ebits = intexp(value); - - /* Time to deal with the issues surrounding normalization */ - if (ebits <= -127) { - exponent = 0; - mantissa = (value * Math.pow(2, 149)) & 0x7fffff; - } else { - exponent = 127 + ebits; - mantissa = value * Math.pow(2, 23 - ebits); - mantissa &= 0x7fffff; - } - } - - bytes[0] = sign << 7 | (exponent & 0xfe) >>> 1; - bytes[1] = (exponent & 0x01) << 7 | (mantissa & 0x7f0000) >>> 16; - bytes[2] = (mantissa & 0x00ff00) >>> 8; - bytes[3] = mantissa & 0x0000ff; - - if (endian == 'big') { - buffer[offset] = bytes[0]; - buffer[offset+1] = bytes[1]; - buffer[offset+2] = bytes[2]; - buffer[offset+3] = bytes[3]; - } else { - buffer[offset] = bytes[3]; - buffer[offset+1] = bytes[2]; - buffer[offset+2] = bytes[1]; - buffer[offset+3] = bytes[0]; - } -} - -/* - * Now we move onto doubles. Doubles are similar to floats in pretty much all - * ways except that the processing isn't quite as straightforward because we - * can't always use shifting, i.e. we have > 32 bit values. - * - * We're going to proceed in an identical fashion to floats and utilize the same - * helper functions. All that really is changing are the specific values that we - * use to do the calculations. Thus, to review we have to do the following. - * - * First get the sign bit and convert the value to its absolute value - * representation. Next, we determine the number of bits that we used to get to - * the value, branching whether the value is greater than or less than 1. Once - * we have that value which we will again call ebits, we have to do the - * following in the general case: - * - * exponent 1023 + ebits - * mantissa [value * 2^(52 - ebits)] % 2^52 - * - * In the case where the value of ebits <= -1023 we no longer use normalized - * numbers, thus like with floats we have to do slightly different processing: - * - * exponent 0 - * mantissa [value * 2^1074] % 2^52 - * - * Once we have determined the sign, exponent and mantissa we can construct the - * bytes as follows: - * - * byte0 sign bit and seven most significant bits form the exp - * sign << 7 | (exponent & 0x7f0) >>> 4 - * - * byte1 Remaining 4 bits from the exponent and the four most - * significant bits from the mantissa 48-51 - * (exponent & 0x00f) << 4 | mantissa >>> 48 - * - * byte2 Bits 40-47 from the mantissa - * (mantissa >>> 40) & 0xff - * - * byte3 Bits 32-39 from the mantissa - * (mantissa >>> 32) & 0xff - * - * byte4 Bits 24-31 from the mantissa - * (mantissa >>> 24) & 0xff - * - * byte5 Bits 16-23 from the Mantissa - * (mantissa >>> 16) & 0xff - * - * byte6 Bits 8-15 from the mantissa - * (mantissa >>> 8) & 0xff - * - * byte7 Bits 0-7 from the mantissa - * mantissa & 0xff - * - * Now we can't quite do the right shifting that we want in bytes 1 - 3, because - * we'll have extended too far and we'll lose those values when we try and do - * the shift. Instead we have to use an alternate approach. To try and stay out - * of floating point, what we'll do is say that mantissa -= bytes[4-7] and then - * divide by 2^32. Once we've done that we can use binary arithmetic. Oof, - * that's ugly, but it seems to avoid using floating point (just based on how v8 - * seems to be optimizing for base 2 arithmetic). - */ -function wdouble(value, endian, buffer, offset) -{ - var sign, exponent, mantissa, ebits; - var bytes = []; - - if (value === undefined) - throw (new Error('missing value')); - - if (endian === undefined) - throw (new Error('missing endian')); - - if (buffer === undefined) - throw (new Error('missing buffer')); - - if (offset === undefined) - throw (new Error('missing offset')); - - - if (offset + 7 >= buffer.length) - throw (new Error('Trying to read beyond buffer length')); - - if (isNaN(value)) { - sign = 0; - exponent = 0x7ff; - mantissa = 23; - } else if (value == Number.POSITIVE_INFINITY) { - sign = 0; - exponent = 0x7ff; - mantissa = 0; - } else if (value == Number.NEGATIVE_INFINITY) { - sign = 1; - exponent = 0x7ff; - mantissa = 0; - } else { - /* Well we have some work to do */ - - /* Thankfully the sign bit is trivial */ - if (value < 0) { - sign = 1; - value = Math.abs(value); - } else { - sign = 0; - } - - /* Use the correct function to determine number of bits */ - if (value < 1) - ebits = fracexp(value); - else - ebits = intexp(value); - - /* - * This is a total hack to determine a denormalized value. - * Unfortunately, we sometimes do not get a proper value for - * ebits, i.e. we lose the values that would get rounded off. - * - * - * The astute observer may wonder why we would be - * multiplying by two Math.pows rather than just summing - * them. Well, that's to get around a small bug in the - * way v8 seems to implement the function. On occasion - * doing: - * - * foo * Math.pow(2, 1023 + 51) - * - * Causes us to overflow to infinity, where as doing: - * - * foo * Math.pow(2, 1023) * Math.pow(2, 51) - * - * Does not cause us to overflow. Go figure. - * - */ - if (value <= 2.225073858507201e-308 || ebits <= -1023) { - exponent = 0; - mantissa = value * Math.pow(2, 1023) * Math.pow(2, 51); - mantissa %= Math.pow(2, 52); - } else { - /* - * We might have gotten fucked by our floating point - * logarithm magic. This is rather crappy, but that's - * our luck. If we just had a log base 2 or access to - * the stupid underlying representation this would have - * been much easier and we wouldn't have such stupid - * kludges or hacks. - */ - if (ebits > 1023) - ebits = 1023; - exponent = 1023 + ebits; - mantissa = value * Math.pow(2, -ebits); - mantissa *= Math.pow(2, 52); - mantissa %= Math.pow(2, 52); - } - } - - /* Fill the bytes in backwards to deal with the size issues */ - bytes[7] = mantissa & 0xff; - bytes[6] = (mantissa >>> 8) & 0xff; - bytes[5] = (mantissa >>> 16) & 0xff; - mantissa = (mantissa - (mantissa & 0xffffff)) / Math.pow(2, 24); - bytes[4] = mantissa & 0xff; - bytes[3] = (mantissa >>> 8) & 0xff; - bytes[2] = (mantissa >>> 16) & 0xff; - bytes[1] = (exponent & 0x00f) << 4 | mantissa >>> 24; - bytes[0] = (sign << 7) | (exponent & 0x7f0) >>> 4; - - if (endian == 'big') { - buffer[offset] = bytes[0]; - buffer[offset+1] = bytes[1]; - buffer[offset+2] = bytes[2]; - buffer[offset+3] = bytes[3]; - buffer[offset+4] = bytes[4]; - buffer[offset+5] = bytes[5]; - buffer[offset+6] = bytes[6]; - buffer[offset+7] = bytes[7]; - } else { - buffer[offset+7] = bytes[0]; - buffer[offset+6] = bytes[1]; - buffer[offset+5] = bytes[2]; - buffer[offset+4] = bytes[3]; - buffer[offset+3] = bytes[4]; - buffer[offset+2] = bytes[5]; - buffer[offset+1] = bytes[6]; - buffer[offset] = bytes[7]; - } -} - -/* - * Actually export our work above. One might argue that we shouldn't expose - * these interfaces and just force people to use the higher level abstractions - * around this work. However, unlike say other libraries we've come across, this - * interface has several properties: it makes sense, it's simple, and it's - * useful. - */ -exports.ruint8 = ruint8; -exports.ruint16 = ruint16; -exports.ruint32 = ruint32; -exports.ruint64 = ruint64; -exports.wuint8 = wuint8; -exports.wuint16 = wuint16; -exports.wuint32 = wuint32; -exports.wuint64 = wuint64; - -exports.rsint8 = rsint8; -exports.rsint16 = rsint16; -exports.rsint32 = rsint32; -exports.rsint64 = rsint64; -exports.wsint8 = wsint8; -exports.wsint16 = wsint16; -exports.wsint32 = wsint32; -exports.wsint64 = wsint64; - -exports.rfloat = rfloat; -exports.rdouble = rdouble; -exports.wfloat = wfloat; -exports.wdouble = wdouble; diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/ctype/ctype.js b/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/ctype/ctype.js deleted file mode 100644 index 7d2f4a5a6..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/ctype/ctype.js +++ /dev/null @@ -1,944 +0,0 @@ -/* - * rm - Feb 2011 - * ctype.js - * - * This module provides a simple abstraction towards reading and writing - * different types of binary data. It is designed to use ctio.js and provide a - * richer and more expressive API on top of it. - * - * By default we support the following as built in basic types: - * int8_t - * int16_t - * int32_t - * uint8_t - * uint16_t - * uint32_t - * uint64_t - * float - * double - * char - * char[] - * - * Each type is returned as a Number, with the exception of char and char[] - * which are returned as Node Buffers. A char is considered a uint8_t. - * - * Requests to read and write data are specified as an array of JSON objects. - * This is also the same way that one declares structs. Even if just a single - * value is requested, it must be done as a struct. The array order determines - * the order that we try and read values. Each entry has the following format - * with values marked with a * being optional. - * - * { key: { type: /type/, value*: /value/, offset*: /offset/ } - * - * If offset is defined, we lseek(offset, SEEK_SET) before reading the next - * value. Value is defined when we're writing out data, otherwise it's ignored. - * - */ - -var mod_ctf = require('./ctf.js'); -var mod_ctio = require('./ctio.js'); -var mod_assert = require('assert'); - -/* - * This is the set of basic types that we support. - * - * read The function to call to read in a value from a buffer - * - * write The function to call to write a value to a buffer - * - */ -var deftypes = { - 'uint8_t': { read: ctReadUint8, write: ctWriteUint8 }, - 'uint16_t': { read: ctReadUint16, write: ctWriteUint16 }, - 'uint32_t': { read: ctReadUint32, write: ctWriteUint32 }, - 'uint64_t': { read: ctReadUint64, write: ctWriteUint64 }, - 'int8_t': { read: ctReadSint8, write: ctWriteSint8 }, - 'int16_t': { read: ctReadSint16, write: ctWriteSint16 }, - 'int32_t': { read: ctReadSint32, write: ctWriteSint32 }, - 'int64_t': { read: ctReadSint64, write: ctWriteSint64 }, - 'float': { read: ctReadFloat, write: ctWriteFloat }, - 'double': { read: ctReadDouble, write: ctWriteDouble }, - 'char': { read: ctReadChar, write: ctWriteChar }, - 'char[]': { read: ctReadCharArray, write: ctWriteCharArray } -}; - -/* - * The following are wrappers around the CType IO low level API. They encode - * knowledge about the size and return something in the expected format. - */ -function ctReadUint8(endian, buffer, offset) -{ - var val = mod_ctio.ruint8(buffer, endian, offset); - return ({ value: val, size: 1 }); -} - -function ctReadUint16(endian, buffer, offset) -{ - var val = mod_ctio.ruint16(buffer, endian, offset); - return ({ value: val, size: 2 }); -} - -function ctReadUint32(endian, buffer, offset) -{ - var val = mod_ctio.ruint32(buffer, endian, offset); - return ({ value: val, size: 4 }); -} - -function ctReadUint64(endian, buffer, offset) -{ - var val = mod_ctio.ruint64(buffer, endian, offset); - return ({ value: val, size: 8 }); -} - -function ctReadSint8(endian, buffer, offset) -{ - var val = mod_ctio.rsint8(buffer, endian, offset); - return ({ value: val, size: 1 }); -} - -function ctReadSint16(endian, buffer, offset) -{ - var val = mod_ctio.rsint16(buffer, endian, offset); - return ({ value: val, size: 2 }); -} - -function ctReadSint32(endian, buffer, offset) -{ - var val = mod_ctio.rsint32(buffer, endian, offset); - return ({ value: val, size: 4 }); -} - -function ctReadSint64(endian, buffer, offset) -{ - var val = mod_ctio.rsint64(buffer, endian, offset); - return ({ value: val, size: 8 }); -} - -function ctReadFloat(endian, buffer, offset) -{ - var val = mod_ctio.rfloat(buffer, endian, offset); - return ({ value: val, size: 4 }); -} - -function ctReadDouble(endian, buffer, offset) -{ - var val = mod_ctio.rdouble(buffer, endian, offset); - return ({ value: val, size: 8 }); -} - -/* - * Reads a single character into a node buffer - */ -function ctReadChar(endian, buffer, offset) -{ - var res = new Buffer(1); - res[0] = mod_ctio.ruint8(buffer, endian, offset); - return ({ value: res, size: 1 }); -} - -function ctReadCharArray(length, endian, buffer, offset) -{ - var ii; - var res = new Buffer(length); - - for (ii = 0; ii < length; ii++) - res[ii] = mod_ctio.ruint8(buffer, endian, offset + ii); - - return ({ value: res, size: length }); -} - -function ctWriteUint8(value, endian, buffer, offset) -{ - mod_ctio.wuint8(value, endian, buffer, offset); - return (1); -} - -function ctWriteUint16(value, endian, buffer, offset) -{ - mod_ctio.wuint16(value, endian, buffer, offset); - return (2); -} - -function ctWriteUint32(value, endian, buffer, offset) -{ - mod_ctio.wuint32(value, endian, buffer, offset); - return (4); -} - -function ctWriteUint64(value, endian, buffer, offset) -{ - mod_ctio.wuint64(value, endian, buffer, offset); - return (8); -} - -function ctWriteSint8(value, endian, buffer, offset) -{ - mod_ctio.wsint8(value, endian, buffer, offset); - return (1); -} - -function ctWriteSint16(value, endian, buffer, offset) -{ - mod_ctio.wsint16(value, endian, buffer, offset); - return (2); -} - -function ctWriteSint32(value, endian, buffer, offset) -{ - mod_ctio.wsint32(value, endian, buffer, offset); - return (4); -} - -function ctWriteSint64(value, endian, buffer, offset) -{ - mod_ctio.wsint64(value, endian, buffer, offset); - return (8); -} - -function ctWriteFloat(value, endian, buffer, offset) -{ - mod_ctio.wfloat(value, endian, buffer, offset); - return (4); -} - -function ctWriteDouble(value, endian, buffer, offset) -{ - mod_ctio.wdouble(value, endian, buffer, offset); - return (8); -} - -/* - * Writes a single character into a node buffer - */ -function ctWriteChar(value, endian, buffer, offset) -{ - if (!(value instanceof Buffer)) - throw (new Error('Input must be a buffer')); - - mod_ctio.ruint8(value[0], endian, buffer, offset); - return (1); -} - -/* - * We're going to write 0s into the buffer if the string is shorter than the - * length of the array. - */ -function ctWriteCharArray(value, length, endian, buffer, offset) -{ - var ii; - - if (!(value instanceof Buffer)) - throw (new Error('Input must be a buffer')); - - if (value.length > length) - throw (new Error('value length greater than array length')); - - for (ii = 0; ii < value.length && ii < length; ii++) - mod_ctio.wuint8(value[ii], endian, buffer, offset + ii); - - for (; ii < length; ii++) - mod_ctio.wuint8(0, endian, offset + ii); - - - return (length); -} - -/* - * Each parser has their own set of types. We want to make sure that they each - * get their own copy as they may need to modify it. - */ -function ctGetBasicTypes() -{ - var ret = {}; - var key; - for (key in deftypes) - ret[key] = deftypes[key]; - - return (ret); -} - -/* - * Given a string in the form of type[length] we want to split this into an - * object that extracts that information. We want to note that we could possibly - * have nested arrays so this should only check the furthest one. It may also be - * the case that we have no [] pieces, in which case we just return the current - * type. - */ -function ctParseType(str) -{ - var begInd, endInd; - var type, len; - if (typeof (str) != 'string') - throw (new Error('type must be a Javascript string')); - - endInd = str.lastIndexOf(']'); - if (endInd == -1) { - if (str.lastIndexOf('[') != -1) - throw (new Error('found invalid type with \'[\' but ' + - 'no corresponding \']\'')); - - return ({ type: str }); - } - - begInd = str.lastIndexOf('['); - if (begInd == -1) - throw (new Error('found invalid type with \']\' but ' + - 'no corresponding \'[\'')); - - if (begInd >= endInd) - throw (new Error('malformed type, \']\' appears before \'[\'')); - - type = str.substring(0, begInd); - len = str.substring(begInd + 1, endInd); - - return ({ type: type, len: len }); -} - -/* - * Given a request validate that all of the fields for it are valid and make - * sense. This includes verifying the following notions: - * - Each type requested is present in types - * - Only allow a name for a field to be specified once - * - If an array is specified, validate that the requested field exists and - * comes before it. - * - If fields is defined, check that each entry has the occurrence of field - */ -function ctCheckReq(def, types, fields) -{ - var ii, jj; - var req, keys, key; - var found = {}; - - if (!(def instanceof Array)) - throw (new Error('definition is not an array')); - - if (def.length === 0) - throw (new Error('definition must have at least one element')); - - for (ii = 0; ii < def.length; ii++) { - req = def[ii]; - if (!(req instanceof Object)) - throw (new Error('definition must be an array of' + - 'objects')); - - keys = Object.keys(req); - if (keys.length != 1) - throw (new Error('definition entry must only have ' + - 'one key')); - - if (keys[0] in found) - throw (new Error('Specified name already ' + - 'specified: ' + keys[0])); - - if (!('type' in req[keys[0]])) - throw (new Error('missing required type definition')); - - key = ctParseType(req[keys[0]]['type']); - - /* - * We may have nested arrays, we need to check the validity of - * the types until the len field is undefined in key. However, - * each time len is defined we need to verify it is either an - * integer or corresponds to an already seen key. - */ - while (key['len'] !== undefined) { - if (isNaN(parseInt(key['len'], 10))) { - if (!(key['len'] in found)) - throw (new Error('Given an array ' + - 'length without a matching type')); - - } - - key = ctParseType(key['type']); - } - - /* Now we can validate if the type is valid */ - if (!(key['type'] in types)) - throw (new Error('type not found or typdefed: ' + - key['type'])); - - /* Check for any required fields */ - if (fields !== undefined) { - for (jj = 0; jj < fields.length; jj++) { - if (!(fields[jj] in req[keys[0]])) - throw (new Error('Missing required ' + - 'field: ' + fields[jj])); - } - } - - found[keys[0]] = true; - } -} - - -/* - * Create a new instance of the parser. Each parser has its own store of - * typedefs and endianness. Conf is an object with the following required - * values: - * - * endian Either 'big' or 'little' do determine the endianness we - * want to read from or write to. - * - * And the following optional values: - * - * char-type Valid options here are uint8 and int8. If uint8 is - * specified this changes the default behavior of a single - * char from being a buffer of a single character to being - * a uint8_t. If int8, it becomes an int8_t instead. - */ -function CTypeParser(conf) -{ - if (!conf) throw (new Error('missing required argument')); - - if (!('endian' in conf)) - throw (new Error('missing required endian value')); - - if (conf['endian'] != 'big' && conf['endian'] != 'little') - throw (new Error('Invalid endian type')); - - if ('char-type' in conf && (conf['char-type'] != 'uint8' && - conf['char-type'] != 'int8')) - throw (new Error('invalid option for char-type: ' + - conf['char-type'])); - - this.endian = conf['endian']; - this.types = ctGetBasicTypes(); - - /* - * There may be a more graceful way to do this, but this will have to - * serve. - */ - if ('char-type' in conf && conf['char-type'] == 'uint8') - this.types['char'] = this.types['uint8_t']; - - if ('char-type' in conf && conf['char-type'] == 'int8') - this.types['char'] = this.types['int8_t']; -} - -/* - * Sets the current endian value for the Parser. If the value is not valid, - * throws an Error. - * - * endian Either 'big' or 'little' do determine the endianness we - * want to read from or write to. - * - */ -CTypeParser.prototype.setEndian = function (endian) -{ - if (endian != 'big' && endian != 'little') - throw (new Error('invalid endian type, must be big or ' + - 'little')); - - this.endian = endian; -}; - -/* - * Returns the current value of the endian value for the parser. - */ -CTypeParser.prototype.getEndian = function () -{ - return (this.endian); -}; - -/* - * A user has requested to add a type, let us honor their request. Yet, if their - * request doth spurn us, send them unto the Hells which Dante describes. - * - * name The string for the type definition we're adding - * - * value Either a string that is a type/array name or an object - * that describes a struct. - */ -CTypeParser.prototype.typedef = function (name, value) -{ - var type; - - if (name === undefined) - throw (new (Error('missing required typedef argument: name'))); - - if (value === undefined) - throw (new (Error('missing required typedef argument: value'))); - - if (typeof (name) != 'string') - throw (new (Error('the name of a type must be a string'))); - - type = ctParseType(name); - - if (type['len'] !== undefined) - throw (new Error('Cannot have an array in the typedef name')); - - if (name in this.types) - throw (new Error('typedef name already present: ' + name)); - - if (typeof (value) != 'string' && !(value instanceof Array)) - throw (new Error('typedef value must either be a string or ' + - 'struct')); - - if (typeof (value) == 'string') { - type = ctParseType(value); - if (type['len'] !== undefined) { - if (isNaN(parseInt(type['len'], 10))) - throw (new (Error('typedef value must use ' + - 'fixed size array when outside of a ' + - 'struct'))); - } - - this.types[name] = value; - } else { - /* We have a struct, validate it */ - ctCheckReq(value, this.types); - this.types[name] = value; - } -}; - -/* - * Include all of the typedefs, but none of the built in types. This should be - * treated as read-only. - */ -CTypeParser.prototype.lstypes = function () -{ - var key; - var ret = {}; - - for (key in this.types) { - if (key in deftypes) - continue; - ret[key] = this.types[key]; - } - - return (ret); -}; - -/* - * Given a type string that may have array types that aren't numbers, try and - * fill them in from the values object. The object should be of the format where - * indexing into it should return a number for that type. - * - * str The type string - * - * values An object that can be used to fulfill type information - */ -function ctResolveArray(str, values) -{ - var ret = ''; - var type = ctParseType(str); - - while (type['len'] !== undefined) { - if (isNaN(parseInt(type['len'], 10))) { - if (typeof (values[type['len']]) != 'number') - throw (new Error('cannot sawp in non-number ' + - 'for array value')); - ret = '[' + values[type['len']] + ']' + ret; - } else { - ret = '[' + type['len'] + ']' + ret; - } - type = ctParseType(type['type']); - } - - ret = type['type'] + ret; - - return (ret); -} - -/* - * [private] Either the typedef resolves to another type string or to a struct. - * If it resolves to a struct, we just pass it off to read struct. If not, we - * can just pass it off to read entry. - */ -CTypeParser.prototype.resolveTypedef = function (type, dispatch, buffer, - offset, value) -{ - var pt; - - mod_assert.ok(type in this.types); - if (typeof (this.types[type]) == 'string') { - pt = ctParseType(this.types[type]); - if (dispatch == 'read') - return (this.readEntry(pt, buffer, offset)); - else if (dispatch == 'write') - return (this.writeEntry(value, pt, buffer, offset)); - else - throw (new Error('invalid dispatch type to ' + - 'resolveTypedef')); - } else { - if (dispatch == 'read') - return (this.readStruct(this.types[type], buffer, - offset)); - else if (dispatch == 'write') - return (this.writeStruct(value, this.types[type], - buffer, offset)); - else - throw (new Error('invalid dispatch type to ' + - 'resolveTypedef')); - } - -}; - -/* - * [private] Try and read in the specific entry. - */ -CTypeParser.prototype.readEntry = function (type, buffer, offset) -{ - var parse, len; - - /* - * Because we want to special case char[]s this is unfortunately - * a bit uglier than it really should be. We want to special - * case char[]s so that we return a node buffer, thus they are a - * first class type where as all other arrays just call into a - * generic array routine which calls their data-specific routine - * the specified number of times. - * - * The valid dispatch options we have are: - * - Array and char => char[] handler - * - Generic array handler - * - Generic typedef handler - * - Basic type handler - */ - if (type['len'] !== undefined) { - len = parseInt(type['len'], 10); - if (isNaN(len)) - throw (new Error('somehow got a non-numeric length')); - - if (type['type'] == 'char') - parse = this.types['char[]']['read'](len, - this.endian, buffer, offset); - else - parse = this.readArray(type['type'], - len, buffer, offset); - } else { - if (type['type'] in deftypes) - parse = this.types[type['type']]['read'](this.endian, - buffer, offset); - else - parse = this.resolveTypedef(type['type'], 'read', - buffer, offset); - } - - return (parse); -}; - -/* - * [private] Read an array of data - */ -CTypeParser.prototype.readArray = function (type, length, buffer, offset) -{ - var ii, ent, pt; - var baseOffset = offset; - var ret = new Array(length); - pt = ctParseType(type); - - for (ii = 0; ii < length; ii++) { - ent = this.readEntry(pt, buffer, offset); - offset += ent['size']; - ret[ii] = ent['value']; - } - - return ({ value: ret, size: offset - baseOffset }); -}; - -/* - * [private] Read a single struct in. - */ -CTypeParser.prototype.readStruct = function (def, buffer, offset) -{ - var parse, ii, type, entry, key; - var baseOffset = offset; - var ret = {}; - - /* Walk it and handle doing what's necessary */ - for (ii = 0; ii < def.length; ii++) { - key = Object.keys(def[ii])[0]; - entry = def[ii][key]; - - /* Resolve all array values */ - type = ctParseType(ctResolveArray(entry['type'], ret)); - - if ('offset' in entry) - offset = baseOffset + entry['offset']; - - parse = this.readEntry(type, buffer, offset); - - offset += parse['size']; - ret[key] = parse['value']; - } - - return ({ value: ret, size: (offset-baseOffset)}); -}; - -/* - * This is what we were born to do. We read the data from a buffer and return it - * in an object whose keys match the values from the object. - * - * def The array definition of the data to read in - * - * buffer The buffer to read data from - * - * offset The offset to start writing to - * - * Returns an object where each key corresponds to an entry in def and the value - * is the read value. - */ -CTypeParser.prototype.readData = function (def, buffer, offset) -{ - /* Sanity check for arguments */ - if (def === undefined) - throw (new Error('missing definition for what we should be' + - 'parsing')); - - if (buffer === undefined) - throw (new Error('missing buffer for what we should be ' + - 'parsing')); - - if (offset === undefined) - throw (new Error('missing offset for what we should be ' + - 'parsing')); - - /* Sanity check the object definition */ - ctCheckReq(def, this.types); - - return (this.readStruct(def, buffer, offset)['value']); -}; - -/* - * [private] Write out an array of data - */ -CTypeParser.prototype.writeArray = function (value, type, length, buffer, - offset) -{ - var ii, pt; - var baseOffset = offset; - if (!(value instanceof Array)) - throw (new Error('asked to write an array, but value is not ' + - 'an array')); - - if (value.length != length) - throw (new Error('asked to write array of length ' + length + - ' but that does not match value length: ' + value.length)); - - pt = ctParseType(type); - for (ii = 0; ii < length; ii++) - offset += this.writeEntry(value[ii], pt, buffer, offset); - - return (offset - baseOffset); -}; - -/* - * [private] Write the specific entry - */ -CTypeParser.prototype.writeEntry = function (value, type, buffer, offset) -{ - var len, ret; - - if (type['len'] !== undefined) { - len = parseInt(type['len'], 10); - if (isNaN(len)) - throw (new Error('somehow got a non-numeric length')); - - if (type['type'] == 'char') - ret = this.types['char[]']['write'](value, len, - this.endian, buffer, offset); - else - ret = this.writeArray(value, type['type'], - len, buffer, offset); - } else { - if (type['type'] in deftypes) - ret = this.types[type['type']]['write'](value, - this.endian, buffer, offset); - else - ret = this.resolveTypedef(type['type'], 'write', - buffer, offset, value); - } - - return (ret); -}; - -/* - * [private] Write a single struct out. - */ -CTypeParser.prototype.writeStruct = function (value, def, buffer, offset) -{ - var ii, entry, type, key; - var baseOffset = offset; - var vals = {}; - - for (ii = 0; ii < def.length; ii++) { - key = Object.keys(def[ii])[0]; - entry = def[ii][key]; - - type = ctParseType(ctResolveArray(entry['type'], vals)); - - if ('offset' in entry) - offset = baseOffset + entry['offset']; - - offset += this.writeEntry(value[ii], type, buffer, offset); - /* Now that we've written it out, we can use it for arrays */ - vals[key] = value[ii]; - } - - return (offset); -}; - -/* - * Unfortunately, we're stuck with the sins of an initial poor design. Because - * of that, we are going to have to support the old way of writing data via - * writeData. There we insert the values that you want to write into the - * definition. A little baroque. Internally, we use the new model. So we need to - * just get those values out of there. But to maintain the principle of least - * surprise, we're not going to modify the input data. - */ -function getValues(def) -{ - var ii, out, key; - out = []; - for (ii = 0; ii < def.length; ii++) { - key = Object.keys(def[ii])[0]; - mod_assert.ok('value' in def[ii][key]); - out.push(def[ii][key]['value']); - } - - return (out); -} - -/* - * This is the second half of what we were born to do, write out the data - * itself. Historically this function required you to put your values in the - * definition section. This was not the smartest thing to do and a bit of an - * oversight to be honest. As such, this function now takes a values argument. - * If values is non-null and non-undefined, it will be used to determine the - * values. This means that the old method is still supported, but is no longer - * acceptable. - * - * def The array definition of the data to write out with - * values - * - * buffer The buffer to write to - * - * offset The offset in the buffer to write to - * - * values An array of values to write. - */ -CTypeParser.prototype.writeData = function (def, buffer, offset, values) -{ - var hv; - - if (def === undefined) - throw (new Error('missing definition for what we should be' + - 'parsing')); - - if (buffer === undefined) - throw (new Error('missing buffer for what we should be ' + - 'parsing')); - - if (offset === undefined) - throw (new Error('missing offset for what we should be ' + - 'parsing')); - - hv = (values != null && values != undefined); - if (hv) { - if (!Array.isArray(values)) - throw (new Error('missing values for writing')); - ctCheckReq(def, this.types); - } else { - ctCheckReq(def, this.types, [ 'value' ]); - } - - this.writeStruct(hv ? values : getValues(def), def, buffer, offset); -}; - -/* - * Functions to go to and from 64 bit numbers in a way that is compatible with - * Javascript limitations. There are two sets. One where the user is okay with - * an approximation and one where they are definitely not okay with an - * approximation. - */ - -/* - * Attempts to convert an array of two integers returned from rsint64 / ruint64 - * into an absolute 64 bit number. If however the value would exceed 2^52 this - * will instead throw an error. The mantissa in a double is a 52 bit number and - * rather than potentially give you a value that is an approximation this will - * error. If you would rather an approximation, please see toApprox64. - * - * val An array of two 32-bit integers - */ -function toAbs64(val) -{ - if (val === undefined) - throw (new Error('missing required arg: value')); - - if (!Array.isArray(val)) - throw (new Error('value must be an array')); - - if (val.length != 2) - throw (new Error('value must be an array of length 2')); - - /* We have 20 bits worth of precision in this range */ - if (val[0] >= 0x100000) - throw (new Error('value would become approximated')); - - return (val[0] * Math.pow(2, 32) + val[1]); -} - -/* - * Will return the 64 bit value as returned in an array from rsint64 / ruint64 - * to a value as close as it can. Note that Javascript stores all numbers as a - * double and the mantissa only has 52 bits. Thus this version may approximate - * the value. - * - * val An array of two 32-bit integers - */ -function toApprox64(val) -{ - if (val === undefined) - throw (new Error('missing required arg: value')); - - if (!Array.isArray(val)) - throw (new Error('value must be an array')); - - if (val.length != 2) - throw (new Error('value must be an array of length 2')); - - return (Math.pow(2, 32) * val[0] + val[1]); -} - -function parseCTF(json, conf) -{ - var ctype = new CTypeParser(conf); - mod_ctf.ctfParseJson(json, ctype); - - return (ctype); -} - -/* - * Export the few things we actually want to. Currently this is just the CType - * Parser and ctio. - */ -exports.Parser = CTypeParser; -exports.toAbs64 = toAbs64; -exports.toApprox64 = toApprox64; - -exports.parseCTF = parseCTF; - -exports.ruint8 = mod_ctio.ruint8; -exports.ruint16 = mod_ctio.ruint16; -exports.ruint32 = mod_ctio.ruint32; -exports.ruint64 = mod_ctio.ruint64; -exports.wuint8 = mod_ctio.wuint8; -exports.wuint16 = mod_ctio.wuint16; -exports.wuint32 = mod_ctio.wuint32; -exports.wuint64 = mod_ctio.wuint64; - -exports.rsint8 = mod_ctio.rsint8; -exports.rsint16 = mod_ctio.rsint16; -exports.rsint32 = mod_ctio.rsint32; -exports.rsint64 = mod_ctio.rsint64; -exports.wsint8 = mod_ctio.wsint8; -exports.wsint16 = mod_ctio.wsint16; -exports.wsint32 = mod_ctio.wsint32; -exports.wsint64 = mod_ctio.wsint64; - -exports.rfloat = mod_ctio.rfloat; -exports.rdouble = mod_ctio.rdouble; -exports.wfloat = mod_ctio.wfloat; -exports.wdouble = mod_ctio.wdouble; diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/ctype/man/man3ctype/ctio.3ctype b/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/ctype/man/man3ctype/ctio.3ctype deleted file mode 100644 index 3f94986a1..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/ctype/man/man3ctype/ctio.3ctype +++ /dev/null @@ -1,241 +0,0 @@ -'\" te -.\" Copyright (c) 2011, Robert Mustacchi. All Rights Reserved. -.\" Copyright (c) 2011, 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. -.TH CTIO 3CTYPE "December 12, 2011" -.SH NAME -ctio, ruint8, ruint16, ruint32, ruint64, wuint8, wuint16, wuint32, wuint64, -rsint8, rsint16, rsint32, rsint64, wsint8, wsint16, wsint32, wsint64, rfloat, -rdouble, wfloat, wdouble \- integer and float operations -.SH SYNOPSIS -.LP -.nf -var mod_ctype = require('ctype'); - -\fBNumber\fR \fBmod_ctype.ruint8\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR); -.fi - -.LP -.nf -\fBNumber\fR \fBmod_ctype.ruint16\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR); -.fi - -.LP -.nf -\fBNumber\fR \fBmod_ctype.ruint32\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR); -.fi - -.LP -.nf -\fBNumber[2]\fR \fBmod_ctype.ruint64\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR); -.fi - -.LP -.nf -\fBNumber\fR \fBmod_ctype.rsint8\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR); -.fi - -.LP -.nf -\fBNumber\fR \fBmod_ctype.rsint16\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR); -.fi - -.LP -.nf -\fBNumber\fR \fBmod_ctype.rsint32\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR); -.fi - -.LP -.nf -\fBNumber[2]\fR \fBmod_ctype.rsint64\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR); -.fi - -.LP -.nf -\fBNumber\fR \fBmod_ctype.rfloat\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR); -.fi - -.LP -.nf -\fBNumber\fR \fBmod_ctype.rdouble\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR); -.fi - -.LP -.nf -\fBvoid\fR \fBmod_ctype.wuint8\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR); -.fi - -.LP -.nf -\fBvoid\fR \fBmod_ctype.wuint16\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR); -.fi - -.LP -.nf -\fBvoid\fR \fBmod_ctype.wuint32\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR); -.fi - -.LP -.nf -\fBvoid\fR \fBmod_ctype.wuint64\fR(\fBNumber[2]\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR); -.fi - -.LP -.nf -\fBvoid\fR \fBmod_ctype.wsint8\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR); -.fi - -.LP -.nf -\fBvoid\fR \fBmod_ctype.wsint16\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR); -.fi - -.LP -.nf -\fBvoid\fR \fBmod_ctype.wsint32\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR); -.fi - -.LP -.nf -\fBvoid\fR \fBmod_ctype.wsint64\fR(\fBNumber[2]\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR); -.fi - -.LP -.nf -\fBvoid\fR \fBmod_ctype.wfloat\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR); -.fi - -.LP -.nf -\fBvoid\fR \fBmod_ctype.wdouble\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR); -.fi - -.SH DESCRIPTION -.sp -.LP -The argument \fIbuf\fR refers to a valid buffer (from calling new Buffer()). The -argument \fIendian\fR is either the string 'big' or 'little' and controls -whether the data in the buffer is interpreted as big or little endian. The argument -\fIoffset\fR indicates the starting index into the buffer to read or write. All -functions ensure that starting at \fIoffset\fR does not overflow the end of the -buffer. The argument \fIvalue\fR is a Number that is the valid type for the -specific function. All functions that take \fIvalue\fR as an argument, verify -that the passed value is valid. - -.SS "\fBruint8()\fR, \fBruint16()\fR, \fBruint32()\fR" -.sp -.LP -The \fBruint8()\fR, \fBruint16()\fR, and \fBruint32()\fR functions read an 8, -16, and 32-bit unsigned value from \fIbuf\fR and return it. The value read is -influenced by the values of \fIoffset\fR and \fRendian\fI. - - -.SS "\fBrsint8()\fR, \fBrsint16()\fR, \fBrsint32()\fR" -.sp -.LP -The \fBruint8()\fR, \fBruint16()\fR, and \fBruint32()\fR functions work just as -\fBruint8()\fR, \fBruint16()\fR, and \fBruint32()\fR, except they return signed -integers. - -.SS "\fBruint64()\fR, \fBrsint64()\fR" -.sp -.LP -The \fBruint64()\fR and \fBrsint64()\fR functions read unsigned and signed 64 -bit integers respectively from \fBbuf\fR. Due to the limitations of ECMAScript's -\fBNumber\fR type, they cannot be stored as one value without a loss of -precision. Instead of returning the values as a single \fBNumber\fR, the -functions return an array of two numbers. The first entry always contains the -upper 32-bits and the second value contains the lower 32-bits. The lossy -transformation into a number would be \fIres[0]*Math.pow(2,32)+res[1]\fR. -Note that, unless an entry is zero, both array entries are guaranteed to have -the same sign. - -.SS "\fBwuint8()\fR, \fBwuint16()\fR, \fBwuint32()\fR" -.sp -.LP -The functions \fBwuint8()\fR, \fBwuint16()\fR, and \fBwuint32()\fR modify the -contents of \fBbuf\fR by writing an 8, 16, and 32-bit unsigned integer -respectively to \fBbuf\fR. It is illegal to pass a number that is not an integer -within the domain of the integer size, for example, for \fBwuint8()\fR the valid -range is \fB[0, 255]\fR. The value will be written in either big or little -endian format based upon the value of \fBendian\fR. - - -.SS "\fBwsint8()\fR, \fBwsint16()\fR, \fBwsint32()\fR" -.sp -.LP -The functions \fBwsint8()\fR, \fBwsint16()\fR, and \fBwsint32()\fR function -identically to the functions \fBwuint8()\fR, \fBwuint16()\fR, and -\fBwuint32()\fR except that they the valid domain for \fBvalue\fR is that of a -signed number instead of an unsigned number. For example the \fBwsint8()\fR has -a domain of \fB[-128, 127]\fR. - -.SS "\fBwuint64()\fR, \fBwsint64()\fR" -.sp -.LP -The functions \fBwuint64()\fR and \fBswint64()\fR write out 64-bit unsigned and -signed integers to \fBbuf\fR. The \fBvalue\fR argument must be in the same -format as described in \fBruint64()\fR and \fBrsint64()\fR. - -.SS "\fBrfloat()\fR, \fBrdouble()\fR" -.sp -.LP -The functions "\fBrfloat()\fR and \fBrdouble()\fR" work like the other read -functions, except that they read a single precision and double precision -IEEE-754 floating point value instead. - -.SS "\fBwfloat()\fR, \fBwdouble()\fR" -.sp -.LP -The functions "\fBrfloat()\fR and \fBrdouble()\fR" work like the other write -functions, except that the domain for a float is that of a single precision 4 -byte value. The domain for a double is any \fBNumber\fR in ECMAScript, which is -defined to be represented by a double. - -.SH ATTRIBUTES -.sp -.LP -See \fBattributes\fR(5) for descriptions of the following attributes: -.sp - -.sp -.TS -box; -c | c -l | l . -ATTRIBUTE TYPE ATTRIBUTE VALUE -_ -Interface Stability Committed -_ -MT-Level See below. -_ -Standard Not standardized. -.TE - -.sp -.LP - -All functions are MT-safe in so far as there aren't shared memory MT concerns in -most node programs. If one where to concoct such an environment, these functions -wouldn't be MT-safe. - -.SH SEE ALSO -.sp -.LP diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/ctype/package.json b/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/ctype/package.json deleted file mode 100644 index 1127363f0..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/ctype/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "ctype", - "version": "0.5.3", - "description": "read and write binary structures and data types", - "homepage": "https://github.com/rmustacc/node-ctype", - "author": { - "name": "Robert Mustacchi", - "email": "rm@fingolfin.org" - }, - "engines": { - "node": ">= 0.4" - }, - "main": "ctype.js", - "repository": { - "type": "git", - "url": "https://github.com/rmustacc/node-ctype.git" - }, - "readme": "Node-CType is a way to read and write binary data in structured and easy to use\nformat. Its name comes from the C header file.\n\nTo get started, simply clone the repository or use npm to install it. Once it is\nthere, simply require it.\n\ngit clone git://github.com/rmustacc/node-ctype\nnpm install ctype\nvar mod_ctype = require('ctype')\n\n\nThere are two APIs that you can use, depending on what abstraction you'd like.\nThe low level API let's you read and write individual integers and floats from\nbuffers. The higher level API let's you read and write structures of these. To\nillustrate this, let's looks look at how we would read and write a binary\nencoded x,y point.\n\nIn C we would define this structure as follows:\n\ntypedef struct point {\n\tuint16_t\tp_x;\n\tuint16_t\tp_y;\n} point_t;\n\nTo read a binary encoded point from a Buffer, we first need to create a CType\nparser (where we specify the endian and other options) and add the typedef.\n\nvar parser = new mod_ctype.Parser({ endian: 'big' });\nparser.typedef('point_t', [\n\t{ x: { type: 'uint16_t' } },\n\t{ y: { type: 'uint16_t' } }\n]);\n\nFrom here, given a buffer buf and an offset into it, we can read a point.\n\nvar out = parser.readData([ { point: { type: 'point_t' } } ], buffer, 0);\nconsole.log(out);\n{ point: { x: 23, y: 42 } }\n\nAnother way to get the same information would be to use the low level methods.\nNote that these require you to manually deal with the offset. Here's how we'd\nget the same values of x and y from the buffer.\n\nvar x = mod_ctype.ruint16(buf, 'big', 0);\nvar y = mod_ctype.ruint16(buf, 'big', 2);\nconsole.log(x + ', ' + y);\n23, 42\n\nThe true power of this API comes from the ability to define and nest typedefs,\njust as you would in C. By default, the following types are defined by default.\nNote that they return a Number, unless indicated otherwise.\n\n * int8_t\n * int16_t\n * int32_t\n * int64_t (returns an array where val[0] << 32 + val[1] would be the value)\n * uint8_t\n * uint16_t\n * uint32_t\n * uint64_t (returns an array where val[0] << 32 + val[1] would be the value)\n * float\n * double\n * char (either returns a buffer with that character or a uint8_t)\n * char[] (returns an object with the buffer and the number of characters read which is either the total amount requested or until the first 0)\n\n\nctf2json integration:\n\nNode-CType supports consuming the output of ctf2json. Once you read in a JSON file,\nall you have to do to add all the definitions it contains is:\n\nvar data, parser;\ndata = JSON.parse(parsedJSONData);\nparser = mod_ctype.parseCTF(data, { endian: 'big' });\n\nFor more documentation, see the file README.old. Full documentation is in the\nprocess of being rewritten as a series of manual pages which will be available\nin the repository and online for viewing.\n\nTo read the ctio manual page simple run, from the root of the workspace:\n\nman -Mman -s 3ctype ctio\n", - "readmeFilename": "README", - "bugs": { - "url": "https://github.com/rmustacc/node-ctype/issues" - }, - "_id": "ctype@0.5.3", - "_from": "ctype@0.5.3", - "scripts": {} -} diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsl.conf b/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsl.conf deleted file mode 100644 index 845f367a2..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsl.conf +++ /dev/null @@ -1,129 +0,0 @@ -# -# Configuration File for JavaScript Lint 0.3.0 -# Developed by Matthias Miller (http://www.JavaScriptLint.com) -# -# This configuration file can be used to lint a collection of scripts, or to enable -# or disable warnings for scripts that are linted via the command line. -# - -### Warnings -# Enable or disable warnings based on requirements. -# Use "+WarningName" to display or "-WarningName" to suppress. -# -+no_return_value # function {0} does not always return a value -+duplicate_formal # duplicate formal argument {0} -+equal_as_assign # test for equality (==) mistyped as assignment (=)?{0} -+var_hides_arg # variable {0} hides argument -+redeclared_var # redeclaration of {0} {1} -+anon_no_return_value # anonymous function does not always return a value -+missing_semicolon # missing semicolon -+meaningless_block # meaningless block; curly braces have no impact -+comma_separated_stmts # multiple statements separated by commas (use semicolons?) -+unreachable_code # unreachable code -+missing_break # missing break statement -+missing_break_for_last_case # missing break statement for last case in switch -+comparison_type_conv # comparisons against null, 0, true, false, or an empty string allowing implicit type conversion (use === or !==) --inc_dec_within_stmt # increment (++) and decrement (--) operators used as part of greater statement -+useless_void # use of the void type may be unnecessary (void is always undefined) --useless_quotes # quotation marks are unnecessary -+multiple_plus_minus # unknown order of operations for successive plus (e.g. x+++y) or minus (e.g. x---y) signs -+use_of_label # use of label --block_without_braces # block statement without curly braces -+leading_decimal_point # leading decimal point may indicate a number or an object member -+trailing_decimal_point # trailing decimal point may indicate a number or an object member --octal_number # leading zeros make an octal number -+nested_comment # nested comment -+misplaced_regex # regular expressions should be preceded by a left parenthesis, assignment, colon, or comma -+ambiguous_newline # unexpected end of line; it is ambiguous whether these lines are part of the same statement -+empty_statement # empty statement or extra semicolon --missing_option_explicit # the "option explicit" control comment is missing -+partial_option_explicit # the "option explicit" control comment, if used, must be in the first script tag -+dup_option_explicit # duplicate "option explicit" control comment -+useless_assign # useless assignment -+ambiguous_nested_stmt # block statements containing block statements should use curly braces to resolve ambiguity -+ambiguous_else_stmt # the else statement could be matched with one of multiple if statements (use curly braces to indicate intent) -+missing_default_case # missing default case in switch statement -+duplicate_case_in_switch # duplicate case in switch statements -+default_not_at_end # the default case is not at the end of the switch statement -+legacy_cc_not_understood # couldn't understand control comment using /*@keyword@*/ syntax -+jsl_cc_not_understood # couldn't understand control comment using /*jsl:keyword*/ syntax -+useless_comparison # useless comparison; comparing identical expressions -+with_statement # with statement hides undeclared variables; use temporary variable instead -+trailing_comma_in_array # extra comma is not recommended in array initializers -+assign_to_function_call # assignment to a function call -+parseint_missing_radix # parseInt missing radix parameter --unreferenced_argument # argument declared but never referenced: {name} - -### Output format -# Customize the format of the error message. -# __FILE__ indicates current file path -# __FILENAME__ indicates current file name -# __LINE__ indicates current line -# __ERROR__ indicates error message -# -# Visual Studio syntax (default): -+output-format __FILE__(__LINE__): __ERROR__ -# Alternative syntax: -#+output-format __FILE__:__LINE__: __ERROR__ - - -### Context -# Show the in-line position of the error. -# Use "+context" to display or "-context" to suppress. -# -+context - - -### Semicolons -# By default, assignments of an anonymous function to a variable or -# property (such as a function prototype) must be followed by a semicolon. -# -#+lambda_assign_requires_semicolon # deprecated setting - - -### Control Comments -# Both JavaScript Lint and the JScript interpreter confuse each other with the syntax for -# the /*@keyword@*/ control comments and JScript conditional comments. (The latter is -# enabled in JScript with @cc_on@). The /*jsl:keyword*/ syntax is preferred for this reason, -# although legacy control comments are enabled by default for backward compatibility. -# -+legacy_control_comments - - -### JScript Function Extensions -# JScript allows member functions to be defined like this: -# function MyObj() { /*constructor*/ } -# function MyObj.prototype.go() { /*member function*/ } -# -# It also allows events to be attached like this: -# function window::onload() { /*init page*/ } -# -# This is a Microsoft-only JavaScript extension. Enable this setting to allow them. -# -#-jscript_function_extensions # deprecated setting - - -### Defining identifiers -# By default, "option explicit" is enabled on a per-file basis. -# To enable this for all files, use "+always_use_option_explicit" --always_use_option_explicit - -# Define certain identifiers of which the lint is not aware. -# (Use this in conjunction with the "undeclared identifier" warning.) -# -# Common uses for webpages might be: -#+define window -#+define document -+define require -+define exports -+define console -+define Buffer -+define JSON - -### Files -# Specify which files to lint -# Use "+recurse" to enable recursion (disabled by default). -# To add a set of files, use "+process FileName", "+process Folder\Path\*.js", -# or "+process Folder\Path\*.htm". -# -#+process jsl-test.js diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsstyle b/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsstyle deleted file mode 100644 index 96c72b6d7..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsstyle +++ /dev/null @@ -1,839 +0,0 @@ -#!/usr/bin/env perl -# -# CDDL HEADER START -# -# The contents of this file are subject to the terms of the -# Common Development and Distribution License (the "License"). -# You may not use this file except in compliance with the License. -# -# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -# or http://www.opensolaris.org/os/licensing. -# See the License for the specific language governing permissions -# and limitations under the License. -# -# When distributing Covered Code, include this CDDL HEADER in each -# file and include the License file at usr/src/OPENSOLARIS.LICENSE. -# If applicable, add the following below this CDDL HEADER, with the -# fields enclosed by brackets "[]" replaced with your own identifying -# information: Portions Copyright [yyyy] [name of copyright owner] -# -# CDDL HEADER END -# -# -# Copyright 2008 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# Copyright 2011 Joyent, Inc. All rights reserved. -# -# jsstyle - check for some common stylistic errors. -# -# jsstyle is a sort of "lint" for Javascript coding style. This tool is -# derived from the cstyle tool, used to check for the style used in the -# Solaris kernel, sometimes known as "Bill Joy Normal Form". -# -# There's a lot this can't check for, like proper indentation of code -# blocks. There's also a lot more this could check for. -# -# A note to the non perl literate: -# -# perl regular expressions are pretty much like egrep -# regular expressions, with the following special symbols -# -# \s any space character -# \S any non-space character -# \w any "word" character [a-zA-Z0-9_] -# \W any non-word character -# \d a digit [0-9] -# \D a non-digit -# \b word boundary (between \w and \W) -# \B non-word boundary -# - -require 5.0; -use IO::File; -use Getopt::Std; -use strict; - -my $usage = -"usage: jsstyle [-chvC] [-o constructs] file ... - -c check continuation indentation inside functions - -h perform heuristic checks that are sometimes wrong - -v verbose - -C don't check anything in header block comments - -o constructs - allow a comma-seperated list of optional constructs: - doxygen allow doxygen-style block comments (/** /*!) - splint allow splint-style lint comments (/*@ ... @*/) -"; - -my %opts; - -if (!getopts("cho:vC", \%opts)) { - print $usage; - exit 2; -} - -my $check_continuation = $opts{'c'}; -my $heuristic = $opts{'h'}; -my $verbose = $opts{'v'}; -my $ignore_hdr_comment = $opts{'C'}; - -my $doxygen_comments = 0; -my $splint_comments = 0; - -if (defined($opts{'o'})) { - for my $x (split /,/, $opts{'o'}) { - if ($x eq "doxygen") { - $doxygen_comments = 1; - } elsif ($x eq "splint") { - $splint_comments = 1; - } else { - print "jsstyle: unrecognized construct \"$x\"\n"; - print $usage; - exit 2; - } - } -} - -my ($filename, $line, $prev); # shared globals - -my $fmt; -my $hdr_comment_start; - -if ($verbose) { - $fmt = "%s: %d: %s\n%s\n"; -} else { - $fmt = "%s: %d: %s\n"; -} - -if ($doxygen_comments) { - # doxygen comments look like "/*!" or "/**"; allow them. - $hdr_comment_start = qr/^\s*\/\*[\!\*]?$/; -} else { - $hdr_comment_start = qr/^\s*\/\*$/; -} - -# Note, following must be in single quotes so that \s and \w work right. -my $lint_re = qr/\/\*(?: - jsl:\w+?|ARGSUSED[0-9]*|NOTREACHED|LINTLIBRARY|VARARGS[0-9]*| - CONSTCOND|CONSTANTCOND|CONSTANTCONDITION|EMPTY| - FALLTHRU|FALLTHROUGH|LINTED.*?|PRINTFLIKE[0-9]*| - PROTOLIB[0-9]*|SCANFLIKE[0-9]*|JSSTYLED.*? - )\*\//x; - -my $splint_re = qr/\/\*@.*?@\*\//x; - -my $err_stat = 0; # exit status - -if ($#ARGV >= 0) { - foreach my $arg (@ARGV) { - my $fh = new IO::File $arg, "r"; - if (!defined($fh)) { - printf "%s: cannot open\n", $arg; - } else { - &jsstyle($arg, $fh); - close $fh; - } - } -} else { - &jsstyle("", *STDIN); -} -exit $err_stat; - -my $no_errs = 0; # set for JSSTYLED-protected lines - -sub err($) { - my ($error) = @_; - unless ($no_errs) { - printf $fmt, $filename, $., $error, $line; - $err_stat = 1; - } -} - -sub err_prefix($$) { - my ($prevline, $error) = @_; - my $out = $prevline."\n".$line; - unless ($no_errs) { - printf $fmt, $filename, $., $error, $out; - $err_stat = 1; - } -} - -sub err_prev($) { - my ($error) = @_; - unless ($no_errs) { - printf $fmt, $filename, $. - 1, $error, $prev; - $err_stat = 1; - } -} - -sub jsstyle($$) { - -my ($fn, $filehandle) = @_; -$filename = $fn; # share it globally - -my $in_cpp = 0; -my $next_in_cpp = 0; - -my $in_comment = 0; -my $in_header_comment = 0; -my $comment_done = 0; -my $in_function = 0; -my $in_function_header = 0; -my $in_declaration = 0; -my $note_level = 0; -my $nextok = 0; -my $nocheck = 0; - -my $in_string = 0; - -my ($okmsg, $comment_prefix); - -$line = ''; -$prev = ''; -reset_indent(); - -line: while (<$filehandle>) { - s/\r?\n$//; # strip return and newline - - # save the original line, then remove all text from within - # double or single quotes, we do not want to check such text. - - $line = $_; - - # - # C allows strings to be continued with a backslash at the end of - # the line. We translate that into a quoted string on the previous - # line followed by an initial quote on the next line. - # - # (we assume that no-one will use backslash-continuation with character - # constants) - # - $_ = '"' . $_ if ($in_string && !$nocheck && !$in_comment); - - # - # normal strings and characters - # - s/'([^\\']|\\.)*'/\'\'/g; - s/"([^\\"]|\\.)*"/\"\"/g; - - # - # detect string continuation - # - if ($nocheck || $in_comment) { - $in_string = 0; - } else { - # - # Now that all full strings are replaced with "", we check - # for unfinished strings continuing onto the next line. - # - $in_string = - (s/([^"](?:"")*)"([^\\"]|\\.)*\\$/$1""/ || - s/^("")*"([^\\"]|\\.)*\\$/""/); - } - - # - # figure out if we are in a cpp directive - # - $in_cpp = $next_in_cpp || /^\s*#/; # continued or started - $next_in_cpp = $in_cpp && /\\$/; # only if continued - - # strip off trailing backslashes, which appear in long macros - s/\s*\\$//; - - # an /* END JSSTYLED */ comment ends a no-check block. - if ($nocheck) { - if (/\/\* *END *JSSTYLED *\*\//) { - $nocheck = 0; - } else { - reset_indent(); - next line; - } - } - - # a /*JSSTYLED*/ comment indicates that the next line is ok. - if ($nextok) { - if ($okmsg) { - err($okmsg); - } - $nextok = 0; - $okmsg = 0; - if (/\/\* *JSSTYLED.*\*\//) { - /^.*\/\* *JSSTYLED *(.*) *\*\/.*$/; - $okmsg = $1; - $nextok = 1; - } - $no_errs = 1; - } elsif ($no_errs) { - $no_errs = 0; - } - - # check length of line. - # first, a quick check to see if there is any chance of being too long. - if (($line =~ tr/\t/\t/) * 7 + length($line) > 80) { - # yes, there is a chance. - # replace tabs with spaces and check again. - my $eline = $line; - 1 while $eline =~ - s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e; - if (length($eline) > 80) { - err("line > 80 characters"); - } - } - - # ignore NOTE(...) annotations (assumes NOTE is on lines by itself). - if ($note_level || /\b_?NOTE\s*\(/) { # if in NOTE or this is NOTE - s/[^()]//g; # eliminate all non-parens - $note_level += s/\(//g - length; # update paren nest level - next; - } - - # a /* BEGIN JSSTYLED */ comment starts a no-check block. - if (/\/\* *BEGIN *JSSTYLED *\*\//) { - $nocheck = 1; - } - - # a /*JSSTYLED*/ comment indicates that the next line is ok. - if (/\/\* *JSSTYLED.*\*\//) { - /^.*\/\* *JSSTYLED *(.*) *\*\/.*$/; - $okmsg = $1; - $nextok = 1; - } - if (/\/\/ *JSSTYLED/) { - /^.*\/\/ *JSSTYLED *(.*)$/; - $okmsg = $1; - $nextok = 1; - } - - # universal checks; apply to everything - if (/\t +\t/) { - err("spaces between tabs"); - } - if (/ \t+ /) { - err("tabs between spaces"); - } - if (/\s$/) { - err("space or tab at end of line"); - } - if (/[^ \t(]\/\*/ && !/\w\(\/\*.*\*\/\);/) { - err("comment preceded by non-blank"); - } - - # is this the beginning or ending of a function? - # (not if "struct foo\n{\n") - if (/^{$/ && $prev =~ /\)\s*(const\s*)?(\/\*.*\*\/\s*)?\\?$/) { - $in_function = 1; - $in_declaration = 1; - $in_function_header = 0; - $prev = $line; - next line; - } - if (/^}\s*(\/\*.*\*\/\s*)*$/) { - if ($prev =~ /^\s*return\s*;/) { - err_prev("unneeded return at end of function"); - } - $in_function = 0; - reset_indent(); # we don't check between functions - $prev = $line; - next line; - } - if (/^\w*\($/) { - $in_function_header = 1; - } - - # a blank line terminates the declarations within a function. - # XXX - but still a problem in sub-blocks. - if ($in_declaration && /^$/) { - $in_declaration = 0; - } - - if ($comment_done) { - $in_comment = 0; - $in_header_comment = 0; - $comment_done = 0; - } - # does this looks like the start of a block comment? - if (/$hdr_comment_start/) { - if (!/^\t*\/\*/) { - err("block comment not indented by tabs"); - } - $in_comment = 1; - /^(\s*)\//; - $comment_prefix = $1; - if ($comment_prefix eq "") { - $in_header_comment = 1; - } - $prev = $line; - next line; - } - # are we still in the block comment? - if ($in_comment) { - if (/^$comment_prefix \*\/$/) { - $comment_done = 1; - } elsif (/\*\//) { - $comment_done = 1; - err("improper block comment close") - unless ($ignore_hdr_comment && $in_header_comment); - } elsif (!/^$comment_prefix \*[ \t]/ && - !/^$comment_prefix \*$/) { - err("improper block comment") - unless ($ignore_hdr_comment && $in_header_comment); - } - } - - if ($in_header_comment && $ignore_hdr_comment) { - $prev = $line; - next line; - } - - # check for errors that might occur in comments and in code. - - # allow spaces to be used to draw pictures in header comments. - #if (/[^ ] / && !/".* .*"/ && !$in_header_comment) { - # err("spaces instead of tabs"); - #} - #if (/^ / && !/^ \*[ \t\/]/ && !/^ \*$/ && - # (!/^ \w/ || $in_function != 0)) { - # err("indent by spaces instead of tabs"); - #} - if (/^ {2,}/ && !/^ [^ ]/) { - err("indent by spaces instead of tabs"); - } - if (/^\t+ [^ \t\*]/ || /^\t+ \S/ || /^\t+ \S/) { - err("continuation line not indented by 4 spaces"); - } - - if (/^\s*\/\*./ && !/^\s*\/\*.*\*\// && !/$hdr_comment_start/) { - err("improper first line of block comment"); - } - - if ($in_comment) { # still in comment, don't do further checks - $prev = $line; - next line; - } - - if ((/[^(]\/\*\S/ || /^\/\*\S/) && - !(/$lint_re/ || ($splint_comments && /$splint_re/))) { - err("missing blank after open comment"); - } - if (/\S\*\/[^)]|\S\*\/$/ && - !(/$lint_re/ || ($splint_comments && /$splint_re/))) { - err("missing blank before close comment"); - } - if (/\/\/\S/) { # C++ comments - err("missing blank after start comment"); - } - # check for unterminated single line comments, but allow them when - # they are used to comment out the argument list of a function - # declaration. - if (/\S.*\/\*/ && !/\S.*\/\*.*\*\// && !/\(\/\*/) { - err("unterminated single line comment"); - } - - if (/^(#else|#endif|#include)(.*)$/) { - $prev = $line; - next line; - } - - # - # delete any comments and check everything else. Note that - # ".*?" is a non-greedy match, so that we don't get confused by - # multiple comments on the same line. - # - s/\/\*.*?\*\///g; - s/\/\/.*$//; # C++ comments - - # delete any trailing whitespace; we have already checked for that. - s/\s*$//; - - # following checks do not apply to text in comments. - if (/"/) { - err("literal string using double-quote instead of single"); - } - - if (/[^=!<>\s][!<>=]=/ || /[^<>!=][!<>=]==?[^\s,=]/ || - (/[^->]>[^,=>\s]/ && !/[^->]>$/) || - (/[^<]<[^,=<\s]/ && !/[^<]<$/) || - /[^<\s]<[^<]/ || /[^->\s]>[^>]/) { - err("missing space around relational operator"); - } - if (/\S>>=/ || /\S<<=/ || />>=\S/ || /<<=\S/ || /\S[-+*\/&|^%]=/ || - (/[^-+*\/&|^%!<>=\s]=[^=]/ && !/[^-+*\/&|^%!<>=\s]=$/) || - (/[^!<>=]=[^=\s]/ && !/[^!<>=]=$/)) { - # XXX - should only check this for C++ code - # XXX - there are probably other forms that should be allowed - if (!/\soperator=/) { - err("missing space around assignment operator"); - } - } - if (/[,;]\S/ && !/\bfor \(;;\)/) { - err("comma or semicolon followed by non-blank"); - } - # allow "for" statements to have empty "while" clauses - if (/\s[,;]/ && !/^[\t]+;$/ && !/^\s*for \([^;]*; ;[^;]*\)/) { - err("comma or semicolon preceded by blank"); - } - if (/^\s*(&&|\|\|)/) { - err("improper boolean continuation"); - } - if (/\S *(&&|\|\|)/ || /(&&|\|\|) *\S/) { - err("more than one space around boolean operator"); - } - if (/\b(delete|typeof|instanceOf|throw|with|catch|new|function|in|for|if|while|switch|return|case)\(/) { - err("missing space between keyword and paren"); - } - if (/(\b(catch|for|if|with|while|switch|return)\b.*){2,}/) { - # multiple "case" and "sizeof" allowed - err("more than one keyword on line"); - } - if (/\b(delete|typeof|instanceOf|with|throw|catch|new|function|in|for|if|while|switch|return|case)\s\s+\(/ && - !/^#if\s+\(/) { - err("extra space between keyword and paren"); - } - # try to detect "func (x)" but not "if (x)" or - # "#define foo (x)" or "int (*func)();" - if (/\w\s\(/) { - my $s = $_; - # strip off all keywords on the line - s/\b(delete|typeof|instanceOf|throw|with|catch|new|function|in|for|if|while|switch|return|case)\s\(/XXX(/g; - s/#elif\s\(/XXX(/g; - s/^#define\s+\w+\s+\(/XXX(/; - # do not match things like "void (*f)();" - # or "typedef void (func_t)();" - s/\w\s\(+\*/XXX(*/g; - s/\b(void)\s+\(+/XXX(/og; - if (/\w\s\(/) { - err("extra space between function name and left paren"); - } - $_ = $s; - } - - if (/^\s*return\W[^;]*;/ && !/^\s*return\s*\(.*\);/) { - err("unparenthesized return expression"); - } - if (/\btypeof\b/ && !/\btypeof\s*\(.*\)/) { - err("unparenthesized typeof expression"); - } - if (/\(\s/) { - err("whitespace after left paren"); - } - # allow "for" statements to have empty "continue" clauses - if (/\s\)/ && !/^\s*for \([^;]*;[^;]*; \)/) { - err("whitespace before right paren"); - } - if (/^\s*\(void\)[^ ]/) { - err("missing space after (void) cast"); - } - if (/\S{/ && !/({|\(){/) { - err("missing space before left brace"); - } - if ($in_function && /^\s+{/ && - ($prev =~ /\)\s*$/ || $prev =~ /\bstruct\s+\w+$/)) { - err("left brace starting a line"); - } - if (/}(else|while)/) { - err("missing space after right brace"); - } - if (/}\s\s+(else|while)/) { - err("extra space after right brace"); - } - if (/^\s+#/) { - err("preprocessor statement not in column 1"); - } - if (/^#\s/) { - err("blank after preprocessor #"); - } - - # - # We completely ignore, for purposes of indentation: - # * lines outside of functions - # * preprocessor lines - # - if ($check_continuation && $in_function && !$in_cpp) { - process_indent($_); - } - - if ($heuristic) { - # cannot check this everywhere due to "struct {\n...\n} foo;" - if ($in_function && !$in_declaration && - /}./ && !/}\s+=/ && !/{.*}[;,]$/ && !/}(\s|)*$/ && - !/} (else|while)/ && !/}}/) { - err("possible bad text following right brace"); - } - # cannot check this because sub-blocks in - # the middle of code are ok - if ($in_function && /^\s+{/) { - err("possible left brace starting a line"); - } - } - if (/^\s*else\W/) { - if ($prev =~ /^\s*}$/) { - err_prefix($prev, - "else and right brace should be on same line"); - } - } - $prev = $line; -} - -if ($prev eq "") { - err("last line in file is blank"); -} - -} - -# -# Continuation-line checking -# -# The rest of this file contains the code for the continuation checking -# engine. It's a pretty simple state machine which tracks the expression -# depth (unmatched '('s and '['s). -# -# Keep in mind that the argument to process_indent() has already been heavily -# processed; all comments have been replaced by control-A, and the contents of -# strings and character constants have been elided. -# - -my $cont_in; # currently inside of a continuation -my $cont_off; # skipping an initializer or definition -my $cont_noerr; # suppress cascading errors -my $cont_start; # the line being continued -my $cont_base; # the base indentation -my $cont_first; # this is the first line of a statement -my $cont_multiseg; # this continuation has multiple segments - -my $cont_special; # this is a C statement (if, for, etc.) -my $cont_macro; # this is a macro -my $cont_case; # this is a multi-line case - -my @cont_paren; # the stack of unmatched ( and [s we've seen - -sub -reset_indent() -{ - $cont_in = 0; - $cont_off = 0; -} - -sub -delabel($) -{ - # - # replace labels with tabs. Note that there may be multiple - # labels on a line. - # - local $_ = $_[0]; - - while (/^(\t*)( *(?:(?:\w+\s*)|(?:case\b[^:]*)): *)(.*)$/) { - my ($pre_tabs, $label, $rest) = ($1, $2, $3); - $_ = $pre_tabs; - while ($label =~ s/^([^\t]*)(\t+)//) { - $_ .= "\t" x (length($2) + length($1) / 8); - } - $_ .= ("\t" x (length($label) / 8)).$rest; - } - - return ($_); -} - -sub -process_indent($) -{ - require strict; - local $_ = $_[0]; # preserve the global $_ - - s///g; # No comments - s/\s+$//; # Strip trailing whitespace - - return if (/^$/); # skip empty lines - - # regexps used below; keywords taking (), macros, and continued cases - my $special = '(?:(?:\}\s*)?else\s+)?(?:if|for|while|switch)\b'; - my $macro = '[A-Z_][A-Z_0-9]*\('; - my $case = 'case\b[^:]*$'; - - # skip over enumerations, array definitions, initializers, etc. - if ($cont_off <= 0 && !/^\s*$special/ && - (/(?:(?:\b(?:enum|struct|union)\s*[^\{]*)|(?:\s+=\s*)){/ || - (/^\s*{/ && $prev =~ /=\s*(?:\/\*.*\*\/\s*)*$/))) { - $cont_in = 0; - $cont_off = tr/{/{/ - tr/}/}/; - return; - } - if ($cont_off) { - $cont_off += tr/{/{/ - tr/}/}/; - return; - } - - if (!$cont_in) { - $cont_start = $line; - - if (/^\t* /) { - err("non-continuation indented 4 spaces"); - $cont_noerr = 1; # stop reporting - } - $_ = delabel($_); # replace labels with tabs - - # check if the statement is complete - return if (/^\s*\}?$/); - return if (/^\s*\}?\s*else\s*\{?$/); - return if (/^\s*do\s*\{?$/); - return if (/{$/); - return if (/}[,;]?$/); - - # Allow macros on their own lines - return if (/^\s*[A-Z_][A-Z_0-9]*$/); - - # cases we don't deal with, generally non-kosher - if (/{/) { - err("stuff after {"); - return; - } - - # Get the base line, and set up the state machine - /^(\t*)/; - $cont_base = $1; - $cont_in = 1; - @cont_paren = (); - $cont_first = 1; - $cont_multiseg = 0; - - # certain things need special processing - $cont_special = /^\s*$special/? 1 : 0; - $cont_macro = /^\s*$macro/? 1 : 0; - $cont_case = /^\s*$case/? 1 : 0; - } else { - $cont_first = 0; - - # Strings may be pulled back to an earlier (half-)tabstop - unless ($cont_noerr || /^$cont_base / || - (/^\t*(?: )?(?:gettext\()?\"/ && !/^$cont_base\t/)) { - err_prefix($cont_start, - "continuation should be indented 4 spaces"); - } - } - - my $rest = $_; # keeps the remainder of the line - - # - # The split matches 0 characters, so that each 'special' character - # is processed separately. Parens and brackets are pushed and - # popped off the @cont_paren stack. For normal processing, we wait - # until a ; or { terminates the statement. "special" processing - # (if/for/while/switch) is allowed to stop when the stack empties, - # as is macro processing. Case statements are terminated with a : - # and an empty paren stack. - # - foreach $_ (split /[^\(\)\[\]\{\}\;\:]*/) { - next if (length($_) == 0); - - # rest contains the remainder of the line - my $rxp = "[^\Q$_\E]*\Q$_\E"; - $rest =~ s/^$rxp//; - - if (/\(/ || /\[/) { - push @cont_paren, $_; - } elsif (/\)/ || /\]/) { - my $cur = $_; - tr/\)\]/\(\[/; - - my $old = (pop @cont_paren); - if (!defined($old)) { - err("unexpected '$cur'"); - $cont_in = 0; - last; - } elsif ($old ne $_) { - err("'$cur' mismatched with '$old'"); - $cont_in = 0; - last; - } - - # - # If the stack is now empty, do special processing - # for if/for/while/switch and macro statements. - # - next if (@cont_paren != 0); - if ($cont_special) { - if ($rest =~ /^\s*{?$/) { - $cont_in = 0; - last; - } - if ($rest =~ /^\s*;$/) { - err("empty if/for/while body ". - "not on its own line"); - $cont_in = 0; - last; - } - if (!$cont_first && $cont_multiseg == 1) { - err_prefix($cont_start, - "multiple statements continued ". - "over multiple lines"); - $cont_multiseg = 2; - } elsif ($cont_multiseg == 0) { - $cont_multiseg = 1; - } - # We've finished this section, start - # processing the next. - goto section_ended; - } - if ($cont_macro) { - if ($rest =~ /^$/) { - $cont_in = 0; - last; - } - } - } elsif (/\;/) { - if ($cont_case) { - err("unexpected ;"); - } elsif (!$cont_special) { - err("unexpected ;") if (@cont_paren != 0); - if (!$cont_first && $cont_multiseg == 1) { - err_prefix($cont_start, - "multiple statements continued ". - "over multiple lines"); - $cont_multiseg = 2; - } elsif ($cont_multiseg == 0) { - $cont_multiseg = 1; - } - if ($rest =~ /^$/) { - $cont_in = 0; - last; - } - if ($rest =~ /^\s*special/) { - err("if/for/while/switch not started ". - "on its own line"); - } - goto section_ended; - } - } elsif (/\{/) { - err("{ while in parens/brackets") if (@cont_paren != 0); - err("stuff after {") if ($rest =~ /[^\s}]/); - $cont_in = 0; - last; - } elsif (/\}/) { - err("} while in parens/brackets") if (@cont_paren != 0); - if (!$cont_special && $rest !~ /^\s*(while|else)\b/) { - if ($rest =~ /^$/) { - err("unexpected }"); - } else { - err("stuff after }"); - } - $cont_in = 0; - last; - } - } elsif (/\:/ && $cont_case && @cont_paren == 0) { - err("stuff after multi-line case") if ($rest !~ /$^/); - $cont_in = 0; - last; - } - next; -section_ended: - # End of a statement or if/while/for loop. Reset - # cont_special and cont_macro based on the rest of the - # line. - $cont_special = ($rest =~ /^\s*$special/)? 1 : 0; - $cont_macro = ($rest =~ /^\s*$macro/)? 1 : 0; - $cont_case = 0; - next; - } - $cont_noerr = 0 if (!$cont_in); -} diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/mime-types/HISTORY.md b/update_nation/node_modules/couchapp/node_modules/request/node_modules/mime-types/HISTORY.md deleted file mode 100644 index aa7cdf169..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/mime-types/HISTORY.md +++ /dev/null @@ -1,91 +0,0 @@ -2.0.10 / 2015-03-13 -=================== - - * deps: mime-db@~1.8.0 - - Add new mime types - -2.0.9 / 2015-02-09 -================== - - * deps: mime-db@~1.7.0 - - Add new mime types - - Community extensions ownership transferred from `node-mime` - -2.0.8 / 2015-01-29 -================== - - * deps: mime-db@~1.6.0 - - Add new mime types - -2.0.7 / 2014-12-30 -================== - - * deps: mime-db@~1.5.0 - - Add new mime types - - Fix various invalid MIME type entries - -2.0.6 / 2014-12-30 -================== - - * deps: mime-db@~1.4.0 - - Add new mime types - - Fix various invalid MIME type entries - - Remove example template MIME types - -2.0.5 / 2014-12-29 -================== - - * deps: mime-db@~1.3.1 - - Fix missing extensions - -2.0.4 / 2014-12-10 -================== - - * deps: mime-db@~1.3.0 - - Add new mime types - -2.0.3 / 2014-11-09 -================== - - * deps: mime-db@~1.2.0 - - Add new mime types - -2.0.2 / 2014-09-28 -================== - - * deps: mime-db@~1.1.0 - - Add new mime types - - Add additional compressible - - Update charsets - -2.0.1 / 2014-09-07 -================== - - * Support Node.js 0.6 - -2.0.0 / 2014-09-02 -================== - - * Use `mime-db` - * Remove `.define()` - -1.0.2 / 2014-08-04 -================== - - * Set charset=utf-8 for `text/javascript` - -1.0.1 / 2014-06-24 -================== - - * Add `text/jsx` type - -1.0.0 / 2014-05-12 -================== - - * Return `false` for unknown types - * Set charset=utf-8 for `application/json` - -0.1.0 / 2014-05-02 -================== - - * Initial release diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/mime-types/LICENSE b/update_nation/node_modules/couchapp/node_modules/request/node_modules/mime-types/LICENSE deleted file mode 100644 index a7ae8ee9b..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/mime-types/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ - -The MIT License (MIT) - -Copyright (c) 2014 Jonathan Ong me@jongleberry.com - -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/update_nation/node_modules/couchapp/node_modules/request/node_modules/mime-types/README.md b/update_nation/node_modules/couchapp/node_modules/request/node_modules/mime-types/README.md deleted file mode 100644 index 8fea7ff4c..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/mime-types/README.md +++ /dev/null @@ -1,102 +0,0 @@ -# mime-types - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Node.js Version][node-version-image]][node-version-url] -[![Build Status][travis-image]][travis-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -The ultimate javascript content-type utility. - -Similar to [node-mime](https://github.com/broofa/node-mime), except: - -- __No fallbacks.__ Instead of naively returning the first available type, `mime-types` simply returns `false`, - so do `var type = mime.lookup('unrecognized') || 'application/octet-stream'`. -- No `new Mime()` business, so you could do `var lookup = require('mime-types').lookup`. -- Additional mime types are added such as jade and stylus via [mime-db](https://github.com/jshttp/mime-db) -- No `.define()` functionality - -Otherwise, the API is compatible. - -## Install - -```sh -$ npm install mime-types -``` - -## Adding Types - -All mime types are based on [mime-db](https://github.com/jshttp/mime-db), -so open a PR there if you'd like to add mime types. - -## API - -```js -var mime = require('mime-types') -``` - -All functions return `false` if input is invalid or not found. - -### mime.lookup(path) - -Lookup the content-type associated with a file. - -```js -mime.lookup('json') // 'application/json' -mime.lookup('.md') // 'text/x-markdown' -mime.lookup('file.html') // 'text/html' -mime.lookup('folder/file.js') // 'application/javascript' - -mime.lookup('cats') // false -``` - -### mime.contentType(type) - -Create a full content-type header given a content-type or extension. - -```js -mime.contentType('markdown') // 'text/x-markdown; charset=utf-8' -mime.contentType('file.json') // 'application/json; charset=utf-8' - -// from a full path -mime.contentType(path.extname('/path/to/file.json')) // 'application/json; charset=utf-8' -``` - -### mime.extension(type) - -Get the default extension for a content-type. - -```js -mime.extension('application/octet-stream') // 'bin' -``` - -### mime.charset(type) - -Lookup the implied default charset of a content-type. - -```js -mime.charset('text/x-markdown') // 'UTF-8' -``` - -### var type = mime.types[extension] - -A map of content-types by extension. - -### [extensions...] = mime.extensions[type] - -A map of extensions by content-type. - -## License - -[MIT](LICENSE) - -[npm-image]: https://img.shields.io/npm/v/mime-types.svg?style=flat -[npm-url]: https://npmjs.org/package/mime-types -[node-version-image]: https://img.shields.io/badge/node.js-%3E%3D_0.6-brightgreen.svg?style=flat -[node-version-url]: http://nodejs.org/download/ -[travis-image]: https://img.shields.io/travis/jshttp/mime-types.svg?style=flat -[travis-url]: https://travis-ci.org/jshttp/mime-types -[coveralls-image]: https://img.shields.io/coveralls/jshttp/mime-types.svg?style=flat -[coveralls-url]: https://coveralls.io/r/jshttp/mime-types -[downloads-image]: https://img.shields.io/npm/dm/mime-types.svg?style=flat -[downloads-url]: https://npmjs.org/package/mime-types diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/mime-types/index.js b/update_nation/node_modules/couchapp/node_modules/request/node_modules/mime-types/index.js deleted file mode 100644 index b46a202f5..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/mime-types/index.js +++ /dev/null @@ -1,63 +0,0 @@ - -var db = require('mime-db') - -// types[extension] = type -exports.types = Object.create(null) -// extensions[type] = [extensions] -exports.extensions = Object.create(null) - -Object.keys(db).forEach(function (name) { - var mime = db[name] - var exts = mime.extensions - if (!exts || !exts.length) return - exports.extensions[name] = exts - exts.forEach(function (ext) { - exports.types[ext] = name - }) -}) - -exports.lookup = function (string) { - if (!string || typeof string !== "string") return false - // remove any leading paths, though we should just use path.basename - string = string.replace(/.*[\.\/\\]/, '').toLowerCase() - if (!string) return false - return exports.types[string] || false -} - -exports.extension = function (type) { - if (!type || typeof type !== "string") return false - // to do: use media-typer - type = type.match(/^\s*([^;\s]*)(?:;|\s|$)/) - if (!type) return false - var exts = exports.extensions[type[1].toLowerCase()] - if (!exts || !exts.length) return false - return exts[0] -} - -// type has to be an exact mime type -exports.charset = function (type) { - var mime = db[type] - if (mime && mime.charset) return mime.charset - - // default text/* to utf-8 - if (/^text\//.test(type)) return 'UTF-8' - - return false -} - -// backwards compatibility -exports.charsets = { - lookup: exports.charset -} - -// to do: maybe use set-type module or something -exports.contentType = function (type) { - if (!type || typeof type !== "string") return false - if (!~type.indexOf('/')) type = exports.lookup(type) - if (!type) return false - if (!~type.indexOf('charset')) { - var charset = exports.charset(type) - if (charset) type += '; charset=' + charset.toLowerCase() - } - return type -} diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md b/update_nation/node_modules/couchapp/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md deleted file mode 100644 index 3c6674819..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md +++ /dev/null @@ -1,174 +0,0 @@ -1.8.0 / 2015-03-13 -================== - - * Add `application/vnd.citationstyles.style+xml` - * Add `application/vnd.fastcopy-disk-image` - * Add `application/vnd.gov.sk.xmldatacontainer+xml` - * Add extension `.jsonld` to `application/ld+json` - -1.7.0 / 2015-02-08 -================== - - * Add `application/vnd.gerber` - * Add `application/vnd.msa-disk-image` - -1.6.1 / 2015-02-05 -================== - - * Community extensions ownership transferred from `node-mime` - -1.6.0 / 2015-01-29 -================== - - * Add `application/jose` - * Add `application/jose+json` - * Add `application/json-seq` - * Add `application/jwk+json` - * Add `application/jwk-set+json` - * Add `application/jwt` - * Add `application/rdap+json` - * Add `application/vnd.gov.sk.e-form+xml` - * Add `application/vnd.ims.imsccv1p3` - -1.5.0 / 2014-12-30 -================== - - * Add `application/vnd.oracle.resource+json` - * Fix various invalid MIME type entries - - `application/mbox+xml` - - `application/oscp-response` - - `application/vwg-multiplexed` - - `audio/g721` - -1.4.0 / 2014-12-21 -================== - - * Add `application/vnd.ims.imsccv1p2` - * Fix various invalid MIME type entries - - `application/vnd-acucobol` - - `application/vnd-curl` - - `application/vnd-dart` - - `application/vnd-dxr` - - `application/vnd-fdf` - - `application/vnd-mif` - - `application/vnd-sema` - - `application/vnd-wap-wmlc` - - `application/vnd.adobe.flash-movie` - - `application/vnd.dece-zip` - - `application/vnd.dvb_service` - - `application/vnd.micrografx-igx` - - `application/vnd.sealed-doc` - - `application/vnd.sealed-eml` - - `application/vnd.sealed-mht` - - `application/vnd.sealed-ppt` - - `application/vnd.sealed-tiff` - - `application/vnd.sealed-xls` - - `application/vnd.sealedmedia.softseal-html` - - `application/vnd.sealedmedia.softseal-pdf` - - `application/vnd.wap-slc` - - `application/vnd.wap-wbxml` - - `audio/vnd.sealedmedia.softseal-mpeg` - - `image/vnd-djvu` - - `image/vnd-svf` - - `image/vnd-wap-wbmp` - - `image/vnd.sealed-png` - - `image/vnd.sealedmedia.softseal-gif` - - `image/vnd.sealedmedia.softseal-jpg` - - `model/vnd-dwf` - - `model/vnd.parasolid.transmit-binary` - - `model/vnd.parasolid.transmit-text` - - `text/vnd-a` - - `text/vnd-curl` - - `text/vnd.wap-wml` - * Remove example template MIME types - - `application/example` - - `audio/example` - - `image/example` - - `message/example` - - `model/example` - - `multipart/example` - - `text/example` - - `video/example` - -1.3.1 / 2014-12-16 -================== - - * Fix missing extensions - - `application/json5` - - `text/hjson` - -1.3.0 / 2014-12-07 -================== - - * Add `application/a2l` - * Add `application/aml` - * Add `application/atfx` - * Add `application/atxml` - * Add `application/cdfx+xml` - * Add `application/dii` - * Add `application/json5` - * Add `application/lxf` - * Add `application/mf4` - * Add `application/vnd.apache.thrift.compact` - * Add `application/vnd.apache.thrift.json` - * Add `application/vnd.coffeescript` - * Add `application/vnd.enphase.envoy` - * Add `application/vnd.ims.imsccv1p1` - * Add `text/csv-schema` - * Add `text/hjson` - * Add `text/markdown` - * Add `text/yaml` - -1.2.0 / 2014-11-09 -================== - - * Add `application/cea` - * Add `application/dit` - * Add `application/vnd.gov.sk.e-form+zip` - * Add `application/vnd.tmd.mediaflex.api+xml` - * Type `application/epub+zip` is now IANA-registered - -1.1.2 / 2014-10-23 -================== - - * Rebuild database for `application/x-www-form-urlencoded` change - -1.1.1 / 2014-10-20 -================== - - * Mark `application/x-www-form-urlencoded` as compressible. - -1.1.0 / 2014-09-28 -================== - - * Add `application/font-woff2` - -1.0.3 / 2014-09-25 -================== - - * Fix engine requirement in package - -1.0.2 / 2014-09-25 -================== - - * Add `application/coap-group+json` - * Add `application/dcd` - * Add `application/vnd.apache.thrift.binary` - * Add `image/vnd.tencent.tap` - * Mark all JSON-derived types as compressible - * Update `text/vtt` data - -1.0.1 / 2014-08-30 -================== - - * Fix extension ordering - -1.0.0 / 2014-08-30 -================== - - * Add `application/atf` - * Add `application/merge-patch+json` - * Add `multipart/x-mixed-replace` - * Add `source: 'apache'` metadata - * Add `source: 'iana'` metadata - * Remove badly-assumed charset data diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/mime-types/node_modules/mime-db/LICENSE b/update_nation/node_modules/couchapp/node_modules/request/node_modules/mime-types/node_modules/mime-db/LICENSE deleted file mode 100644 index a7ae8ee9b..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/mime-types/node_modules/mime-db/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ - -The MIT License (MIT) - -Copyright (c) 2014 Jonathan Ong me@jongleberry.com - -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/update_nation/node_modules/couchapp/node_modules/request/node_modules/mime-types/node_modules/mime-db/README.md b/update_nation/node_modules/couchapp/node_modules/request/node_modules/mime-types/node_modules/mime-db/README.md deleted file mode 100644 index 1dde23490..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/mime-types/node_modules/mime-db/README.md +++ /dev/null @@ -1,76 +0,0 @@ -# mime-db - -[![NPM Version][npm-version-image]][npm-url] -[![NPM Downloads][npm-downloads-image]][npm-url] -[![Node.js Version][node-image]][node-url] -[![Build Status][travis-image]][travis-url] -[![Coverage Status][coveralls-image]][coveralls-url] - -This is a database of all mime types. -It consists of a single, public JSON file and does not include any logic, -allowing it to remain as un-opinionated as possible with an API. -It aggregates data from the following sources: - -- http://www.iana.org/assignments/media-types/media-types.xhtml -- http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types - -## Installation - -```bash -npm install mime-db -``` - -If you're crazy enough to use this in the browser, -you can just grab the JSON file: - -``` -https://cdn.rawgit.com/jshttp/mime-db/master/db.json -``` - -## Usage - -```js -var db = require('mime-db'); - -// grab data on .js files -var data = db['application/javascript']; -``` - -## Data Structure - -The JSON file is a map lookup for lowercased mime types. -Each mime type has the following properties: - -- `.source` - where the mime type is defined. - If not set, it's probably a custom media type. - - `apache` - [Apache common media types](http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types) - - `iana` - [IANA-defined media types](http://www.iana.org/assignments/media-types/media-types.xhtml) -- `.extensions[]` - known extensions associated with this mime type. -- `.compressible` - whether a file of this type is can be gzipped. -- `.charset` - the default charset associated with this type, if any. - -If unknown, every property could be `undefined`. - -## Contributing - -To edit the database, only make PRs against `src/custom.json` or -`src/custom-suffix.json`. - -To update the build, run `npm run update`. - -## Adding Custom Media Types - -The best way to get new media types included in this library is to register -them with the IANA. The community registration procedure is outlined in -[RFC 6838 section 5](http://tools.ietf.org/html/rfc6838#section-5). Types -registered with the IANA are automatically pulled into this library. - -[npm-version-image]: https://img.shields.io/npm/v/mime-db.svg?style=flat -[npm-downloads-image]: https://img.shields.io/npm/dm/mime-db.svg?style=flat -[npm-url]: https://npmjs.org/package/mime-db -[travis-image]: https://img.shields.io/travis/jshttp/mime-db.svg?style=flat -[travis-url]: https://travis-ci.org/jshttp/mime-db -[coveralls-image]: https://img.shields.io/coveralls/jshttp/mime-db.svg?style=flat -[coveralls-url]: https://coveralls.io/r/jshttp/mime-db?branch=master -[node-image]: https://img.shields.io/node/v/mime-db.svg?style=flat -[node-url]: http://nodejs.org/download/ diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json b/update_nation/node_modules/couchapp/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json deleted file mode 100644 index f9f3515b0..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json +++ /dev/null @@ -1,6309 +0,0 @@ -{ - "application/1d-interleaved-parityfec": { - "source": "iana" - }, - "application/3gpdash-qoe-report+xml": { - "source": "iana" - }, - "application/3gpp-ims+xml": { - "source": "iana" - }, - "application/a2l": { - "source": "iana" - }, - "application/activemessage": { - "source": "iana" - }, - "application/alto-costmap+json": { - "source": "iana", - "compressible": true - }, - "application/alto-costmapfilter+json": { - "source": "iana", - "compressible": true - }, - "application/alto-directory+json": { - "source": "iana", - "compressible": true - }, - "application/alto-endpointcost+json": { - "source": "iana", - "compressible": true - }, - "application/alto-endpointcostparams+json": { - "source": "iana", - "compressible": true - }, - "application/alto-endpointprop+json": { - "source": "iana", - "compressible": true - }, - "application/alto-endpointpropparams+json": { - "source": "iana", - "compressible": true - }, - "application/alto-error+json": { - "source": "iana", - "compressible": true - }, - "application/alto-networkmap+json": { - "source": "iana", - "compressible": true - }, - "application/alto-networkmapfilter+json": { - "source": "iana", - "compressible": true - }, - "application/aml": { - "source": "iana" - }, - "application/andrew-inset": { - "source": "iana", - "extensions": ["ez"] - }, - "application/applefile": { - "source": "iana" - }, - "application/applixware": { - "source": "apache", - "extensions": ["aw"] - }, - "application/atf": { - "source": "iana" - }, - "application/atfx": { - "source": "iana" - }, - "application/atom+xml": { - "source": "iana", - "compressible": true, - "extensions": ["atom"] - }, - "application/atomcat+xml": { - "source": "iana", - "extensions": ["atomcat"] - }, - "application/atomdeleted+xml": { - "source": "iana" - }, - "application/atomicmail": { - "source": "iana" - }, - "application/atomsvc+xml": { - "source": "iana", - "extensions": ["atomsvc"] - }, - "application/atxml": { - "source": "iana" - }, - "application/auth-policy+xml": { - "source": "iana" - }, - "application/bacnet-xdd+zip": { - "source": "iana" - }, - "application/batch-smtp": { - "source": "iana" - }, - "application/beep+xml": { - "source": "iana" - }, - "application/calendar+json": { - "source": "iana", - "compressible": true - }, - "application/calendar+xml": { - "source": "iana" - }, - "application/call-completion": { - "source": "iana" - }, - "application/cals-1840": { - "source": "iana" - }, - "application/cbor": { - "source": "iana" - }, - "application/ccmp+xml": { - "source": "iana" - }, - "application/ccxml+xml": { - "source": "iana", - "extensions": ["ccxml"] - }, - "application/cdfx+xml": { - "source": "iana" - }, - "application/cdmi-capability": { - "source": "iana", - "extensions": ["cdmia"] - }, - "application/cdmi-container": { - "source": "iana", - "extensions": ["cdmic"] - }, - "application/cdmi-domain": { - "source": "iana", - "extensions": ["cdmid"] - }, - "application/cdmi-object": { - "source": "iana", - "extensions": ["cdmio"] - }, - "application/cdmi-queue": { - "source": "iana", - "extensions": ["cdmiq"] - }, - "application/cea": { - "source": "iana" - }, - "application/cea-2018+xml": { - "source": "iana" - }, - "application/cellml+xml": { - "source": "iana" - }, - "application/cfw": { - "source": "iana" - }, - "application/cms": { - "source": "iana" - }, - "application/cnrp+xml": { - "source": "iana" - }, - "application/coap-group+json": { - "source": "iana", - "compressible": true - }, - "application/commonground": { - "source": "iana" - }, - "application/conference-info+xml": { - "source": "iana" - }, - "application/cpl+xml": { - "source": "iana" - }, - "application/csrattrs": { - "source": "iana" - }, - "application/csta+xml": { - "source": "iana" - }, - "application/cstadata+xml": { - "source": "iana" - }, - "application/cu-seeme": { - "source": "apache", - "extensions": ["cu"] - }, - "application/cybercash": { - "source": "iana" - }, - "application/dart": { - "compressible": true - }, - "application/dash+xml": { - "source": "iana", - "extensions": ["mdp"] - }, - "application/dashdelta": { - "source": "iana" - }, - "application/davmount+xml": { - "source": "iana", - "extensions": ["davmount"] - }, - "application/dca-rft": { - "source": "iana" - }, - "application/dcd": { - "source": "iana" - }, - "application/dec-dx": { - "source": "iana" - }, - "application/dialog-info+xml": { - "source": "iana" - }, - "application/dicom": { - "source": "iana" - }, - "application/dii": { - "source": "iana" - }, - "application/dit": { - "source": "iana" - }, - "application/dns": { - "source": "iana" - }, - "application/docbook+xml": { - "source": "apache", - "extensions": ["dbk"] - }, - "application/dskpp+xml": { - "source": "iana" - }, - "application/dssc+der": { - "source": "iana", - "extensions": ["dssc"] - }, - "application/dssc+xml": { - "source": "iana", - "extensions": ["xdssc"] - }, - "application/dvcs": { - "source": "iana" - }, - "application/ecmascript": { - "source": "iana", - "compressible": true, - "extensions": ["ecma"] - }, - "application/edi-consent": { - "source": "iana" - }, - "application/edi-x12": { - "source": "iana", - "compressible": false - }, - "application/edifact": { - "source": "iana", - "compressible": false - }, - "application/emma+xml": { - "source": "iana", - "extensions": ["emma"] - }, - "application/emotionml+xml": { - "source": "iana" - }, - "application/encaprtp": { - "source": "iana" - }, - "application/epp+xml": { - "source": "iana" - }, - "application/epub+zip": { - "source": "iana", - "extensions": ["epub"] - }, - "application/eshop": { - "source": "iana" - }, - "application/exi": { - "source": "iana", - "extensions": ["exi"] - }, - "application/fastinfoset": { - "source": "iana" - }, - "application/fastsoap": { - "source": "iana" - }, - "application/fdt+xml": { - "source": "iana" - }, - "application/fits": { - "source": "iana" - }, - "application/font-sfnt": { - "source": "iana" - }, - "application/font-tdpfr": { - "source": "iana", - "extensions": ["pfr"] - }, - "application/font-woff": { - "source": "iana", - "compressible": false, - "extensions": ["woff"] - }, - "application/font-woff2": { - "compressible": false, - "extensions": ["woff2"] - }, - "application/framework-attributes+xml": { - "source": "iana" - }, - "application/gml+xml": { - "source": "apache", - "extensions": ["gml"] - }, - "application/gpx+xml": { - "source": "apache", - "extensions": ["gpx"] - }, - "application/gxf": { - "source": "apache", - "extensions": ["gxf"] - }, - "application/gzip": { - "source": "iana", - "compressible": false - }, - "application/h224": { - "source": "iana" - }, - "application/held+xml": { - "source": "iana" - }, - "application/http": { - "source": "iana" - }, - "application/hyperstudio": { - "source": "iana", - "extensions": ["stk"] - }, - "application/ibe-key-request+xml": { - "source": "iana" - }, - "application/ibe-pkg-reply+xml": { - "source": "iana" - }, - "application/ibe-pp-data": { - "source": "iana" - }, - "application/iges": { - "source": "iana" - }, - "application/im-iscomposing+xml": { - "source": "iana" - }, - "application/index": { - "source": "iana" - }, - "application/index.cmd": { - "source": "iana" - }, - "application/index.obj": { - "source": "iana" - }, - "application/index.response": { - "source": "iana" - }, - "application/index.vnd": { - "source": "iana" - }, - "application/inkml+xml": { - "source": "iana", - "extensions": ["ink","inkml"] - }, - "application/iotp": { - "source": "iana" - }, - "application/ipfix": { - "source": "iana", - "extensions": ["ipfix"] - }, - "application/ipp": { - "source": "iana" - }, - "application/isup": { - "source": "iana" - }, - "application/its+xml": { - "source": "iana" - }, - "application/java-archive": { - "source": "apache", - "compressible": false, - "extensions": ["jar"] - }, - "application/java-serialized-object": { - "source": "apache", - "compressible": false, - "extensions": ["ser"] - }, - "application/java-vm": { - "source": "apache", - "compressible": false, - "extensions": ["class"] - }, - "application/javascript": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["js"] - }, - "application/jose": { - "source": "iana" - }, - "application/jose+json": { - "source": "iana", - "compressible": true - }, - "application/jrd+json": { - "source": "iana", - "compressible": true - }, - "application/json": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["json","map"] - }, - "application/json-patch+json": { - "source": "iana", - "compressible": true - }, - "application/json-seq": { - "source": "iana" - }, - "application/json5": { - "extensions": ["json5"] - }, - "application/jsonml+json": { - "source": "apache", - "compressible": true, - "extensions": ["jsonml"] - }, - "application/jwk+json": { - "source": "iana", - "compressible": true - }, - "application/jwk-set+json": { - "source": "iana", - "compressible": true - }, - "application/jwt": { - "source": "iana" - }, - "application/kpml-request+xml": { - "source": "iana" - }, - "application/kpml-response+xml": { - "source": "iana" - }, - "application/ld+json": { - "source": "iana", - "compressible": true, - "extensions": ["jsonld"] - }, - "application/link-format": { - "source": "iana" - }, - "application/load-control+xml": { - "source": "iana" - }, - "application/lost+xml": { - "source": "iana", - "extensions": ["lostxml"] - }, - "application/lostsync+xml": { - "source": "iana" - }, - "application/lxf": { - "source": "iana" - }, - "application/mac-binhex40": { - "source": "iana", - "extensions": ["hqx"] - }, - "application/mac-compactpro": { - "source": "apache", - "extensions": ["cpt"] - }, - "application/macwriteii": { - "source": "iana" - }, - "application/mads+xml": { - "source": "iana", - "extensions": ["mads"] - }, - "application/marc": { - "source": "iana", - "extensions": ["mrc"] - }, - "application/marcxml+xml": { - "source": "iana", - "extensions": ["mrcx"] - }, - "application/mathematica": { - "source": "iana", - "extensions": ["ma","nb","mb"] - }, - "application/mathml+xml": { - "source": "iana", - "extensions": ["mathml"] - }, - "application/mathml-content+xml": { - "source": "iana" - }, - "application/mathml-presentation+xml": { - "source": "iana" - }, - "application/mbms-associated-procedure-description+xml": { - "source": "iana" - }, - "application/mbms-deregister+xml": { - "source": "iana" - }, - "application/mbms-envelope+xml": { - "source": "iana" - }, - "application/mbms-msk+xml": { - "source": "iana" - }, - "application/mbms-msk-response+xml": { - "source": "iana" - }, - "application/mbms-protection-description+xml": { - "source": "iana" - }, - "application/mbms-reception-report+xml": { - "source": "iana" - }, - "application/mbms-register+xml": { - "source": "iana" - }, - "application/mbms-register-response+xml": { - "source": "iana" - }, - "application/mbms-schedule+xml": { - "source": "iana" - }, - "application/mbms-user-service-description+xml": { - "source": "iana" - }, - "application/mbox": { - "source": "iana", - "extensions": ["mbox"] - }, - "application/media-policy-dataset+xml": { - "source": "iana" - }, - "application/media_control+xml": { - "source": "iana" - }, - "application/mediaservercontrol+xml": { - "source": "iana", - "extensions": ["mscml"] - }, - "application/merge-patch+json": { - "source": "iana", - "compressible": true - }, - "application/metalink+xml": { - "source": "apache", - "extensions": ["metalink"] - }, - "application/metalink4+xml": { - "source": "iana", - "extensions": ["meta4"] - }, - "application/mets+xml": { - "source": "iana", - "extensions": ["mets"] - }, - "application/mf4": { - "source": "iana" - }, - "application/mikey": { - "source": "iana" - }, - "application/mods+xml": { - "source": "iana", - "extensions": ["mods"] - }, - "application/moss-keys": { - "source": "iana" - }, - "application/moss-signature": { - "source": "iana" - }, - "application/mosskey-data": { - "source": "iana" - }, - "application/mosskey-request": { - "source": "iana" - }, - "application/mp21": { - "source": "iana", - "extensions": ["m21","mp21"] - }, - "application/mp4": { - "source": "iana", - "extensions": ["mp4s","m4p"] - }, - "application/mpeg4-generic": { - "source": "iana" - }, - "application/mpeg4-iod": { - "source": "iana" - }, - "application/mpeg4-iod-xmt": { - "source": "iana" - }, - "application/mrb-consumer+xml": { - "source": "iana" - }, - "application/mrb-publish+xml": { - "source": "iana" - }, - "application/msc-ivr+xml": { - "source": "iana" - }, - "application/msc-mixer+xml": { - "source": "iana" - }, - "application/msword": { - "source": "iana", - "compressible": false, - "extensions": ["doc","dot"] - }, - "application/mxf": { - "source": "iana", - "extensions": ["mxf"] - }, - "application/nasdata": { - "source": "iana" - }, - "application/news-checkgroups": { - "source": "iana" - }, - "application/news-groupinfo": { - "source": "iana" - }, - "application/news-transmission": { - "source": "iana" - }, - "application/nlsml+xml": { - "source": "iana" - }, - "application/nss": { - "source": "iana" - }, - "application/ocsp-request": { - "source": "iana" - }, - "application/ocsp-response": { - "source": "iana" - }, - "application/octet-stream": { - "source": "iana", - "compressible": false, - "extensions": ["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","buffer"] - }, - "application/oda": { - "source": "iana", - "extensions": ["oda"] - }, - "application/odx": { - "source": "iana" - }, - "application/oebps-package+xml": { - "source": "iana", - "extensions": ["opf"] - }, - "application/ogg": { - "source": "iana", - "compressible": false, - "extensions": ["ogx"] - }, - "application/omdoc+xml": { - "source": "apache", - "extensions": ["omdoc"] - }, - "application/onenote": { - "source": "apache", - "extensions": ["onetoc","onetoc2","onetmp","onepkg"] - }, - "application/oxps": { - "source": "iana", - "extensions": ["oxps"] - }, - "application/p2p-overlay+xml": { - "source": "iana" - }, - "application/parityfec": { - "source": "iana" - }, - "application/patch-ops-error+xml": { - "source": "iana", - "extensions": ["xer"] - }, - "application/pdf": { - "source": "iana", - "compressible": false, - "extensions": ["pdf"] - }, - "application/pdx": { - "source": "iana" - }, - "application/pgp-encrypted": { - "source": "iana", - "compressible": false, - "extensions": ["pgp"] - }, - "application/pgp-keys": { - "source": "iana" - }, - "application/pgp-signature": { - "source": "iana", - "extensions": ["asc","sig"] - }, - "application/pics-rules": { - "source": "apache", - "extensions": ["prf"] - }, - "application/pidf+xml": { - "source": "iana" - }, - "application/pidf-diff+xml": { - "source": "iana" - }, - "application/pkcs10": { - "source": "iana", - "extensions": ["p10"] - }, - "application/pkcs7-mime": { - "source": "iana", - "extensions": ["p7m","p7c"] - }, - "application/pkcs7-signature": { - "source": "iana", - "extensions": ["p7s"] - }, - "application/pkcs8": { - "source": "iana", - "extensions": ["p8"] - }, - "application/pkix-attr-cert": { - "source": "iana", - "extensions": ["ac"] - }, - "application/pkix-cert": { - "source": "iana", - "extensions": ["cer"] - }, - "application/pkix-crl": { - "source": "iana", - "extensions": ["crl"] - }, - "application/pkix-pkipath": { - "source": "iana", - "extensions": ["pkipath"] - }, - "application/pkixcmp": { - "source": "iana", - "extensions": ["pki"] - }, - "application/pls+xml": { - "source": "iana", - "extensions": ["pls"] - }, - "application/poc-settings+xml": { - "source": "iana" - }, - "application/postscript": { - "source": "iana", - "compressible": true, - "extensions": ["ai","eps","ps"] - }, - "application/provenance+xml": { - "source": "iana" - }, - "application/prs.alvestrand.titrax-sheet": { - "source": "iana" - }, - "application/prs.cww": { - "source": "iana", - "extensions": ["cww"] - }, - "application/prs.hpub+zip": { - "source": "iana" - }, - "application/prs.nprend": { - "source": "iana" - }, - "application/prs.plucker": { - "source": "iana" - }, - "application/prs.rdf-xml-crypt": { - "source": "iana" - }, - "application/prs.xsf+xml": { - "source": "iana" - }, - "application/pskc+xml": { - "source": "iana", - "extensions": ["pskcxml"] - }, - "application/qsig": { - "source": "iana" - }, - "application/raptorfec": { - "source": "iana" - }, - "application/rdap+json": { - "source": "iana", - "compressible": true - }, - "application/rdf+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rdf"] - }, - "application/reginfo+xml": { - "source": "iana", - "extensions": ["rif"] - }, - "application/relax-ng-compact-syntax": { - "source": "iana", - "extensions": ["rnc"] - }, - "application/remote-printing": { - "source": "iana" - }, - "application/reputon+json": { - "source": "iana", - "compressible": true - }, - "application/resource-lists+xml": { - "source": "iana", - "extensions": ["rl"] - }, - "application/resource-lists-diff+xml": { - "source": "iana", - "extensions": ["rld"] - }, - "application/riscos": { - "source": "iana" - }, - "application/rlmi+xml": { - "source": "iana" - }, - "application/rls-services+xml": { - "source": "iana", - "extensions": ["rs"] - }, - "application/rpki-ghostbusters": { - "source": "iana", - "extensions": ["gbr"] - }, - "application/rpki-manifest": { - "source": "iana", - "extensions": ["mft"] - }, - "application/rpki-roa": { - "source": "iana", - "extensions": ["roa"] - }, - "application/rpki-updown": { - "source": "iana" - }, - "application/rsd+xml": { - "source": "apache", - "extensions": ["rsd"] - }, - "application/rss+xml": { - "source": "apache", - "compressible": true, - "extensions": ["rss"] - }, - "application/rtf": { - "source": "iana", - "compressible": true, - "extensions": ["rtf"] - }, - "application/rtploopback": { - "source": "iana" - }, - "application/rtx": { - "source": "iana" - }, - "application/samlassertion+xml": { - "source": "iana" - }, - "application/samlmetadata+xml": { - "source": "iana" - }, - "application/sbml+xml": { - "source": "iana", - "extensions": ["sbml"] - }, - "application/scaip+xml": { - "source": "iana" - }, - "application/scvp-cv-request": { - "source": "iana", - "extensions": ["scq"] - }, - "application/scvp-cv-response": { - "source": "iana", - "extensions": ["scs"] - }, - "application/scvp-vp-request": { - "source": "iana", - "extensions": ["spq"] - }, - "application/scvp-vp-response": { - "source": "iana", - "extensions": ["spp"] - }, - "application/sdp": { - "source": "iana", - "extensions": ["sdp"] - }, - "application/sep+xml": { - "source": "iana" - }, - "application/sep-exi": { - "source": "iana" - }, - "application/session-info": { - "source": "iana" - }, - "application/set-payment": { - "source": "iana" - }, - "application/set-payment-initiation": { - "source": "iana", - "extensions": ["setpay"] - }, - "application/set-registration": { - "source": "iana" - }, - "application/set-registration-initiation": { - "source": "iana", - "extensions": ["setreg"] - }, - "application/sgml": { - "source": "iana" - }, - "application/sgml-open-catalog": { - "source": "iana" - }, - "application/shf+xml": { - "source": "iana", - "extensions": ["shf"] - }, - "application/sieve": { - "source": "iana" - }, - "application/simple-filter+xml": { - "source": "iana" - }, - "application/simple-message-summary": { - "source": "iana" - }, - "application/simplesymbolcontainer": { - "source": "iana" - }, - "application/slate": { - "source": "iana" - }, - "application/smil": { - "source": "iana" - }, - "application/smil+xml": { - "source": "iana", - "extensions": ["smi","smil"] - }, - "application/smpte336m": { - "source": "iana" - }, - "application/soap+fastinfoset": { - "source": "iana" - }, - "application/soap+xml": { - "source": "iana", - "compressible": true - }, - "application/sparql-query": { - "source": "iana", - "extensions": ["rq"] - }, - "application/sparql-results+xml": { - "source": "iana", - "extensions": ["srx"] - }, - "application/spirits-event+xml": { - "source": "iana" - }, - "application/sql": { - "source": "iana" - }, - "application/srgs": { - "source": "iana", - "extensions": ["gram"] - }, - "application/srgs+xml": { - "source": "iana", - "extensions": ["grxml"] - }, - "application/sru+xml": { - "source": "iana", - "extensions": ["sru"] - }, - "application/ssdl+xml": { - "source": "apache", - "extensions": ["ssdl"] - }, - "application/ssml+xml": { - "source": "iana", - "extensions": ["ssml"] - }, - "application/tamp-apex-update": { - "source": "iana" - }, - "application/tamp-apex-update-confirm": { - "source": "iana" - }, - "application/tamp-community-update": { - "source": "iana" - }, - "application/tamp-community-update-confirm": { - "source": "iana" - }, - "application/tamp-error": { - "source": "iana" - }, - "application/tamp-sequence-adjust": { - "source": "iana" - }, - "application/tamp-sequence-adjust-confirm": { - "source": "iana" - }, - "application/tamp-status-query": { - "source": "iana" - }, - "application/tamp-status-response": { - "source": "iana" - }, - "application/tamp-update": { - "source": "iana" - }, - "application/tamp-update-confirm": { - "source": "iana" - }, - "application/tar": { - "compressible": true - }, - "application/tei+xml": { - "source": "iana", - "extensions": ["tei","teicorpus"] - }, - "application/thraud+xml": { - "source": "iana", - "extensions": ["tfi"] - }, - "application/timestamp-query": { - "source": "iana" - }, - "application/timestamp-reply": { - "source": "iana" - }, - "application/timestamped-data": { - "source": "iana", - "extensions": ["tsd"] - }, - "application/ttml+xml": { - "source": "iana" - }, - "application/tve-trigger": { - "source": "iana" - }, - "application/ulpfec": { - "source": "iana" - }, - "application/urc-grpsheet+xml": { - "source": "iana" - }, - "application/urc-ressheet+xml": { - "source": "iana" - }, - "application/urc-targetdesc+xml": { - "source": "iana" - }, - "application/urc-uisocketdesc+xml": { - "source": "iana" - }, - "application/vcard+json": { - "source": "iana", - "compressible": true - }, - "application/vcard+xml": { - "source": "iana" - }, - "application/vemmi": { - "source": "iana" - }, - "application/vividence.scriptfile": { - "source": "apache" - }, - "application/vnd.3gpp.bsf+xml": { - "source": "iana" - }, - "application/vnd.3gpp.pic-bw-large": { - "source": "iana", - "extensions": ["plb"] - }, - "application/vnd.3gpp.pic-bw-small": { - "source": "iana", - "extensions": ["psb"] - }, - "application/vnd.3gpp.pic-bw-var": { - "source": "iana", - "extensions": ["pvb"] - }, - "application/vnd.3gpp.sms": { - "source": "iana" - }, - "application/vnd.3gpp2.bcmcsinfo+xml": { - "source": "iana" - }, - "application/vnd.3gpp2.sms": { - "source": "iana" - }, - "application/vnd.3gpp2.tcap": { - "source": "iana", - "extensions": ["tcap"] - }, - "application/vnd.3m.post-it-notes": { - "source": "iana", - "extensions": ["pwn"] - }, - "application/vnd.accpac.simply.aso": { - "source": "iana", - "extensions": ["aso"] - }, - "application/vnd.accpac.simply.imp": { - "source": "iana", - "extensions": ["imp"] - }, - "application/vnd.acucobol": { - "source": "iana", - "extensions": ["acu"] - }, - "application/vnd.acucorp": { - "source": "iana", - "extensions": ["atc","acutc"] - }, - "application/vnd.adobe.air-application-installer-package+zip": { - "source": "apache", - "extensions": ["air"] - }, - "application/vnd.adobe.flash.movie": { - "source": "iana" - }, - "application/vnd.adobe.formscentral.fcdt": { - "source": "iana", - "extensions": ["fcdt"] - }, - "application/vnd.adobe.fxp": { - "source": "iana", - "extensions": ["fxp","fxpl"] - }, - "application/vnd.adobe.partial-upload": { - "source": "iana" - }, - "application/vnd.adobe.xdp+xml": { - "source": "iana", - "extensions": ["xdp"] - }, - "application/vnd.adobe.xfdf": { - "source": "iana", - "extensions": ["xfdf"] - }, - "application/vnd.aether.imp": { - "source": "iana" - }, - "application/vnd.ah-barcode": { - "source": "iana" - }, - "application/vnd.ahead.space": { - "source": "iana", - "extensions": ["ahead"] - }, - "application/vnd.airzip.filesecure.azf": { - "source": "iana", - "extensions": ["azf"] - }, - "application/vnd.airzip.filesecure.azs": { - "source": "iana", - "extensions": ["azs"] - }, - "application/vnd.amazon.ebook": { - "source": "apache", - "extensions": ["azw"] - }, - "application/vnd.americandynamics.acc": { - "source": "iana", - "extensions": ["acc"] - }, - "application/vnd.amiga.ami": { - "source": "iana", - "extensions": ["ami"] - }, - "application/vnd.amundsen.maze+xml": { - "source": "iana" - }, - "application/vnd.android.package-archive": { - "source": "apache", - "compressible": false, - "extensions": ["apk"] - }, - "application/vnd.anser-web-certificate-issue-initiation": { - "source": "iana", - "extensions": ["cii"] - }, - "application/vnd.anser-web-funds-transfer-initiation": { - "source": "apache", - "extensions": ["fti"] - }, - "application/vnd.antix.game-component": { - "source": "iana", - "extensions": ["atx"] - }, - "application/vnd.apache.thrift.binary": { - "source": "iana" - }, - "application/vnd.apache.thrift.compact": { - "source": "iana" - }, - "application/vnd.apache.thrift.json": { - "source": "iana" - }, - "application/vnd.api+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.apple.installer+xml": { - "source": "iana", - "extensions": ["mpkg"] - }, - "application/vnd.apple.mpegurl": { - "source": "iana", - "extensions": ["m3u8"] - }, - "application/vnd.arastra.swi": { - "source": "iana" - }, - "application/vnd.aristanetworks.swi": { - "source": "iana", - "extensions": ["swi"] - }, - "application/vnd.artsquare": { - "source": "iana" - }, - "application/vnd.astraea-software.iota": { - "source": "iana", - "extensions": ["iota"] - }, - "application/vnd.audiograph": { - "source": "iana", - "extensions": ["aep"] - }, - "application/vnd.autopackage": { - "source": "iana" - }, - "application/vnd.avistar+xml": { - "source": "iana" - }, - "application/vnd.balsamiq.bmml+xml": { - "source": "iana" - }, - "application/vnd.bekitzur-stech+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.blueice.multipass": { - "source": "iana", - "extensions": ["mpm"] - }, - "application/vnd.bluetooth.ep.oob": { - "source": "iana" - }, - "application/vnd.bluetooth.le.oob": { - "source": "iana" - }, - "application/vnd.bmi": { - "source": "iana", - "extensions": ["bmi"] - }, - "application/vnd.businessobjects": { - "source": "iana", - "extensions": ["rep"] - }, - "application/vnd.cab-jscript": { - "source": "iana" - }, - "application/vnd.canon-cpdl": { - "source": "iana" - }, - "application/vnd.canon-lips": { - "source": "iana" - }, - "application/vnd.cendio.thinlinc.clientconf": { - "source": "iana" - }, - "application/vnd.century-systems.tcp_stream": { - "source": "iana" - }, - "application/vnd.chemdraw+xml": { - "source": "iana", - "extensions": ["cdxml"] - }, - "application/vnd.chipnuts.karaoke-mmd": { - "source": "iana", - "extensions": ["mmd"] - }, - "application/vnd.cinderella": { - "source": "iana", - "extensions": ["cdy"] - }, - "application/vnd.cirpack.isdn-ext": { - "source": "iana" - }, - "application/vnd.citationstyles.style+xml": { - "source": "iana" - }, - "application/vnd.claymore": { - "source": "iana", - "extensions": ["cla"] - }, - "application/vnd.cloanto.rp9": { - "source": "iana", - "extensions": ["rp9"] - }, - "application/vnd.clonk.c4group": { - "source": "iana", - "extensions": ["c4g","c4d","c4f","c4p","c4u"] - }, - "application/vnd.cluetrust.cartomobile-config": { - "source": "iana", - "extensions": ["c11amc"] - }, - "application/vnd.cluetrust.cartomobile-config-pkg": { - "source": "iana", - "extensions": ["c11amz"] - }, - "application/vnd.coffeescript": { - "source": "iana" - }, - "application/vnd.collection+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.collection.doc+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.collection.next+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.commerce-battelle": { - "source": "iana" - }, - "application/vnd.commonspace": { - "source": "iana", - "extensions": ["csp"] - }, - "application/vnd.contact.cmsg": { - "source": "iana", - "extensions": ["cdbcmsg"] - }, - "application/vnd.cosmocaller": { - "source": "iana", - "extensions": ["cmc"] - }, - "application/vnd.crick.clicker": { - "source": "iana", - "extensions": ["clkx"] - }, - "application/vnd.crick.clicker.keyboard": { - "source": "iana", - "extensions": ["clkk"] - }, - "application/vnd.crick.clicker.palette": { - "source": "iana", - "extensions": ["clkp"] - }, - "application/vnd.crick.clicker.template": { - "source": "iana", - "extensions": ["clkt"] - }, - "application/vnd.crick.clicker.wordbank": { - "source": "iana", - "extensions": ["clkw"] - }, - "application/vnd.criticaltools.wbs+xml": { - "source": "iana", - "extensions": ["wbs"] - }, - "application/vnd.ctc-posml": { - "source": "iana", - "extensions": ["pml"] - }, - "application/vnd.ctct.ws+xml": { - "source": "iana" - }, - "application/vnd.cups-pdf": { - "source": "iana" - }, - "application/vnd.cups-postscript": { - "source": "iana" - }, - "application/vnd.cups-ppd": { - "source": "iana", - "extensions": ["ppd"] - }, - "application/vnd.cups-raster": { - "source": "iana" - }, - "application/vnd.cups-raw": { - "source": "iana" - }, - "application/vnd.curl": { - "source": "iana" - }, - "application/vnd.curl.car": { - "source": "apache", - "extensions": ["car"] - }, - "application/vnd.curl.pcurl": { - "source": "apache", - "extensions": ["pcurl"] - }, - "application/vnd.cyan.dean.root+xml": { - "source": "iana" - }, - "application/vnd.cybank": { - "source": "iana" - }, - "application/vnd.dart": { - "source": "iana", - "compressible": true, - "extensions": ["dart"] - }, - "application/vnd.data-vision.rdz": { - "source": "iana", - "extensions": ["rdz"] - }, - "application/vnd.debian.binary-package": { - "source": "iana" - }, - "application/vnd.dece.data": { - "source": "iana", - "extensions": ["uvf","uvvf","uvd","uvvd"] - }, - "application/vnd.dece.ttml+xml": { - "source": "iana", - "extensions": ["uvt","uvvt"] - }, - "application/vnd.dece.unspecified": { - "source": "iana", - "extensions": ["uvx","uvvx"] - }, - "application/vnd.dece.zip": { - "source": "iana", - "extensions": ["uvz","uvvz"] - }, - "application/vnd.denovo.fcselayout-link": { - "source": "iana", - "extensions": ["fe_launch"] - }, - "application/vnd.desmume-movie": { - "source": "iana" - }, - "application/vnd.dir-bi.plate-dl-nosuffix": { - "source": "iana" - }, - "application/vnd.dm.delegation+xml": { - "source": "iana" - }, - "application/vnd.dna": { - "source": "iana", - "extensions": ["dna"] - }, - "application/vnd.document+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.dolby.mlp": { - "source": "apache", - "extensions": ["mlp"] - }, - "application/vnd.dolby.mobile.1": { - "source": "iana" - }, - "application/vnd.dolby.mobile.2": { - "source": "iana" - }, - "application/vnd.doremir.scorecloud-binary-document": { - "source": "iana" - }, - "application/vnd.dpgraph": { - "source": "iana", - "extensions": ["dpg"] - }, - "application/vnd.dreamfactory": { - "source": "iana", - "extensions": ["dfac"] - }, - "application/vnd.ds-keypoint": { - "source": "apache", - "extensions": ["kpxx"] - }, - "application/vnd.dtg.local": { - "source": "iana" - }, - "application/vnd.dtg.local.flash": { - "source": "iana" - }, - "application/vnd.dtg.local.html": { - "source": "iana" - }, - "application/vnd.dvb.ait": { - "source": "iana", - "extensions": ["ait"] - }, - "application/vnd.dvb.dvbj": { - "source": "iana" - }, - "application/vnd.dvb.esgcontainer": { - "source": "iana" - }, - "application/vnd.dvb.ipdcdftnotifaccess": { - "source": "iana" - }, - "application/vnd.dvb.ipdcesgaccess": { - "source": "iana" - }, - "application/vnd.dvb.ipdcesgaccess2": { - "source": "iana" - }, - "application/vnd.dvb.ipdcesgpdd": { - "source": "iana" - }, - "application/vnd.dvb.ipdcroaming": { - "source": "iana" - }, - "application/vnd.dvb.iptv.alfec-base": { - "source": "iana" - }, - "application/vnd.dvb.iptv.alfec-enhancement": { - "source": "iana" - }, - "application/vnd.dvb.notif-aggregate-root+xml": { - "source": "iana" - }, - "application/vnd.dvb.notif-container+xml": { - "source": "iana" - }, - "application/vnd.dvb.notif-generic+xml": { - "source": "iana" - }, - "application/vnd.dvb.notif-ia-msglist+xml": { - "source": "iana" - }, - "application/vnd.dvb.notif-ia-registration-request+xml": { - "source": "iana" - }, - "application/vnd.dvb.notif-ia-registration-response+xml": { - "source": "iana" - }, - "application/vnd.dvb.notif-init+xml": { - "source": "iana" - }, - "application/vnd.dvb.pfr": { - "source": "iana" - }, - "application/vnd.dvb.service": { - "source": "iana", - "extensions": ["svc"] - }, - "application/vnd.dxr": { - "source": "iana" - }, - "application/vnd.dynageo": { - "source": "iana", - "extensions": ["geo"] - }, - "application/vnd.dzr": { - "source": "iana" - }, - "application/vnd.easykaraoke.cdgdownload": { - "source": "iana" - }, - "application/vnd.ecdis-update": { - "source": "iana" - }, - "application/vnd.ecowin.chart": { - "source": "iana", - "extensions": ["mag"] - }, - "application/vnd.ecowin.filerequest": { - "source": "iana" - }, - "application/vnd.ecowin.fileupdate": { - "source": "iana" - }, - "application/vnd.ecowin.series": { - "source": "iana" - }, - "application/vnd.ecowin.seriesrequest": { - "source": "iana" - }, - "application/vnd.ecowin.seriesupdate": { - "source": "iana" - }, - "application/vnd.emclient.accessrequest+xml": { - "source": "iana" - }, - "application/vnd.enliven": { - "source": "iana", - "extensions": ["nml"] - }, - "application/vnd.enphase.envoy": { - "source": "iana" - }, - "application/vnd.eprints.data+xml": { - "source": "iana" - }, - "application/vnd.epson.esf": { - "source": "iana", - "extensions": ["esf"] - }, - "application/vnd.epson.msf": { - "source": "iana", - "extensions": ["msf"] - }, - "application/vnd.epson.quickanime": { - "source": "iana", - "extensions": ["qam"] - }, - "application/vnd.epson.salt": { - "source": "iana", - "extensions": ["slt"] - }, - "application/vnd.epson.ssf": { - "source": "iana", - "extensions": ["ssf"] - }, - "application/vnd.ericsson.quickcall": { - "source": "iana" - }, - "application/vnd.eszigno3+xml": { - "source": "iana", - "extensions": ["es3","et3"] - }, - "application/vnd.etsi.aoc+xml": { - "source": "iana" - }, - "application/vnd.etsi.asic-e+zip": { - "source": "iana" - }, - "application/vnd.etsi.asic-s+zip": { - "source": "iana" - }, - "application/vnd.etsi.cug+xml": { - "source": "iana" - }, - "application/vnd.etsi.iptvcommand+xml": { - "source": "iana" - }, - "application/vnd.etsi.iptvdiscovery+xml": { - "source": "iana" - }, - "application/vnd.etsi.iptvprofile+xml": { - "source": "iana" - }, - "application/vnd.etsi.iptvsad-bc+xml": { - "source": "iana" - }, - "application/vnd.etsi.iptvsad-cod+xml": { - "source": "iana" - }, - "application/vnd.etsi.iptvsad-npvr+xml": { - "source": "iana" - }, - "application/vnd.etsi.iptvservice+xml": { - "source": "iana" - }, - "application/vnd.etsi.iptvsync+xml": { - "source": "iana" - }, - "application/vnd.etsi.iptvueprofile+xml": { - "source": "iana" - }, - "application/vnd.etsi.mcid+xml": { - "source": "iana" - }, - "application/vnd.etsi.mheg5": { - "source": "iana" - }, - "application/vnd.etsi.overload-control-policy-dataset+xml": { - "source": "iana" - }, - "application/vnd.etsi.pstn+xml": { - "source": "iana" - }, - "application/vnd.etsi.sci+xml": { - "source": "iana" - }, - "application/vnd.etsi.simservs+xml": { - "source": "iana" - }, - "application/vnd.etsi.timestamp-token": { - "source": "iana" - }, - "application/vnd.etsi.tsl+xml": { - "source": "iana" - }, - "application/vnd.etsi.tsl.der": { - "source": "iana" - }, - "application/vnd.eudora.data": { - "source": "iana" - }, - "application/vnd.ezpix-album": { - "source": "iana", - "extensions": ["ez2"] - }, - "application/vnd.ezpix-package": { - "source": "iana", - "extensions": ["ez3"] - }, - "application/vnd.f-secure.mobile": { - "source": "iana" - }, - "application/vnd.fastcopy-disk-image": { - "source": "iana" - }, - "application/vnd.fdf": { - "source": "iana", - "extensions": ["fdf"] - }, - "application/vnd.fdsn.mseed": { - "source": "iana", - "extensions": ["mseed"] - }, - "application/vnd.fdsn.seed": { - "source": "iana", - "extensions": ["seed","dataless"] - }, - "application/vnd.ffsns": { - "source": "iana" - }, - "application/vnd.fints": { - "source": "iana" - }, - "application/vnd.flographit": { - "source": "iana", - "extensions": ["gph"] - }, - "application/vnd.fluxtime.clip": { - "source": "iana", - "extensions": ["ftc"] - }, - "application/vnd.font-fontforge-sfd": { - "source": "iana" - }, - "application/vnd.framemaker": { - "source": "iana", - "extensions": ["fm","frame","maker","book"] - }, - "application/vnd.frogans.fnc": { - "source": "iana", - "extensions": ["fnc"] - }, - "application/vnd.frogans.ltf": { - "source": "iana", - "extensions": ["ltf"] - }, - "application/vnd.fsc.weblaunch": { - "source": "iana", - "extensions": ["fsc"] - }, - "application/vnd.fujitsu.oasys": { - "source": "iana", - "extensions": ["oas"] - }, - "application/vnd.fujitsu.oasys2": { - "source": "iana", - "extensions": ["oa2"] - }, - "application/vnd.fujitsu.oasys3": { - "source": "iana", - "extensions": ["oa3"] - }, - "application/vnd.fujitsu.oasysgp": { - "source": "iana", - "extensions": ["fg5"] - }, - "application/vnd.fujitsu.oasysprs": { - "source": "iana", - "extensions": ["bh2"] - }, - "application/vnd.fujixerox.art-ex": { - "source": "iana" - }, - "application/vnd.fujixerox.art4": { - "source": "iana" - }, - "application/vnd.fujixerox.ddd": { - "source": "iana", - "extensions": ["ddd"] - }, - "application/vnd.fujixerox.docuworks": { - "source": "iana", - "extensions": ["xdw"] - }, - "application/vnd.fujixerox.docuworks.binder": { - "source": "iana", - "extensions": ["xbd"] - }, - "application/vnd.fujixerox.docuworks.container": { - "source": "iana" - }, - "application/vnd.fujixerox.hbpl": { - "source": "iana" - }, - "application/vnd.fut-misnet": { - "source": "iana" - }, - "application/vnd.fuzzysheet": { - "source": "iana", - "extensions": ["fzs"] - }, - "application/vnd.genomatix.tuxedo": { - "source": "iana", - "extensions": ["txd"] - }, - "application/vnd.geo+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.geocube+xml": { - "source": "iana" - }, - "application/vnd.geogebra.file": { - "source": "iana", - "extensions": ["ggb"] - }, - "application/vnd.geogebra.tool": { - "source": "iana", - "extensions": ["ggt"] - }, - "application/vnd.geometry-explorer": { - "source": "iana", - "extensions": ["gex","gre"] - }, - "application/vnd.geonext": { - "source": "iana", - "extensions": ["gxt"] - }, - "application/vnd.geoplan": { - "source": "iana", - "extensions": ["g2w"] - }, - "application/vnd.geospace": { - "source": "iana", - "extensions": ["g3w"] - }, - "application/vnd.gerber": { - "source": "iana" - }, - "application/vnd.globalplatform.card-content-mgt": { - "source": "iana" - }, - "application/vnd.globalplatform.card-content-mgt-response": { - "source": "iana" - }, - "application/vnd.gmx": { - "source": "iana", - "extensions": ["gmx"] - }, - "application/vnd.google-earth.kml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["kml"] - }, - "application/vnd.google-earth.kmz": { - "source": "iana", - "compressible": false, - "extensions": ["kmz"] - }, - "application/vnd.gov.sk.e-form+xml": { - "source": "iana" - }, - "application/vnd.gov.sk.e-form+zip": { - "source": "iana" - }, - "application/vnd.gov.sk.xmldatacontainer+xml": { - "source": "iana" - }, - "application/vnd.grafeq": { - "source": "iana", - "extensions": ["gqf","gqs"] - }, - "application/vnd.gridmp": { - "source": "iana" - }, - "application/vnd.groove-account": { - "source": "iana", - "extensions": ["gac"] - }, - "application/vnd.groove-help": { - "source": "iana", - "extensions": ["ghf"] - }, - "application/vnd.groove-identity-message": { - "source": "iana", - "extensions": ["gim"] - }, - "application/vnd.groove-injector": { - "source": "iana", - "extensions": ["grv"] - }, - "application/vnd.groove-tool-message": { - "source": "iana", - "extensions": ["gtm"] - }, - "application/vnd.groove-tool-template": { - "source": "iana", - "extensions": ["tpl"] - }, - "application/vnd.groove-vcard": { - "source": "iana", - "extensions": ["vcg"] - }, - "application/vnd.hal+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.hal+xml": { - "source": "iana", - "extensions": ["hal"] - }, - "application/vnd.handheld-entertainment+xml": { - "source": "iana", - "extensions": ["zmm"] - }, - "application/vnd.hbci": { - "source": "iana", - "extensions": ["hbci"] - }, - "application/vnd.hcl-bireports": { - "source": "iana" - }, - "application/vnd.heroku+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.hhe.lesson-player": { - "source": "iana", - "extensions": ["les"] - }, - "application/vnd.hp-hpgl": { - "source": "iana", - "extensions": ["hpgl"] - }, - "application/vnd.hp-hpid": { - "source": "iana", - "extensions": ["hpid"] - }, - "application/vnd.hp-hps": { - "source": "iana", - "extensions": ["hps"] - }, - "application/vnd.hp-jlyt": { - "source": "iana", - "extensions": ["jlt"] - }, - "application/vnd.hp-pcl": { - "source": "iana", - "extensions": ["pcl"] - }, - "application/vnd.hp-pclxl": { - "source": "iana", - "extensions": ["pclxl"] - }, - "application/vnd.httphone": { - "source": "iana" - }, - "application/vnd.hydrostatix.sof-data": { - "source": "iana" - }, - "application/vnd.hzn-3d-crossword": { - "source": "iana" - }, - "application/vnd.ibm.afplinedata": { - "source": "iana" - }, - "application/vnd.ibm.electronic-media": { - "source": "iana" - }, - "application/vnd.ibm.minipay": { - "source": "iana", - "extensions": ["mpy"] - }, - "application/vnd.ibm.modcap": { - "source": "iana", - "extensions": ["afp","listafp","list3820"] - }, - "application/vnd.ibm.rights-management": { - "source": "iana", - "extensions": ["irm"] - }, - "application/vnd.ibm.secure-container": { - "source": "iana", - "extensions": ["sc"] - }, - "application/vnd.iccprofile": { - "source": "iana", - "extensions": ["icc","icm"] - }, - "application/vnd.ieee.1905": { - "source": "iana" - }, - "application/vnd.igloader": { - "source": "iana", - "extensions": ["igl"] - }, - "application/vnd.immervision-ivp": { - "source": "iana", - "extensions": ["ivp"] - }, - "application/vnd.immervision-ivu": { - "source": "iana", - "extensions": ["ivu"] - }, - "application/vnd.ims.imsccv1p1": { - "source": "iana" - }, - "application/vnd.ims.imsccv1p2": { - "source": "iana" - }, - "application/vnd.ims.imsccv1p3": { - "source": "iana" - }, - "application/vnd.ims.lis.v2.result+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ims.lti.v2.toolconsumerprofile+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ims.lti.v2.toolproxy+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ims.lti.v2.toolproxy.id+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ims.lti.v2.toolsettings+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ims.lti.v2.toolsettings.simple+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.informedcontrol.rms+xml": { - "source": "iana" - }, - "application/vnd.informix-visionary": { - "source": "iana" - }, - "application/vnd.infotech.project": { - "source": "iana" - }, - "application/vnd.infotech.project+xml": { - "source": "iana" - }, - "application/vnd.innopath.wamp.notification": { - "source": "iana" - }, - "application/vnd.insors.igm": { - "source": "iana", - "extensions": ["igm"] - }, - "application/vnd.intercon.formnet": { - "source": "iana", - "extensions": ["xpw","xpx"] - }, - "application/vnd.intergeo": { - "source": "iana", - "extensions": ["i2g"] - }, - "application/vnd.intertrust.digibox": { - "source": "iana" - }, - "application/vnd.intertrust.nncp": { - "source": "iana" - }, - "application/vnd.intu.qbo": { - "source": "iana", - "extensions": ["qbo"] - }, - "application/vnd.intu.qfx": { - "source": "iana", - "extensions": ["qfx"] - }, - "application/vnd.iptc.g2.catalogitem+xml": { - "source": "iana" - }, - "application/vnd.iptc.g2.conceptitem+xml": { - "source": "iana" - }, - "application/vnd.iptc.g2.knowledgeitem+xml": { - "source": "iana" - }, - "application/vnd.iptc.g2.newsitem+xml": { - "source": "iana" - }, - "application/vnd.iptc.g2.newsmessage+xml": { - "source": "iana" - }, - "application/vnd.iptc.g2.packageitem+xml": { - "source": "iana" - }, - "application/vnd.iptc.g2.planningitem+xml": { - "source": "iana" - }, - "application/vnd.ipunplugged.rcprofile": { - "source": "iana", - "extensions": ["rcprofile"] - }, - "application/vnd.irepository.package+xml": { - "source": "iana", - "extensions": ["irp"] - }, - "application/vnd.is-xpr": { - "source": "iana", - "extensions": ["xpr"] - }, - "application/vnd.isac.fcs": { - "source": "iana", - "extensions": ["fcs"] - }, - "application/vnd.jam": { - "source": "iana", - "extensions": ["jam"] - }, - "application/vnd.japannet-directory-service": { - "source": "iana" - }, - "application/vnd.japannet-jpnstore-wakeup": { - "source": "iana" - }, - "application/vnd.japannet-payment-wakeup": { - "source": "iana" - }, - "application/vnd.japannet-registration": { - "source": "iana" - }, - "application/vnd.japannet-registration-wakeup": { - "source": "iana" - }, - "application/vnd.japannet-setstore-wakeup": { - "source": "iana" - }, - "application/vnd.japannet-verification": { - "source": "iana" - }, - "application/vnd.japannet-verification-wakeup": { - "source": "iana" - }, - "application/vnd.jcp.javame.midlet-rms": { - "source": "iana", - "extensions": ["rms"] - }, - "application/vnd.jisp": { - "source": "iana", - "extensions": ["jisp"] - }, - "application/vnd.joost.joda-archive": { - "source": "iana", - "extensions": ["joda"] - }, - "application/vnd.jsk.isdn-ngn": { - "source": "iana" - }, - "application/vnd.kahootz": { - "source": "iana", - "extensions": ["ktz","ktr"] - }, - "application/vnd.kde.karbon": { - "source": "iana", - "extensions": ["karbon"] - }, - "application/vnd.kde.kchart": { - "source": "iana", - "extensions": ["chrt"] - }, - "application/vnd.kde.kformula": { - "source": "iana", - "extensions": ["kfo"] - }, - "application/vnd.kde.kivio": { - "source": "iana", - "extensions": ["flw"] - }, - "application/vnd.kde.kontour": { - "source": "iana", - "extensions": ["kon"] - }, - "application/vnd.kde.kpresenter": { - "source": "iana", - "extensions": ["kpr","kpt"] - }, - "application/vnd.kde.kspread": { - "source": "iana", - "extensions": ["ksp"] - }, - "application/vnd.kde.kword": { - "source": "iana", - "extensions": ["kwd","kwt"] - }, - "application/vnd.kenameaapp": { - "source": "iana", - "extensions": ["htke"] - }, - "application/vnd.kidspiration": { - "source": "iana", - "extensions": ["kia"] - }, - "application/vnd.kinar": { - "source": "iana", - "extensions": ["kne","knp"] - }, - "application/vnd.koan": { - "source": "iana", - "extensions": ["skp","skd","skt","skm"] - }, - "application/vnd.kodak-descriptor": { - "source": "iana", - "extensions": ["sse"] - }, - "application/vnd.las.las+xml": { - "source": "iana", - "extensions": ["lasxml"] - }, - "application/vnd.liberty-request+xml": { - "source": "iana" - }, - "application/vnd.llamagraphics.life-balance.desktop": { - "source": "iana", - "extensions": ["lbd"] - }, - "application/vnd.llamagraphics.life-balance.exchange+xml": { - "source": "iana", - "extensions": ["lbe"] - }, - "application/vnd.lotus-1-2-3": { - "source": "iana", - "extensions": ["123"] - }, - "application/vnd.lotus-approach": { - "source": "iana", - "extensions": ["apr"] - }, - "application/vnd.lotus-freelance": { - "source": "iana", - "extensions": ["pre"] - }, - "application/vnd.lotus-notes": { - "source": "iana", - "extensions": ["nsf"] - }, - "application/vnd.lotus-organizer": { - "source": "iana", - "extensions": ["org"] - }, - "application/vnd.lotus-screencam": { - "source": "iana", - "extensions": ["scm"] - }, - "application/vnd.lotus-wordpro": { - "source": "iana", - "extensions": ["lwp"] - }, - "application/vnd.macports.portpkg": { - "source": "iana", - "extensions": ["portpkg"] - }, - "application/vnd.marlin.drm.actiontoken+xml": { - "source": "iana" - }, - "application/vnd.marlin.drm.conftoken+xml": { - "source": "iana" - }, - "application/vnd.marlin.drm.license+xml": { - "source": "iana" - }, - "application/vnd.marlin.drm.mdcf": { - "source": "iana" - }, - "application/vnd.mason+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.maxmind.maxmind-db": { - "source": "iana" - }, - "application/vnd.mcd": { - "source": "iana", - "extensions": ["mcd"] - }, - "application/vnd.medcalcdata": { - "source": "iana", - "extensions": ["mc1"] - }, - "application/vnd.mediastation.cdkey": { - "source": "iana", - "extensions": ["cdkey"] - }, - "application/vnd.meridian-slingshot": { - "source": "iana" - }, - "application/vnd.mfer": { - "source": "iana", - "extensions": ["mwf"] - }, - "application/vnd.mfmp": { - "source": "iana", - "extensions": ["mfm"] - }, - "application/vnd.micrografx.flo": { - "source": "iana", - "extensions": ["flo"] - }, - "application/vnd.micrografx.igx": { - "source": "iana", - "extensions": ["igx"] - }, - "application/vnd.miele+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.mif": { - "source": "iana", - "extensions": ["mif"] - }, - "application/vnd.minisoft-hp3000-save": { - "source": "iana" - }, - "application/vnd.mitsubishi.misty-guard.trustweb": { - "source": "iana" - }, - "application/vnd.mobius.daf": { - "source": "iana", - "extensions": ["daf"] - }, - "application/vnd.mobius.dis": { - "source": "iana", - "extensions": ["dis"] - }, - "application/vnd.mobius.mbk": { - "source": "iana", - "extensions": ["mbk"] - }, - "application/vnd.mobius.mqy": { - "source": "iana", - "extensions": ["mqy"] - }, - "application/vnd.mobius.msl": { - "source": "iana", - "extensions": ["msl"] - }, - "application/vnd.mobius.plc": { - "source": "iana", - "extensions": ["plc"] - }, - "application/vnd.mobius.txf": { - "source": "iana", - "extensions": ["txf"] - }, - "application/vnd.mophun.application": { - "source": "iana", - "extensions": ["mpn"] - }, - "application/vnd.mophun.certificate": { - "source": "iana", - "extensions": ["mpc"] - }, - "application/vnd.motorola.flexsuite": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.adsi": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.fis": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.gotap": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.kmr": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.ttc": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.wem": { - "source": "iana" - }, - "application/vnd.motorola.iprm": { - "source": "iana" - }, - "application/vnd.mozilla.xul+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xul"] - }, - "application/vnd.ms-3mfdocument": { - "source": "iana" - }, - "application/vnd.ms-artgalry": { - "source": "iana", - "extensions": ["cil"] - }, - "application/vnd.ms-asf": { - "source": "iana" - }, - "application/vnd.ms-cab-compressed": { - "source": "iana", - "extensions": ["cab"] - }, - "application/vnd.ms-color.iccprofile": { - "source": "apache" - }, - "application/vnd.ms-excel": { - "source": "iana", - "compressible": false, - "extensions": ["xls","xlm","xla","xlc","xlt","xlw"] - }, - "application/vnd.ms-excel.addin.macroenabled.12": { - "source": "iana", - "extensions": ["xlam"] - }, - "application/vnd.ms-excel.sheet.binary.macroenabled.12": { - "source": "iana", - "extensions": ["xlsb"] - }, - "application/vnd.ms-excel.sheet.macroenabled.12": { - "source": "iana", - "extensions": ["xlsm"] - }, - "application/vnd.ms-excel.template.macroenabled.12": { - "source": "iana", - "extensions": ["xltm"] - }, - "application/vnd.ms-fontobject": { - "source": "iana", - "compressible": true, - "extensions": ["eot"] - }, - "application/vnd.ms-htmlhelp": { - "source": "iana", - "extensions": ["chm"] - }, - "application/vnd.ms-ims": { - "source": "iana", - "extensions": ["ims"] - }, - "application/vnd.ms-lrm": { - "source": "iana", - "extensions": ["lrm"] - }, - "application/vnd.ms-office.activex+xml": { - "source": "iana" - }, - "application/vnd.ms-officetheme": { - "source": "iana", - "extensions": ["thmx"] - }, - "application/vnd.ms-opentype": { - "source": "apache", - "compressible": true - }, - "application/vnd.ms-package.obfuscated-opentype": { - "source": "apache" - }, - "application/vnd.ms-pki.seccat": { - "source": "apache", - "extensions": ["cat"] - }, - "application/vnd.ms-pki.stl": { - "source": "apache", - "extensions": ["stl"] - }, - "application/vnd.ms-playready.initiator+xml": { - "source": "iana" - }, - "application/vnd.ms-powerpoint": { - "source": "iana", - "compressible": false, - "extensions": ["ppt","pps","pot"] - }, - "application/vnd.ms-powerpoint.addin.macroenabled.12": { - "source": "iana", - "extensions": ["ppam"] - }, - "application/vnd.ms-powerpoint.presentation.macroenabled.12": { - "source": "iana", - "extensions": ["pptm"] - }, - "application/vnd.ms-powerpoint.slide.macroenabled.12": { - "source": "iana", - "extensions": ["sldm"] - }, - "application/vnd.ms-powerpoint.slideshow.macroenabled.12": { - "source": "iana", - "extensions": ["ppsm"] - }, - "application/vnd.ms-powerpoint.template.macroenabled.12": { - "source": "iana", - "extensions": ["potm"] - }, - "application/vnd.ms-printing.printticket+xml": { - "source": "apache" - }, - "application/vnd.ms-project": { - "source": "iana", - "extensions": ["mpp","mpt"] - }, - "application/vnd.ms-tnef": { - "source": "iana" - }, - "application/vnd.ms-windows.printerpairing": { - "source": "iana" - }, - "application/vnd.ms-wmdrm.lic-chlg-req": { - "source": "iana" - }, - "application/vnd.ms-wmdrm.lic-resp": { - "source": "iana" - }, - "application/vnd.ms-wmdrm.meter-chlg-req": { - "source": "iana" - }, - "application/vnd.ms-wmdrm.meter-resp": { - "source": "iana" - }, - "application/vnd.ms-word.document.macroenabled.12": { - "source": "iana", - "extensions": ["docm"] - }, - "application/vnd.ms-word.template.macroenabled.12": { - "source": "iana", - "extensions": ["dotm"] - }, - "application/vnd.ms-works": { - "source": "iana", - "extensions": ["wps","wks","wcm","wdb"] - }, - "application/vnd.ms-wpl": { - "source": "iana", - "extensions": ["wpl"] - }, - "application/vnd.ms-xpsdocument": { - "source": "iana", - "compressible": false, - "extensions": ["xps"] - }, - "application/vnd.msa-disk-image": { - "source": "iana" - }, - "application/vnd.mseq": { - "source": "iana", - "extensions": ["mseq"] - }, - "application/vnd.msign": { - "source": "iana" - }, - "application/vnd.multiad.creator": { - "source": "iana" - }, - "application/vnd.multiad.creator.cif": { - "source": "iana" - }, - "application/vnd.music-niff": { - "source": "iana" - }, - "application/vnd.musician": { - "source": "iana", - "extensions": ["mus"] - }, - "application/vnd.muvee.style": { - "source": "iana", - "extensions": ["msty"] - }, - "application/vnd.mynfc": { - "source": "iana", - "extensions": ["taglet"] - }, - "application/vnd.ncd.control": { - "source": "iana" - }, - "application/vnd.ncd.reference": { - "source": "iana" - }, - "application/vnd.nervana": { - "source": "iana" - }, - "application/vnd.netfpx": { - "source": "iana" - }, - "application/vnd.neurolanguage.nlu": { - "source": "iana", - "extensions": ["nlu"] - }, - "application/vnd.nintendo.nitro.rom": { - "source": "iana" - }, - "application/vnd.nintendo.snes.rom": { - "source": "iana" - }, - "application/vnd.nitf": { - "source": "iana", - "extensions": ["ntf","nitf"] - }, - "application/vnd.noblenet-directory": { - "source": "iana", - "extensions": ["nnd"] - }, - "application/vnd.noblenet-sealer": { - "source": "iana", - "extensions": ["nns"] - }, - "application/vnd.noblenet-web": { - "source": "iana", - "extensions": ["nnw"] - }, - "application/vnd.nokia.catalogs": { - "source": "iana" - }, - "application/vnd.nokia.conml+wbxml": { - "source": "iana" - }, - "application/vnd.nokia.conml+xml": { - "source": "iana" - }, - "application/vnd.nokia.iptv.config+xml": { - "source": "iana" - }, - "application/vnd.nokia.isds-radio-presets": { - "source": "iana" - }, - "application/vnd.nokia.landmark+wbxml": { - "source": "iana" - }, - "application/vnd.nokia.landmark+xml": { - "source": "iana" - }, - "application/vnd.nokia.landmarkcollection+xml": { - "source": "iana" - }, - "application/vnd.nokia.n-gage.ac+xml": { - "source": "iana" - }, - "application/vnd.nokia.n-gage.data": { - "source": "iana", - "extensions": ["ngdat"] - }, - "application/vnd.nokia.n-gage.symbian.install": { - "source": "iana" - }, - "application/vnd.nokia.ncd": { - "source": "iana" - }, - "application/vnd.nokia.pcd+wbxml": { - "source": "iana" - }, - "application/vnd.nokia.pcd+xml": { - "source": "iana" - }, - "application/vnd.nokia.radio-preset": { - "source": "iana", - "extensions": ["rpst"] - }, - "application/vnd.nokia.radio-presets": { - "source": "iana", - "extensions": ["rpss"] - }, - "application/vnd.novadigm.edm": { - "source": "iana", - "extensions": ["edm"] - }, - "application/vnd.novadigm.edx": { - "source": "iana", - "extensions": ["edx"] - }, - "application/vnd.novadigm.ext": { - "source": "iana", - "extensions": ["ext"] - }, - "application/vnd.ntt-local.content-share": { - "source": "iana" - }, - "application/vnd.ntt-local.file-transfer": { - "source": "iana" - }, - "application/vnd.ntt-local.ogw_remote-access": { - "source": "iana" - }, - "application/vnd.ntt-local.sip-ta_remote": { - "source": "iana" - }, - "application/vnd.ntt-local.sip-ta_tcp_stream": { - "source": "iana" - }, - "application/vnd.oasis.opendocument.chart": { - "source": "iana", - "extensions": ["odc"] - }, - "application/vnd.oasis.opendocument.chart-template": { - "source": "iana", - "extensions": ["otc"] - }, - "application/vnd.oasis.opendocument.database": { - "source": "iana", - "extensions": ["odb"] - }, - "application/vnd.oasis.opendocument.formula": { - "source": "iana", - "extensions": ["odf"] - }, - "application/vnd.oasis.opendocument.formula-template": { - "source": "iana", - "extensions": ["odft"] - }, - "application/vnd.oasis.opendocument.graphics": { - "source": "iana", - "compressible": false, - "extensions": ["odg"] - }, - "application/vnd.oasis.opendocument.graphics-template": { - "source": "iana", - "extensions": ["otg"] - }, - "application/vnd.oasis.opendocument.image": { - "source": "iana", - "extensions": ["odi"] - }, - "application/vnd.oasis.opendocument.image-template": { - "source": "iana", - "extensions": ["oti"] - }, - "application/vnd.oasis.opendocument.presentation": { - "source": "iana", - "compressible": false, - "extensions": ["odp"] - }, - "application/vnd.oasis.opendocument.presentation-template": { - "source": "iana", - "extensions": ["otp"] - }, - "application/vnd.oasis.opendocument.spreadsheet": { - "source": "iana", - "compressible": false, - "extensions": ["ods"] - }, - "application/vnd.oasis.opendocument.spreadsheet-template": { - "source": "iana", - "extensions": ["ots"] - }, - "application/vnd.oasis.opendocument.text": { - "source": "iana", - "compressible": false, - "extensions": ["odt"] - }, - "application/vnd.oasis.opendocument.text-master": { - "source": "iana", - "extensions": ["odm"] - }, - "application/vnd.oasis.opendocument.text-template": { - "source": "iana", - "extensions": ["ott"] - }, - "application/vnd.oasis.opendocument.text-web": { - "source": "iana", - "extensions": ["oth"] - }, - "application/vnd.obn": { - "source": "iana" - }, - "application/vnd.oftn.l10n+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.contentaccessdownload+xml": { - "source": "iana" - }, - "application/vnd.oipf.contentaccessstreaming+xml": { - "source": "iana" - }, - "application/vnd.oipf.cspg-hexbinary": { - "source": "iana" - }, - "application/vnd.oipf.dae.svg+xml": { - "source": "iana" - }, - "application/vnd.oipf.dae.xhtml+xml": { - "source": "iana" - }, - "application/vnd.oipf.mippvcontrolmessage+xml": { - "source": "iana" - }, - "application/vnd.oipf.pae.gem": { - "source": "iana" - }, - "application/vnd.oipf.spdiscovery+xml": { - "source": "iana" - }, - "application/vnd.oipf.spdlist+xml": { - "source": "iana" - }, - "application/vnd.oipf.ueprofile+xml": { - "source": "iana" - }, - "application/vnd.oipf.userprofile+xml": { - "source": "iana" - }, - "application/vnd.olpc-sugar": { - "source": "iana", - "extensions": ["xo"] - }, - "application/vnd.oma-scws-config": { - "source": "iana" - }, - "application/vnd.oma-scws-http-request": { - "source": "iana" - }, - "application/vnd.oma-scws-http-response": { - "source": "iana" - }, - "application/vnd.oma.bcast.associated-procedure-parameter+xml": { - "source": "iana" - }, - "application/vnd.oma.bcast.drm-trigger+xml": { - "source": "iana" - }, - "application/vnd.oma.bcast.imd+xml": { - "source": "iana" - }, - "application/vnd.oma.bcast.ltkm": { - "source": "iana" - }, - "application/vnd.oma.bcast.notification+xml": { - "source": "iana" - }, - "application/vnd.oma.bcast.provisioningtrigger": { - "source": "iana" - }, - "application/vnd.oma.bcast.sgboot": { - "source": "iana" - }, - "application/vnd.oma.bcast.sgdd+xml": { - "source": "iana" - }, - "application/vnd.oma.bcast.sgdu": { - "source": "iana" - }, - "application/vnd.oma.bcast.simple-symbol-container": { - "source": "iana" - }, - "application/vnd.oma.bcast.smartcard-trigger+xml": { - "source": "iana" - }, - "application/vnd.oma.bcast.sprov+xml": { - "source": "iana" - }, - "application/vnd.oma.bcast.stkm": { - "source": "iana" - }, - "application/vnd.oma.cab-address-book+xml": { - "source": "iana" - }, - "application/vnd.oma.cab-feature-handler+xml": { - "source": "iana" - }, - "application/vnd.oma.cab-pcc+xml": { - "source": "iana" - }, - "application/vnd.oma.cab-subs-invite+xml": { - "source": "iana" - }, - "application/vnd.oma.cab-user-prefs+xml": { - "source": "iana" - }, - "application/vnd.oma.dcd": { - "source": "iana" - }, - "application/vnd.oma.dcdc": { - "source": "iana" - }, - "application/vnd.oma.dd2+xml": { - "source": "iana", - "extensions": ["dd2"] - }, - "application/vnd.oma.drm.risd+xml": { - "source": "iana" - }, - "application/vnd.oma.group-usage-list+xml": { - "source": "iana" - }, - "application/vnd.oma.pal+xml": { - "source": "iana" - }, - "application/vnd.oma.poc.detailed-progress-report+xml": { - "source": "iana" - }, - "application/vnd.oma.poc.final-report+xml": { - "source": "iana" - }, - "application/vnd.oma.poc.groups+xml": { - "source": "iana" - }, - "application/vnd.oma.poc.invocation-descriptor+xml": { - "source": "iana" - }, - "application/vnd.oma.poc.optimized-progress-report+xml": { - "source": "iana" - }, - "application/vnd.oma.push": { - "source": "iana" - }, - "application/vnd.oma.scidm.messages+xml": { - "source": "iana" - }, - "application/vnd.oma.xcap-directory+xml": { - "source": "iana" - }, - "application/vnd.omads-email+xml": { - "source": "iana" - }, - "application/vnd.omads-file+xml": { - "source": "iana" - }, - "application/vnd.omads-folder+xml": { - "source": "iana" - }, - "application/vnd.omaloc-supl-init": { - "source": "iana" - }, - "application/vnd.openeye.oeb": { - "source": "iana" - }, - "application/vnd.openofficeorg.extension": { - "source": "apache", - "extensions": ["oxt"] - }, - "application/vnd.openxmlformats-officedocument.custom-properties+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.drawing+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.extended-properties+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.presentationml-template": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.presentationml.presentation": { - "source": "iana", - "compressible": false, - "extensions": ["pptx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.presentationml.slide": { - "source": "iana", - "extensions": ["sldx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideshow": { - "source": "iana", - "extensions": ["ppsx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.presentationml.template": { - "source": "apache", - "extensions": ["potx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml-template": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { - "source": "iana", - "compressible": false, - "extensions": ["xlsx"] - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.template": { - "source": "apache", - "extensions": ["xltx"] - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.theme+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.themeoverride+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.vmldrawing": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml-template": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document": { - "source": "iana", - "compressible": false, - "extensions": ["docx"] - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.template": { - "source": "apache", - "extensions": ["dotx"] - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-package.core-properties+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-package.relationships+xml": { - "source": "iana" - }, - "application/vnd.oracle.resource+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.orange.indata": { - "source": "iana" - }, - "application/vnd.osa.netdeploy": { - "source": "iana" - }, - "application/vnd.osgeo.mapguide.package": { - "source": "iana", - "extensions": ["mgp"] - }, - "application/vnd.osgi.bundle": { - "source": "iana" - }, - "application/vnd.osgi.dp": { - "source": "iana", - "extensions": ["dp"] - }, - "application/vnd.osgi.subsystem": { - "source": "iana", - "extensions": ["esa"] - }, - "application/vnd.otps.ct-kip+xml": { - "source": "iana" - }, - "application/vnd.palm": { - "source": "iana", - "extensions": ["pdb","pqa","oprc"] - }, - "application/vnd.panoply": { - "source": "iana" - }, - "application/vnd.paos+xml": { - "source": "iana" - }, - "application/vnd.paos.xml": { - "source": "apache" - }, - "application/vnd.pawaafile": { - "source": "iana", - "extensions": ["paw"] - }, - "application/vnd.pcos": { - "source": "iana" - }, - "application/vnd.pg.format": { - "source": "iana", - "extensions": ["str"] - }, - "application/vnd.pg.osasli": { - "source": "iana", - "extensions": ["ei6"] - }, - "application/vnd.piaccess.application-licence": { - "source": "iana" - }, - "application/vnd.picsel": { - "source": "iana", - "extensions": ["efif"] - }, - "application/vnd.pmi.widget": { - "source": "iana", - "extensions": ["wg"] - }, - "application/vnd.poc.group-advertisement+xml": { - "source": "iana" - }, - "application/vnd.pocketlearn": { - "source": "iana", - "extensions": ["plf"] - }, - "application/vnd.powerbuilder6": { - "source": "iana", - "extensions": ["pbd"] - }, - "application/vnd.powerbuilder6-s": { - "source": "iana" - }, - "application/vnd.powerbuilder7": { - "source": "iana" - }, - "application/vnd.powerbuilder7-s": { - "source": "iana" - }, - "application/vnd.powerbuilder75": { - "source": "iana" - }, - "application/vnd.powerbuilder75-s": { - "source": "iana" - }, - "application/vnd.preminet": { - "source": "iana" - }, - "application/vnd.previewsystems.box": { - "source": "iana", - "extensions": ["box"] - }, - "application/vnd.proteus.magazine": { - "source": "iana", - "extensions": ["mgz"] - }, - "application/vnd.publishare-delta-tree": { - "source": "iana", - "extensions": ["qps"] - }, - "application/vnd.pvi.ptid1": { - "source": "iana", - "extensions": ["ptid"] - }, - "application/vnd.pwg-multiplexed": { - "source": "iana" - }, - "application/vnd.pwg-xhtml-print+xml": { - "source": "iana" - }, - "application/vnd.qualcomm.brew-app-res": { - "source": "iana" - }, - "application/vnd.quark.quarkxpress": { - "source": "iana", - "extensions": ["qxd","qxt","qwd","qwt","qxl","qxb"] - }, - "application/vnd.quobject-quoxdocument": { - "source": "iana" - }, - "application/vnd.radisys.moml+xml": { - "source": "iana" - }, - "application/vnd.radisys.msml+xml": { - "source": "iana" - }, - "application/vnd.radisys.msml-audit+xml": { - "source": "iana" - }, - "application/vnd.radisys.msml-audit-conf+xml": { - "source": "iana" - }, - "application/vnd.radisys.msml-audit-conn+xml": { - "source": "iana" - }, - "application/vnd.radisys.msml-audit-dialog+xml": { - "source": "iana" - }, - "application/vnd.radisys.msml-audit-stream+xml": { - "source": "iana" - }, - "application/vnd.radisys.msml-conf+xml": { - "source": "iana" - }, - "application/vnd.radisys.msml-dialog+xml": { - "source": "iana" - }, - "application/vnd.radisys.msml-dialog-base+xml": { - "source": "iana" - }, - "application/vnd.radisys.msml-dialog-fax-detect+xml": { - "source": "iana" - }, - "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": { - "source": "iana" - }, - "application/vnd.radisys.msml-dialog-group+xml": { - "source": "iana" - }, - "application/vnd.radisys.msml-dialog-speech+xml": { - "source": "iana" - }, - "application/vnd.radisys.msml-dialog-transform+xml": { - "source": "iana" - }, - "application/vnd.rainstor.data": { - "source": "iana" - }, - "application/vnd.rapid": { - "source": "iana" - }, - "application/vnd.realvnc.bed": { - "source": "iana", - "extensions": ["bed"] - }, - "application/vnd.recordare.musicxml": { - "source": "iana", - "extensions": ["mxl"] - }, - "application/vnd.recordare.musicxml+xml": { - "source": "iana", - "extensions": ["musicxml"] - }, - "application/vnd.renlearn.rlprint": { - "source": "iana" - }, - "application/vnd.rig.cryptonote": { - "source": "iana", - "extensions": ["cryptonote"] - }, - "application/vnd.rim.cod": { - "source": "apache", - "extensions": ["cod"] - }, - "application/vnd.rn-realmedia": { - "source": "apache", - "extensions": ["rm"] - }, - "application/vnd.rn-realmedia-vbr": { - "source": "apache", - "extensions": ["rmvb"] - }, - "application/vnd.route66.link66+xml": { - "source": "iana", - "extensions": ["link66"] - }, - "application/vnd.rs-274x": { - "source": "iana" - }, - "application/vnd.ruckus.download": { - "source": "iana" - }, - "application/vnd.s3sms": { - "source": "iana" - }, - "application/vnd.sailingtracker.track": { - "source": "iana", - "extensions": ["st"] - }, - "application/vnd.sbm.cid": { - "source": "iana" - }, - "application/vnd.sbm.mid2": { - "source": "iana" - }, - "application/vnd.scribus": { - "source": "iana" - }, - "application/vnd.sealed.3df": { - "source": "iana" - }, - "application/vnd.sealed.csf": { - "source": "iana" - }, - "application/vnd.sealed.doc": { - "source": "iana" - }, - "application/vnd.sealed.eml": { - "source": "iana" - }, - "application/vnd.sealed.mht": { - "source": "iana" - }, - "application/vnd.sealed.net": { - "source": "iana" - }, - "application/vnd.sealed.ppt": { - "source": "iana" - }, - "application/vnd.sealed.tiff": { - "source": "iana" - }, - "application/vnd.sealed.xls": { - "source": "iana" - }, - "application/vnd.sealedmedia.softseal.html": { - "source": "iana" - }, - "application/vnd.sealedmedia.softseal.pdf": { - "source": "iana" - }, - "application/vnd.seemail": { - "source": "iana", - "extensions": ["see"] - }, - "application/vnd.sema": { - "source": "iana", - "extensions": ["sema"] - }, - "application/vnd.semd": { - "source": "iana", - "extensions": ["semd"] - }, - "application/vnd.semf": { - "source": "iana", - "extensions": ["semf"] - }, - "application/vnd.shana.informed.formdata": { - "source": "iana", - "extensions": ["ifm"] - }, - "application/vnd.shana.informed.formtemplate": { - "source": "iana", - "extensions": ["itp"] - }, - "application/vnd.shana.informed.interchange": { - "source": "iana", - "extensions": ["iif"] - }, - "application/vnd.shana.informed.package": { - "source": "iana", - "extensions": ["ipk"] - }, - "application/vnd.simtech-mindmapper": { - "source": "iana", - "extensions": ["twd","twds"] - }, - "application/vnd.siren+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.smaf": { - "source": "iana", - "extensions": ["mmf"] - }, - "application/vnd.smart.notebook": { - "source": "iana" - }, - "application/vnd.smart.teacher": { - "source": "iana", - "extensions": ["teacher"] - }, - "application/vnd.software602.filler.form+xml": { - "source": "iana" - }, - "application/vnd.software602.filler.form-xml-zip": { - "source": "iana" - }, - "application/vnd.solent.sdkm+xml": { - "source": "iana", - "extensions": ["sdkm","sdkd"] - }, - "application/vnd.spotfire.dxp": { - "source": "iana", - "extensions": ["dxp"] - }, - "application/vnd.spotfire.sfs": { - "source": "iana", - "extensions": ["sfs"] - }, - "application/vnd.sss-cod": { - "source": "iana" - }, - "application/vnd.sss-dtf": { - "source": "iana" - }, - "application/vnd.sss-ntf": { - "source": "iana" - }, - "application/vnd.stardivision.calc": { - "source": "apache", - "extensions": ["sdc"] - }, - "application/vnd.stardivision.draw": { - "source": "apache", - "extensions": ["sda"] - }, - "application/vnd.stardivision.impress": { - "source": "apache", - "extensions": ["sdd"] - }, - "application/vnd.stardivision.math": { - "source": "apache", - "extensions": ["smf"] - }, - "application/vnd.stardivision.writer": { - "source": "apache", - "extensions": ["sdw","vor"] - }, - "application/vnd.stardivision.writer-global": { - "source": "apache", - "extensions": ["sgl"] - }, - "application/vnd.stepmania.package": { - "source": "iana", - "extensions": ["smzip"] - }, - "application/vnd.stepmania.stepchart": { - "source": "iana", - "extensions": ["sm"] - }, - "application/vnd.street-stream": { - "source": "iana" - }, - "application/vnd.sun.wadl+xml": { - "source": "iana" - }, - "application/vnd.sun.xml.calc": { - "source": "apache", - "extensions": ["sxc"] - }, - "application/vnd.sun.xml.calc.template": { - "source": "apache", - "extensions": ["stc"] - }, - "application/vnd.sun.xml.draw": { - "source": "apache", - "extensions": ["sxd"] - }, - "application/vnd.sun.xml.draw.template": { - "source": "apache", - "extensions": ["std"] - }, - "application/vnd.sun.xml.impress": { - "source": "apache", - "extensions": ["sxi"] - }, - "application/vnd.sun.xml.impress.template": { - "source": "apache", - "extensions": ["sti"] - }, - "application/vnd.sun.xml.math": { - "source": "apache", - "extensions": ["sxm"] - }, - "application/vnd.sun.xml.writer": { - "source": "apache", - "extensions": ["sxw"] - }, - "application/vnd.sun.xml.writer.global": { - "source": "apache", - "extensions": ["sxg"] - }, - "application/vnd.sun.xml.writer.template": { - "source": "apache", - "extensions": ["stw"] - }, - "application/vnd.sus-calendar": { - "source": "iana", - "extensions": ["sus","susp"] - }, - "application/vnd.svd": { - "source": "iana", - "extensions": ["svd"] - }, - "application/vnd.swiftview-ics": { - "source": "iana" - }, - "application/vnd.symbian.install": { - "source": "apache", - "extensions": ["sis","sisx"] - }, - "application/vnd.syncml+xml": { - "source": "iana", - "extensions": ["xsm"] - }, - "application/vnd.syncml.dm+wbxml": { - "source": "iana", - "extensions": ["bdm"] - }, - "application/vnd.syncml.dm+xml": { - "source": "iana", - "extensions": ["xdm"] - }, - "application/vnd.syncml.dm.notification": { - "source": "iana" - }, - "application/vnd.syncml.dmddf+wbxml": { - "source": "iana" - }, - "application/vnd.syncml.dmddf+xml": { - "source": "iana" - }, - "application/vnd.syncml.dmtnds+wbxml": { - "source": "iana" - }, - "application/vnd.syncml.dmtnds+xml": { - "source": "iana" - }, - "application/vnd.syncml.ds.notification": { - "source": "iana" - }, - "application/vnd.tao.intent-module-archive": { - "source": "iana", - "extensions": ["tao"] - }, - "application/vnd.tcpdump.pcap": { - "source": "iana", - "extensions": ["pcap","cap","dmp"] - }, - "application/vnd.tmd.mediaflex.api+xml": { - "source": "iana" - }, - "application/vnd.tmobile-livetv": { - "source": "iana", - "extensions": ["tmo"] - }, - "application/vnd.trid.tpt": { - "source": "iana", - "extensions": ["tpt"] - }, - "application/vnd.triscape.mxs": { - "source": "iana", - "extensions": ["mxs"] - }, - "application/vnd.trueapp": { - "source": "iana", - "extensions": ["tra"] - }, - "application/vnd.truedoc": { - "source": "iana" - }, - "application/vnd.ubisoft.webplayer": { - "source": "iana" - }, - "application/vnd.ufdl": { - "source": "iana", - "extensions": ["ufd","ufdl"] - }, - "application/vnd.uiq.theme": { - "source": "iana", - "extensions": ["utz"] - }, - "application/vnd.umajin": { - "source": "iana", - "extensions": ["umj"] - }, - "application/vnd.unity": { - "source": "iana", - "extensions": ["unityweb"] - }, - "application/vnd.uoml+xml": { - "source": "iana", - "extensions": ["uoml"] - }, - "application/vnd.uplanet.alert": { - "source": "iana" - }, - "application/vnd.uplanet.alert-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.bearer-choice": { - "source": "iana" - }, - "application/vnd.uplanet.bearer-choice-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.cacheop": { - "source": "iana" - }, - "application/vnd.uplanet.cacheop-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.channel": { - "source": "iana" - }, - "application/vnd.uplanet.channel-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.list": { - "source": "iana" - }, - "application/vnd.uplanet.list-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.listcmd": { - "source": "iana" - }, - "application/vnd.uplanet.listcmd-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.signal": { - "source": "iana" - }, - "application/vnd.valve.source.material": { - "source": "iana" - }, - "application/vnd.vcx": { - "source": "iana", - "extensions": ["vcx"] - }, - "application/vnd.vd-study": { - "source": "iana" - }, - "application/vnd.vectorworks": { - "source": "iana" - }, - "application/vnd.verimatrix.vcas": { - "source": "iana" - }, - "application/vnd.vidsoft.vidconference": { - "source": "iana" - }, - "application/vnd.visio": { - "source": "iana", - "extensions": ["vsd","vst","vss","vsw"] - }, - "application/vnd.visionary": { - "source": "iana", - "extensions": ["vis"] - }, - "application/vnd.vividence.scriptfile": { - "source": "iana" - }, - "application/vnd.vsf": { - "source": "iana", - "extensions": ["vsf"] - }, - "application/vnd.wap.sic": { - "source": "iana" - }, - "application/vnd.wap.slc": { - "source": "iana" - }, - "application/vnd.wap.wbxml": { - "source": "iana", - "extensions": ["wbxml"] - }, - "application/vnd.wap.wmlc": { - "source": "iana", - "extensions": ["wmlc"] - }, - "application/vnd.wap.wmlscriptc": { - "source": "iana", - "extensions": ["wmlsc"] - }, - "application/vnd.webturbo": { - "source": "iana", - "extensions": ["wtb"] - }, - "application/vnd.wfa.p2p": { - "source": "iana" - }, - "application/vnd.wfa.wsc": { - "source": "iana" - }, - "application/vnd.windows.devicepairing": { - "source": "iana" - }, - "application/vnd.wmc": { - "source": "iana" - }, - "application/vnd.wmf.bootstrap": { - "source": "iana" - }, - "application/vnd.wolfram.mathematica": { - "source": "iana" - }, - "application/vnd.wolfram.mathematica.package": { - "source": "iana" - }, - "application/vnd.wolfram.player": { - "source": "iana", - "extensions": ["nbp"] - }, - "application/vnd.wordperfect": { - "source": "iana", - "extensions": ["wpd"] - }, - "application/vnd.wqd": { - "source": "iana", - "extensions": ["wqd"] - }, - "application/vnd.wrq-hp3000-labelled": { - "source": "iana" - }, - "application/vnd.wt.stf": { - "source": "iana", - "extensions": ["stf"] - }, - "application/vnd.wv.csp+wbxml": { - "source": "iana" - }, - "application/vnd.wv.csp+xml": { - "source": "iana" - }, - "application/vnd.wv.ssp+xml": { - "source": "iana" - }, - "application/vnd.xacml+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.xara": { - "source": "iana", - "extensions": ["xar"] - }, - "application/vnd.xfdl": { - "source": "iana", - "extensions": ["xfdl"] - }, - "application/vnd.xfdl.webform": { - "source": "iana" - }, - "application/vnd.xmi+xml": { - "source": "iana" - }, - "application/vnd.xmpie.cpkg": { - "source": "iana" - }, - "application/vnd.xmpie.dpkg": { - "source": "iana" - }, - "application/vnd.xmpie.plan": { - "source": "iana" - }, - "application/vnd.xmpie.ppkg": { - "source": "iana" - }, - "application/vnd.xmpie.xlim": { - "source": "iana" - }, - "application/vnd.yamaha.hv-dic": { - "source": "iana", - "extensions": ["hvd"] - }, - "application/vnd.yamaha.hv-script": { - "source": "iana", - "extensions": ["hvs"] - }, - "application/vnd.yamaha.hv-voice": { - "source": "iana", - "extensions": ["hvp"] - }, - "application/vnd.yamaha.openscoreformat": { - "source": "iana", - "extensions": ["osf"] - }, - "application/vnd.yamaha.openscoreformat.osfpvg+xml": { - "source": "iana", - "extensions": ["osfpvg"] - }, - "application/vnd.yamaha.remote-setup": { - "source": "iana" - }, - "application/vnd.yamaha.smaf-audio": { - "source": "iana", - "extensions": ["saf"] - }, - "application/vnd.yamaha.smaf-phrase": { - "source": "iana", - "extensions": ["spf"] - }, - "application/vnd.yamaha.through-ngn": { - "source": "iana" - }, - "application/vnd.yamaha.tunnel-udpencap": { - "source": "iana" - }, - "application/vnd.yaoweme": { - "source": "iana" - }, - "application/vnd.yellowriver-custom-menu": { - "source": "iana", - "extensions": ["cmp"] - }, - "application/vnd.zul": { - "source": "iana", - "extensions": ["zir","zirz"] - }, - "application/vnd.zzazz.deck+xml": { - "source": "iana", - "extensions": ["zaz"] - }, - "application/voicexml+xml": { - "source": "iana", - "extensions": ["vxml"] - }, - "application/vq-rtcpxr": { - "source": "iana" - }, - "application/watcherinfo+xml": { - "source": "iana" - }, - "application/whoispp-query": { - "source": "iana" - }, - "application/whoispp-response": { - "source": "iana" - }, - "application/widget": { - "source": "iana", - "extensions": ["wgt"] - }, - "application/winhlp": { - "source": "apache", - "extensions": ["hlp"] - }, - "application/wita": { - "source": "iana" - }, - "application/wordperfect5.1": { - "source": "iana" - }, - "application/wsdl+xml": { - "source": "iana", - "extensions": ["wsdl"] - }, - "application/wspolicy+xml": { - "source": "iana", - "extensions": ["wspolicy"] - }, - "application/x-7z-compressed": { - "source": "apache", - "compressible": false, - "extensions": ["7z"] - }, - "application/x-abiword": { - "source": "apache", - "extensions": ["abw"] - }, - "application/x-ace-compressed": { - "source": "apache", - "extensions": ["ace"] - }, - "application/x-amf": { - "source": "apache" - }, - "application/x-apple-diskimage": { - "source": "apache", - "extensions": ["dmg"] - }, - "application/x-authorware-bin": { - "source": "apache", - "extensions": ["aab","x32","u32","vox"] - }, - "application/x-authorware-map": { - "source": "apache", - "extensions": ["aam"] - }, - "application/x-authorware-seg": { - "source": "apache", - "extensions": ["aas"] - }, - "application/x-bcpio": { - "source": "apache", - "extensions": ["bcpio"] - }, - "application/x-bittorrent": { - "source": "apache", - "extensions": ["torrent"] - }, - "application/x-blorb": { - "source": "apache", - "extensions": ["blb","blorb"] - }, - "application/x-bzip": { - "source": "apache", - "compressible": false, - "extensions": ["bz"] - }, - "application/x-bzip2": { - "source": "apache", - "compressible": false, - "extensions": ["bz2","boz"] - }, - "application/x-cbr": { - "source": "apache", - "extensions": ["cbr","cba","cbt","cbz","cb7"] - }, - "application/x-cdlink": { - "source": "apache", - "extensions": ["vcd"] - }, - "application/x-cfs-compressed": { - "source": "apache", - "extensions": ["cfs"] - }, - "application/x-chat": { - "source": "apache", - "extensions": ["chat"] - }, - "application/x-chess-pgn": { - "source": "apache", - "extensions": ["pgn"] - }, - "application/x-chrome-extension": { - "extensions": ["crx"] - }, - "application/x-compress": { - "source": "apache" - }, - "application/x-conference": { - "source": "apache", - "extensions": ["nsc"] - }, - "application/x-cpio": { - "source": "apache", - "extensions": ["cpio"] - }, - "application/x-csh": { - "source": "apache", - "extensions": ["csh"] - }, - "application/x-deb": { - "compressible": false - }, - "application/x-debian-package": { - "source": "apache", - "extensions": ["deb","udeb"] - }, - "application/x-dgc-compressed": { - "source": "apache", - "extensions": ["dgc"] - }, - "application/x-director": { - "source": "apache", - "extensions": ["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"] - }, - "application/x-doom": { - "source": "apache", - "extensions": ["wad"] - }, - "application/x-dtbncx+xml": { - "source": "apache", - "extensions": ["ncx"] - }, - "application/x-dtbook+xml": { - "source": "apache", - "extensions": ["dtb"] - }, - "application/x-dtbresource+xml": { - "source": "apache", - "extensions": ["res"] - }, - "application/x-dvi": { - "source": "apache", - "compressible": false, - "extensions": ["dvi"] - }, - "application/x-envoy": { - "source": "apache", - "extensions": ["evy"] - }, - "application/x-eva": { - "source": "apache", - "extensions": ["eva"] - }, - "application/x-font-bdf": { - "source": "apache", - "extensions": ["bdf"] - }, - "application/x-font-dos": { - "source": "apache" - }, - "application/x-font-framemaker": { - "source": "apache" - }, - "application/x-font-ghostscript": { - "source": "apache", - "extensions": ["gsf"] - }, - "application/x-font-libgrx": { - "source": "apache" - }, - "application/x-font-linux-psf": { - "source": "apache", - "extensions": ["psf"] - }, - "application/x-font-otf": { - "source": "apache", - "compressible": true, - "extensions": ["otf"] - }, - "application/x-font-pcf": { - "source": "apache", - "extensions": ["pcf"] - }, - "application/x-font-snf": { - "source": "apache", - "extensions": ["snf"] - }, - "application/x-font-speedo": { - "source": "apache" - }, - "application/x-font-sunos-news": { - "source": "apache" - }, - "application/x-font-ttf": { - "source": "apache", - "compressible": true, - "extensions": ["ttf","ttc"] - }, - "application/x-font-type1": { - "source": "apache", - "extensions": ["pfa","pfb","pfm","afm"] - }, - "application/x-font-vfont": { - "source": "apache" - }, - "application/x-freearc": { - "source": "apache", - "extensions": ["arc"] - }, - "application/x-futuresplash": { - "source": "apache", - "extensions": ["spl"] - }, - "application/x-gca-compressed": { - "source": "apache", - "extensions": ["gca"] - }, - "application/x-glulx": { - "source": "apache", - "extensions": ["ulx"] - }, - "application/x-gnumeric": { - "source": "apache", - "extensions": ["gnumeric"] - }, - "application/x-gramps-xml": { - "source": "apache", - "extensions": ["gramps"] - }, - "application/x-gtar": { - "source": "apache", - "extensions": ["gtar"] - }, - "application/x-gzip": { - "source": "apache" - }, - "application/x-hdf": { - "source": "apache", - "extensions": ["hdf"] - }, - "application/x-install-instructions": { - "source": "apache", - "extensions": ["install"] - }, - "application/x-iso9660-image": { - "source": "apache", - "extensions": ["iso"] - }, - "application/x-java-jnlp-file": { - "source": "apache", - "compressible": false, - "extensions": ["jnlp"] - }, - "application/x-javascript": { - "compressible": true - }, - "application/x-latex": { - "source": "apache", - "compressible": false, - "extensions": ["latex"] - }, - "application/x-lua-bytecode": { - "extensions": ["luac"] - }, - "application/x-lzh-compressed": { - "source": "apache", - "extensions": ["lzh","lha"] - }, - "application/x-mie": { - "source": "apache", - "extensions": ["mie"] - }, - "application/x-mobipocket-ebook": { - "source": "apache", - "extensions": ["prc","mobi"] - }, - "application/x-mpegurl": { - "compressible": false - }, - "application/x-ms-application": { - "source": "apache", - "extensions": ["application"] - }, - "application/x-ms-shortcut": { - "source": "apache", - "extensions": ["lnk"] - }, - "application/x-ms-wmd": { - "source": "apache", - "extensions": ["wmd"] - }, - "application/x-ms-wmz": { - "source": "apache", - "extensions": ["wmz"] - }, - "application/x-ms-xbap": { - "source": "apache", - "extensions": ["xbap"] - }, - "application/x-msaccess": { - "source": "apache", - "extensions": ["mdb"] - }, - "application/x-msbinder": { - "source": "apache", - "extensions": ["obd"] - }, - "application/x-mscardfile": { - "source": "apache", - "extensions": ["crd"] - }, - "application/x-msclip": { - "source": "apache", - "extensions": ["clp"] - }, - "application/x-msdownload": { - "source": "apache", - "extensions": ["exe","dll","com","bat","msi"] - }, - "application/x-msmediaview": { - "source": "apache", - "extensions": ["mvb","m13","m14"] - }, - "application/x-msmetafile": { - "source": "apache", - "extensions": ["wmf","wmz","emf","emz"] - }, - "application/x-msmoney": { - "source": "apache", - "extensions": ["mny"] - }, - "application/x-mspublisher": { - "source": "apache", - "extensions": ["pub"] - }, - "application/x-msschedule": { - "source": "apache", - "extensions": ["scd"] - }, - "application/x-msterminal": { - "source": "apache", - "extensions": ["trm"] - }, - "application/x-mswrite": { - "source": "apache", - "extensions": ["wri"] - }, - "application/x-netcdf": { - "source": "apache", - "extensions": ["nc","cdf"] - }, - "application/x-nzb": { - "source": "apache", - "extensions": ["nzb"] - }, - "application/x-pkcs12": { - "source": "apache", - "compressible": false, - "extensions": ["p12","pfx"] - }, - "application/x-pkcs7-certificates": { - "source": "apache", - "extensions": ["p7b","spc"] - }, - "application/x-pkcs7-certreqresp": { - "source": "apache", - "extensions": ["p7r"] - }, - "application/x-rar-compressed": { - "source": "apache", - "compressible": false, - "extensions": ["rar"] - }, - "application/x-research-info-systems": { - "source": "apache", - "extensions": ["ris"] - }, - "application/x-sh": { - "source": "apache", - "compressible": true, - "extensions": ["sh"] - }, - "application/x-shar": { - "source": "apache", - "extensions": ["shar"] - }, - "application/x-shockwave-flash": { - "source": "apache", - "compressible": false, - "extensions": ["swf"] - }, - "application/x-silverlight-app": { - "source": "apache", - "extensions": ["xap"] - }, - "application/x-sql": { - "source": "apache", - "extensions": ["sql"] - }, - "application/x-stuffit": { - "source": "apache", - "compressible": false, - "extensions": ["sit"] - }, - "application/x-stuffitx": { - "source": "apache", - "extensions": ["sitx"] - }, - "application/x-subrip": { - "source": "apache", - "extensions": ["srt"] - }, - "application/x-sv4cpio": { - "source": "apache", - "extensions": ["sv4cpio"] - }, - "application/x-sv4crc": { - "source": "apache", - "extensions": ["sv4crc"] - }, - "application/x-t3vm-image": { - "source": "apache", - "extensions": ["t3"] - }, - "application/x-tads": { - "source": "apache", - "extensions": ["gam"] - }, - "application/x-tar": { - "source": "apache", - "compressible": true, - "extensions": ["tar"] - }, - "application/x-tcl": { - "source": "apache", - "extensions": ["tcl"] - }, - "application/x-tex": { - "source": "apache", - "extensions": ["tex"] - }, - "application/x-tex-tfm": { - "source": "apache", - "extensions": ["tfm"] - }, - "application/x-texinfo": { - "source": "apache", - "extensions": ["texinfo","texi"] - }, - "application/x-tgif": { - "source": "apache", - "extensions": ["obj"] - }, - "application/x-ustar": { - "source": "apache", - "extensions": ["ustar"] - }, - "application/x-wais-source": { - "source": "apache", - "extensions": ["src"] - }, - "application/x-web-app-manifest+json": { - "compressible": true, - "extensions": ["webapp"] - }, - "application/x-www-form-urlencoded": { - "source": "iana", - "compressible": true - }, - "application/x-x509-ca-cert": { - "source": "apache", - "extensions": ["der","crt"] - }, - "application/x-xfig": { - "source": "apache", - "extensions": ["fig"] - }, - "application/x-xliff+xml": { - "source": "apache", - "extensions": ["xlf"] - }, - "application/x-xpinstall": { - "source": "apache", - "compressible": false, - "extensions": ["xpi"] - }, - "application/x-xz": { - "source": "apache", - "extensions": ["xz"] - }, - "application/x-zmachine": { - "source": "apache", - "extensions": ["z1","z2","z3","z4","z5","z6","z7","z8"] - }, - "application/x400-bp": { - "source": "iana" - }, - "application/xacml+xml": { - "source": "iana" - }, - "application/xaml+xml": { - "source": "apache", - "extensions": ["xaml"] - }, - "application/xcap-att+xml": { - "source": "iana" - }, - "application/xcap-caps+xml": { - "source": "iana" - }, - "application/xcap-diff+xml": { - "source": "iana", - "extensions": ["xdf"] - }, - "application/xcap-el+xml": { - "source": "iana" - }, - "application/xcap-error+xml": { - "source": "iana" - }, - "application/xcap-ns+xml": { - "source": "iana" - }, - "application/xcon-conference-info+xml": { - "source": "iana" - }, - "application/xcon-conference-info-diff+xml": { - "source": "iana" - }, - "application/xenc+xml": { - "source": "iana", - "extensions": ["xenc"] - }, - "application/xhtml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xhtml","xht"] - }, - "application/xhtml-voice+xml": { - "source": "iana" - }, - "application/xml": { - "source": "iana", - "compressible": true, - "extensions": ["xml","xsl","xsd"] - }, - "application/xml-dtd": { - "source": "iana", - "compressible": true, - "extensions": ["dtd"] - }, - "application/xml-external-parsed-entity": { - "source": "iana" - }, - "application/xml-patch+xml": { - "source": "iana" - }, - "application/xmpp+xml": { - "source": "iana" - }, - "application/xop+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xop"] - }, - "application/xproc+xml": { - "source": "apache", - "extensions": ["xpl"] - }, - "application/xslt+xml": { - "source": "iana", - "extensions": ["xslt"] - }, - "application/xspf+xml": { - "source": "apache", - "extensions": ["xspf"] - }, - "application/xv+xml": { - "source": "iana", - "extensions": ["mxml","xhvml","xvml","xvm"] - }, - "application/yang": { - "source": "iana", - "extensions": ["yang"] - }, - "application/yin+xml": { - "source": "iana", - "extensions": ["yin"] - }, - "application/zip": { - "source": "iana", - "compressible": false, - "extensions": ["zip"] - }, - "application/zlib": { - "source": "iana" - }, - "audio/1d-interleaved-parityfec": { - "source": "iana" - }, - "audio/32kadpcm": { - "source": "iana" - }, - "audio/3gpp": { - "source": "iana" - }, - "audio/3gpp2": { - "source": "iana" - }, - "audio/ac3": { - "source": "iana" - }, - "audio/adpcm": { - "source": "apache", - "extensions": ["adp"] - }, - "audio/amr": { - "source": "iana" - }, - "audio/amr-wb": { - "source": "iana" - }, - "audio/amr-wb+": { - "source": "iana" - }, - "audio/aptx": { - "source": "iana" - }, - "audio/asc": { - "source": "iana" - }, - "audio/atrac-advanced-lossless": { - "source": "iana" - }, - "audio/atrac-x": { - "source": "iana" - }, - "audio/atrac3": { - "source": "iana" - }, - "audio/basic": { - "source": "iana", - "compressible": false, - "extensions": ["au","snd"] - }, - "audio/bv16": { - "source": "iana" - }, - "audio/bv32": { - "source": "iana" - }, - "audio/clearmode": { - "source": "iana" - }, - "audio/cn": { - "source": "iana" - }, - "audio/dat12": { - "source": "iana" - }, - "audio/dls": { - "source": "iana" - }, - "audio/dsr-es201108": { - "source": "iana" - }, - "audio/dsr-es202050": { - "source": "iana" - }, - "audio/dsr-es202211": { - "source": "iana" - }, - "audio/dsr-es202212": { - "source": "iana" - }, - "audio/dv": { - "source": "iana" - }, - "audio/dvi4": { - "source": "iana" - }, - "audio/eac3": { - "source": "iana" - }, - "audio/encaprtp": { - "source": "iana" - }, - "audio/evrc": { - "source": "iana" - }, - "audio/evrc-qcp": { - "source": "iana" - }, - "audio/evrc0": { - "source": "iana" - }, - "audio/evrc1": { - "source": "iana" - }, - "audio/evrcb": { - "source": "iana" - }, - "audio/evrcb0": { - "source": "iana" - }, - "audio/evrcb1": { - "source": "iana" - }, - "audio/evrcnw": { - "source": "iana" - }, - "audio/evrcnw0": { - "source": "iana" - }, - "audio/evrcnw1": { - "source": "iana" - }, - "audio/evrcwb": { - "source": "iana" - }, - "audio/evrcwb0": { - "source": "iana" - }, - "audio/evrcwb1": { - "source": "iana" - }, - "audio/fwdred": { - "source": "iana" - }, - "audio/g719": { - "source": "iana" - }, - "audio/g722": { - "source": "iana" - }, - "audio/g7221": { - "source": "iana" - }, - "audio/g723": { - "source": "iana" - }, - "audio/g726-16": { - "source": "iana" - }, - "audio/g726-24": { - "source": "iana" - }, - "audio/g726-32": { - "source": "iana" - }, - "audio/g726-40": { - "source": "iana" - }, - "audio/g728": { - "source": "iana" - }, - "audio/g729": { - "source": "iana" - }, - "audio/g7291": { - "source": "iana" - }, - "audio/g729d": { - "source": "iana" - }, - "audio/g729e": { - "source": "iana" - }, - "audio/gsm": { - "source": "iana" - }, - "audio/gsm-efr": { - "source": "iana" - }, - "audio/gsm-hr-08": { - "source": "iana" - }, - "audio/ilbc": { - "source": "iana" - }, - "audio/ip-mr_v2.5": { - "source": "iana" - }, - "audio/isac": { - "source": "apache" - }, - "audio/l16": { - "source": "iana" - }, - "audio/l20": { - "source": "iana" - }, - "audio/l24": { - "source": "iana", - "compressible": false - }, - "audio/l8": { - "source": "iana" - }, - "audio/lpc": { - "source": "iana" - }, - "audio/midi": { - "source": "apache", - "extensions": ["mid","midi","kar","rmi"] - }, - "audio/mobile-xmf": { - "source": "iana" - }, - "audio/mp4": { - "source": "iana", - "compressible": false, - "extensions": ["mp4a","m4a"] - }, - "audio/mp4a-latm": { - "source": "iana" - }, - "audio/mpa": { - "source": "iana" - }, - "audio/mpa-robust": { - "source": "iana" - }, - "audio/mpeg": { - "source": "iana", - "compressible": false, - "extensions": ["mpga","mp2","mp2a","mp3","m2a","m3a"] - }, - "audio/mpeg4-generic": { - "source": "iana" - }, - "audio/musepack": { - "source": "apache" - }, - "audio/ogg": { - "source": "iana", - "compressible": false, - "extensions": ["oga","ogg","spx"] - }, - "audio/opus": { - "source": "apache" - }, - "audio/parityfec": { - "source": "iana" - }, - "audio/pcma": { - "source": "iana" - }, - "audio/pcma-wb": { - "source": "iana" - }, - "audio/pcmu": { - "source": "iana" - }, - "audio/pcmu-wb": { - "source": "iana" - }, - "audio/prs.sid": { - "source": "iana" - }, - "audio/qcelp": { - "source": "iana" - }, - "audio/raptorfec": { - "source": "iana" - }, - "audio/red": { - "source": "iana" - }, - "audio/rtp-enc-aescm128": { - "source": "iana" - }, - "audio/rtp-midi": { - "source": "iana" - }, - "audio/rtploopback": { - "source": "iana" - }, - "audio/rtx": { - "source": "iana" - }, - "audio/s3m": { - "source": "apache", - "extensions": ["s3m"] - }, - "audio/silk": { - "source": "apache", - "extensions": ["sil"] - }, - "audio/smv": { - "source": "iana" - }, - "audio/smv-qcp": { - "source": "iana" - }, - "audio/smv0": { - "source": "iana" - }, - "audio/sp-midi": { - "source": "iana" - }, - "audio/speex": { - "source": "iana" - }, - "audio/t140c": { - "source": "iana" - }, - "audio/t38": { - "source": "iana" - }, - "audio/telephone-event": { - "source": "iana" - }, - "audio/tone": { - "source": "iana" - }, - "audio/uemclip": { - "source": "iana" - }, - "audio/ulpfec": { - "source": "iana" - }, - "audio/vdvi": { - "source": "iana" - }, - "audio/vmr-wb": { - "source": "iana" - }, - "audio/vnd.3gpp.iufp": { - "source": "iana" - }, - "audio/vnd.4sb": { - "source": "iana" - }, - "audio/vnd.audiokoz": { - "source": "iana" - }, - "audio/vnd.celp": { - "source": "iana" - }, - "audio/vnd.cisco.nse": { - "source": "iana" - }, - "audio/vnd.cmles.radio-events": { - "source": "iana" - }, - "audio/vnd.cns.anp1": { - "source": "iana" - }, - "audio/vnd.cns.inf1": { - "source": "iana" - }, - "audio/vnd.dece.audio": { - "source": "iana", - "extensions": ["uva","uvva"] - }, - "audio/vnd.digital-winds": { - "source": "iana", - "extensions": ["eol"] - }, - "audio/vnd.dlna.adts": { - "source": "iana" - }, - "audio/vnd.dolby.heaac.1": { - "source": "iana" - }, - "audio/vnd.dolby.heaac.2": { - "source": "iana" - }, - "audio/vnd.dolby.mlp": { - "source": "iana" - }, - "audio/vnd.dolby.mps": { - "source": "iana" - }, - "audio/vnd.dolby.pl2": { - "source": "iana" - }, - "audio/vnd.dolby.pl2x": { - "source": "iana" - }, - "audio/vnd.dolby.pl2z": { - "source": "iana" - }, - "audio/vnd.dolby.pulse.1": { - "source": "iana" - }, - "audio/vnd.dra": { - "source": "iana", - "extensions": ["dra"] - }, - "audio/vnd.dts": { - "source": "iana", - "extensions": ["dts"] - }, - "audio/vnd.dts.hd": { - "source": "iana", - "extensions": ["dtshd"] - }, - "audio/vnd.dvb.file": { - "source": "iana" - }, - "audio/vnd.everad.plj": { - "source": "iana" - }, - "audio/vnd.hns.audio": { - "source": "iana" - }, - "audio/vnd.lucent.voice": { - "source": "iana", - "extensions": ["lvp"] - }, - "audio/vnd.ms-playready.media.pya": { - "source": "iana", - "extensions": ["pya"] - }, - "audio/vnd.nokia.mobile-xmf": { - "source": "iana" - }, - "audio/vnd.nortel.vbk": { - "source": "iana" - }, - "audio/vnd.nuera.ecelp4800": { - "source": "iana", - "extensions": ["ecelp4800"] - }, - "audio/vnd.nuera.ecelp7470": { - "source": "iana", - "extensions": ["ecelp7470"] - }, - "audio/vnd.nuera.ecelp9600": { - "source": "iana", - "extensions": ["ecelp9600"] - }, - "audio/vnd.octel.sbc": { - "source": "iana" - }, - "audio/vnd.qcelp": { - "source": "iana" - }, - "audio/vnd.rhetorex.32kadpcm": { - "source": "iana" - }, - "audio/vnd.rip": { - "source": "iana", - "extensions": ["rip"] - }, - "audio/vnd.rn-realaudio": { - "compressible": false - }, - "audio/vnd.sealedmedia.softseal.mpeg": { - "source": "iana" - }, - "audio/vnd.vmx.cvsd": { - "source": "iana" - }, - "audio/vnd.wave": { - "compressible": false - }, - "audio/vorbis": { - "source": "iana", - "compressible": false - }, - "audio/vorbis-config": { - "source": "iana" - }, - "audio/webm": { - "source": "apache", - "compressible": false, - "extensions": ["weba"] - }, - "audio/x-aac": { - "source": "apache", - "compressible": false, - "extensions": ["aac"] - }, - "audio/x-aiff": { - "source": "apache", - "extensions": ["aif","aiff","aifc"] - }, - "audio/x-caf": { - "source": "apache", - "compressible": false, - "extensions": ["caf"] - }, - "audio/x-flac": { - "source": "apache", - "extensions": ["flac"] - }, - "audio/x-matroska": { - "source": "apache", - "extensions": ["mka"] - }, - "audio/x-mpegurl": { - "source": "apache", - "extensions": ["m3u"] - }, - "audio/x-ms-wax": { - "source": "apache", - "extensions": ["wax"] - }, - "audio/x-ms-wma": { - "source": "apache", - "extensions": ["wma"] - }, - "audio/x-pn-realaudio": { - "source": "apache", - "extensions": ["ram","ra"] - }, - "audio/x-pn-realaudio-plugin": { - "source": "apache", - "extensions": ["rmp"] - }, - "audio/x-tta": { - "source": "apache" - }, - "audio/x-wav": { - "source": "apache", - "extensions": ["wav"] - }, - "audio/xm": { - "source": "apache", - "extensions": ["xm"] - }, - "chemical/x-cdx": { - "source": "apache", - "extensions": ["cdx"] - }, - "chemical/x-cif": { - "source": "apache", - "extensions": ["cif"] - }, - "chemical/x-cmdf": { - "source": "apache", - "extensions": ["cmdf"] - }, - "chemical/x-cml": { - "source": "apache", - "extensions": ["cml"] - }, - "chemical/x-csml": { - "source": "apache", - "extensions": ["csml"] - }, - "chemical/x-pdb": { - "source": "apache" - }, - "chemical/x-xyz": { - "source": "apache", - "extensions": ["xyz"] - }, - "font/opentype": { - "compressible": true, - "extensions": ["otf"] - }, - "image/bmp": { - "source": "apache", - "compressible": true, - "extensions": ["bmp"] - }, - "image/cgm": { - "source": "iana", - "extensions": ["cgm"] - }, - "image/fits": { - "source": "iana" - }, - "image/g3fax": { - "source": "iana", - "extensions": ["g3"] - }, - "image/gif": { - "source": "iana", - "compressible": false, - "extensions": ["gif"] - }, - "image/ief": { - "source": "iana", - "extensions": ["ief"] - }, - "image/jp2": { - "source": "iana" - }, - "image/jpeg": { - "source": "iana", - "compressible": false, - "extensions": ["jpeg","jpg","jpe"] - }, - "image/jpm": { - "source": "iana" - }, - "image/jpx": { - "source": "iana" - }, - "image/ktx": { - "source": "iana", - "extensions": ["ktx"] - }, - "image/naplps": { - "source": "iana" - }, - "image/pjpeg": { - "compressible": false - }, - "image/png": { - "source": "iana", - "compressible": false, - "extensions": ["png"] - }, - "image/prs.btif": { - "source": "iana", - "extensions": ["btif"] - }, - "image/prs.pti": { - "source": "iana" - }, - "image/pwg-raster": { - "source": "iana" - }, - "image/sgi": { - "source": "apache", - "extensions": ["sgi"] - }, - "image/svg+xml": { - "source": "iana", - "compressible": true, - "extensions": ["svg","svgz"] - }, - "image/t38": { - "source": "iana" - }, - "image/tiff": { - "source": "iana", - "compressible": false, - "extensions": ["tiff","tif"] - }, - "image/tiff-fx": { - "source": "iana" - }, - "image/vnd.adobe.photoshop": { - "source": "iana", - "compressible": true, - "extensions": ["psd"] - }, - "image/vnd.airzip.accelerator.azv": { - "source": "iana" - }, - "image/vnd.cns.inf2": { - "source": "iana" - }, - "image/vnd.dece.graphic": { - "source": "iana", - "extensions": ["uvi","uvvi","uvg","uvvg"] - }, - "image/vnd.djvu": { - "source": "iana", - "extensions": ["djvu","djv"] - }, - "image/vnd.dvb.subtitle": { - "source": "iana", - "extensions": ["sub"] - }, - "image/vnd.dwg": { - "source": "iana", - "extensions": ["dwg"] - }, - "image/vnd.dxf": { - "source": "iana", - "extensions": ["dxf"] - }, - "image/vnd.fastbidsheet": { - "source": "iana", - "extensions": ["fbs"] - }, - "image/vnd.fpx": { - "source": "iana", - "extensions": ["fpx"] - }, - "image/vnd.fst": { - "source": "iana", - "extensions": ["fst"] - }, - "image/vnd.fujixerox.edmics-mmr": { - "source": "iana", - "extensions": ["mmr"] - }, - "image/vnd.fujixerox.edmics-rlc": { - "source": "iana", - "extensions": ["rlc"] - }, - "image/vnd.globalgraphics.pgb": { - "source": "iana" - }, - "image/vnd.microsoft.icon": { - "source": "iana" - }, - "image/vnd.mix": { - "source": "iana" - }, - "image/vnd.ms-modi": { - "source": "iana", - "extensions": ["mdi"] - }, - "image/vnd.ms-photo": { - "source": "apache", - "extensions": ["wdp"] - }, - "image/vnd.net-fpx": { - "source": "iana", - "extensions": ["npx"] - }, - "image/vnd.radiance": { - "source": "iana" - }, - "image/vnd.sealed.png": { - "source": "iana" - }, - "image/vnd.sealedmedia.softseal.gif": { - "source": "iana" - }, - "image/vnd.sealedmedia.softseal.jpg": { - "source": "iana" - }, - "image/vnd.svf": { - "source": "iana" - }, - "image/vnd.tencent.tap": { - "source": "iana" - }, - "image/vnd.valve.source.texture": { - "source": "iana" - }, - "image/vnd.wap.wbmp": { - "source": "iana", - "extensions": ["wbmp"] - }, - "image/vnd.xiff": { - "source": "iana", - "extensions": ["xif"] - }, - "image/webp": { - "source": "apache", - "extensions": ["webp"] - }, - "image/x-3ds": { - "source": "apache", - "extensions": ["3ds"] - }, - "image/x-cmu-raster": { - "source": "apache", - "extensions": ["ras"] - }, - "image/x-cmx": { - "source": "apache", - "extensions": ["cmx"] - }, - "image/x-freehand": { - "source": "apache", - "extensions": ["fh","fhc","fh4","fh5","fh7"] - }, - "image/x-icon": { - "source": "apache", - "compressible": true, - "extensions": ["ico"] - }, - "image/x-mrsid-image": { - "source": "apache", - "extensions": ["sid"] - }, - "image/x-pcx": { - "source": "apache", - "extensions": ["pcx"] - }, - "image/x-pict": { - "source": "apache", - "extensions": ["pic","pct"] - }, - "image/x-portable-anymap": { - "source": "apache", - "extensions": ["pnm"] - }, - "image/x-portable-bitmap": { - "source": "apache", - "extensions": ["pbm"] - }, - "image/x-portable-graymap": { - "source": "apache", - "extensions": ["pgm"] - }, - "image/x-portable-pixmap": { - "source": "apache", - "extensions": ["ppm"] - }, - "image/x-rgb": { - "source": "apache", - "extensions": ["rgb"] - }, - "image/x-tga": { - "source": "apache", - "extensions": ["tga"] - }, - "image/x-xbitmap": { - "source": "apache", - "extensions": ["xbm"] - }, - "image/x-xcf": { - "compressible": false - }, - "image/x-xpixmap": { - "source": "apache", - "extensions": ["xpm"] - }, - "image/x-xwindowdump": { - "source": "apache", - "extensions": ["xwd"] - }, - "message/cpim": { - "source": "iana" - }, - "message/delivery-status": { - "source": "iana" - }, - "message/disposition-notification": { - "source": "iana" - }, - "message/external-body": { - "source": "iana" - }, - "message/feedback-report": { - "source": "iana" - }, - "message/global": { - "source": "iana" - }, - "message/global-delivery-status": { - "source": "iana" - }, - "message/global-disposition-notification": { - "source": "iana" - }, - "message/global-headers": { - "source": "iana" - }, - "message/http": { - "source": "iana", - "compressible": false - }, - "message/imdn+xml": { - "source": "iana", - "compressible": true - }, - "message/news": { - "source": "iana" - }, - "message/partial": { - "source": "iana", - "compressible": false - }, - "message/rfc822": { - "source": "iana", - "compressible": true, - "extensions": ["eml","mime"] - }, - "message/s-http": { - "source": "iana" - }, - "message/sip": { - "source": "iana" - }, - "message/sipfrag": { - "source": "iana" - }, - "message/tracking-status": { - "source": "iana" - }, - "message/vnd.si.simp": { - "source": "iana" - }, - "message/vnd.wfa.wsc": { - "source": "iana" - }, - "model/iges": { - "source": "iana", - "compressible": false, - "extensions": ["igs","iges"] - }, - "model/mesh": { - "source": "iana", - "compressible": false, - "extensions": ["msh","mesh","silo"] - }, - "model/vnd.collada+xml": { - "source": "iana", - "extensions": ["dae"] - }, - "model/vnd.dwf": { - "source": "iana", - "extensions": ["dwf"] - }, - "model/vnd.flatland.3dml": { - "source": "iana" - }, - "model/vnd.gdl": { - "source": "iana", - "extensions": ["gdl"] - }, - "model/vnd.gs-gdl": { - "source": "apache" - }, - "model/vnd.gs.gdl": { - "source": "iana" - }, - "model/vnd.gtw": { - "source": "iana", - "extensions": ["gtw"] - }, - "model/vnd.moml+xml": { - "source": "iana" - }, - "model/vnd.mts": { - "source": "iana", - "extensions": ["mts"] - }, - "model/vnd.opengex": { - "source": "iana" - }, - "model/vnd.parasolid.transmit.binary": { - "source": "iana" - }, - "model/vnd.parasolid.transmit.text": { - "source": "iana" - }, - "model/vnd.valve.source.compiled-map": { - "source": "iana" - }, - "model/vnd.vtu": { - "source": "iana", - "extensions": ["vtu"] - }, - "model/vrml": { - "source": "iana", - "compressible": false, - "extensions": ["wrl","vrml"] - }, - "model/x3d+binary": { - "source": "apache", - "compressible": false, - "extensions": ["x3db","x3dbz"] - }, - "model/x3d+fastinfoset": { - "source": "iana" - }, - "model/x3d+vrml": { - "source": "apache", - "compressible": false, - "extensions": ["x3dv","x3dvz"] - }, - "model/x3d+xml": { - "source": "iana", - "compressible": true, - "extensions": ["x3d","x3dz"] - }, - "model/x3d-vrml": { - "source": "iana" - }, - "multipart/alternative": { - "source": "iana", - "compressible": false - }, - "multipart/appledouble": { - "source": "iana" - }, - "multipart/byteranges": { - "source": "iana" - }, - "multipart/digest": { - "source": "iana" - }, - "multipart/encrypted": { - "source": "iana", - "compressible": false - }, - "multipart/form-data": { - "source": "iana", - "compressible": false - }, - "multipart/header-set": { - "source": "iana" - }, - "multipart/mixed": { - "source": "iana", - "compressible": false - }, - "multipart/parallel": { - "source": "iana" - }, - "multipart/related": { - "source": "iana", - "compressible": false - }, - "multipart/report": { - "source": "iana" - }, - "multipart/signed": { - "source": "iana", - "compressible": false - }, - "multipart/voice-message": { - "source": "iana" - }, - "multipart/x-mixed-replace": { - "source": "iana" - }, - "text/1d-interleaved-parityfec": { - "source": "iana" - }, - "text/cache-manifest": { - "source": "iana", - "compressible": true, - "extensions": ["appcache","manifest"] - }, - "text/calendar": { - "source": "iana", - "extensions": ["ics","ifb"] - }, - "text/calender": { - "compressible": true - }, - "text/cmd": { - "compressible": true - }, - "text/coffeescript": { - "extensions": ["coffee"] - }, - "text/css": { - "source": "iana", - "compressible": true, - "extensions": ["css"] - }, - "text/csv": { - "source": "iana", - "compressible": true, - "extensions": ["csv"] - }, - "text/csv-schema": { - "source": "iana" - }, - "text/directory": { - "source": "iana" - }, - "text/dns": { - "source": "iana" - }, - "text/ecmascript": { - "source": "iana" - }, - "text/encaprtp": { - "source": "iana" - }, - "text/enriched": { - "source": "iana" - }, - "text/fwdred": { - "source": "iana" - }, - "text/grammar-ref-list": { - "source": "iana" - }, - "text/hjson": { - "extensions": ["hjson"] - }, - "text/html": { - "source": "iana", - "compressible": true, - "extensions": ["html","htm"] - }, - "text/jade": { - "extensions": ["jade"] - }, - "text/javascript": { - "source": "iana", - "compressible": true - }, - "text/jcr-cnd": { - "source": "iana" - }, - "text/jsx": { - "compressible": true, - "extensions": ["jsx"] - }, - "text/less": { - "extensions": ["less"] - }, - "text/markdown": { - "source": "iana" - }, - "text/mizar": { - "source": "iana" - }, - "text/n3": { - "source": "iana", - "compressible": true, - "extensions": ["n3"] - }, - "text/parameters": { - "source": "iana" - }, - "text/parityfec": { - "source": "iana" - }, - "text/plain": { - "source": "iana", - "compressible": true, - "extensions": ["txt","text","conf","def","list","log","in","ini"] - }, - "text/provenance-notation": { - "source": "iana" - }, - "text/prs.fallenstein.rst": { - "source": "iana" - }, - "text/prs.lines.tag": { - "source": "iana", - "extensions": ["dsc"] - }, - "text/raptorfec": { - "source": "iana" - }, - "text/red": { - "source": "iana" - }, - "text/rfc822-headers": { - "source": "iana" - }, - "text/richtext": { - "source": "iana", - "compressible": true, - "extensions": ["rtx"] - }, - "text/rtf": { - "source": "iana" - }, - "text/rtp-enc-aescm128": { - "source": "iana" - }, - "text/rtploopback": { - "source": "iana" - }, - "text/rtx": { - "source": "iana" - }, - "text/sgml": { - "source": "iana", - "extensions": ["sgml","sgm"] - }, - "text/stylus": { - "extensions": ["stylus","styl"] - }, - "text/t140": { - "source": "iana" - }, - "text/tab-separated-values": { - "source": "iana", - "compressible": true, - "extensions": ["tsv"] - }, - "text/troff": { - "source": "iana", - "extensions": ["t","tr","roff","man","me","ms"] - }, - "text/turtle": { - "source": "iana", - "extensions": ["ttl"] - }, - "text/ulpfec": { - "source": "iana" - }, - "text/uri-list": { - "source": "iana", - "compressible": true, - "extensions": ["uri","uris","urls"] - }, - "text/vcard": { - "source": "iana", - "compressible": true, - "extensions": ["vcard"] - }, - "text/vnd.a": { - "source": "iana" - }, - "text/vnd.abc": { - "source": "iana" - }, - "text/vnd.curl": { - "source": "iana", - "extensions": ["curl"] - }, - "text/vnd.curl.dcurl": { - "source": "apache", - "extensions": ["dcurl"] - }, - "text/vnd.curl.mcurl": { - "source": "apache", - "extensions": ["mcurl"] - }, - "text/vnd.curl.scurl": { - "source": "apache", - "extensions": ["scurl"] - }, - "text/vnd.debian.copyright": { - "source": "iana" - }, - "text/vnd.dmclientscript": { - "source": "iana" - }, - "text/vnd.dvb.subtitle": { - "source": "iana", - "extensions": ["sub"] - }, - "text/vnd.esmertec.theme-descriptor": { - "source": "iana" - }, - "text/vnd.fly": { - "source": "iana", - "extensions": ["fly"] - }, - "text/vnd.fmi.flexstor": { - "source": "iana", - "extensions": ["flx"] - }, - "text/vnd.graphviz": { - "source": "iana", - "extensions": ["gv"] - }, - "text/vnd.in3d.3dml": { - "source": "iana", - "extensions": ["3dml"] - }, - "text/vnd.in3d.spot": { - "source": "iana", - "extensions": ["spot"] - }, - "text/vnd.iptc.newsml": { - "source": "iana" - }, - "text/vnd.iptc.nitf": { - "source": "iana" - }, - "text/vnd.latex-z": { - "source": "iana" - }, - "text/vnd.motorola.reflex": { - "source": "iana" - }, - "text/vnd.ms-mediapackage": { - "source": "iana" - }, - "text/vnd.net2phone.commcenter.command": { - "source": "iana" - }, - "text/vnd.radisys.msml-basic-layout": { - "source": "iana" - }, - "text/vnd.si.uricatalogue": { - "source": "iana" - }, - "text/vnd.sun.j2me.app-descriptor": { - "source": "iana", - "extensions": ["jad"] - }, - "text/vnd.trolltech.linguist": { - "source": "iana" - }, - "text/vnd.wap.si": { - "source": "iana" - }, - "text/vnd.wap.sl": { - "source": "iana" - }, - "text/vnd.wap.wml": { - "source": "iana", - "extensions": ["wml"] - }, - "text/vnd.wap.wmlscript": { - "source": "iana", - "extensions": ["wmls"] - }, - "text/vtt": { - "charset": "UTF-8", - "compressible": true, - "extensions": ["vtt"] - }, - "text/x-asm": { - "source": "apache", - "extensions": ["s","asm"] - }, - "text/x-c": { - "source": "apache", - "extensions": ["c","cc","cxx","cpp","h","hh","dic"] - }, - "text/x-component": { - "extensions": ["htc"] - }, - "text/x-fortran": { - "source": "apache", - "extensions": ["f","for","f77","f90"] - }, - "text/x-gwt-rpc": { - "compressible": true - }, - "text/x-handlebars-template": { - "extensions": ["hbs"] - }, - "text/x-java-source": { - "source": "apache", - "extensions": ["java"] - }, - "text/x-jquery-tmpl": { - "compressible": true - }, - "text/x-lua": { - "extensions": ["lua"] - }, - "text/x-markdown": { - "compressible": true, - "extensions": ["markdown","md","mkd"] - }, - "text/x-nfo": { - "source": "apache", - "extensions": ["nfo"] - }, - "text/x-opml": { - "source": "apache", - "extensions": ["opml"] - }, - "text/x-pascal": { - "source": "apache", - "extensions": ["p","pas"] - }, - "text/x-sass": { - "extensions": ["sass"] - }, - "text/x-scss": { - "extensions": ["scss"] - }, - "text/x-setext": { - "source": "apache", - "extensions": ["etx"] - }, - "text/x-sfv": { - "source": "apache", - "extensions": ["sfv"] - }, - "text/x-uuencode": { - "source": "apache", - "extensions": ["uu"] - }, - "text/x-vcalendar": { - "source": "apache", - "extensions": ["vcs"] - }, - "text/x-vcard": { - "source": "apache", - "extensions": ["vcf"] - }, - "text/xml": { - "source": "iana", - "compressible": true - }, - "text/xml-external-parsed-entity": { - "source": "iana" - }, - "text/yaml": { - "extensions": ["yaml","yml"] - }, - "video/1d-interleaved-parityfec": { - "source": "apache" - }, - "video/3gpp": { - "source": "apache", - "extensions": ["3gp"] - }, - "video/3gpp-tt": { - "source": "apache" - }, - "video/3gpp2": { - "source": "apache", - "extensions": ["3g2"] - }, - "video/bmpeg": { - "source": "apache" - }, - "video/bt656": { - "source": "apache" - }, - "video/celb": { - "source": "apache" - }, - "video/dv": { - "source": "apache" - }, - "video/h261": { - "source": "apache", - "extensions": ["h261"] - }, - "video/h263": { - "source": "apache", - "extensions": ["h263"] - }, - "video/h263-1998": { - "source": "apache" - }, - "video/h263-2000": { - "source": "apache" - }, - "video/h264": { - "source": "apache", - "extensions": ["h264"] - }, - "video/h264-rcdo": { - "source": "apache" - }, - "video/h264-svc": { - "source": "apache" - }, - "video/jpeg": { - "source": "apache", - "extensions": ["jpgv"] - }, - "video/jpeg2000": { - "source": "apache" - }, - "video/jpm": { - "source": "apache", - "extensions": ["jpm","jpgm"] - }, - "video/mj2": { - "source": "apache", - "extensions": ["mj2","mjp2"] - }, - "video/mp1s": { - "source": "apache" - }, - "video/mp2p": { - "source": "apache" - }, - "video/mp2t": { - "source": "apache", - "extensions": ["ts"] - }, - "video/mp4": { - "source": "apache", - "compressible": false, - "extensions": ["mp4","mp4v","mpg4"] - }, - "video/mp4v-es": { - "source": "apache" - }, - "video/mpeg": { - "source": "apache", - "compressible": false, - "extensions": ["mpeg","mpg","mpe","m1v","m2v"] - }, - "video/mpeg4-generic": { - "source": "apache" - }, - "video/mpv": { - "source": "apache" - }, - "video/nv": { - "source": "apache" - }, - "video/ogg": { - "source": "apache", - "compressible": false, - "extensions": ["ogv"] - }, - "video/parityfec": { - "source": "apache" - }, - "video/pointer": { - "source": "apache" - }, - "video/quicktime": { - "source": "apache", - "compressible": false, - "extensions": ["qt","mov"] - }, - "video/raw": { - "source": "apache" - }, - "video/rtp-enc-aescm128": { - "source": "apache" - }, - "video/rtx": { - "source": "apache" - }, - "video/smpte292m": { - "source": "apache" - }, - "video/ulpfec": { - "source": "apache" - }, - "video/vc1": { - "source": "apache" - }, - "video/vnd.cctv": { - "source": "apache" - }, - "video/vnd.dece.hd": { - "source": "apache", - "extensions": ["uvh","uvvh"] - }, - "video/vnd.dece.mobile": { - "source": "apache", - "extensions": ["uvm","uvvm"] - }, - "video/vnd.dece.mp4": { - "source": "apache" - }, - "video/vnd.dece.pd": { - "source": "apache", - "extensions": ["uvp","uvvp"] - }, - "video/vnd.dece.sd": { - "source": "apache", - "extensions": ["uvs","uvvs"] - }, - "video/vnd.dece.video": { - "source": "apache", - "extensions": ["uvv","uvvv"] - }, - "video/vnd.directv.mpeg": { - "source": "apache" - }, - "video/vnd.directv.mpeg-tts": { - "source": "apache" - }, - "video/vnd.dlna.mpeg-tts": { - "source": "apache" - }, - "video/vnd.dvb.file": { - "source": "apache", - "extensions": ["dvb"] - }, - "video/vnd.fvt": { - "source": "apache", - "extensions": ["fvt"] - }, - "video/vnd.hns.video": { - "source": "apache" - }, - "video/vnd.iptvforum.1dparityfec-1010": { - "source": "apache" - }, - "video/vnd.iptvforum.1dparityfec-2005": { - "source": "apache" - }, - "video/vnd.iptvforum.2dparityfec-1010": { - "source": "apache" - }, - "video/vnd.iptvforum.2dparityfec-2005": { - "source": "apache" - }, - "video/vnd.iptvforum.ttsavc": { - "source": "apache" - }, - "video/vnd.iptvforum.ttsmpeg2": { - "source": "apache" - }, - "video/vnd.motorola.video": { - "source": "apache" - }, - "video/vnd.motorola.videop": { - "source": "apache" - }, - "video/vnd.mpegurl": { - "source": "apache", - "extensions": ["mxu","m4u"] - }, - "video/vnd.ms-playready.media.pyv": { - "source": "apache", - "extensions": ["pyv"] - }, - "video/vnd.nokia.interleaved-multimedia": { - "source": "apache" - }, - "video/vnd.nokia.videovoip": { - "source": "apache" - }, - "video/vnd.objectvideo": { - "source": "apache" - }, - "video/vnd.sealed.mpeg1": { - "source": "apache" - }, - "video/vnd.sealed.mpeg4": { - "source": "apache" - }, - "video/vnd.sealed.swf": { - "source": "apache" - }, - "video/vnd.sealedmedia.softseal.mov": { - "source": "apache" - }, - "video/vnd.uvvu.mp4": { - "source": "apache", - "extensions": ["uvu","uvvu"] - }, - "video/vnd.vivo": { - "source": "apache", - "extensions": ["viv"] - }, - "video/webm": { - "source": "apache", - "compressible": false, - "extensions": ["webm"] - }, - "video/x-f4v": { - "source": "apache", - "extensions": ["f4v"] - }, - "video/x-fli": { - "source": "apache", - "extensions": ["fli"] - }, - "video/x-flv": { - "source": "apache", - "compressible": false, - "extensions": ["flv"] - }, - "video/x-m4v": { - "source": "apache", - "extensions": ["m4v"] - }, - "video/x-matroska": { - "source": "apache", - "compressible": false, - "extensions": ["mkv","mk3d","mks"] - }, - "video/x-mng": { - "source": "apache", - "extensions": ["mng"] - }, - "video/x-ms-asf": { - "source": "apache", - "extensions": ["asf","asx"] - }, - "video/x-ms-vob": { - "source": "apache", - "extensions": ["vob"] - }, - "video/x-ms-wm": { - "source": "apache", - "extensions": ["wm"] - }, - "video/x-ms-wmv": { - "source": "apache", - "compressible": false, - "extensions": ["wmv"] - }, - "video/x-ms-wmx": { - "source": "apache", - "extensions": ["wmx"] - }, - "video/x-ms-wvx": { - "source": "apache", - "extensions": ["wvx"] - }, - "video/x-msvideo": { - "source": "apache", - "extensions": ["avi"] - }, - "video/x-sgi-movie": { - "source": "apache", - "extensions": ["movie"] - }, - "video/x-smv": { - "source": "apache", - "extensions": ["smv"] - }, - "x-conference/x-cooltalk": { - "source": "apache", - "extensions": ["ice"] - }, - "x-shader/x-fragment": { - "compressible": true - }, - "x-shader/x-vertex": { - "compressible": true - } -} diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/mime-types/node_modules/mime-db/index.js b/update_nation/node_modules/couchapp/node_modules/request/node_modules/mime-types/node_modules/mime-db/index.js deleted file mode 100644 index 551031f69..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/mime-types/node_modules/mime-db/index.js +++ /dev/null @@ -1,11 +0,0 @@ -/*! - * mime-db - * Copyright(c) 2014 Jonathan Ong - * MIT Licensed - */ - -/** - * Module exports. - */ - -module.exports = require('./db.json') diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json b/update_nation/node_modules/couchapp/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json deleted file mode 100644 index 3bd3ecabb..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "mime-db", - "description": "Media Type Database", - "version": "1.8.0", - "contributors": [ - { - "name": "Douglas Christopher Wilson", - "email": "doug@somethingdoug.com" - }, - { - "name": "Jonathan Ong", - "email": "me@jongleberry.com", - "url": "http://jongleberry.com" - }, - { - "name": "Robert Kieffer", - "email": "robert@broofa.com", - "url": "http://github.com/broofa" - } - ], - "license": "MIT", - "keywords": [ - "mime", - "db", - "type", - "types", - "database", - "charset", - "charsets" - ], - "repository": { - "type": "git", - "url": "git://github.com/jshttp/mime-db" - }, - "devDependencies": { - "bluebird": "~2.9.14", - "co": "~4.4.0", - "cogent": "1", - "csv-parse": "0.0.9", - "gnode": "0.1.1", - "istanbul": "0.3.7", - "mocha": "~1.21.4", - "raw-body": "~1.3.3", - "stream-to-array": "2" - }, - "files": [ - "HISTORY.md", - "LICENSE", - "README.md", - "db.json", - "index.js" - ], - "engines": { - "node": ">= 0.6" - }, - "scripts": { - "build": "node scripts/build", - "fetch": "gnode scripts/extensions && gnode scripts/types", - "test": "mocha --reporter spec --bail --check-leaks test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/", - "update": "npm run fetch && npm run build" - }, - "readme": "# mime-db\n\n[![NPM Version][npm-version-image]][npm-url]\n[![NPM Downloads][npm-downloads-image]][npm-url]\n[![Node.js Version][node-image]][node-url]\n[![Build Status][travis-image]][travis-url]\n[![Coverage Status][coveralls-image]][coveralls-url]\n\nThis is a database of all mime types.\nIt consists of a single, public JSON file and does not include any logic,\nallowing it to remain as un-opinionated as possible with an API.\nIt aggregates data from the following sources:\n\n- http://www.iana.org/assignments/media-types/media-types.xhtml\n- http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types\n\n## Installation\n\n```bash\nnpm install mime-db\n```\n\nIf you're crazy enough to use this in the browser,\nyou can just grab the JSON file:\n\n```\nhttps://cdn.rawgit.com/jshttp/mime-db/master/db.json\n```\n\n## Usage\n\n```js\nvar db = require('mime-db');\n\n// grab data on .js files\nvar data = db['application/javascript'];\n```\n\n## Data Structure\n\nThe JSON file is a map lookup for lowercased mime types.\nEach mime type has the following properties:\n\n- `.source` - where the mime type is defined.\n If not set, it's probably a custom media type.\n - `apache` - [Apache common media types](http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types)\n - `iana` - [IANA-defined media types](http://www.iana.org/assignments/media-types/media-types.xhtml)\n- `.extensions[]` - known extensions associated with this mime type.\n- `.compressible` - whether a file of this type is can be gzipped.\n- `.charset` - the default charset associated with this type, if any.\n\nIf unknown, every property could be `undefined`.\n\n## Contributing\n\nTo edit the database, only make PRs against `src/custom.json` or\n`src/custom-suffix.json`.\n\nTo update the build, run `npm run update`.\n\n## Adding Custom Media Types\n\nThe best way to get new media types included in this library is to register\nthem with the IANA. The community registration procedure is outlined in\n[RFC 6838 section 5](http://tools.ietf.org/html/rfc6838#section-5). Types\nregistered with the IANA are automatically pulled into this library.\n\n[npm-version-image]: https://img.shields.io/npm/v/mime-db.svg?style=flat\n[npm-downloads-image]: https://img.shields.io/npm/dm/mime-db.svg?style=flat\n[npm-url]: https://npmjs.org/package/mime-db\n[travis-image]: https://img.shields.io/travis/jshttp/mime-db.svg?style=flat\n[travis-url]: https://travis-ci.org/jshttp/mime-db\n[coveralls-image]: https://img.shields.io/coveralls/jshttp/mime-db.svg?style=flat\n[coveralls-url]: https://coveralls.io/r/jshttp/mime-db?branch=master\n[node-image]: https://img.shields.io/node/v/mime-db.svg?style=flat\n[node-url]: http://nodejs.org/download/\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/jshttp/mime-db/issues" - }, - "homepage": "https://github.com/jshttp/mime-db", - "_id": "mime-db@1.8.0", - "_from": "mime-db@~1.8.0" -} diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/mime-types/package.json b/update_nation/node_modules/couchapp/node_modules/request/node_modules/mime-types/package.json deleted file mode 100644 index 0fb5cbdbb..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/mime-types/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "mime-types", - "description": "The ultimate javascript content-type utility.", - "version": "2.0.10", - "contributors": [ - { - "name": "Douglas Christopher Wilson", - "email": "doug@somethingdoug.com" - }, - { - "name": "Jeremiah Senkpiel", - "email": "fishrock123@rocketmail.com", - "url": "https://searchbeam.jit.su" - }, - { - "name": "Jonathan Ong", - "email": "me@jongleberry.com", - "url": "http://jongleberry.com" - } - ], - "license": "MIT", - "keywords": [ - "mime", - "types" - ], - "repository": { - "type": "git", - "url": "git://github.com/jshttp/mime-types" - }, - "dependencies": { - "mime-db": "~1.8.0" - }, - "devDependencies": { - "istanbul": "0.3.7", - "mocha": "~1.21.5" - }, - "files": [ - "HISTORY.md", - "LICENSE", - "index.js" - ], - "engines": { - "node": ">= 0.6" - }, - "scripts": { - "test": "mocha --reporter spec test/test.js", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/test.js", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot test/test.js" - }, - "readme": "# mime-types\n\n[![NPM Version][npm-image]][npm-url]\n[![NPM Downloads][downloads-image]][downloads-url]\n[![Node.js Version][node-version-image]][node-version-url]\n[![Build Status][travis-image]][travis-url]\n[![Test Coverage][coveralls-image]][coveralls-url]\n\nThe ultimate javascript content-type utility.\n\nSimilar to [node-mime](https://github.com/broofa/node-mime), except:\n\n- __No fallbacks.__ Instead of naively returning the first available type, `mime-types` simply returns `false`,\n so do `var type = mime.lookup('unrecognized') || 'application/octet-stream'`.\n- No `new Mime()` business, so you could do `var lookup = require('mime-types').lookup`.\n- Additional mime types are added such as jade and stylus via [mime-db](https://github.com/jshttp/mime-db)\n- No `.define()` functionality\n\nOtherwise, the API is compatible.\n\n## Install\n\n```sh\n$ npm install mime-types\n```\n\n## Adding Types\n\nAll mime types are based on [mime-db](https://github.com/jshttp/mime-db),\nso open a PR there if you'd like to add mime types.\n\n## API\n\n```js\nvar mime = require('mime-types')\n```\n\nAll functions return `false` if input is invalid or not found.\n\n### mime.lookup(path)\n\nLookup the content-type associated with a file.\n\n```js\nmime.lookup('json') // 'application/json'\nmime.lookup('.md') // 'text/x-markdown'\nmime.lookup('file.html') // 'text/html'\nmime.lookup('folder/file.js') // 'application/javascript'\n\nmime.lookup('cats') // false\n```\n\n### mime.contentType(type)\n\nCreate a full content-type header given a content-type or extension.\n\n```js\nmime.contentType('markdown') // 'text/x-markdown; charset=utf-8'\nmime.contentType('file.json') // 'application/json; charset=utf-8'\n\n// from a full path\nmime.contentType(path.extname('/path/to/file.json')) // 'application/json; charset=utf-8'\n```\n\n### mime.extension(type)\n\nGet the default extension for a content-type.\n\n```js\nmime.extension('application/octet-stream') // 'bin'\n```\n\n### mime.charset(type)\n\nLookup the implied default charset of a content-type.\n\n```js\nmime.charset('text/x-markdown') // 'UTF-8'\n```\n\n### var type = mime.types[extension]\n\nA map of content-types by extension.\n\n### [extensions...] = mime.extensions[type]\n\nA map of extensions by content-type.\n\n## License\n\n[MIT](LICENSE)\n\n[npm-image]: https://img.shields.io/npm/v/mime-types.svg?style=flat\n[npm-url]: https://npmjs.org/package/mime-types\n[node-version-image]: https://img.shields.io/badge/node.js-%3E%3D_0.6-brightgreen.svg?style=flat\n[node-version-url]: http://nodejs.org/download/\n[travis-image]: https://img.shields.io/travis/jshttp/mime-types.svg?style=flat\n[travis-url]: https://travis-ci.org/jshttp/mime-types\n[coveralls-image]: https://img.shields.io/coveralls/jshttp/mime-types.svg?style=flat\n[coveralls-url]: https://coveralls.io/r/jshttp/mime-types\n[downloads-image]: https://img.shields.io/npm/dm/mime-types.svg?style=flat\n[downloads-url]: https://npmjs.org/package/mime-types\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/jshttp/mime-types/issues" - }, - "homepage": "https://github.com/jshttp/mime-types", - "_id": "mime-types@2.0.10", - "_from": "mime-types@~2.0.1" -} diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/tough-cookie/node_modules/punycode/LICENSE-MIT.txt b/update_nation/node_modules/couchapp/node_modules/request/node_modules/tough-cookie/node_modules/punycode/LICENSE-MIT.txt deleted file mode 100644 index a41e0a7ef..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/tough-cookie/node_modules/punycode/LICENSE-MIT.txt +++ /dev/null @@ -1,20 +0,0 @@ -Copyright Mathias Bynens - -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/update_nation/node_modules/couchapp/node_modules/request/node_modules/tough-cookie/node_modules/punycode/README.md b/update_nation/node_modules/couchapp/node_modules/request/node_modules/tough-cookie/node_modules/punycode/README.md deleted file mode 100644 index 831e6379b..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/tough-cookie/node_modules/punycode/README.md +++ /dev/null @@ -1,176 +0,0 @@ -# Punycode.js [![Build status](https://travis-ci.org/bestiejs/punycode.js.svg?branch=master)](https://travis-ci.org/bestiejs/punycode.js) [![Code coverage status](http://img.shields.io/coveralls/bestiejs/punycode.js/master.svg)](https://coveralls.io/r/bestiejs/punycode.js) [![Dependency status](https://gemnasium.com/bestiejs/punycode.js.svg)](https://gemnasium.com/bestiejs/punycode.js) - -A robust Punycode converter that fully complies to [RFC 3492](http://tools.ietf.org/html/rfc3492) and [RFC 5891](http://tools.ietf.org/html/rfc5891), and works on nearly all JavaScript platforms. - -This JavaScript library is the result of comparing, optimizing and documenting different open-source implementations of the Punycode algorithm: - -* [The C example code from RFC 3492](http://tools.ietf.org/html/rfc3492#appendix-C) -* [`punycode.c` by _Markus W. Scherer_ (IBM)](http://opensource.apple.com/source/ICU/ICU-400.42/icuSources/common/punycode.c) -* [`punycode.c` by _Ben Noordhuis_](https://github.com/bnoordhuis/punycode/blob/master/punycode.c) -* [JavaScript implementation by _some_](http://stackoverflow.com/questions/183485/can-anyone-recommend-a-good-free-javascript-for-punycode-to-unicode-conversion/301287#301287) -* [`punycode.js` by _Ben Noordhuis_](https://github.com/joyent/node/blob/426298c8c1c0d5b5224ac3658c41e7c2a3fe9377/lib/punycode.js) (note: [not fully compliant](https://github.com/joyent/node/issues/2072)) - -This project is [bundled](https://github.com/joyent/node/blob/master/lib/punycode.js) with [Node.js v0.6.2+](https://github.com/joyent/node/compare/975f1930b1...61e796decc). - -## Installation - -Via [npm](http://npmjs.org/) (only required for Node.js releases older than v0.6.2): - -```bash -npm install punycode -``` - -Via [Bower](http://bower.io/): - -```bash -bower install punycode -``` - -Via [Component](https://github.com/component/component): - -```bash -component install bestiejs/punycode.js -``` - -In a browser: - -```html - -``` - -In [Narwhal](http://narwhaljs.org/), [Node.js](http://nodejs.org/), and [RingoJS](http://ringojs.org/): - -```js -var punycode = require('punycode'); -``` - -In [Rhino](http://www.mozilla.org/rhino/): - -```js -load('punycode.js'); -``` - -Using an AMD loader like [RequireJS](http://requirejs.org/): - -```js -require( - { - 'paths': { - 'punycode': 'path/to/punycode' - } - }, - ['punycode'], - function(punycode) { - console.log(punycode); - } -); -``` - -## API - -### `punycode.decode(string)` - -Converts a Punycode string of ASCII symbols to a string of Unicode symbols. - -```js -// decode domain name parts -punycode.decode('maana-pta'); // 'mañana' -punycode.decode('--dqo34k'); // '☃-⌘' -``` - -### `punycode.encode(string)` - -Converts a string of Unicode symbols to a Punycode string of ASCII symbols. - -```js -// encode domain name parts -punycode.encode('mañana'); // 'maana-pta' -punycode.encode('☃-⌘'); // '--dqo34k' -``` - -### `punycode.toUnicode(input)` - -Converts a Punycode string representing a domain name or an email address to Unicode. Only the Punycoded parts of the input will be converted, i.e. it doesn’t matter if you call it on a string that has already been converted to Unicode. - -```js -// decode domain names -punycode.toUnicode('xn--maana-pta.com'); -// → 'mañana.com' -punycode.toUnicode('xn----dqo34k.com'); -// → '☃-⌘.com' - -// decode email addresses -punycode.toUnicode('джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq'); -// → 'джумла@джpумлатест.bрфa' -``` - -### `punycode.toASCII(input)` - -Converts a Unicode string representing a domain name or an email address to Punycode. Only the non-ASCII parts of the input will be converted, i.e. it doesn’t matter if you call it with a domain that's already in ASCII. - -```js -// encode domain names -punycode.toASCII('mañana.com'); -// → 'xn--maana-pta.com' -punycode.toASCII('☃-⌘.com'); -// → 'xn----dqo34k.com' - -// encode email addresses -punycode.toASCII('джумла@джpумлатест.bрфa'); -// → 'джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq' -``` - -### `punycode.ucs2` - -#### `punycode.ucs2.decode(string)` - -Creates an array containing the numeric code point values of each Unicode symbol in the string. While [JavaScript uses UCS-2 internally](https://mathiasbynens.be/notes/javascript-encoding), this function will convert a pair of surrogate halves (each of which UCS-2 exposes as separate characters) into a single code point, matching UTF-16. - -```js -punycode.ucs2.decode('abc'); -// → [0x61, 0x62, 0x63] -// surrogate pair for U+1D306 TETRAGRAM FOR CENTRE: -punycode.ucs2.decode('\uD834\uDF06'); -// → [0x1D306] -``` - -#### `punycode.ucs2.encode(codePoints)` - -Creates a string based on an array of numeric code point values. - -```js -punycode.ucs2.encode([0x61, 0x62, 0x63]); -// → 'abc' -punycode.ucs2.encode([0x1D306]); -// → '\uD834\uDF06' -``` - -### `punycode.version` - -A string representing the current Punycode.js version number. - -## Unit tests & code coverage - -After cloning this repository, run `npm install --dev` to install the dependencies needed for Punycode.js development and testing. You may want to install Istanbul _globally_ using `npm install istanbul -g`. - -Once that’s done, you can run the unit tests in Node using `npm test` or `node tests/tests.js`. To run the tests in Rhino, Ringo, Narwhal, PhantomJS, and web browsers as well, use `grunt test`. - -To generate the code coverage report, use `grunt cover`. - -Feel free to fork if you see possible improvements! - -## Author - -| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | -|---| -| [Mathias Bynens](https://mathiasbynens.be/) | - -## Contributors - -| [![twitter/jdalton](https://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") | -|---| -| [John-David Dalton](http://allyoucanleet.com/) | - -## License - -Punycode.js is available under the [MIT](https://mths.be/mit) license. diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/tough-cookie/node_modules/punycode/package.json b/update_nation/node_modules/couchapp/node_modules/request/node_modules/tough-cookie/node_modules/punycode/package.json deleted file mode 100644 index acee7eba3..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/tough-cookie/node_modules/punycode/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "name": "punycode", - "version": "1.3.2", - "description": "A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.", - "homepage": "https://mths.be/punycode", - "main": "punycode.js", - "keywords": [ - "punycode", - "unicode", - "idn", - "idna", - "dns", - "url", - "domain" - ], - "license": "MIT", - "author": { - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - }, - "contributors": [ - { - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - }, - { - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - } - ], - "repository": { - "type": "git", - "url": "https://github.com/bestiejs/punycode.js.git" - }, - "bugs": { - "url": "https://github.com/bestiejs/punycode.js/issues" - }, - "files": [ - "LICENSE-MIT.txt", - "punycode.js" - ], - "scripts": { - "test": "node tests/tests.js" - }, - "devDependencies": { - "coveralls": "^2.10.1", - "grunt": "^0.4.5", - "grunt-contrib-uglify": "^0.5.0", - "grunt-shell": "^0.7.0", - "istanbul": "^0.2.13", - "qunit-extras": "^1.2.0", - "qunitjs": "~1.11.0", - "requirejs": "^2.1.14" - }, - "readme": "# Punycode.js [![Build status](https://travis-ci.org/bestiejs/punycode.js.svg?branch=master)](https://travis-ci.org/bestiejs/punycode.js) [![Code coverage status](http://img.shields.io/coveralls/bestiejs/punycode.js/master.svg)](https://coveralls.io/r/bestiejs/punycode.js) [![Dependency status](https://gemnasium.com/bestiejs/punycode.js.svg)](https://gemnasium.com/bestiejs/punycode.js)\n\nA robust Punycode converter that fully complies to [RFC 3492](http://tools.ietf.org/html/rfc3492) and [RFC 5891](http://tools.ietf.org/html/rfc5891), and works on nearly all JavaScript platforms.\n\nThis JavaScript library is the result of comparing, optimizing and documenting different open-source implementations of the Punycode algorithm:\n\n* [The C example code from RFC 3492](http://tools.ietf.org/html/rfc3492#appendix-C)\n* [`punycode.c` by _Markus W. Scherer_ (IBM)](http://opensource.apple.com/source/ICU/ICU-400.42/icuSources/common/punycode.c)\n* [`punycode.c` by _Ben Noordhuis_](https://github.com/bnoordhuis/punycode/blob/master/punycode.c)\n* [JavaScript implementation by _some_](http://stackoverflow.com/questions/183485/can-anyone-recommend-a-good-free-javascript-for-punycode-to-unicode-conversion/301287#301287)\n* [`punycode.js` by _Ben Noordhuis_](https://github.com/joyent/node/blob/426298c8c1c0d5b5224ac3658c41e7c2a3fe9377/lib/punycode.js) (note: [not fully compliant](https://github.com/joyent/node/issues/2072))\n\nThis project is [bundled](https://github.com/joyent/node/blob/master/lib/punycode.js) with [Node.js v0.6.2+](https://github.com/joyent/node/compare/975f1930b1...61e796decc).\n\n## Installation\n\nVia [npm](http://npmjs.org/) (only required for Node.js releases older than v0.6.2):\n\n```bash\nnpm install punycode\n```\n\nVia [Bower](http://bower.io/):\n\n```bash\nbower install punycode\n```\n\nVia [Component](https://github.com/component/component):\n\n```bash\ncomponent install bestiejs/punycode.js\n```\n\nIn a browser:\n\n```html\n\n```\n\nIn [Narwhal](http://narwhaljs.org/), [Node.js](http://nodejs.org/), and [RingoJS](http://ringojs.org/):\n\n```js\nvar punycode = require('punycode');\n```\n\nIn [Rhino](http://www.mozilla.org/rhino/):\n\n```js\nload('punycode.js');\n```\n\nUsing an AMD loader like [RequireJS](http://requirejs.org/):\n\n```js\nrequire(\n {\n 'paths': {\n 'punycode': 'path/to/punycode'\n }\n },\n ['punycode'],\n function(punycode) {\n console.log(punycode);\n }\n);\n```\n\n## API\n\n### `punycode.decode(string)`\n\nConverts a Punycode string of ASCII symbols to a string of Unicode symbols.\n\n```js\n// decode domain name parts\npunycode.decode('maana-pta'); // 'mañana'\npunycode.decode('--dqo34k'); // '☃-⌘'\n```\n\n### `punycode.encode(string)`\n\nConverts a string of Unicode symbols to a Punycode string of ASCII symbols.\n\n```js\n// encode domain name parts\npunycode.encode('mañana'); // 'maana-pta'\npunycode.encode('☃-⌘'); // '--dqo34k'\n```\n\n### `punycode.toUnicode(input)`\n\nConverts a Punycode string representing a domain name or an email address to Unicode. Only the Punycoded parts of the input will be converted, i.e. it doesn’t matter if you call it on a string that has already been converted to Unicode.\n\n```js\n// decode domain names\npunycode.toUnicode('xn--maana-pta.com');\n// → 'mañana.com'\npunycode.toUnicode('xn----dqo34k.com');\n// → '☃-⌘.com'\n\n// decode email addresses\npunycode.toUnicode('джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq');\n// → 'джумла@джpумлатест.bрфa'\n```\n\n### `punycode.toASCII(input)`\n\nConverts a Unicode string representing a domain name or an email address to Punycode. Only the non-ASCII parts of the input will be converted, i.e. it doesn’t matter if you call it with a domain that's already in ASCII.\n\n```js\n// encode domain names\npunycode.toASCII('mañana.com');\n// → 'xn--maana-pta.com'\npunycode.toASCII('☃-⌘.com');\n// → 'xn----dqo34k.com'\n\n// encode email addresses\npunycode.toASCII('джумла@джpумлатест.bрфa');\n// → 'джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq'\n```\n\n### `punycode.ucs2`\n\n#### `punycode.ucs2.decode(string)`\n\nCreates an array containing the numeric code point values of each Unicode symbol in the string. While [JavaScript uses UCS-2 internally](https://mathiasbynens.be/notes/javascript-encoding), this function will convert a pair of surrogate halves (each of which UCS-2 exposes as separate characters) into a single code point, matching UTF-16.\n\n```js\npunycode.ucs2.decode('abc');\n// → [0x61, 0x62, 0x63]\n// surrogate pair for U+1D306 TETRAGRAM FOR CENTRE:\npunycode.ucs2.decode('\\uD834\\uDF06');\n// → [0x1D306]\n```\n\n#### `punycode.ucs2.encode(codePoints)`\n\nCreates a string based on an array of numeric code point values.\n\n```js\npunycode.ucs2.encode([0x61, 0x62, 0x63]);\n// → 'abc'\npunycode.ucs2.encode([0x1D306]);\n// → '\\uD834\\uDF06'\n```\n\n### `punycode.version`\n\nA string representing the current Punycode.js version number.\n\n## Unit tests & code coverage\n\nAfter cloning this repository, run `npm install --dev` to install the dependencies needed for Punycode.js development and testing. You may want to install Istanbul _globally_ using `npm install istanbul -g`.\n\nOnce that’s done, you can run the unit tests in Node using `npm test` or `node tests/tests.js`. To run the tests in Rhino, Ringo, Narwhal, PhantomJS, and web browsers as well, use `grunt test`.\n\nTo generate the code coverage report, use `grunt cover`.\n\nFeel free to fork if you see possible improvements!\n\n## Author\n\n| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias \"Follow @mathias on Twitter\") |\n|---|\n| [Mathias Bynens](https://mathiasbynens.be/) |\n\n## Contributors\n\n| [![twitter/jdalton](https://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton \"Follow @jdalton on Twitter\") |\n|---|\n| [John-David Dalton](http://allyoucanleet.com/) |\n\n## License\n\nPunycode.js is available under the [MIT](https://mths.be/mit) license.\n", - "readmeFilename": "README.md", - "_id": "punycode@1.3.2", - "_from": "punycode@>=0.2.0" -} diff --git a/update_nation/node_modules/couchapp/node_modules/request/node_modules/tough-cookie/node_modules/punycode/punycode.js b/update_nation/node_modules/couchapp/node_modules/request/node_modules/tough-cookie/node_modules/punycode/punycode.js deleted file mode 100644 index ac6859738..000000000 --- a/update_nation/node_modules/couchapp/node_modules/request/node_modules/tough-cookie/node_modules/punycode/punycode.js +++ /dev/null @@ -1,530 +0,0 @@ -/*! https://mths.be/punycode v1.3.2 by @mathias */ -;(function(root) { - - /** Detect free variables */ - var freeExports = typeof exports == 'object' && exports && - !exports.nodeType && exports; - var freeModule = typeof module == 'object' && module && - !module.nodeType && module; - var freeGlobal = typeof global == 'object' && global; - if ( - freeGlobal.global === freeGlobal || - freeGlobal.window === freeGlobal || - freeGlobal.self === freeGlobal - ) { - root = freeGlobal; - } - - /** - * The `punycode` object. - * @name punycode - * @type Object - */ - var punycode, - - /** Highest positive signed 32-bit float value */ - maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1 - - /** Bootstring parameters */ - base = 36, - tMin = 1, - tMax = 26, - skew = 38, - damp = 700, - initialBias = 72, - initialN = 128, // 0x80 - delimiter = '-', // '\x2D' - - /** Regular expressions */ - regexPunycode = /^xn--/, - regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars - regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators - - /** Error messages */ - errors = { - 'overflow': 'Overflow: input needs wider integers to process', - 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', - 'invalid-input': 'Invalid input' - }, - - /** Convenience shortcuts */ - baseMinusTMin = base - tMin, - floor = Math.floor, - stringFromCharCode = String.fromCharCode, - - /** Temporary variable */ - key; - - /*--------------------------------------------------------------------------*/ - - /** - * A generic error utility function. - * @private - * @param {String} type The error type. - * @returns {Error} Throws a `RangeError` with the applicable error message. - */ - function error(type) { - throw RangeError(errors[type]); - } - - /** - * A generic `Array#map` utility function. - * @private - * @param {Array} array The array to iterate over. - * @param {Function} callback The function that gets called for every array - * item. - * @returns {Array} A new array of values returned by the callback function. - */ - function map(array, fn) { - var length = array.length; - var result = []; - while (length--) { - result[length] = fn(array[length]); - } - return result; - } - - /** - * A simple `Array#map`-like wrapper to work with domain name strings or email - * addresses. - * @private - * @param {String} domain The domain name or email address. - * @param {Function} callback The function that gets called for every - * character. - * @returns {Array} A new string of characters returned by the callback - * function. - */ - function mapDomain(string, fn) { - var parts = string.split('@'); - var result = ''; - if (parts.length > 1) { - // In email addresses, only the domain name should be punycoded. Leave - // the local part (i.e. everything up to `@`) intact. - result = parts[0] + '@'; - string = parts[1]; - } - // Avoid `split(regex)` for IE8 compatibility. See #17. - string = string.replace(regexSeparators, '\x2E'); - var labels = string.split('.'); - var encoded = map(labels, fn).join('.'); - return result + encoded; - } - - /** - * Creates an array containing the numeric code points of each Unicode - * character in the string. While JavaScript uses UCS-2 internally, - * this function will convert a pair of surrogate halves (each of which - * UCS-2 exposes as separate characters) into a single code point, - * matching UTF-16. - * @see `punycode.ucs2.encode` - * @see - * @memberOf punycode.ucs2 - * @name decode - * @param {String} string The Unicode input string (UCS-2). - * @returns {Array} The new array of code points. - */ - function ucs2decode(string) { - var output = [], - counter = 0, - length = string.length, - value, - extra; - while (counter < length) { - value = string.charCodeAt(counter++); - if (value >= 0xD800 && value <= 0xDBFF && counter < length) { - // high surrogate, and there is a next character - extra = string.charCodeAt(counter++); - if ((extra & 0xFC00) == 0xDC00) { // low surrogate - output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); - } else { - // unmatched surrogate; only append this code unit, in case the next - // code unit is the high surrogate of a surrogate pair - output.push(value); - counter--; - } - } else { - output.push(value); - } - } - return output; - } - - /** - * Creates a string based on an array of numeric code points. - * @see `punycode.ucs2.decode` - * @memberOf punycode.ucs2 - * @name encode - * @param {Array} codePoints The array of numeric code points. - * @returns {String} The new Unicode string (UCS-2). - */ - function ucs2encode(array) { - return map(array, function(value) { - var output = ''; - if (value > 0xFFFF) { - value -= 0x10000; - output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); - value = 0xDC00 | value & 0x3FF; - } - output += stringFromCharCode(value); - return output; - }).join(''); - } - - /** - * Converts a basic code point into a digit/integer. - * @see `digitToBasic()` - * @private - * @param {Number} codePoint The basic numeric code point value. - * @returns {Number} The numeric value of a basic code point (for use in - * representing integers) in the range `0` to `base - 1`, or `base` if - * the code point does not represent a value. - */ - function basicToDigit(codePoint) { - if (codePoint - 48 < 10) { - return codePoint - 22; - } - if (codePoint - 65 < 26) { - return codePoint - 65; - } - if (codePoint - 97 < 26) { - return codePoint - 97; - } - return base; - } - - /** - * Converts a digit/integer into a basic code point. - * @see `basicToDigit()` - * @private - * @param {Number} digit The numeric value of a basic code point. - * @returns {Number} The basic code point whose value (when used for - * representing integers) is `digit`, which needs to be in the range - * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is - * used; else, the lowercase form is used. The behavior is undefined - * if `flag` is non-zero and `digit` has no uppercase form. - */ - function digitToBasic(digit, flag) { - // 0..25 map to ASCII a..z or A..Z - // 26..35 map to ASCII 0..9 - return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); - } - - /** - * Bias adaptation function as per section 3.4 of RFC 3492. - * http://tools.ietf.org/html/rfc3492#section-3.4 - * @private - */ - function adapt(delta, numPoints, firstTime) { - var k = 0; - delta = firstTime ? floor(delta / damp) : delta >> 1; - delta += floor(delta / numPoints); - for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { - delta = floor(delta / baseMinusTMin); - } - return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); - } - - /** - * Converts a Punycode string of ASCII-only symbols to a string of Unicode - * symbols. - * @memberOf punycode - * @param {String} input The Punycode string of ASCII-only symbols. - * @returns {String} The resulting string of Unicode symbols. - */ - function decode(input) { - // Don't use UCS-2 - var output = [], - inputLength = input.length, - out, - i = 0, - n = initialN, - bias = initialBias, - basic, - j, - index, - oldi, - w, - k, - digit, - t, - /** Cached calculation results */ - baseMinusT; - - // Handle the basic code points: let `basic` be the number of input code - // points before the last delimiter, or `0` if there is none, then copy - // the first basic code points to the output. - - basic = input.lastIndexOf(delimiter); - if (basic < 0) { - basic = 0; - } - - for (j = 0; j < basic; ++j) { - // if it's not a basic code point - if (input.charCodeAt(j) >= 0x80) { - error('not-basic'); - } - output.push(input.charCodeAt(j)); - } - - // Main decoding loop: start just after the last delimiter if any basic code - // points were copied; start at the beginning otherwise. - - for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { - - // `index` is the index of the next character to be consumed. - // Decode a generalized variable-length integer into `delta`, - // which gets added to `i`. The overflow checking is easier - // if we increase `i` as we go, then subtract off its starting - // value at the end to obtain `delta`. - for (oldi = i, w = 1, k = base; /* no condition */; k += base) { - - if (index >= inputLength) { - error('invalid-input'); - } - - digit = basicToDigit(input.charCodeAt(index++)); - - if (digit >= base || digit > floor((maxInt - i) / w)) { - error('overflow'); - } - - i += digit * w; - t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); - - if (digit < t) { - break; - } - - baseMinusT = base - t; - if (w > floor(maxInt / baseMinusT)) { - error('overflow'); - } - - w *= baseMinusT; - - } - - out = output.length + 1; - bias = adapt(i - oldi, out, oldi == 0); - - // `i` was supposed to wrap around from `out` to `0`, - // incrementing `n` each time, so we'll fix that now: - if (floor(i / out) > maxInt - n) { - error('overflow'); - } - - n += floor(i / out); - i %= out; - - // Insert `n` at position `i` of the output - output.splice(i++, 0, n); - - } - - return ucs2encode(output); - } - - /** - * Converts a string of Unicode symbols (e.g. a domain name label) to a - * Punycode string of ASCII-only symbols. - * @memberOf punycode - * @param {String} input The string of Unicode symbols. - * @returns {String} The resulting Punycode string of ASCII-only symbols. - */ - function encode(input) { - var n, - delta, - handledCPCount, - basicLength, - bias, - j, - m, - q, - k, - t, - currentValue, - output = [], - /** `inputLength` will hold the number of code points in `input`. */ - inputLength, - /** Cached calculation results */ - handledCPCountPlusOne, - baseMinusT, - qMinusT; - - // Convert the input in UCS-2 to Unicode - input = ucs2decode(input); - - // Cache the length - inputLength = input.length; - - // Initialize the state - n = initialN; - delta = 0; - bias = initialBias; - - // Handle the basic code points - for (j = 0; j < inputLength; ++j) { - currentValue = input[j]; - if (currentValue < 0x80) { - output.push(stringFromCharCode(currentValue)); - } - } - - handledCPCount = basicLength = output.length; - - // `handledCPCount` is the number of code points that have been handled; - // `basicLength` is the number of basic code points. - - // Finish the basic string - if it is not empty - with a delimiter - if (basicLength) { - output.push(delimiter); - } - - // Main encoding loop: - while (handledCPCount < inputLength) { - - // All non-basic code points < n have been handled already. Find the next - // larger one: - for (m = maxInt, j = 0; j < inputLength; ++j) { - currentValue = input[j]; - if (currentValue >= n && currentValue < m) { - m = currentValue; - } - } - - // Increase `delta` enough to advance the decoder's state to , - // but guard against overflow - handledCPCountPlusOne = handledCPCount + 1; - if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { - error('overflow'); - } - - delta += (m - n) * handledCPCountPlusOne; - n = m; - - for (j = 0; j < inputLength; ++j) { - currentValue = input[j]; - - if (currentValue < n && ++delta > maxInt) { - error('overflow'); - } - - if (currentValue == n) { - // Represent delta as a generalized variable-length integer - for (q = delta, k = base; /* no condition */; k += base) { - t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); - if (q < t) { - break; - } - qMinusT = q - t; - baseMinusT = base - t; - output.push( - stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) - ); - q = floor(qMinusT / baseMinusT); - } - - output.push(stringFromCharCode(digitToBasic(q, 0))); - bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); - delta = 0; - ++handledCPCount; - } - } - - ++delta; - ++n; - - } - return output.join(''); - } - - /** - * Converts a Punycode string representing a domain name or an email address - * to Unicode. Only the Punycoded parts of the input will be converted, i.e. - * it doesn't matter if you call it on a string that has already been - * converted to Unicode. - * @memberOf punycode - * @param {String} input The Punycoded domain name or email address to - * convert to Unicode. - * @returns {String} The Unicode representation of the given Punycode - * string. - */ - function toUnicode(input) { - return mapDomain(input, function(string) { - return regexPunycode.test(string) - ? decode(string.slice(4).toLowerCase()) - : string; - }); - } - - /** - * Converts a Unicode string representing a domain name or an email address to - * Punycode. Only the non-ASCII parts of the domain name will be converted, - * i.e. it doesn't matter if you call it with a domain that's already in - * ASCII. - * @memberOf punycode - * @param {String} input The domain name or email address to convert, as a - * Unicode string. - * @returns {String} The Punycode representation of the given domain name or - * email address. - */ - function toASCII(input) { - return mapDomain(input, function(string) { - return regexNonASCII.test(string) - ? 'xn--' + encode(string) - : string; - }); - } - - /*--------------------------------------------------------------------------*/ - - /** Define the public API */ - punycode = { - /** - * A string representing the current Punycode.js version number. - * @memberOf punycode - * @type String - */ - 'version': '1.3.2', - /** - * An object of methods to convert from JavaScript's internal character - * representation (UCS-2) to Unicode code points, and back. - * @see - * @memberOf punycode - * @type Object - */ - 'ucs2': { - 'decode': ucs2decode, - 'encode': ucs2encode - }, - 'decode': decode, - 'encode': encode, - 'toASCII': toASCII, - 'toUnicode': toUnicode - }; - - /** Expose `punycode` */ - // Some AMD build optimizers, like r.js, check for specific condition patterns - // like the following: - if ( - typeof define == 'function' && - typeof define.amd == 'object' && - define.amd - ) { - define('punycode', function() { - return punycode; - }); - } else if (freeExports && freeModule) { - if (module.exports == freeExports) { // in Node.js or RingoJS v0.8.0+ - freeModule.exports = punycode; - } else { // in Narwhal or RingoJS v0.7.0- - for (key in punycode) { - punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]); - } - } - } else { // in Rhino or a web browser - root.punycode = punycode; - } - -}(this)); diff --git a/update_nation/node_modules/couchapp/node_modules/url/node_modules/punycode/package.json b/update_nation/node_modules/couchapp/node_modules/url/node_modules/punycode/package.json index 188feaf81..59e700405 100644 --- a/update_nation/node_modules/couchapp/node_modules/url/node_modules/punycode/package.json +++ b/update_nation/node_modules/couchapp/node_modules/url/node_modules/punycode/package.json @@ -1,23 +1,35 @@ { - "name": "punycode", - "version": "1.3.2", - "description": "A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.", - "homepage": "https://mths.be/punycode", - "main": "punycode.js", - "keywords": [ - "punycode", - "unicode", - "idn", - "idna", - "dns", - "url", - "domain" + "_from": "punycode@1.3.2", + "_id": "punycode@1.3.2", + "_inBundle": false, + "_integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", + "_location": "/couchapp/url/punycode", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "punycode@1.3.2", + "name": "punycode", + "escapedName": "punycode", + "rawSpec": "1.3.2", + "saveSpec": null, + "fetchSpec": "1.3.2" + }, + "_requiredBy": [ + "/couchapp/url" ], - "license": "MIT", + "_resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "_shasum": "9653a036fb7c1ee42342f2325cceefea3926c48d", + "_spec": "punycode@1.3.2", + "_where": "/Users/Raju/BeLL-Apps/update_nation/node_modules/couchapp/node_modules/url", "author": { "name": "Mathias Bynens", "url": "https://mathiasbynens.be/" }, + "bugs": { + "url": "https://github.com/bestiejs/punycode.js/issues" + }, + "bundleDependencies": false, "contributors": [ { "name": "Mathias Bynens", @@ -28,20 +40,8 @@ "url": "http://allyoucanleet.com/" } ], - "repository": { - "type": "git", - "url": "https://github.com/bestiejs/punycode.js.git" - }, - "bugs": { - "url": "https://github.com/bestiejs/punycode.js/issues" - }, - "files": [ - "LICENSE-MIT.txt", - "punycode.js" - ], - "scripts": { - "test": "node tests/tests.js" - }, + "deprecated": false, + "description": "A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.", "devDependencies": { "coveralls": "^2.10.1", "grunt": "^0.4.5", @@ -52,8 +52,29 @@ "qunitjs": "~1.11.0", "requirejs": "^2.1.14" }, - "readme": "# Punycode.js [![Build status](https://travis-ci.org/bestiejs/punycode.js.svg?branch=master)](https://travis-ci.org/bestiejs/punycode.js) [![Code coverage status](http://img.shields.io/coveralls/bestiejs/punycode.js/master.svg)](https://coveralls.io/r/bestiejs/punycode.js) [![Dependency status](https://gemnasium.com/bestiejs/punycode.js.svg)](https://gemnasium.com/bestiejs/punycode.js)\n\nA robust Punycode converter that fully complies to [RFC 3492](http://tools.ietf.org/html/rfc3492) and [RFC 5891](http://tools.ietf.org/html/rfc5891), and works on nearly all JavaScript platforms.\n\nThis JavaScript library is the result of comparing, optimizing and documenting different open-source implementations of the Punycode algorithm:\n\n* [The C example code from RFC 3492](http://tools.ietf.org/html/rfc3492#appendix-C)\n* [`punycode.c` by _Markus W. Scherer_ (IBM)](http://opensource.apple.com/source/ICU/ICU-400.42/icuSources/common/punycode.c)\n* [`punycode.c` by _Ben Noordhuis_](https://github.com/bnoordhuis/punycode/blob/master/punycode.c)\n* [JavaScript implementation by _some_](http://stackoverflow.com/questions/183485/can-anyone-recommend-a-good-free-javascript-for-punycode-to-unicode-conversion/301287#301287)\n* [`punycode.js` by _Ben Noordhuis_](https://github.com/joyent/node/blob/426298c8c1c0d5b5224ac3658c41e7c2a3fe9377/lib/punycode.js) (note: [not fully compliant](https://github.com/joyent/node/issues/2072))\n\nThis project is [bundled](https://github.com/joyent/node/blob/master/lib/punycode.js) with [Node.js v0.6.2+](https://github.com/joyent/node/compare/975f1930b1...61e796decc).\n\n## Installation\n\nVia [npm](http://npmjs.org/) (only required for Node.js releases older than v0.6.2):\n\n```bash\nnpm install punycode\n```\n\nVia [Bower](http://bower.io/):\n\n```bash\nbower install punycode\n```\n\nVia [Component](https://github.com/component/component):\n\n```bash\ncomponent install bestiejs/punycode.js\n```\n\nIn a browser:\n\n```html\n\n```\n\nIn [Narwhal](http://narwhaljs.org/), [Node.js](http://nodejs.org/), and [RingoJS](http://ringojs.org/):\n\n```js\nvar punycode = require('punycode');\n```\n\nIn [Rhino](http://www.mozilla.org/rhino/):\n\n```js\nload('punycode.js');\n```\n\nUsing an AMD loader like [RequireJS](http://requirejs.org/):\n\n```js\nrequire(\n {\n 'paths': {\n 'punycode': 'path/to/punycode'\n }\n },\n ['punycode'],\n function(punycode) {\n console.log(punycode);\n }\n);\n```\n\n## API\n\n### `punycode.decode(string)`\n\nConverts a Punycode string of ASCII symbols to a string of Unicode symbols.\n\n```js\n// decode domain name parts\npunycode.decode('maana-pta'); // 'mañana'\npunycode.decode('--dqo34k'); // '☃-⌘'\n```\n\n### `punycode.encode(string)`\n\nConverts a string of Unicode symbols to a Punycode string of ASCII symbols.\n\n```js\n// encode domain name parts\npunycode.encode('mañana'); // 'maana-pta'\npunycode.encode('☃-⌘'); // '--dqo34k'\n```\n\n### `punycode.toUnicode(input)`\n\nConverts a Punycode string representing a domain name or an email address to Unicode. Only the Punycoded parts of the input will be converted, i.e. it doesn’t matter if you call it on a string that has already been converted to Unicode.\n\n```js\n// decode domain names\npunycode.toUnicode('xn--maana-pta.com');\n// → 'mañana.com'\npunycode.toUnicode('xn----dqo34k.com');\n// → '☃-⌘.com'\n\n// decode email addresses\npunycode.toUnicode('джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq');\n// → 'джумла@джpумлатест.bрфa'\n```\n\n### `punycode.toASCII(input)`\n\nConverts a Unicode string representing a domain name or an email address to Punycode. Only the non-ASCII parts of the input will be converted, i.e. it doesn’t matter if you call it with a domain that's already in ASCII.\n\n```js\n// encode domain names\npunycode.toASCII('mañana.com');\n// → 'xn--maana-pta.com'\npunycode.toASCII('☃-⌘.com');\n// → 'xn----dqo34k.com'\n\n// encode email addresses\npunycode.toASCII('джумла@джpумлатест.bрфa');\n// → 'джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq'\n```\n\n### `punycode.ucs2`\n\n#### `punycode.ucs2.decode(string)`\n\nCreates an array containing the numeric code point values of each Unicode symbol in the string. While [JavaScript uses UCS-2 internally](https://mathiasbynens.be/notes/javascript-encoding), this function will convert a pair of surrogate halves (each of which UCS-2 exposes as separate characters) into a single code point, matching UTF-16.\n\n```js\npunycode.ucs2.decode('abc');\n// → [0x61, 0x62, 0x63]\n// surrogate pair for U+1D306 TETRAGRAM FOR CENTRE:\npunycode.ucs2.decode('\\uD834\\uDF06');\n// → [0x1D306]\n```\n\n#### `punycode.ucs2.encode(codePoints)`\n\nCreates a string based on an array of numeric code point values.\n\n```js\npunycode.ucs2.encode([0x61, 0x62, 0x63]);\n// → 'abc'\npunycode.ucs2.encode([0x1D306]);\n// → '\\uD834\\uDF06'\n```\n\n### `punycode.version`\n\nA string representing the current Punycode.js version number.\n\n## Unit tests & code coverage\n\nAfter cloning this repository, run `npm install --dev` to install the dependencies needed for Punycode.js development and testing. You may want to install Istanbul _globally_ using `npm install istanbul -g`.\n\nOnce that’s done, you can run the unit tests in Node using `npm test` or `node tests/tests.js`. To run the tests in Rhino, Ringo, Narwhal, PhantomJS, and web browsers as well, use `grunt test`.\n\nTo generate the code coverage report, use `grunt cover`.\n\nFeel free to fork if you see possible improvements!\n\n## Author\n\n| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias \"Follow @mathias on Twitter\") |\n|---|\n| [Mathias Bynens](https://mathiasbynens.be/) |\n\n## Contributors\n\n| [![twitter/jdalton](https://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton \"Follow @jdalton on Twitter\") |\n|---|\n| [John-David Dalton](http://allyoucanleet.com/) |\n\n## License\n\nPunycode.js is available under the [MIT](https://mths.be/mit) license.\n", - "readmeFilename": "README.md", - "_id": "punycode@1.3.2", - "_from": "punycode@1.3.2" + "files": [ + "LICENSE-MIT.txt", + "punycode.js" + ], + "homepage": "https://mths.be/punycode", + "keywords": [ + "punycode", + "unicode", + "idn", + "idna", + "dns", + "url", + "domain" + ], + "license": "MIT", + "main": "punycode.js", + "name": "punycode", + "repository": { + "type": "git", + "url": "git+https://github.com/bestiejs/punycode.js.git" + }, + "scripts": { + "test": "node tests/tests.js" + }, + "version": "1.3.2" } diff --git a/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/.History.md.un~ b/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/.History.md.un~ deleted file mode 100644 index c96a7dd8c..000000000 Binary files a/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/.History.md.un~ and /dev/null differ diff --git a/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/.Readme.md.un~ b/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/.Readme.md.un~ deleted file mode 100644 index 71613b59b..000000000 Binary files a/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/.Readme.md.un~ and /dev/null differ diff --git a/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/.package.json.un~ b/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/.package.json.un~ deleted file mode 100644 index d86fe314c..000000000 Binary files a/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/.package.json.un~ and /dev/null differ diff --git a/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/.travis.yml b/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/.travis.yml deleted file mode 100644 index 895dbd362..000000000 --- a/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.6 - - 0.8 diff --git a/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/History.md b/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/History.md deleted file mode 100644 index 4fddbaf78..000000000 --- a/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/History.md +++ /dev/null @@ -1,20 +0,0 @@ -# 0.2.0 / 2013-02-21 - - - Refactor into function per-module idiomatic style. - - Improved test coverage. - -# 0.1.0 / 2011-12-13 - - - Minor project reorganization - -# 0.0.3 / 2011-04-16 - - Support for AMD module loaders - -# 0.0.2 / 2011-04-16 - - - Ported unit tests - - Removed functionality that depended on Buffers - -# 0.0.1 / 2011-04-15 - - - Initial release diff --git a/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/License.md b/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/License.md deleted file mode 100644 index fc80e85f2..000000000 --- a/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/License.md +++ /dev/null @@ -1,19 +0,0 @@ - -Copyright 2012 Irakli Gozalishvili. 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/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/Readme.md b/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/Readme.md deleted file mode 100644 index a4fe2520d..000000000 --- a/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/Readme.md +++ /dev/null @@ -1,15 +0,0 @@ -# querystring - -[![Build Status](https://secure.travis-ci.org/Gozala/querystring.png)](http://travis-ci.org/Gozala/querystring) - - -[![Browser support](http://ci.testling.com/Gozala/querystring.png)](http://ci.testling.com/Gozala/querystring) - - - -Node's querystring module for all engines. - -## Install ## - - npm install querystring - diff --git a/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/decode.js b/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/decode.js deleted file mode 100644 index a6518b8ff..000000000 --- a/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/decode.js +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -'use strict'; - -// If obj.hasOwnProperty has been overridden, then calling -// obj.hasOwnProperty(prop) will break. -// See: https://github.com/joyent/node/issues/1707 -function hasOwnProperty(obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop); -} - -module.exports = function(qs, sep, eq, options) { - sep = sep || '&'; - eq = eq || '='; - var obj = {}; - - if (typeof qs !== 'string' || qs.length === 0) { - return obj; - } - - var regexp = /\+/g; - qs = qs.split(sep); - - var maxKeys = 1000; - if (options && typeof options.maxKeys === 'number') { - maxKeys = options.maxKeys; - } - - var len = qs.length; - // maxKeys <= 0 means that we should not limit keys count - if (maxKeys > 0 && len > maxKeys) { - len = maxKeys; - } - - for (var i = 0; i < len; ++i) { - var x = qs[i].replace(regexp, '%20'), - idx = x.indexOf(eq), - kstr, vstr, k, v; - - if (idx >= 0) { - kstr = x.substr(0, idx); - vstr = x.substr(idx + 1); - } else { - kstr = x; - vstr = ''; - } - - k = decodeURIComponent(kstr); - v = decodeURIComponent(vstr); - - if (!hasOwnProperty(obj, k)) { - obj[k] = v; - } else if (Array.isArray(obj[k])) { - obj[k].push(v); - } else { - obj[k] = [obj[k], v]; - } - } - - return obj; -}; diff --git a/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/encode.js b/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/encode.js deleted file mode 100644 index 4f2b561b2..000000000 --- a/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/encode.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -'use strict'; - -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 ''; - } -}; - -module.exports = function(obj, sep, eq, name) { - sep = sep || '&'; - eq = eq || '='; - if (obj === null) { - obj = undefined; - } - - if (typeof obj === 'object') { - return Object.keys(obj).map(function(k) { - var ks = encodeURIComponent(stringifyPrimitive(k)) + eq; - if (Array.isArray(obj[k])) { - return obj[k].map(function(v) { - return ks + encodeURIComponent(stringifyPrimitive(v)); - }).join(sep); - } else { - return ks + encodeURIComponent(stringifyPrimitive(obj[k])); - } - }).join(sep); - - } - - if (!name) return ''; - return encodeURIComponent(stringifyPrimitive(name)) + eq + - encodeURIComponent(stringifyPrimitive(obj)); -}; diff --git a/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/index.js b/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/index.js deleted file mode 100644 index 99826ea8a..000000000 --- a/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/index.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; - -exports.decode = exports.parse = require('./decode'); -exports.encode = exports.stringify = require('./encode'); diff --git a/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/package.json b/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/package.json deleted file mode 100644 index 2104b902a..000000000 --- a/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/package.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "name": "querystring", - "id": "querystring", - "version": "0.2.0", - "description": "Node's querystring module for all engines.", - "keywords": [ - "commonjs", - "query", - "querystring" - ], - "author": { - "name": "Irakli Gozalishvili", - "email": "rfobic@gmail.com" - }, - "repository": { - "type": "git", - "url": "git://github.com/Gozala/querystring.git", - "web": "https://github.com/Gozala/querystring" - }, - "bugs": { - "url": "http://github.com/Gozala/querystring/issues/" - }, - "devDependencies": { - "test": "~0.x.0", - "phantomify": "~0.x.0", - "retape": "~0.x.0", - "tape": "~0.1.5" - }, - "engines": { - "node": ">=0.4.x" - }, - "scripts": { - "test": "npm run test-node && npm run test-browser && npm run test-tap", - "test-browser": "node ./node_modules/phantomify/bin/cmd.js ./test/common-index.js", - "test-node": "node ./test/common-index.js", - "test-tap": "node ./test/tap-index.js" - }, - "testling": { - "files": "test/tap-index.js", - "browsers": { - "iexplore": [ - 9, - 10 - ], - "chrome": [ - 16, - 20, - 25, - "canary" - ], - "firefox": [ - 10, - 15, - 16, - 17, - 18, - "nightly" - ], - "safari": [ - 5, - 6 - ], - "opera": [ - 12 - ] - } - }, - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/Gozala/enchain/License.md" - } - ], - "readme": "# querystring\n\n[![Build Status](https://secure.travis-ci.org/Gozala/querystring.png)](http://travis-ci.org/Gozala/querystring)\n\n\n[![Browser support](http://ci.testling.com/Gozala/querystring.png)](http://ci.testling.com/Gozala/querystring)\n\n\n\nNode's querystring module for all engines.\n\n## Install ##\n\n npm install querystring\n\n", - "readmeFilename": "Readme.md", - "homepage": "https://github.com/Gozala/querystring", - "_id": "querystring@0.2.0", - "_from": "querystring@0.2.0" -} diff --git a/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/test/.index.js.un~ b/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/test/.index.js.un~ deleted file mode 100644 index 898eceddc..000000000 Binary files a/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/test/.index.js.un~ and /dev/null differ diff --git a/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/test/common-index.js b/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/test/common-index.js deleted file mode 100644 index f356f9875..000000000 --- a/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/test/common-index.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; - -require("test").run(require("./index")) \ No newline at end of file diff --git a/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/test/index.js b/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/test/index.js deleted file mode 100644 index 62eb2ac89..000000000 --- a/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/test/index.js +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -"use strict"; - -// test using assert -var qs = require('../'); - -// 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 '}], - // disable test that fails ['foo=%zx', 'foo=%25zx', {'foo': '%zx'}], - ['foo=%EF%BF%BD', 'foo=%EF%BF%BD', {'foo': '\ufffd' }], - // See: https://github.com/joyent/node/issues/1707 - ['hasOwnProperty=x&toString=foo&valueOf=bar&__defineGetter__=baz', - 'hasOwnProperty=x&toString=foo&valueOf=bar&__defineGetter__=baz', - { hasOwnProperty: 'x', - toString: 'foo', - valueOf: 'bar', - __defineGetter__: 'baz' }], - // See: https://github.com/joyent/node/issues/3058 - ['foo&bar=baz', 'foo=&bar=baz', { foo: '', bar: 'baz' }] -]; - -// [ 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 qsNoMungeTestCases = [ - ['', {}], - ['foo=bar&foo=baz', {'foo': ['bar', 'baz']}], - ['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'}] -]; - -exports['test basic'] = function(assert) { - assert.strictEqual('918854443121279438895193', - qs.parse('id=918854443121279438895193').id, - 'prase id=918854443121279438895193'); -}; - -exports['test that the canonical qs is parsed properly'] = function(assert) { - qsTestCases.forEach(function(testCase) { - assert.deepEqual(testCase[2], qs.parse(testCase[0]), - 'parse ' + testCase[0]); - }); -}; - - -exports['test that the colon test cases can do the same'] = function(assert) { - qsColonTestCases.forEach(function(testCase) { - assert.deepEqual(testCase[2], qs.parse(testCase[0], ';', ':'), - 'parse ' + testCase[0] + ' -> ; :'); - }); -}; - -exports['test the weird objects, that they get parsed properly'] = function(assert) { - qsWeirdObjects.forEach(function(testCase) { - assert.deepEqual(testCase[2], qs.parse(testCase[1]), - 'parse ' + testCase[1]); - }); -}; - -exports['test non munge test cases'] = function(assert) { - qsNoMungeTestCases.forEach(function(testCase) { - assert.deepEqual(testCase[0], qs.stringify(testCase[1], '&', '=', false), - 'stringify ' + JSON.stringify(testCase[1]) + ' -> & ='); - }); -}; - -exports['test the nested qs-in-qs case'] = function(assert) { - 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' } }, - 'parse a=b&q=x%3Dy%26y%3Dz'); -}; - -exports['test nested in colon'] = function(assert) { - 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' } }, - 'parse a:b;q:x%3Ay%3By%3Az -> ; :'); -}; - -exports['test stringifying'] = function(assert) { - qsTestCases.forEach(function(testCase) { - assert.equal(testCase[1], qs.stringify(testCase[2]), - 'stringify ' + JSON.stringify(testCase[2])); - }); - - qsColonTestCases.forEach(function(testCase) { - assert.equal(testCase[1], qs.stringify(testCase[2], ';', ':'), - 'stringify ' + JSON.stringify(testCase[2]) + ' -> ; :'); - }); - - qsWeirdObjects.forEach(function(testCase) { - assert.equal(testCase[1], qs.stringify(testCase[0]), - 'stringify ' + JSON.stringify(testCase[0])); - }); -}; - -exports['test stringifying nested'] = function(assert) { - var f = qs.stringify({ - a: 'b', - q: qs.stringify({ - x: 'y', - y: 'z' - }) - }); - assert.equal(f, 'a=b&q=x%3Dy%26y%3Dz', - JSON.stringify({ - a: 'b', - 'qs.stringify -> q': { - x: 'y', - y: 'z' - } - })); - - var threw = false; - try { qs.parse(undefined); } catch(error) { threw = true; } - assert.ok(!threw, "does not throws on undefined"); -}; - -exports['test nested in colon'] = function(assert) { - var f = qs.stringify({ - a: 'b', - q: qs.stringify({ - x: 'y', - y: 'z' - }, ';', ':') - }, ';', ':'); - assert.equal(f, 'a:b;q:x%3Ay%3By%3Az', - 'stringify ' + JSON.stringify({ - a: 'b', - 'qs.stringify -> q': { - x: 'y', - y: 'z' - } - }) + ' -> ; : '); - - - assert.deepEqual({}, qs.parse(), 'parse undefined'); -}; diff --git a/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/test/tap-index.js b/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/test/tap-index.js deleted file mode 100644 index 70679b3fc..000000000 --- a/update_nation/node_modules/couchapp/node_modules/url/node_modules/querystring/test/tap-index.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; - -require("retape")(require("./index")) \ No newline at end of file diff --git a/update_nation/node_modules/fs/package.json b/update_nation/node_modules/fs/package.json index f535b5d39..2a9142831 100644 --- a/update_nation/node_modules/fs/package.json +++ b/update_nation/node_modules/fs/package.json @@ -1,18 +1,36 @@ { - "name": "fs", - "version": "0.0.2", + "_from": "fs@0.0.2", + "_id": "fs@0.0.2", + "_inBundle": false, + "_integrity": "sha1-4fJE7zkzwbKmS9R5kTYGDQ9ZFPg=", + "_location": "/fs", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "fs@0.0.2", + "name": "fs", + "escapedName": "fs", + "rawSpec": "0.0.2", + "saveSpec": null, + "fetchSpec": "0.0.2" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/fs/-/fs-0.0.2.tgz", + "_shasum": "e1f244ef3933c1b2a64bd4799136060d0f5914f8", + "_spec": "fs@0.0.2", + "_where": "/Users/Raju/BeLL-Apps/update_nation", + "author": "", + "bundleDependencies": false, + "deprecated": false, "description": "", + "license": "MIT", "main": "index.js", + "name": "fs", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, - "author": "", - "license": "MIT", - "readme": "ERROR: No README data found!", - "_id": "fs@0.0.2", - "dist": { - "shasum": "5618f46fa823799bf3b826b9efd95a688a706048" - }, - "_from": "fs@0.0.2", - "_resolved": "https://registry.npmjs.org/fs/-/fs-0.0.2.tgz" + "version": "0.0.2" } diff --git a/update_nation/node_modules/nano/node_modules/.bin/follow b/update_nation/node_modules/nano/node_modules/.bin/follow deleted file mode 100644 index eb7722ec8..000000000 --- a/update_nation/node_modules/nano/node_modules/.bin/follow +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -basedir=`dirname "$0"` - -case `uname` in - *CYGWIN*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - "$basedir/node" "$basedir/../follow/cli.js" "$@" - ret=$? -else - node "$basedir/../follow/cli.js" "$@" - ret=$? -fi -exit $ret diff --git a/update_nation/node_modules/nano/node_modules/debug/.jshintrc b/update_nation/node_modules/nano/node_modules/debug/.jshintrc deleted file mode 100644 index 299877f26..000000000 --- a/update_nation/node_modules/nano/node_modules/debug/.jshintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "laxbreak": true -} diff --git a/update_nation/node_modules/nano/node_modules/debug/.npmignore b/update_nation/node_modules/nano/node_modules/debug/.npmignore deleted file mode 100644 index 7e6163db0..000000000 --- a/update_nation/node_modules/nano/node_modules/debug/.npmignore +++ /dev/null @@ -1,6 +0,0 @@ -support -test -examples -example -*.sock -dist diff --git a/update_nation/node_modules/nano/node_modules/debug/History.md b/update_nation/node_modules/nano/node_modules/debug/History.md deleted file mode 100644 index 770e4832d..000000000 --- a/update_nation/node_modules/nano/node_modules/debug/History.md +++ /dev/null @@ -1,186 +0,0 @@ - -2.1.3 / 2015-03-13 -================== - - * Updated stdout/stderr example (#186) - * Updated example/stdout.js to match debug current behaviour - * Renamed example/stderr.js to stdout.js - * Update Readme.md (#184) - * replace high intensity foreground color for bold (#182, #183) - -2.1.2 / 2015-03-01 -================== - - * dist: recompile - * update "ms" to v0.7.0 - * package: update "browserify" to v9.0.3 - * component: fix "ms.js" repo location - * changed bower package name - * updated documentation about using debug in a browser - * fix: security error on safari (#167, #168, @yields) - -2.1.1 / 2014-12-29 -================== - - * browser: use `typeof` to check for `console` existence - * browser: check for `console.log` truthiness (fix IE 8/9) - * browser: add support for Chrome apps - * Readme: added Windows usage remarks - * Add `bower.json` to properly support bower install - -2.1.0 / 2014-10-15 -================== - - * node: implement `DEBUG_FD` env variable support - * package: update "browserify" to v6.1.0 - * package: add "license" field to package.json (#135, @panuhorsmalahti) - -2.0.0 / 2014-09-01 -================== - - * package: update "browserify" to v5.11.0 - * node: use stderr rather than stdout for logging (#29, @stephenmathieson) - -1.0.4 / 2014-07-15 -================== - - * dist: recompile - * example: remove `console.info()` log usage - * example: add "Content-Type" UTF-8 header to browser example - * browser: place %c marker after the space character - * browser: reset the "content" color via `color: inherit` - * browser: add colors support for Firefox >= v31 - * debug: prefer an instance `log()` function over the global one (#119) - * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) - -1.0.3 / 2014-07-09 -================== - - * Add support for multiple wildcards in namespaces (#122, @seegno) - * browser: fix lint - -1.0.2 / 2014-06-10 -================== - - * browser: update color palette (#113, @gscottolson) - * common: make console logging function configurable (#108, @timoxley) - * node: fix %o colors on old node <= 0.8.x - * Makefile: find node path using shell/which (#109, @timoxley) - -1.0.1 / 2014-06-06 -================== - - * browser: use `removeItem()` to clear localStorage - * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) - * package: add "contributors" section - * node: fix comment typo - * README: list authors - -1.0.0 / 2014-06-04 -================== - - * make ms diff be global, not be scope - * debug: ignore empty strings in enable() - * node: make DEBUG_COLORS able to disable coloring - * *: export the `colors` array - * npmignore: don't publish the `dist` dir - * Makefile: refactor to use browserify - * package: add "browserify" as a dev dependency - * Readme: add Web Inspector Colors section - * node: reset terminal color for the debug content - * node: map "%o" to `util.inspect()` - * browser: map "%j" to `JSON.stringify()` - * debug: add custom "formatters" - * debug: use "ms" module for humanizing the diff - * Readme: add "bash" syntax highlighting - * browser: add Firebug color support - * browser: add colors for WebKit browsers - * node: apply log to `console` - * rewrite: abstract common logic for Node & browsers - * add .jshintrc file - -0.8.1 / 2014-04-14 -================== - - * package: re-add the "component" section - -0.8.0 / 2014-03-30 -================== - - * add `enable()` method for nodejs. Closes #27 - * change from stderr to stdout - * remove unnecessary index.js file - -0.7.4 / 2013-11-13 -================== - - * remove "browserify" key from package.json (fixes something in browserify) - -0.7.3 / 2013-10-30 -================== - - * fix: catch localStorage security error when cookies are blocked (Chrome) - * add debug(err) support. Closes #46 - * add .browser prop to package.json. Closes #42 - -0.7.2 / 2013-02-06 -================== - - * fix package.json - * fix: Mobile Safari (private mode) is broken with debug - * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript - -0.7.1 / 2013-02-05 -================== - - * add repository URL to package.json - * add DEBUG_COLORED to force colored output - * add browserify support - * fix component. Closes #24 - -0.7.0 / 2012-05-04 -================== - - * Added .component to package.json - * Added debug.component.js build - -0.6.0 / 2012-03-16 -================== - - * Added support for "-" prefix in DEBUG [Vinay Pulim] - * Added `.enabled` flag to the node version [TooTallNate] - -0.5.0 / 2012-02-02 -================== - - * Added: humanize diffs. Closes #8 - * Added `debug.disable()` to the CS variant - * Removed padding. Closes #10 - * Fixed: persist client-side variant again. Closes #9 - -0.4.0 / 2012-02-01 -================== - - * Added browser variant support for older browsers [TooTallNate] - * Added `debug.enable('project:*')` to browser variant [TooTallNate] - * Added padding to diff (moved it to the right) - -0.3.0 / 2012-01-26 -================== - - * Added millisecond diff when isatty, otherwise UTC string - -0.2.0 / 2012-01-22 -================== - - * Added wildcard support - -0.1.0 / 2011-12-02 -================== - - * Added: remove colors unless stderr isatty [TooTallNate] - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/update_nation/node_modules/nano/node_modules/debug/Makefile b/update_nation/node_modules/nano/node_modules/debug/Makefile deleted file mode 100644 index b0bde6e63..000000000 --- a/update_nation/node_modules/nano/node_modules/debug/Makefile +++ /dev/null @@ -1,33 +0,0 @@ - -# get Makefile directory name: http://stackoverflow.com/a/5982798/376773 -THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) -THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) - -# BIN directory -BIN := $(THIS_DIR)/node_modules/.bin - -# applications -NODE ?= $(shell which node) -NPM ?= $(NODE) $(shell which npm) -BROWSERIFY ?= $(NODE) $(BIN)/browserify - -all: dist/debug.js - -install: node_modules - -clean: - @rm -rf node_modules dist - -dist: - @mkdir -p $@ - -dist/debug.js: node_modules browser.js debug.js dist - @$(BROWSERIFY) \ - --standalone debug \ - . > $@ - -node_modules: package.json - @NODE_ENV= $(NPM) install - @touch node_modules - -.PHONY: all install clean diff --git a/update_nation/node_modules/nano/node_modules/debug/Readme.md b/update_nation/node_modules/nano/node_modules/debug/Readme.md deleted file mode 100644 index 14222e0c2..000000000 --- a/update_nation/node_modules/nano/node_modules/debug/Readme.md +++ /dev/null @@ -1,178 +0,0 @@ -# debug - - tiny node.js debugging utility modelled after node core's debugging technique. - -## Installation - -```bash -$ npm install debug -``` - -## Usage - - With `debug` you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated `console.error`, so all of the `console` format string goodies you're used to work fine. A unique color is selected per-function for visibility. - -Example _app.js_: - -```js -var debug = require('debug')('http') - , http = require('http') - , name = 'My App'; - -// fake app - -debug('booting %s', name); - -http.createServer(function(req, res){ - debug(req.method + ' ' + req.url); - res.end('hello\n'); -}).listen(3000, function(){ - debug('listening'); -}); - -// fake worker of some kind - -require('./worker'); -``` - -Example _worker.js_: - -```js -var debug = require('debug')('worker'); - -setInterval(function(){ - debug('doing some work'); -}, 1000); -``` - - The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples: - - ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png) - - ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png) - -#### Windows note - - On Windows the environment variable is set using the `set` command. - - ```cmd - set DEBUG=*,-not_this - ``` - -Then, run the program to be debugged as usual. - -## Millisecond diff - - When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. - - ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png) - - When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below: - - ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png) - -## Conventions - - If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". - -## Wildcards - - The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect.compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. - - You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:". - -## Browser support - - Debug works in the browser as well, currently persisted by `localStorage`. Consider the situation shown below where you have `worker:a` and `worker:b`, and wish to debug both. Somewhere in the code on your page, include: - -```js -window.myDebug = require("debug"); -``` - - ("debug" is a global object in the browser so we give this object a different name.) When your page is open in the browser, type the following in the console: - -```js -myDebug.enable("worker:*") -``` - - Refresh the page. Debug output will continue to be sent to the console until it is disabled by typing `myDebug.disable()` in the console. - -```js -a = debug('worker:a'); -b = debug('worker:b'); - -setInterval(function(){ - a('doing some work'); -}, 1000); - -setInterval(function(){ - b('doing some work'); -}, 1200); -``` - -#### Web Inspector Colors - - Colors are also enabled on "Web Inspectors" that understand the `%c` formatting - option. These are WebKit web inspectors, Firefox ([since version - 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) - and the Firebug plugin for Firefox (any version). - - Colored output looks something like: - - ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png) - -### stderr vs stdout - -You can set an alternative logging method per-namespace by overriding the `log` method on a per-namespace or globally: - -Example _stdout.js_: - -```js -var debug = require('debug'); -var error = debug('app:error'); - -// by default stderr is used -error('goes to stderr!'); - -var log = debug('app:log'); -// set this namespace to log via console.log -log.log = console.log.bind(console); // don't forget to bind to console! -log('goes to stdout'); -error('still goes to stderr!'); - -// set all output to go via console.info -// overrides all per-namespace log settings -debug.log = console.info.bind(console); -error('now goes to stdout via console.info'); -log('still goes to stdout, but via console.info now'); -``` - -## Authors - - - TJ Holowaychuk - - Nathan Rajlich - -## License - -(The MIT License) - -Copyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca> - -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/update_nation/node_modules/nano/node_modules/debug/bower.json b/update_nation/node_modules/nano/node_modules/debug/bower.json deleted file mode 100644 index f7d3f6dc1..000000000 --- a/update_nation/node_modules/nano/node_modules/debug/bower.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "visionmedia-debug", - "main": "dist/debug.js", - "version": "2.1.3", - "homepage": "https://github.com/visionmedia/debug", - "authors": [ - "TJ Holowaychuk " - ], - "description": "visionmedia-debug", - "moduleType": [ - "amd", - "es6", - "globals", - "node" - ], - "keywords": [ - "visionmedia", - "debug" - ], - "license": "MIT", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ] -} diff --git a/update_nation/node_modules/nano/node_modules/debug/browser.js b/update_nation/node_modules/nano/node_modules/debug/browser.js deleted file mode 100644 index 55f4cf926..000000000 --- a/update_nation/node_modules/nano/node_modules/debug/browser.js +++ /dev/null @@ -1,175 +0,0 @@ - -/** - * This is the web browser implementation of `debug()`. - * - * Expose `debug()` as the module. - */ - -exports = module.exports = require('./debug'); -exports.log = log; -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; - -/** - * Use chrome.storage.local if we are in an app - */ - -var storage; - -if (typeof chrome !== 'undefined' && typeof chrome.storage !== 'undefined') - storage = chrome.storage.local; -else - storage = localstorage(); - -/** - * Colors. - */ - -exports.colors = [ - 'lightseagreen', - 'forestgreen', - 'goldenrod', - 'dodgerblue', - 'darkorchid', - 'crimson' -]; - -/** - * Currently only WebKit-based Web Inspectors, Firefox >= v31, - * and the Firebug extension (any Firefox version) are known - * to support "%c" CSS customizations. - * - * TODO: add a `localStorage` variable to explicitly enable/disable colors - */ - -function useColors() { - // is webkit? http://stackoverflow.com/a/16459606/376773 - return ('WebkitAppearance' in document.documentElement.style) || - // is firebug? http://stackoverflow.com/a/398120/376773 - (window.console && (console.firebug || (console.exception && console.table))) || - // is firefox >= v31? - // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - (navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31); -} - -/** - * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. - */ - -exports.formatters.j = function(v) { - return JSON.stringify(v); -}; - - -/** - * Colorize log arguments if enabled. - * - * @api public - */ - -function formatArgs() { - var args = arguments; - var useColors = this.useColors; - - args[0] = (useColors ? '%c' : '') - + this.namespace - + (useColors ? ' %c' : ' ') - + args[0] - + (useColors ? '%c ' : ' ') - + '+' + exports.humanize(this.diff); - - if (!useColors) return args; - - var c = 'color: ' + this.color; - args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1)); - - // the final "%c" is somewhat tricky, because there could be other - // arguments passed either before or after the %c, so we need to - // figure out the correct index to insert the CSS into - var index = 0; - var lastC = 0; - args[0].replace(/%[a-z%]/g, function(match) { - if ('%%' === match) return; - index++; - if ('%c' === match) { - // we only are interested in the *last* %c - // (the user may have provided their own) - lastC = index; - } - }); - - args.splice(lastC, 0, c); - return args; -} - -/** - * Invokes `console.log()` when available. - * No-op when `console.log` is not a "function". - * - * @api public - */ - -function log() { - // this hackery is required for IE8/9, where - // the `console.log` function doesn't have 'apply' - return 'object' === typeof console - && console.log - && Function.prototype.apply.call(console.log, console, arguments); -} - -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ - -function save(namespaces) { - try { - if (null == namespaces) { - storage.removeItem('debug'); - } else { - storage.debug = namespaces; - } - } catch(e) {} -} - -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ - -function load() { - var r; - try { - r = storage.debug; - } catch(e) {} - return r; -} - -/** - * Enable namespaces listed in `localStorage.debug` initially. - */ - -exports.enable(load()); - -/** - * Localstorage attempts to return the localstorage. - * - * This is necessary because safari throws - * when a user disables cookies/localstorage - * and you attempt to access it. - * - * @return {LocalStorage} - * @api private - */ - -function localstorage(){ - try { - return window.localStorage; - } catch (e) {} -} diff --git a/update_nation/node_modules/nano/node_modules/debug/component.json b/update_nation/node_modules/nano/node_modules/debug/component.json deleted file mode 100644 index 52ffd4224..000000000 --- a/update_nation/node_modules/nano/node_modules/debug/component.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "debug", - "repo": "visionmedia/debug", - "description": "small debugging utility", - "version": "2.1.3", - "keywords": [ - "debug", - "log", - "debugger" - ], - "main": "browser.js", - "scripts": [ - "browser.js", - "debug.js" - ], - "dependencies": { - "rauchg/ms.js": "0.7.0" - } -} diff --git a/update_nation/node_modules/nano/node_modules/debug/debug.js b/update_nation/node_modules/nano/node_modules/debug/debug.js deleted file mode 100644 index 7571a8605..000000000 --- a/update_nation/node_modules/nano/node_modules/debug/debug.js +++ /dev/null @@ -1,197 +0,0 @@ - -/** - * This is the common logic for both the Node.js and web browser - * implementations of `debug()`. - * - * Expose `debug()` as the module. - */ - -exports = module.exports = debug; -exports.coerce = coerce; -exports.disable = disable; -exports.enable = enable; -exports.enabled = enabled; -exports.humanize = require('ms'); - -/** - * The currently active debug mode names, and names to skip. - */ - -exports.names = []; -exports.skips = []; - -/** - * Map of special "%n" handling functions, for the debug "format" argument. - * - * Valid key names are a single, lowercased letter, i.e. "n". - */ - -exports.formatters = {}; - -/** - * Previously assigned color. - */ - -var prevColor = 0; - -/** - * Previous log timestamp. - */ - -var prevTime; - -/** - * Select a color. - * - * @return {Number} - * @api private - */ - -function selectColor() { - return exports.colors[prevColor++ % exports.colors.length]; -} - -/** - * Create a debugger with the given `namespace`. - * - * @param {String} namespace - * @return {Function} - * @api public - */ - -function debug(namespace) { - - // define the `disabled` version - function disabled() { - } - disabled.enabled = false; - - // define the `enabled` version - function enabled() { - - var self = enabled; - - // set `diff` timestamp - var curr = +new Date(); - var ms = curr - (prevTime || curr); - self.diff = ms; - self.prev = prevTime; - self.curr = curr; - prevTime = curr; - - // add the `color` if not set - if (null == self.useColors) self.useColors = exports.useColors(); - if (null == self.color && self.useColors) self.color = selectColor(); - - var args = Array.prototype.slice.call(arguments); - - args[0] = exports.coerce(args[0]); - - if ('string' !== typeof args[0]) { - // anything else let's inspect with %o - args = ['%o'].concat(args); - } - - // apply any `formatters` transformations - var index = 0; - args[0] = args[0].replace(/%([a-z%])/g, function(match, format) { - // if we encounter an escaped % then don't increase the array index - if (match === '%%') return match; - index++; - var formatter = exports.formatters[format]; - if ('function' === typeof formatter) { - var val = args[index]; - match = formatter.call(self, val); - - // now we need to remove `args[index]` since it's inlined in the `format` - args.splice(index, 1); - index--; - } - return match; - }); - - if ('function' === typeof exports.formatArgs) { - args = exports.formatArgs.apply(self, args); - } - var logFn = enabled.log || exports.log || console.log.bind(console); - logFn.apply(self, args); - } - enabled.enabled = true; - - var fn = exports.enabled(namespace) ? enabled : disabled; - - fn.namespace = namespace; - - return fn; -} - -/** - * Enables a debug mode by namespaces. This can include modes - * separated by a colon and wildcards. - * - * @param {String} namespaces - * @api public - */ - -function enable(namespaces) { - exports.save(namespaces); - - var split = (namespaces || '').split(/[\s,]+/); - var len = split.length; - - for (var i = 0; i < len; i++) { - if (!split[i]) continue; // ignore empty strings - namespaces = split[i].replace(/\*/g, '.*?'); - if (namespaces[0] === '-') { - exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); - } else { - exports.names.push(new RegExp('^' + namespaces + '$')); - } - } -} - -/** - * Disable debug output. - * - * @api public - */ - -function disable() { - exports.enable(''); -} - -/** - * Returns true if the given mode name is enabled, false otherwise. - * - * @param {String} name - * @return {Boolean} - * @api public - */ - -function enabled(name) { - var i, len; - for (i = 0, len = exports.skips.length; i < len; i++) { - if (exports.skips[i].test(name)) { - return false; - } - } - for (i = 0, len = exports.names.length; i < len; i++) { - if (exports.names[i].test(name)) { - return true; - } - } - return false; -} - -/** - * Coerce `val`. - * - * @param {Mixed} val - * @return {Mixed} - * @api private - */ - -function coerce(val) { - if (val instanceof Error) return val.stack || val.message; - return val; -} diff --git a/update_nation/node_modules/nano/node_modules/debug/node.js b/update_nation/node_modules/nano/node_modules/debug/node.js deleted file mode 100644 index 1d392a81d..000000000 --- a/update_nation/node_modules/nano/node_modules/debug/node.js +++ /dev/null @@ -1,209 +0,0 @@ - -/** - * Module dependencies. - */ - -var tty = require('tty'); -var util = require('util'); - -/** - * This is the Node.js implementation of `debug()`. - * - * Expose `debug()` as the module. - */ - -exports = module.exports = require('./debug'); -exports.log = log; -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; - -/** - * Colors. - */ - -exports.colors = [6, 2, 3, 4, 5, 1]; - -/** - * The file descriptor to write the `debug()` calls to. - * Set the `DEBUG_FD` env variable to override with another value. i.e.: - * - * $ DEBUG_FD=3 node script.js 3>debug.log - */ - -var fd = parseInt(process.env.DEBUG_FD, 10) || 2; -var stream = 1 === fd ? process.stdout : - 2 === fd ? process.stderr : - createWritableStdioStream(fd); - -/** - * Is stdout a TTY? Colored output is enabled when `true`. - */ - -function useColors() { - var debugColors = (process.env.DEBUG_COLORS || '').trim().toLowerCase(); - if (0 === debugColors.length) { - return tty.isatty(fd); - } else { - return '0' !== debugColors - && 'no' !== debugColors - && 'false' !== debugColors - && 'disabled' !== debugColors; - } -} - -/** - * Map %o to `util.inspect()`, since Node doesn't do that out of the box. - */ - -var inspect = (4 === util.inspect.length ? - // node <= 0.8.x - function (v, colors) { - return util.inspect(v, void 0, void 0, colors); - } : - // node > 0.8.x - function (v, colors) { - return util.inspect(v, { colors: colors }); - } -); - -exports.formatters.o = function(v) { - return inspect(v, this.useColors) - .replace(/\s*\n\s*/g, ' '); -}; - -/** - * Adds ANSI color escape codes if enabled. - * - * @api public - */ - -function formatArgs() { - var args = arguments; - var useColors = this.useColors; - var name = this.namespace; - - if (useColors) { - var c = this.color; - - args[0] = ' \u001b[3' + c + ';1m' + name + ' ' - + '\u001b[0m' - + args[0] + '\u001b[3' + c + 'm' - + ' +' + exports.humanize(this.diff) + '\u001b[0m'; - } else { - args[0] = new Date().toUTCString() - + ' ' + name + ' ' + args[0]; - } - return args; -} - -/** - * Invokes `console.error()` with the specified arguments. - */ - -function log() { - return stream.write(util.format.apply(this, arguments) + '\n'); -} - -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ - -function save(namespaces) { - if (null == namespaces) { - // If you set a process.env field to null or undefined, it gets cast to the - // string 'null' or 'undefined'. Just delete instead. - delete process.env.DEBUG; - } else { - process.env.DEBUG = namespaces; - } -} - -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ - -function load() { - return process.env.DEBUG; -} - -/** - * Copied from `node/src/node.js`. - * - * XXX: It's lame that node doesn't expose this API out-of-the-box. It also - * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame. - */ - -function createWritableStdioStream (fd) { - var stream; - var tty_wrap = process.binding('tty_wrap'); - - // Note stream._type is used for test-module-load-list.js - - switch (tty_wrap.guessHandleType(fd)) { - case 'TTY': - stream = new tty.WriteStream(fd); - stream._type = 'tty'; - - // Hack to have stream not keep the event loop alive. - // See https://github.com/joyent/node/issues/1726 - if (stream._handle && stream._handle.unref) { - stream._handle.unref(); - } - break; - - case 'FILE': - var fs = require('fs'); - stream = new fs.SyncWriteStream(fd, { autoClose: false }); - stream._type = 'fs'; - break; - - case 'PIPE': - case 'TCP': - var net = require('net'); - stream = new net.Socket({ - fd: fd, - readable: false, - writable: true - }); - - // FIXME Should probably have an option in net.Socket to create a - // stream from an existing fd which is writable only. But for now - // we'll just add this hack and set the `readable` member to false. - // Test: ./node test/fixtures/echo.js < /etc/passwd - stream.readable = false; - stream.read = null; - stream._type = 'pipe'; - - // FIXME Hack to have stream not keep the event loop alive. - // See https://github.com/joyent/node/issues/1726 - if (stream._handle && stream._handle.unref) { - stream._handle.unref(); - } - break; - - default: - // Probably an error on in uv_guess_handle() - throw new Error('Implement me. Unknown stream file type!'); - } - - // For supporting legacy API we put the FD here. - stream.fd = fd; - - stream._isStdio = true; - - return stream; -} - -/** - * Enable namespaces listed in `process.env.DEBUG` initially. - */ - -exports.enable(load()); diff --git a/update_nation/node_modules/nano/node_modules/debug/node_modules/ms/.npmignore b/update_nation/node_modules/nano/node_modules/debug/node_modules/ms/.npmignore deleted file mode 100644 index d1aa0ce42..000000000 --- a/update_nation/node_modules/nano/node_modules/debug/node_modules/ms/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -node_modules -test -History.md -Makefile -component.json diff --git a/update_nation/node_modules/nano/node_modules/debug/node_modules/ms/LICENSE b/update_nation/node_modules/nano/node_modules/debug/node_modules/ms/LICENSE deleted file mode 100644 index 6c07561b6..000000000 --- a/update_nation/node_modules/nano/node_modules/debug/node_modules/ms/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 Guillermo Rauch - -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/update_nation/node_modules/nano/node_modules/debug/node_modules/ms/README.md b/update_nation/node_modules/nano/node_modules/debug/node_modules/ms/README.md deleted file mode 100644 index 0fd54fdc7..000000000 --- a/update_nation/node_modules/nano/node_modules/debug/node_modules/ms/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# ms.js: miliseconds conversion utility - -```js -ms('2 days') // 172800000 -ms('1d') // 86400000 -ms('10h') // 36000000 -ms('2.5 hrs') // 9000000 -ms('2h') // 7200000 -ms('1m') // 60000 -ms('5s') // 5000 -ms('100') // 100 -``` - -```js -ms(60000) // "1m" -ms(2 * 60000) // "2m" -ms(ms('10 hours')) // "10h" -``` - -```js -ms(60000, { long: true }) // "1 minute" -ms(2 * 60000, { long: true }) // "2 minutes" -ms(ms('10 hours'), { long: true }) // "10 hours" -``` - -- Node/Browser compatible. Published as [`ms`](https://www.npmjs.org/package/ms) in [NPM](nodejs.org/download). -- If a number is supplied to `ms`, a string with a unit is returned. -- If a string that contains the number is supplied, it returns it as -a number (e.g: it returns `100` for `'100'`). -- If you pass a string with a number and a valid unit, the number of -equivalent ms is returned. - -## License - -MIT diff --git a/update_nation/node_modules/nano/node_modules/debug/node_modules/ms/index.js b/update_nation/node_modules/nano/node_modules/debug/node_modules/ms/index.js deleted file mode 100644 index e79bfa18c..000000000 --- a/update_nation/node_modules/nano/node_modules/debug/node_modules/ms/index.js +++ /dev/null @@ -1,123 +0,0 @@ -/** - * Helpers. - */ - -var s = 1000; -var m = s * 60; -var h = m * 60; -var d = h * 24; -var y = d * 365.25; - -/** - * Parse or format the given `val`. - * - * Options: - * - * - `long` verbose formatting [false] - * - * @param {String|Number} val - * @param {Object} options - * @return {String|Number} - * @api public - */ - -module.exports = function(val, options){ - options = options || {}; - if ('string' == typeof val) return parse(val); - return options.long - ? long(val) - : short(val); -}; - -/** - * Parse the given `str` and return milliseconds. - * - * @param {String} str - * @return {Number} - * @api private - */ - -function parse(str) { - var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str); - if (!match) return; - var n = parseFloat(match[1]); - var type = (match[2] || 'ms').toLowerCase(); - switch (type) { - case 'years': - case 'year': - case 'yrs': - case 'yr': - case 'y': - return n * y; - case 'days': - case 'day': - case 'd': - return n * d; - case 'hours': - case 'hour': - case 'hrs': - case 'hr': - case 'h': - return n * h; - case 'minutes': - case 'minute': - case 'mins': - case 'min': - case 'm': - return n * m; - case 'seconds': - case 'second': - case 'secs': - case 'sec': - case 's': - return n * s; - case 'milliseconds': - case 'millisecond': - case 'msecs': - case 'msec': - case 'ms': - return n; - } -} - -/** - * Short format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function short(ms) { - if (ms >= d) return Math.round(ms / d) + 'd'; - if (ms >= h) return Math.round(ms / h) + 'h'; - if (ms >= m) return Math.round(ms / m) + 'm'; - if (ms >= s) return Math.round(ms / s) + 's'; - return ms + 'ms'; -} - -/** - * Long format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function long(ms) { - return plural(ms, d, 'day') - || plural(ms, h, 'hour') - || plural(ms, m, 'minute') - || plural(ms, s, 'second') - || ms + ' ms'; -} - -/** - * Pluralization helper. - */ - -function plural(ms, n, name) { - if (ms < n) return; - if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name; - return Math.ceil(ms / n) + ' ' + name + 's'; -} diff --git a/update_nation/node_modules/nano/node_modules/debug/node_modules/ms/package.json b/update_nation/node_modules/nano/node_modules/debug/node_modules/ms/package.json deleted file mode 100644 index d9d1aac38..000000000 --- a/update_nation/node_modules/nano/node_modules/debug/node_modules/ms/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "ms", - "version": "0.7.0", - "description": "Tiny ms conversion utility", - "repository": { - "type": "git", - "url": "git://github.com/guille/ms.js.git" - }, - "main": "./index", - "devDependencies": { - "mocha": "*", - "expect.js": "*", - "serve": "*" - }, - "component": { - "scripts": { - "ms/index.js": "index.js" - } - }, - "readme": "# ms.js: miliseconds conversion utility\n\n```js\nms('2 days') // 172800000\nms('1d') // 86400000\nms('10h') // 36000000\nms('2.5 hrs') // 9000000\nms('2h') // 7200000\nms('1m') // 60000\nms('5s') // 5000\nms('100') // 100\n```\n\n```js\nms(60000) // \"1m\"\nms(2 * 60000) // \"2m\"\nms(ms('10 hours')) // \"10h\"\n```\n\n```js\nms(60000, { long: true }) // \"1 minute\"\nms(2 * 60000, { long: true }) // \"2 minutes\"\nms(ms('10 hours'), { long: true }) // \"10 hours\"\n```\n\n- Node/Browser compatible. Published as [`ms`](https://www.npmjs.org/package/ms) in [NPM](nodejs.org/download).\n- If a number is supplied to `ms`, a string with a unit is returned.\n- If a string that contains the number is supplied, it returns it as\na number (e.g: it returns `100` for `'100'`).\n- If you pass a string with a number and a valid unit, the number of\nequivalent ms is returned.\n\n## License\n\nMIT\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/guille/ms.js/issues" - }, - "homepage": "https://github.com/guille/ms.js", - "_id": "ms@0.7.0", - "_from": "ms@0.7.0" -} diff --git a/update_nation/node_modules/nano/node_modules/debug/package.json b/update_nation/node_modules/nano/node_modules/debug/package.json deleted file mode 100644 index 42f9ef989..000000000 --- a/update_nation/node_modules/nano/node_modules/debug/package.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "debug", - "version": "2.1.3", - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/debug.git" - }, - "description": "small debugging utility", - "keywords": [ - "debug", - "log", - "debugger" - ], - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "contributors": [ - { - "name": "Nathan Rajlich", - "email": "nathan@tootallnate.net", - "url": "http://n8.io" - } - ], - "license": "MIT", - "dependencies": { - "ms": "0.7.0" - }, - "devDependencies": { - "browserify": "9.0.3", - "mocha": "*" - }, - "main": "./node.js", - "browser": "./browser.js", - "component": { - "scripts": { - "debug/index.js": "browser.js", - "debug/debug.js": "debug.js" - } - }, - "readme": "# debug\n\n tiny node.js debugging utility modelled after node core's debugging technique.\n\n## Installation\n\n```bash\n$ npm install debug\n```\n\n## Usage\n\n With `debug` you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated `console.error`, so all of the `console` format string goodies you're used to work fine. A unique color is selected per-function for visibility.\n\nExample _app.js_:\n\n```js\nvar debug = require('debug')('http')\n , http = require('http')\n , name = 'My App';\n\n// fake app\n\ndebug('booting %s', name);\n\nhttp.createServer(function(req, res){\n debug(req.method + ' ' + req.url);\n res.end('hello\\n');\n}).listen(3000, function(){\n debug('listening');\n});\n\n// fake worker of some kind\n\nrequire('./worker');\n```\n\nExample _worker.js_:\n\n```js\nvar debug = require('debug')('worker');\n\nsetInterval(function(){\n debug('doing some work');\n}, 1000);\n```\n\n The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples:\n\n ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png)\n\n ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png)\n\n#### Windows note\n\n On Windows the environment variable is set using the `set` command. \n \n ```cmd\n set DEBUG=*,-not_this\n ```\n\nThen, run the program to be debugged as usual.\n\n## Millisecond diff\n\n When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the \"+NNNms\" will show you how much time was spent between calls.\n\n ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png)\n\n When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below:\n\n ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png)\n\n## Conventions\n\n If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use \":\" to separate features. For example \"bodyParser\" from Connect would then be \"connect:bodyParser\".\n\n## Wildcards\n\n The `*` character may be used as a wildcard. Suppose for example your library has debuggers named \"connect:bodyParser\", \"connect:compress\", \"connect:session\", instead of listing all three with `DEBUG=connect:bodyParser,connect.compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.\n\n You can also exclude specific debuggers by prefixing them with a \"-\" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with \"connect:\".\n\n## Browser support\n\n Debug works in the browser as well, currently persisted by `localStorage`. Consider the situation shown below where you have `worker:a` and `worker:b`, and wish to debug both. Somewhere in the code on your page, include:\n\n```js\nwindow.myDebug = require(\"debug\");\n```\n\n (\"debug\" is a global object in the browser so we give this object a different name.) When your page is open in the browser, type the following in the console:\n\n```js\nmyDebug.enable(\"worker:*\")\n```\n\n Refresh the page. Debug output will continue to be sent to the console until it is disabled by typing `myDebug.disable()` in the console.\n\n```js\na = debug('worker:a');\nb = debug('worker:b');\n\nsetInterval(function(){\n a('doing some work');\n}, 1000);\n\nsetInterval(function(){\n b('doing some work');\n}, 1200);\n```\n\n#### Web Inspector Colors\n\n Colors are also enabled on \"Web Inspectors\" that understand the `%c` formatting\n option. These are WebKit web inspectors, Firefox ([since version\n 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/))\n and the Firebug plugin for Firefox (any version).\n\n Colored output looks something like:\n\n ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png)\n\n### stderr vs stdout\n\nYou can set an alternative logging method per-namespace by overriding the `log` method on a per-namespace or globally:\n\nExample _stdout.js_:\n\n```js\nvar debug = require('debug');\nvar error = debug('app:error');\n\n// by default stderr is used\nerror('goes to stderr!');\n\nvar log = debug('app:log');\n// set this namespace to log via console.log\nlog.log = console.log.bind(console); // don't forget to bind to console!\nlog('goes to stdout');\nerror('still goes to stderr!');\n\n// set all output to go via console.info\n// overrides all per-namespace log settings\ndebug.log = console.info.bind(console);\nerror('now goes to stdout via console.info');\nlog('still goes to stdout, but via console.info now');\n```\n\n## Authors\n\n - TJ Holowaychuk\n - Nathan Rajlich\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/visionmedia/debug/issues" - }, - "homepage": "https://github.com/visionmedia/debug", - "_id": "debug@2.1.3", - "_from": "debug@^2.0.0" -} diff --git a/update_nation/node_modules/nano/node_modules/errs/.npmignore b/update_nation/node_modules/nano/node_modules/errs/.npmignore deleted file mode 100644 index 8d4c2d1d2..000000000 --- a/update_nation/node_modules/nano/node_modules/errs/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -.DS_Store -npm-debug.log \ No newline at end of file diff --git a/update_nation/node_modules/nano/node_modules/errs/.travis.yml b/update_nation/node_modules/nano/node_modules/errs/.travis.yml deleted file mode 100644 index b6a50e4cb..000000000 --- a/update_nation/node_modules/nano/node_modules/errs/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: node_js -node_js: - - 0.8 - - 0.10 - -notifications: - email: - - travis@nodejitsu.com - irc: "irc.freenode.org#nodejitsu" - diff --git a/update_nation/node_modules/nano/node_modules/errs/LICENSE b/update_nation/node_modules/nano/node_modules/errs/LICENSE deleted file mode 100644 index 12fd0a3c3..000000000 --- a/update_nation/node_modules/nano/node_modules/errs/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2012 Charlie Robbins, Nuno Job, and the Contributors. - -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/update_nation/node_modules/nano/node_modules/errs/README.md b/update_nation/node_modules/nano/node_modules/errs/README.md deleted file mode 100644 index f6f2e55b3..000000000 --- a/update_nation/node_modules/nano/node_modules/errs/README.md +++ /dev/null @@ -1,256 +0,0 @@ -# errs [![Build Status](https://secure.travis-ci.org/flatiron/errs.png)](http://travis-ci.org/flatiron/errs) - -Simple error creation and passing utilities focused on: - -* [Creating Errors](#creating-errors) -* [Reusing Error Types](#reusing-types) -* [Merging with Existing Errors](#merging-errors) -* [Optional Callback Invocation](#optional-invocation) -* [Piping Error Events](#piping-errors) - -
-## Creating Errors - -You should know by now that [a String is not an Error][0]. Unfortunately the `Error` constructor in Javascript isn't all that convenient either. How often do you find yourself in this situation? - -``` js - var err = new Error('This is an error. There are many like it.'); - err.someProperty = 'more syntax'; - err.someOtherProperty = 'it wont stop.'; - err.notEven = 'for the mayor'; - - throw err; -``` - -Rest your fingers, `errs` is here to help. The following is equivalent to the above: - -``` js - var errs = require('errs'); - - throw errs.create({ - message: 'This is an error. There are many like it.', - someProperty: 'more syntax', - someOtherProperty: 'it wont stop.', - notEven: 'for the mayor' - }); -``` - - -## Reusing Custom Error Types - -`errs` also exposes an [inversion of control][1] interface for easily reusing custom error types across your application. Custom Error Types registered with `errs` will transparently invoke `Error` constructor and `Error.captureStackTrace` to attach transparent stack traces: - -``` js - /* - * file-a.js: Create and register your error type. - * - */ - - var util = require('util'), - errs = require('errs'); - - function MyError() { - this.message = 'This is my error; I made it myself. It has a transparent stack trace.'; - } - - // - // Alternatively `MyError.prototype.__proto__ = Error;` - // - util.inherits(MyError, Error); - - // - // Register the error type - // - errs.register('myerror', MyError); - - - - /* - * file-b.js: Use your error type. - * - */ - - var errs = require('errs'); - - console.log( - errs.create('myerror') - .stack - .split('\n') - ); -``` - -The output from the two files above is shown below. Notice how it contains no references to `errs.js`: - -``` -[ 'MyError: This is my error; I made it myself. It has a transparent stack trace.', - ' at Object. (/file-b.js:19:8)', - ' at Module._compile (module.js:441:26)', - ' at Object..js (module.js:459:10)', - ' at Module.load (module.js:348:31)', - ' at Function._load (module.js:308:12)', - ' at Array.0 (module.js:479:10)', - ' at EventEmitter._tickCallback (node.js:192:40)' ] -``` - - -## Merging with Existing Errors - -When working with errors you catch or are returned in a callback you can extend those errors with properties by using the `errs.merge` method. This will also create a human readable error message and stack-trace: - -``` js -process.on('uncaughtException', function(err) { - console.log(errs.merge(err, {namespace: 'uncaughtException'})); -}); - -var file = fs.createReadStream('FileDoesNotExist.here'); -``` - -``` js -{ [Error: Unspecified error] - name: 'Error', - namespace: 'uncaughtException', - errno: 34, - code: 'ENOENT', - path: 'FileDoesNotExist.here', - description: 'ENOENT, no such file or directory \'FileDoesNotExist.here\'', - stacktrace: [ 'Error: ENOENT, no such file or directory \'FileDoesNotExist.here\'' ] } -``` - - -## Optional Callback Invocation - -Node.js handles asynchronous IO through the elegant `EventEmitter` API. In many scenarios the `callback` may be optional because you are returning an `EventEmitter` for piping or other event multiplexing. This complicates code with a lot of boilerplate: - -``` js - function importantFeature(callback) { - return someAsyncFn(function (err) { - if (err) { - if (callback) { - return callback(err); - } - - throw err; - } - }); - } -``` - -`errs` it presents a common API for both emitting `error` events and invoking continuations (i.e. callbacks) with errors. If a `callback` is supplied to `errs.handle()` it will be invoked with the error. It no `callback` is provided then an `EventEmitter` is returned which emits an `error` event on the next tick: - -``` js - function importantFeature(callback) { - return someAsyncFn(function (err) { - if (err) { - return errs.handle(err, callback); - } - }); - } -``` - - -## Piping Errors - -Often when working with streams (especially when buffering for whatever reason), you may have already returned an `EventEmitter` or `Stream` instance by the time an error is handled. - -``` js - function pipeSomething(callback) { - // - // You have a stream (e.g. http.ResponseStream) and you - // have an optional `callback`. - // - var stream = new require('stream').Stream; - - // - // You need to do something async which may respond with an - // error - // - getAnotherStream(function (err, source) { - if (err) { - if (callback) - callback(err); - } - - stream.emit('error', err); - return; - } - - source.pipe(stream); - }) - - return stream; - } -``` - -You may pass either a `function` or `EventEmitter` instance to `errs.handle`. - -``` js - function pipeSomething(callback) { - // - // You have a stream (e.g. http.ResponseStream) and you - // have an optional `callback`. - // - var stream = new require('stream').Stream; - - // - // You need to do something async which may respond with an - // error - // - getAnotherStream(function (err, source) { - if (err) { - // - // Invoke the callback if it exists otherwise the stream. - // - return errs.handle(err, callback || stream); - } - - source.pipe(stream); - }) - - return stream; - } -``` - -If you wish to invoke both a `callback` function and an `error` event simply pass both: - -``` js - errs.handle(err, callback, stream); -``` - -## Methods -The `errs` modules exposes some simple utility methods: - -* `.create(type, opts)`: Creates a new error instance for with the specified `type` and `opts`. If the `type` is not registered then a new `Error` instance will be created. -* `.register(type, proto)`: Registers the specified `proto` to `type` for future calls to `errors.create(type, opts)`. -* `.unregister(type)`: Unregisters the specified `type` for future calls to `errors.create(type, opts)`. -* `.handle(err, callback)`: Attempts to instantiate the given `error`. If the `error` is already a properly formed `error` object (with a `stack` property) it will not be modified. -* `.merge(err, type, opts)`: Merges an existing error with a new error instance for with the specified `type` and `opts`. - -## Installation - -### Installing npm (node package manager) - -``` bash - $ curl http://npmjs.org/install.sh | sh -``` - -### Installing errs - -``` bash - $ [sudo] npm install errs -``` - -## Tests -All tests are written with [vows][2] and should be run with [npm][3]: - -``` bash - $ npm test -``` - -#### Author: [Charlie Robbins](http://github.com/indexzero) -#### Contributors: [Nuno Job](http://github.com/dscape) -#### License: MIT - -[0]: http://www.devthought.com/2011/12/22/a-string-is-not-an-error/ -[1]: http://martinfowler.com/articles/injection.html -[2]: https://vowsjs.org -[3]: https://npmjs.org diff --git a/update_nation/node_modules/nano/node_modules/errs/examples/async-uncaught-exception.js b/update_nation/node_modules/nano/node_modules/errs/examples/async-uncaught-exception.js deleted file mode 100644 index 7cbf42dd8..000000000 --- a/update_nation/node_modules/nano/node_modules/errs/examples/async-uncaught-exception.js +++ /dev/null @@ -1,9 +0,0 @@ -var fs = require('fs'), - errs = require('../lib/errs'); - -process.on('uncaughtException', function(err) { - console.log(errs.merge(err, {namespace: 'uncaughtException'})); -}); - -var file = fs.createReadStream(__filename, {encoding: 'utf8'}); -file.on('data', function(b) { throw new Error('Oh Noes'); }); diff --git a/update_nation/node_modules/nano/node_modules/errs/examples/custom-error.js b/update_nation/node_modules/nano/node_modules/errs/examples/custom-error.js deleted file mode 100644 index b964e31ae..000000000 --- a/update_nation/node_modules/nano/node_modules/errs/examples/custom-error.js +++ /dev/null @@ -1,22 +0,0 @@ -var util = require('util'), - errs = require('../lib/errs'); - -function MyError () { - this.message = 'This is my error; I made it myself. It has a transparent stack trace.'; -} - -// -// Alternatively `MyError.prototype.__proto__ = Error;` -// -util.inherits(MyError, Error); - -// -// Register the error type -// -errs.register('myerror', MyError); - -console.log( - errs.create('myerror') - .stack - .split('\n') -); \ No newline at end of file diff --git a/update_nation/node_modules/nano/node_modules/errs/examples/handling-streams.js b/update_nation/node_modules/nano/node_modules/errs/examples/handling-streams.js deleted file mode 100644 index 725b59cee..000000000 --- a/update_nation/node_modules/nano/node_modules/errs/examples/handling-streams.js +++ /dev/null @@ -1,14 +0,0 @@ -var fs = require('fs'), - errs = require('../lib/errs'); - -function safeReadStream(no_such_file, callback) { - try { - return fs.createReadStream(no_such_file, callback); - } catch (err) { - return errs.handle(err, callback); - } -} - -// would throw, now even without a callback it gets picked as a stream -var file = fs.createReadStream('FileDoesNotExist.here'); -file.on('error', function (err) { console.log(err); }); \ No newline at end of file diff --git a/update_nation/node_modules/nano/node_modules/errs/examples/stack.js b/update_nation/node_modules/nano/node_modules/errs/examples/stack.js deleted file mode 100644 index 3672807b5..000000000 --- a/update_nation/node_modules/nano/node_modules/errs/examples/stack.js +++ /dev/null @@ -1,7 +0,0 @@ -var errs = require('../lib/errs'); - -console.log( - errs.create('This is an error. There are many like it. It has a transparent stack trace.') - .stack - .split('\n') -); \ No newline at end of file diff --git a/update_nation/node_modules/nano/node_modules/errs/examples/sync-uncaught-exception.js b/update_nation/node_modules/nano/node_modules/errs/examples/sync-uncaught-exception.js deleted file mode 100644 index 11b04efa4..000000000 --- a/update_nation/node_modules/nano/node_modules/errs/examples/sync-uncaught-exception.js +++ /dev/null @@ -1,8 +0,0 @@ -var fs = require('fs'), - errs = require('../lib/errs'); - -process.on('uncaughtException', function(err) { - console.log(errs.merge(err, {namespace: 'uncaughtException'})); -}); - -var file = fs.createReadStream('FileDoesNotExist.here'); diff --git a/update_nation/node_modules/nano/node_modules/errs/lib/errs.js b/update_nation/node_modules/nano/node_modules/errs/lib/errs.js deleted file mode 100644 index 6beaaf3b5..000000000 --- a/update_nation/node_modules/nano/node_modules/errs/lib/errs.js +++ /dev/null @@ -1,276 +0,0 @@ -/* - * errs.js: Simple error creation and passing utilities. - * - * (C) 2012, Charlie Robbins, Nuno Job, and the Contributors. - * MIT LICENSE - * - */ - -var events = require('events'), - util = require('util'); - -// -// Container for registered error types. -// -exports.registered = {}; - -// -// Add `Error.prototype.toJSON` if it doesn't exist. -// -if (!Error.prototype.toJSON) { - Object.defineProperty(Error.prototype, 'toJSON', { - enumerable: false, - writable: true, - value: function () { - return mixin({ - message: this.message, - stack: this.stack, - arguments: this.arguments, - type: this.type - }, this); - } - }); -} - -// -// ### function create (type, opts) -// #### @type {string} **Optional** Registered error type to create -// #### @opts {string|object|Array|function} Options for creating the error: -// * `string`: Message for the error -// * `object`: Properties to include on the error -// * `array`: Message for the error (' ' joined). -// * `function`: Function to return error options. -// -// Creates a new error instance for with the specified `type` -// and `options`. If the `type` is not registered then a new -// `Error` instance will be created. -// -exports.create = function createErr(type, opts) { - if (!arguments[1] && !exports.registered[type]) { - opts = type; - type = null; - } - - // - // If the `opts` has a `stack` property assume - // that it is already an error instance. - // - if (opts && opts.stack) { - return opts; - } - - var message, - ErrorProto, - error; - - // - // Parse arguments liberally for the message - // - if (typeof opts === 'function') { - opts = opts(); - } - - if (Array.isArray(opts)) { - message = opts.join(' '); - opts = null; - } - else if (opts) { - switch (typeof opts) { - case 'string': - message = opts || 'Unspecified error'; - opts = null; - break; - case 'object': - message = (opts && opts.message) || 'Unspecified error'; - break; - default: - message = 'Unspecified error'; - break; - } - } - - // - // Instantiate a new Error instance or a new - // registered error type (if it exists). - // - ErrorProto = type && exports.registered[type] || Error; - error = new (ErrorProto)(message); - - if (!error.name || error.name === 'Error') { - error.name = (opts && opts.name) || ErrorProto.name || 'Error'; - } - - // - // Capture a stack trace if it does not already exist and - // remote the part of the stack trace referencing `errs.js`. - // - if (!error.stack) { - Error.call(error); - Error.captureStackTrace(error, createErr); - } - else { - error.stack = error.stack.split('\n'); - error.stack.splice(1, 1); - error.stack = error.stack.join('\n'); - } - - // - // Copy all options to the new error instance. - // - if (opts) { - Object.keys(opts).forEach(function (key) { - error[key] = opts[key]; - }); - } - - return error; -}; - -// -// ### function merge (err, type, opts) -// #### @err {error} **Optional** The error to merge -// #### @type {string} **Optional** Registered error type to create -// #### @opts {string|object|Array|function} Options for creating the error: -// * `string`: Message for the error -// * `object`: Properties to include on the error -// * `array`: Message for the error (' ' joined). -// * `function`: Function to return error options. -// -// Merges an existing error with a new error instance for with -// the specified `type` and `options`. -// -exports.merge = function (err, type, opts) { - var merged = exports.create(type, opts); - - // - // If there is no error just return the merged one - // - if (err == undefined || err == null) { - return merged; - } - - // - // optional stuff that might be created by module - // - if (!Array.isArray(err) && typeof err === 'object') { - Object.keys(err).forEach(function (key) { - // - // in node v0.4 v8 errors where treated differently - // we need to make sure we aren't merging these properties - // http://code.google.com/p/v8/issues/detail?id=1215 - // - if (['stack', 'type', 'arguments', 'message'].indexOf(key)===-1) { - merged[key] = err[key]; - } - }); - } - - // merging - merged.name = merged.name || err.name; - merged.message = merged.message || err.message; - - // override stack - merged.stack = err.stack || merged.stack; - - // add human-readable errors - if (err.message) { - merged.description = err.message; - } - - if (err.stack && err.stack.split) { - merged.stacktrace = err.stack.split("\n"); - } - - return merged; -}; - -// -// ### function handle (error, callback) -// #### @error {string|function|Array|object} Error to handle -// #### @callback {function|EventEmitter} **Optional** Continuation or stream to pass the error to. -// #### @stream {EventEmitter} **Optional** Explicit EventEmitter to use. -// -// Attempts to instantiate the given `error`. If the `error` is already a properly -// formed `error` object (with a `stack` property) it will not be modified. -// -// * If `callback` is a function, it is invoked with the `error`. -// * If `callback` is an `EventEmitter`, it emits the `error` event on -// that emitter and returns it. -// * If no `callback`, return a new `EventEmitter` which emits `error` -// on `process.nextTick()`. -// -exports.handle = function (error, callback, stream) { - error = exports.create(error); - - if (typeof callback === 'function') { - callback(error); - } - - if (typeof callback !== 'function' || stream) { - var emitter = stream || callback || new events.EventEmitter(); - process.nextTick(function () { emitter.emit('error', error); }); - return emitter; - } -}; - -// -// ### function register (type, proto) -// #### @type {string} **Optional** Type of the error to register. -// #### @proto {function} Constructor function of the error to register. -// -// Registers the specified `proto` to `type` for future calls to -// `errors.create(type, opts)`. -// -exports.register = function (type, proto) { - if (arguments.length === 1) { - proto = type; - type = proto.name.toLowerCase(); - } - exports.registered[type] = proto; -}; - -// -// ### function unregister (type) -// #### @type {string} Type of the error to unregister. -// -// Unregisters the specified `type` for future calls to -// `errors.create(type, opts)`. -// -exports.unregister = function (type) { - delete exports.registered[type]; -}; - -// -// ### function mixin (target [source0, source1, ...]) -// Copies enumerable properties from `source0 ... sourceN` -// onto `target` and returns the resulting object. -// -function mixin(target) { - // - // Quickly and performantly (in V8) `Arrayify` arguments. - // - var len = arguments.length, - args = new Array(len - 1), - i = 1; - - for (; i < len; i++) { - args[i - 1] = arguments[i]; - } - - args.forEach(function (o) { - Object.keys(o).forEach(function (attr) { - var getter = o.__lookupGetter__(attr), - setter = o.__lookupSetter__(attr); - - if (!getter && !setter) { - target[attr] = o[attr]; - } - else { - if (setter) { target.__defineSetter__(attr, setter) } - if (getter) { target.__defineGetter__(attr, getter) } - } - }); - }); - - return target; -} diff --git a/update_nation/node_modules/nano/node_modules/errs/package.json b/update_nation/node_modules/nano/node_modules/errs/package.json deleted file mode 100644 index 4c64e0a54..000000000 --- a/update_nation/node_modules/nano/node_modules/errs/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "errs", - "description": "Simple error creation and passing utilities", - "version": "0.3.2", - "author": { - "name": "Charlie Robbins", - "email": "charlie.robbins@gmail.com" - }, - "maintainers": [ - { - "name": "indexzero", - "email": "charlie.robbins@gmail.com" - } - ], - "repository": { - "type": "git", - "url": "http://github.com/indexzero/errs.git" - }, - "keywords": [ - "errors", - "error", - "utilities" - ], - "devDependencies": { - "vows": "0.8.x" - }, - "main": "./lib/errs", - "scripts": { - "test": "vows test/*-test.js --spec" - }, - "engines": { - "node": ">= 0.4.0" - }, - "gitHead": "a0b8f3beeb97ee041750f617fca12e7a0fc6bcfb", - "bugs": { - "url": "https://github.com/indexzero/errs/issues" - }, - "homepage": "https://github.com/indexzero/errs", - "_id": "errs@0.3.2", - "_shasum": "798099b2dbd37ca2bc749e538a7c1307d0b50499", - "_from": "errs@^0.3.0", - "_npmVersion": "2.1.9", - "_nodeVersion": "0.10.33", - "_npmUser": { - "name": "indexzero", - "email": "charlie.robbins@gmail.com" - }, - "dist": { - "shasum": "798099b2dbd37ca2bc749e538a7c1307d0b50499", - "tarball": "http://registry.npmjs.org/errs/-/errs-0.3.2.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/errs/-/errs-0.3.2.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/update_nation/node_modules/nano/node_modules/errs/test/errs-test.js b/update_nation/node_modules/nano/node_modules/errs/test/errs-test.js deleted file mode 100644 index 2c9d39a77..000000000 --- a/update_nation/node_modules/nano/node_modules/errs/test/errs-test.js +++ /dev/null @@ -1,225 +0,0 @@ -/* - * errs-test.js: Tests for the `errs` module. - * - * (C) 2012, Charlie Robbins, Nuno Job, and the Contributors. - * MIT LICENSE - * - */ - -var assert = require('assert'), - events = require('events'), - vows = require('vows'), - errs = require('../lib/errs'), - fixtures = require('./fixtures'), - macros = require('./macros'); - -var opts = [{ - foo: 'bar', - status: 404, - whatever: 'some other property' -}, { - testing: true, - 'some-string': 'is-a-value', - message: 'This is an error. There are many like it.' -}, { - 'a-function': 'that returns an object', - should: true, - have: 4, - properties: 'yes' -}]; - -vows.describe('errs').addBatch({ - "Using errs module": { - "the register() method": { - "should register the prototype": function () { - errs.register('named', fixtures.NamedError); - assert.equal(errs.registered['named'], fixtures.NamedError); - }, - "should register an error without providing its name": function () { - errs.register(fixtures.AnError); - assert.equal(errs.registered['anerror'], fixtures.AnError); - } - }, - "the create() method with": { - "a string": macros.create.string('An error as a string'), - "no parameters": macros.create.string('An error as a string'), - "an object": { - "that has no message": macros.create.object(opts[0]), - "that has a message": macros.create.object(opts[1]), - "that has a name": { - topic : errs.create({name: 'OverflowError'}), - "should respect that name in the stack trace" : function (err) { - assert.match(err.stack, /^OverflowError/); - }, - } - }, - "an error": macros.create.err(new Error('An instance of an error')), - "a function": macros.create.fn(function () { - return opts[2]; - }), - "a registered type": { - "that exists": macros.create.registered('named', fixtures.NamedError, opts[1]), - "that doesnt exist": macros.create.registered('bad', null, opts[1]) - } - }, - "the handle() method": { - "with a callback": { - topic: function () { - var err = this.err = errs.create('Some async error'); - errs.handle(err, this.callback.bind(this, null)); - }, - "should invoke the callback with the error": function (_, err) { - assert.equal(err, this.err); - } - }, - "with an EventEmitter (i.e. stream)": { - topic: function () { - var err = this.err = errs.create('Some emitted error'), - stream = new events.EventEmitter(); - - stream.once('error', this.callback.bind(this, null)); - errs.handle(err, stream); - }, - "should emit the `error` event": function (_, err) { - assert.equal(err, this.err); - } - }, - "with a callback and an EventEmitter": { - topic: function () { - var err = this.err = errs.create('Some emitted error'), - stream = new events.EventEmitter(), - invoked = 0, - that = this; - - function onError(err) { - if (++invoked === 2) { - that.callback.call(that, null, err); - } - } - - stream.once('error', onError); - errs.handle(err, onError, stream); - }, - "should emit the `error` event": function (_, err) { - assert.equal(err, this.err); - } - }, - "with no callback": { - topic: function () { - var err = this.err = errs.create('Some emitted error'), - emitter = errs.handle(err); - - emitter.once('error', this.callback.bind(this, null)); - }, - "should emit the `error` event": function (_, err) { - assert.equal(err, this.err); - } - } - } - } -}).addBatch({ - "Using errs module": { - "the unregister() method": { - "should unregister the prototype": function () { - errs.unregister('named'); - assert.isTrue(!errs.registered['named']); - } - } - } -}).addBatch({ - "Using errs module": { - "the merge() method": { - "supports": { - "an undefined error": function () { - var err = errs.merge(undefined, { message: 'oh noes!' }); - assert.equal(err.message, 'oh noes!') - assert.instanceOf(err, Error); - }, - "a null error": function () { - var err = errs.merge(null, { message: 'oh noes!' }); - assert.equal(err.message, 'oh noes!') - assert.instanceOf(err, Error); - }, - "a false error": function () { - var err = errs.merge(false, { message: 'oh noes!' }); - assert.equal(err.message, 'oh noes!') - assert.instanceOf(err, Error); - }, - "a string error": function () { - var err = errs.merge('wat', { message: 'oh noes!' }); - assert.equal(err.message, 'oh noes!'); - assert.instanceOf(err, Error); - }, - }, - "should preserve custom properties": function () { - var err = new Error('Msg!'); - err.foo = "bar"; - err = errs.merge(err, {message: "Override!", ns: "test"}); - assert.equal(err.foo, "bar"); - }, - "should have a stack trace": function () { - var err = new Error('Msg!'); - err = errs.merge(err, {}); - assert.isTrue(Array.isArray(err.stacktrace)); - }, - "should preserve message specified in create": function () { - var err = new Error('Msg!'); - err = errs.merge(err, {message: "Override!"}); - assert.equal(err.message, "Override!"); - }, - "should preserve properties specified": function () { - var err = new Error('Msg!'); - err = errs.merge(err, {ns: "test"}); - assert.equal(err.ns, "test"); - }, - "with a truthy value": function () { - var err = errs.merge(true, { - message: 'Override!', - ns: 'lolwut' - }) - assert.equal(err.message, 'Override!'); - assert.equal(err.ns, 'lolwut'); - }, - "with a truthy stack": function () { - var err = errs.merge({ stack: true } , { - message: 'Override!', - ns: 'lolwut' - }) - assert.equal(err.message, 'Override!'); - assert.equal(err.ns, 'lolwut'); - }, - "with an Array stack": function () { - var err = errs.merge({ stack: [] } , { - message: 'Override!', - ns: 'lolwut' - }) - assert.equal(err.message, 'Override!'); - assert.equal(err.ns, 'lolwut'); - } - } - } -}).addBatch({ - "Using errs module": { - "Error.prototype.toJSON": { - "should exist": function () { - assert.isFunction(Error.prototype.toJSON); - - var json = (new Error('Testing 12345')).toJSON(); - - ['message', 'stack', 'arguments', 'type'].forEach(function (prop) { - assert.isObject(Object.getOwnPropertyDescriptor(json, prop)); - }) - }, - "should be writable": function () { - var orig = Error.prototype.toJSON; - Error.prototype.toJSON = function() { - return 'foo'; - }; - var json = (new Error('Testing 12345')).toJSON(); - - assert.equal(json, 'foo'); - Error.prototype.toJSON = orig; - } - } - } -}).export(module); diff --git a/update_nation/node_modules/nano/node_modules/errs/test/fixtures.js b/update_nation/node_modules/nano/node_modules/errs/test/fixtures.js deleted file mode 100644 index cc13b2278..000000000 --- a/update_nation/node_modules/nano/node_modules/errs/test/fixtures.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * fixtures.js: Test fixtures for the `errs` module. - * - * (C) 2012, Charlie Robbins, Nuno Job, and the Contributors. - * MIT LICENSE - * - */ - -var util = require('util'); - -var fixtures = exports; - -fixtures.NamedError = function NamedError() { - this.named = true; -}; - -util.inherits(fixtures.NamedError, Error); - -fixtures.AnError = function AnError() { - this.named = true; -}; - -util.inherits(fixtures.AnError, Error); diff --git a/update_nation/node_modules/nano/node_modules/errs/test/macros.js b/update_nation/node_modules/nano/node_modules/errs/test/macros.js deleted file mode 100644 index 2b962d40d..000000000 --- a/update_nation/node_modules/nano/node_modules/errs/test/macros.js +++ /dev/null @@ -1,91 +0,0 @@ -/* - * macros.js: Test macros for the `errs` module. - * - * (C) 2012, Charlie Robbins, Nuno Job, and the Contributors. - * MIT LICENSE - * - */ - -var assert = require('assert'), - errs = require('../lib/errs'); - -var macros = exports; - -function assertTransparentStack(err) { - assert.isString(err.stack); - err.stack.split('\n').forEach(function (line) { - assert.isFalse(/\/lib\/errs\.js\:/.test(line)); - }); -} - -// -// Macros for `errs.create(type, opts)`. -// -macros.create = {}; - -macros.create.string = function (msg) { - return { - topic: errs.create(msg), - "should create an error with the correct message": function (err) { - assert.instanceOf(err, Error); - assert.equal(msg, err.message); - assertTransparentStack(err); - } - }; -}; - -macros.create.object = function (obj) { - return { - topic: errs.create(obj), - "should create an error with the specified properties": function (err) { - assert.instanceOf(err, Error); - assert.equal(err.message, obj.message || 'Unspecified error'); - assertTransparentStack(err); - Object.keys(obj).forEach(function (key) { - assert.equal(err[key], obj[key]); - }); - } - }; -}; - -macros.create.err = function (inst) { - return { - topic: errs.create(inst), - "should return the error unmodified": function (err) { - assert.equal(err, inst); - assertTransparentStack(err); - } - }; -}; - -macros.create.fn = function (fn) { - var obj = fn(); - - return { - topic: errs.create(fn), - "should create an error with the specified properties": function (err) { - assert.instanceOf(err, Error); - assert.equal(err.message, obj.message || 'Unspecified error'); - assertTransparentStack(err); - Object.keys(obj).forEach(function (key) { - assert.equal(err[key], obj[key]); - }); - } - }; -}; - -macros.create.registered = function (type, proto, obj) { - return { - topic: function () { - return errs.create(type, obj); - }, - "should create an error of the correct type": function (err) { - assert.instanceOf(err, proto || Error); - assert.equal(err.message, obj.message || 'Unspecified error'); - assertTransparentStack(err); - Object.keys(obj).forEach(function (key) { - assert.equal(err[key], obj[key]); - }); - } - }; -}; \ No newline at end of file diff --git a/update_nation/node_modules/nano/node_modules/follow/.npmignore b/update_nation/node_modules/nano/node_modules/follow/.npmignore deleted file mode 100644 index 76c509fa9..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -./.gitignore -./Rakefile -./browser/ diff --git a/update_nation/node_modules/nano/node_modules/follow/.travis.yml b/update_nation/node_modules/nano/node_modules/follow/.travis.yml deleted file mode 100644 index c9d2314bf..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: node_js -before_install: - - curl --location http://git.io/1OcIZA | bash -s -services: - - couchdb -node_js: - - "0.8" - - "0.10" - - "0.11" diff --git a/update_nation/node_modules/nano/node_modules/follow/AUTHORS b/update_nation/node_modules/nano/node_modules/follow/AUTHORS deleted file mode 100644 index 862622dd0..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/AUTHORS +++ /dev/null @@ -1,2 +0,0 @@ -Jason Smith Work -Jason Smith diff --git a/update_nation/node_modules/nano/node_modules/follow/LICENSE b/update_nation/node_modules/nano/node_modules/follow/LICENSE deleted file mode 100644 index d64569567..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/update_nation/node_modules/nano/node_modules/follow/README.md b/update_nation/node_modules/nano/node_modules/follow/README.md deleted file mode 100644 index 46789cac8..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/README.md +++ /dev/null @@ -1,198 +0,0 @@ -# Follow: CouchDB changes and db updates notifier for NodeJS - -[![build -status](https://secure.travis-ci.org/iriscouch/follow.png)](http://travis-ci.org/iriscouch/follow) - -Follow (upper-case *F*) comes from an internal Iris Couch project used in production for over a year. It works in the browser (beta) and is available as an NPM module. - - $ npm install follow - -## Example - -This looks much like the [request][req] API. - -```javascript -var follow = require('follow'); -follow("https://example.iriscouch.com/boogie", function(error, change) { - if(!error) { - console.log("Got change number " + change.seq + ": " + change.id); - } -}) -``` - -The *error* parameter to the callback will basically always be `null`. - -## Objective - -The API must be very simple: notify me every time a change happens in the DB. Also, never fail. - -If an error occurs, Follow will internally retry without notifying your code. - -Specifically, this should be possible: - -1. Begin a changes feed. Get a couple of change callbacks -2. Shut down CouchDB -3. Go home. Have a nice weekend. Come back on Monday. -4. Start CouchDB with a different IP address -5. Make a couple of changes -6. Update DNS so the domain points to the new IP -7. Once DNS propagates, get a couple more change callbacks - -## Failure Mode - -If CouchDB permanently crashes, there is an option of failure modes: - -* **Default:** Simply never call back with a change again -* **Optional:** Specify an *inactivity* timeout. If no changes happen by the timeout, Follow will signal an error. - -## DB Updates - -If the db url ends with `/_db_updates`, Follow will provide a -[_db_updates](http://docs.couchdb.org/en/latest/api/server/common.html?highlight=db_updates#get--_db_updates) feed. - -Note that this feature is available as of CouchDB 1.4. - -### Simple API: follow(options, callback) - -The first argument is an options object. The only required option is `db`. Instead of an object, you can use a string to indicate the `db` value. - -```javascript -follow({db:"https://example.iriscouch.com/boogie", include_docs:true}, function(error, change) { - if(!error) { - console.log("Change " + change.seq + " has " + Object.keys(change.doc).length + " fields"); - } -}) -``` - - -All of the CouchDB _changes options are allowed. See http://guide.couchdb.org/draft/notifications.html. - -* `db` | Fully-qualified URL of a couch database. (Basic auth URLs are ok.) -* `since` | The sequence number to start from. Use `"now"` to start from the latest change in the DB. -* `heartbeat` | Milliseconds within which CouchDB must respond (default: **30000** or 30 seconds) -* `feed` | **Optional but only "continuous" is allowed** -* `filter` | - * **Either** a path to design document filter, e.g. `app/important` - * **Or** a Javascript `function(doc, req) { ... }` which should return true or false -* `query_params` | **Optional** for use in with `filter` functions, passed as `req.query` to the filter function - -Besides the CouchDB options, more are available: - -* `headers` | Object with HTTP headers to add to the request -* `inactivity_ms` | Maximum time to wait between **changes**. Omitting this means no maximum. - -## Object API - -The main API is a thin wrapper around the EventEmitter API. - -```javascript -var follow = require('follow'); - -var opts = {}; // Same options paramters as before -var feed = new follow.Feed(opts); - -// You can also set values directly. -feed.db = "http://example.iriscouch.com/boogie"; -feed.since = 3; -feed.heartbeat = 30 * 1000 -feed.inactivity_ms = 86400 * 1000; - -feed.filter = function(doc, req) { - // req.query is the parameters from the _changes request and also feed.query_params. - console.log('Filtering for query: ' + JSON.stringify(req.query)); - - if(doc.stinky || doc.ugly) - return false; - return true; -} - -feed.on('change', function(change) { - console.log('Doc ' + change.id + ' in change ' + change.seq + ' is neither stinky nor ugly.'); -}) - -feed.on('error', function(er) { - console.error('Since Follow always retries on errors, this must be serious'); - throw er; -}) - -feed.follow(); -``` - - -## Pause and Resume - -A Follow feed is a Node.js stream. If you get lots of changes and processing them takes a while, use `.pause()` and `.resume()` as needed. Pausing guarantees that no new events will fire. Resuming guarantees you'll pick up where you left off. - -```javascript -follow("https://example.iriscouch.com/boogie", function(error, change) { - var feed = this - - if(change.seq == 1) { - console.log('Uh oh. The first change takes 30 hours to process. Better pause.') - feed.pause() - setTimeout(function() { feed.resume() }, 30 * 60 * 60 * 1000) - } - - // ... 30 hours with no events ... - - else - console.log('No need to pause for normal change: ' + change.id) -}) -``` - - -## Events - -The feed object is an EventEmitter. There are a few ways to get a feed object: - -* Use the object API above -* Use the return value of `follow()` -* In the callback to `follow()`, the *this* variable is bound to the feed object. - -Once you've got one, you can subscribe to these events: - -* **start** | Before any i/o occurs -* **confirm_request** | `function(req)` | The database confirmation request is sent; passed the `request` object -* **confirm** | `function(db_obj)` | The database is confirmed; passed the couch database object -* **change** | `function(change)` | A change occured; passed the change object from CouchDB -* **catchup** | `function(seq_id)` | The feed has caught up to the *update_seq* from the confirm step. Assuming no subsequent changes, you have seen all the data. -* **wait** | Follow is idle, waiting for the next data chunk from CouchDB -* **timeout** | `function(info)` | Follow did not receive a heartbeat from couch in time. The passed object has `.elapsed_ms` set to the elapsed time -* **retry** | `function(info)` | A retry is scheduled (usually after a timeout or disconnection). The passed object has - * `.since` the current sequence id - * `.after` the milliseconds to wait before the request occurs (on an exponential fallback schedule) - * `.db` the database url (scrubbed of basic auth credentials) -* **stop** | The feed is stopping, because of an error, or because you called `feed.stop()` -* **error** | `function(err)` | An error occurs - -## Error conditions - -Follow is happy to retry over and over, for all eternity. It will only emit an error if it thinks your whole application might be in trouble. - -* *DB confirmation* failed: Follow confirms the DB with a preliminary query, which must reply properly. -* *DB is deleted*: Even if it retried, subsequent sequence numbers would be meaningless to your code. -* *Your inactivity timer* expired: This is a last-ditch way to detect possible errors. What if couch is sending heartbeats just fine, but nothing has changed for 24 hours? You know that for your app, 24 hours with no change is impossible. Maybe your filter has a bug? Maybe you queried the wrong DB? Whatever the reason, Follow will emit an error. -* JSON parse error, which should be impossible from CouchDB -* Invalid change object format, which should be impossible from CouchDB -* Internal error, if the internal state seems wrong, e.g. cancelling a timeout that already expired, etc. Follow tries to fail early. - -## Tests - -Follow uses [node-tap][tap]. If you clone this Git repository, tap is included. - - $ ./node_modules/.bin/tap test/*.js test/issues/*.js - ok test/couch.js ...................................... 11/11 - ok test/follow.js ..................................... 69/69 - ok test/issues.js ..................................... 44/44 - ok test/stream.js ................................... 300/300 - ok test/issues/10.js .................................. 11/11 - total ............................................... 435/435 - - ok - -## License - -Apache 2.0 - -[req]: https://github.com/mikeal/request -[tap]: https://github.com/isaacs/node-tap diff --git a/update_nation/node_modules/nano/node_modules/follow/Rakefile b/update_nation/node_modules/nano/node_modules/follow/Rakefile deleted file mode 100644 index b912031b7..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/Rakefile +++ /dev/null @@ -1,54 +0,0 @@ -require 'json' - -LIBRARY = [ "api.js", "feed.js", "lib.js", "cli.js" ] -BROWSER_TOOLS = Dir.glob("browser/*").select{|x| x != "browser/export.js" } - -task :default => :export - -desc 'Export Follow for use in web browsers' -task :export => ([:clean, "cli.js"] + LIBRARY + BROWSER_TOOLS) do |task| - build = "./build" - target = "#{build}/follow" - - sh "mkdir", "-p", target - LIBRARY.each do |js| - sh "node", "browser/export.js", js, "#{target}/#{js}" - end - - BROWSER_TOOLS.each do |file| - sh "cp", file, build - end - - # EventEmitter2 needs wrapping. - sh "node", "browser/export.js", "browser/eventemitter2.js", "#{build}/eventemitter2.js" - - File.open("#{build}/boot.js", 'w') do |boot| - requirejs_paths = { 'request' => 'request.jquery', - 'events' => 'eventemitter2', - # 'foo' => 'bar', etc. - } - - opts = { # 'baseUrl' => "follow", - 'paths' => requirejs_paths, - } - - main_js = "main.js" - - boot.write([ 'require(', - '// Options', - opts.to_json() + ',', - '', - '// Modules', - [main_js].to_json() + ',', - '', - '// Code to run when ready', - 'function(main) { return main(); }', - ');' - ].join("\n")); - end -end - -desc 'Clean up build files' -task :clean do - sh "rm", "-rf", "./build" -end diff --git a/update_nation/node_modules/nano/node_modules/follow/api.js b/update_nation/node_modules/nano/node_modules/follow/api.js deleted file mode 100644 index 4b71d78d6..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/api.js +++ /dev/null @@ -1,35 +0,0 @@ -// The changes_couchdb API -// -// Copyright 2011 Iris Couch -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -var feed = require('./lib/feed') - , stream = require('./lib/stream') - -function follow_feed(opts, cb) { - var ch_feed = new feed.Feed(opts); - ch_feed.on('error' , function(er) { return cb && cb.call(ch_feed, er) }); - ch_feed.on('change', function(ch) { return cb && cb.call(ch_feed, null, ch) }); - - // Give the caller a chance to hook into any events. - process.nextTick(function() { - ch_feed.follow(); - }) - - return ch_feed; -} - -module.exports = follow_feed; -module.exports.Feed = feed.Feed; -module.exports.Changes = stream.Changes diff --git a/update_nation/node_modules/nano/node_modules/follow/browser/eventemitter2.js b/update_nation/node_modules/nano/node_modules/follow/browser/eventemitter2.js deleted file mode 100644 index a4da62460..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/browser/eventemitter2.js +++ /dev/null @@ -1,453 +0,0 @@ - -;!function(exports, undefined) { - - var isArray = Array.isArray; - var defaultMaxListeners = 10; - - function init() { - this._events = new Object; - } - - function configure(conf) { - - if (conf) { - this.wildcard = conf.wildcard; - this.delimiter = conf.delimiter || '.'; - - if (this.wildcard) { - this.listenerTree = new Object; - } - } - } - - function EventEmitter(conf) { - this._events = new Object; - configure.call(this, conf); - } - - function searchListenerTree(handlers, type, tree, i) { - if (!tree) { - return; - } - - var listeners; - - if (i === type.length && tree._listeners) { - // - // If at the end of the event(s) list and the tree has listeners - // invoke those listeners. - // - if (typeof tree._listeners === 'function') { - handlers && handlers.push(tree._listeners); - return tree; - } else { - for (var leaf = 0, len = tree._listeners.length; leaf < len; leaf++) { - handlers && handlers.push(tree._listeners[leaf]); - } - return tree; - } - } - - if (type[i] === '*' || tree[type[i]]) { - // - // If the event emitted is '*' at this part - // or there is a concrete match at this patch - // - if (type[i] === '*') { - for (var branch in tree) { - if (branch !== '_listeners' && tree.hasOwnProperty(branch)) { - listeners = searchListenerTree(handlers, type, tree[branch], i+1); - } - } - return listeners; - } - - listeners = searchListenerTree(handlers, type, tree[type[i]], i+1); - } - - - if (tree['*']) { - // - // If the listener tree will allow any match for this part, - // then recursively explore all branches of the tree - // - searchListenerTree(handlers, type, tree['*'], i+1); - } - - return listeners; - }; - - function growListenerTree(type, listener) { - - type = typeof type === 'string' ? type.split(this.delimiter) : type.slice(); - - var tree = this.listenerTree; - var name = type.shift(); - - while (name) { - - if (!tree[name]) { - tree[name] = new Object; - } - - tree = tree[name]; - - if (type.length === 0) { - - if (!tree._listeners) { - tree._listeners = listener; - } - else if(typeof tree._listeners === 'function') { - tree._listeners = [tree._listeners, listener]; - } - else if (isArray(tree._listeners)) { - - tree._listeners.push(listener); - - if (!tree._listeners.warned) { - - var m = defaultMaxListeners; - - if (m > 0 && tree._listeners.length > m) { - - tree._listeners.warned = true; - console.error('(node) warning: possible EventEmitter memory ' + - 'leak detected. %d listeners added. ' + - 'Use emitter.setMaxListeners() to increase limit.', - tree._listeners.length); - console.trace(); - } - } - } - return true; - } - name = type.shift(); - } - return true; - }; - - // By default EventEmitters will print a warning if more than - // 10 listeners are added to it. This is a useful default which - // helps finding memory leaks. - // - // Obviously not all Emitters should be limited to 10. This function allows - // that to be increased. Set to zero for unlimited. - - EventEmitter.prototype.setMaxListeners = function(n) { - this._events || init.call(this); - this._events.maxListeners = n; - }; - - EventEmitter.prototype.event = ''; - - EventEmitter.prototype.once = function(event, fn) { - this.many(event, 1, fn); - return this; - }; - - EventEmitter.prototype.many = function(event, ttl, fn) { - var self = this; - - if (typeof fn !== 'function') { - throw new Error('many only accepts instances of Function'); - } - - function listener() { - if (--ttl === 0) { - self.off(event, listener); - } - fn.apply(null, arguments); - }; - - listener._origin = fn; - - this.on(event, listener); - - return self; - }; - - EventEmitter.prototype.emit = function() { - this._events || init.call(this); - - var type = arguments[0]; - - if (type === 'newListener') { - if (!this._events.newListener) { return false; } - } - - // Loop through the *_all* functions and invoke them. - if (this._all) { - var l = arguments.length; - var args = new Array(l - 1); - for (var i = 1; i < l; i++) args[i - 1] = arguments[i]; - for (i = 0, l = this._all.length; i < l; i++) { - this.event = type; - this._all[i].apply(this, args); - } - } - - // If there is no 'error' event listener then throw. - if (type === 'error') { - - if (!this._all && - !this._events.error && - !(this.wildcard && this.listenerTree.error)) { - - if (arguments[1] instanceof Error) { - throw arguments[1]; // Unhandled 'error' event - } else { - throw new Error("Uncaught, unspecified 'error' event."); - } - return false; - } - } - - var handler; - - if(this.wildcard) { - handler = []; - var ns = typeof type === 'string' ? type.split(this.delimiter) : type.slice(); - searchListenerTree.call(this, handler, ns, this.listenerTree, 0); - } - else { - handler = this._events[type]; - } - - if (typeof handler === 'function') { - this.event = type; - if (arguments.length === 1) { - handler.call(this); - } - else if (arguments.length > 1) - switch (arguments.length) { - case 2: - handler.call(this, arguments[1]); - break; - case 3: - handler.call(this, arguments[1], arguments[2]); - break; - // slower - default: - var l = arguments.length; - var args = new Array(l - 1); - for (var i = 1; i < l; i++) args[i - 1] = arguments[i]; - handler.apply(this, args); - } - return true; - } - else if (handler) { - var l = arguments.length; - var args = new Array(l - 1); - for (var i = 1; i < l; i++) args[i - 1] = arguments[i]; - - var listeners = handler.slice(); - for (var i = 0, l = listeners.length; i < l; i++) { - this.event = type; - listeners[i].apply(this, args); - } - return true; - } - - }; - - EventEmitter.prototype.on = function(type, listener) { - this._events || init.call(this); - - // To avoid recursion in the case that type == "newListeners"! Before - // adding it to the listeners, first emit "newListeners". - this.emit('newListener', type, listener); - - if(this.wildcard) { - growListenerTree.call(this, type, listener); - return this; - } - - if (!this._events[type]) { - // Optimize the case of one listener. Don't need the extra array object. - this._events[type] = listener; - } - else if(typeof this._events[type] === 'function') { - // Adding the second element, need to change to array. - this._events[type] = [this._events[type], listener]; - } - else if (isArray(this._events[type])) { - // If we've already got an array, just append. - this._events[type].push(listener); - - // Check for listener leak - if (!this._events[type].warned) { - - var m; - if (this._events.maxListeners !== undefined) { - m = this._events.maxListeners; - } else { - m = defaultMaxListeners; - } - - if (m && m > 0 && this._events[type].length > m) { - - this._events[type].warned = true; - console.error('(node) warning: possible EventEmitter memory ' + - 'leak detected. %d listeners added. ' + - 'Use emitter.setMaxListeners() to increase limit.', - this._events[type].length); - console.trace(); - } - } - } - return this; - }; - - EventEmitter.prototype.onAny = function(fn) { - - if(!this._all) { - this._all = []; - } - - if (typeof fn !== 'function') { - throw new Error('onAny only accepts instances of Function'); - } - - // Add the function to the event listener collection. - this._all.push(fn); - return this; - }; - - EventEmitter.prototype.addListener = EventEmitter.prototype.on; - - EventEmitter.prototype.off = function(type, listener) { - if (typeof listener !== 'function') { - throw new Error('removeListener only takes instances of Function'); - } - - var handlers; - - if(this.wildcard) { - var ns = typeof type === 'string' ? type.split(this.delimiter) : type.slice(); - var leaf = searchListenerTree.call(this, null, ns, this.listenerTree, 0); - - if('undefined' === typeof leaf) { return this; } - handlers = leaf._listeners; - } - else { - // does not use listeners(), so no side effect of creating _events[type] - if (!this._events[type]) return this; - handlers = this._events[type]; - } - - if (isArray(handlers)) { - - var position = -1; - - for (var i = 0, length = handlers.length; i < length; i++) { - if (handlers[i] === listener || - (handlers[i].listener && handlers[i].listener === listener) || - (handlers[i]._origin && handlers[i]._origin === listener)) { - position = i; - break; - } - } - - if (position < 0) { - return this; - } - - if(this.wildcard) { - leaf._listeners.splice(position, 1) - } - else { - this._events[type].splice(position, 1); - } - - if (handlers.length === 0) { - if(this.wildcard) { - delete leaf._listeners; - } - else { - delete this._events[type]; - } - } - } - else if (handlers === listener || - (handlers.listener && handlers.listener === listener) || - (handlers._origin && handlers._origin === listener)) { - if(this.wildcard) { - delete leaf._listeners; - } - else { - delete this._events[type]; - } - } - - return this; - }; - - EventEmitter.prototype.offAny = function(fn) { - var i = 0, l = 0, fns; - if (fn && this._all && this._all.length > 0) { - fns = this._all; - for(i = 0, l = fns.length; i < l; i++) { - if(fn === fns[i]) { - fns.splice(i, 1); - return this; - } - } - } else { - this._all = []; - } - return this; - }; - - EventEmitter.prototype.removeListener = EventEmitter.prototype.off; - - EventEmitter.prototype.removeAllListeners = function(type) { - if (arguments.length === 0) { - !this._events || init.call(this); - return this; - } - - if(this.wildcard) { - var ns = typeof type === 'string' ? type.split(this.delimiter) : type.slice(); - var leaf = searchListenerTree.call(this, null, ns, this.listenerTree, 0); - - if('undefined' === typeof leaf) { return this; } - leaf._listeners = null; - } - else { - if (!this._events[type]) return this; - this._events[type] = null; - } - return this; - }; - - EventEmitter.prototype.listeners = function(type) { - if(this.wildcard) { - var handlers = []; - var ns = typeof type === 'string' ? type.split(this.delimiter) : type.slice(); - searchListenerTree.call(this, handlers, ns, this.listenerTree, 0); - return handlers; - } - - this._events || init.call(this); - - if (!this._events[type]) this._events[type] = []; - if (!isArray(this._events[type])) { - this._events[type] = [this._events[type]]; - } - return this._events[type]; - }; - - EventEmitter.prototype.listenersAny = function() { - - if(this._all) { - return this._all; - } - else { - return []; - } - - }; - - exports.EventEmitter2 = EventEmitter; - -}(typeof exports === 'undefined' ? window : exports); diff --git a/update_nation/node_modules/nano/node_modules/follow/browser/export.js b/update_nation/node_modules/nano/node_modules/follow/browser/export.js deleted file mode 100644 index 21a4415b3..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/browser/export.js +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env node -// Export Follow in browser-friendly format. -// -// Copyright 2011 Iris Couch -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -var fs = require('fs') - , path = require('path') - ; - -if(process.argv[1] === module.filename) { - var source = process.argv[2] - , dest = process.argv[3] - ; - - if(!source || !dest) - throw new Error("usage: browser-export.js "); - - install(source, dest, function(er) { - if(er) throw er; - }); -} - -function install(filename, target, callback) { - //console.log('Exporting: ' + filename); - fs.readFile(filename, null, function(er, content) { - if(er && er.errno) er = new Error(er.stack); // Make a better stack trace. - if(er) return callback(er); - - // Strip the shebang. - content = content.toString('utf8'); - var content_lines = content.split(/\n/); - content_lines[0] = content_lines[0].replace(/^(#!.*)$/, '// $1'); - - // TODO - // content_lines.join('\n'), maybe new Buffer of that - - //Convert the Node module (CommonJS) to RequireJS. - var require_re = /\brequire\(['"]([\w\d\-_\/\.]+?)['"]\)/g; - - // No idea why I'm doing this but it's cool. - var match, dependencies = {}; - while(match = require_re.exec(content)) - dependencies[ match[1] ] = true; - dependencies = Object.keys(dependencies); - dependencies.forEach(function(dep) { - //console.log(' depends: ' + dep); - }) - - // In order to keep the error message line numbers correct, this makes an ugly final file. - content = [ 'require.def(function(require, exports, module) {' - //, 'var module = {};' - //, 'var exports = {};' - //, 'module.exports = exports;' - , '' - , content_lines.join('\n') - , '; return(module.exports);' - , '}); // define' - ].join(''); - //content = new Buffer(content); - - fs.writeFile(target, content, 'utf8', function(er) { - if(er) return callback(er); - return callback(); - }) - }) -} diff --git a/update_nation/node_modules/nano/node_modules/follow/browser/index.html b/update_nation/node_modules/nano/node_modules/follow/browser/index.html deleted file mode 100644 index 3b02388cb..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/browser/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - Follow - - -
Booting...
-
-
- - - - diff --git a/update_nation/node_modules/nano/node_modules/follow/browser/jquery-1.6.1.min.js b/update_nation/node_modules/nano/node_modules/follow/browser/jquery-1.6.1.min.js deleted file mode 100644 index b2ac1747f..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/browser/jquery-1.6.1.min.js +++ /dev/null @@ -1,18 +0,0 @@ -/*! - * jQuery JavaScript Library v1.6.1 - * http://jquery.com/ - * - * Copyright 2011, John Resig - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * Copyright 2011, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * - * Date: Thu May 12 15:04:36 2011 -0400 - */ -(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!cj[a]){var b=f("<"+a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),c.body.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write("");b=cl.createElement(a),cl.body.appendChild(b),d=f.css(b,"display"),c.body.removeChild(ck)}cj[a]=d}return cj[a]}function cu(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function ct(){cq=b}function cs(){setTimeout(ct,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g=0===c})}function W(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function O(a,b){return(a&&a!=="*"?a+".":"")+b.replace(A,"`").replace(B,"&")}function N(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;ic)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function L(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function F(){return!0}function E(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"$1-$2").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function H(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(H,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=d.userAgent,x,y,z,A=Object.prototype.toString,B=Object.prototype.hasOwnProperty,C=Array.prototype.push,D=Array.prototype.slice,E=String.prototype.trim,F=Array.prototype.indexOf,G={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.1",length:0,size:function(){return this.length},toArray:function(){return D.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?C.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),y.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(D.apply(this,arguments),"slice",D.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:C,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;y.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!y){y=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",z,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",z),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&H()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):G[A.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;if(a.constructor&&!B.call(a,"constructor")&&!B.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a);return c===b||B.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(b,c,d){a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),d=c.documentElement,(!d||!d.nodeName||d.nodeName==="parsererror")&&e.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c
a",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};f=c.createElement("select"),g=f.appendChild(c.createElement("option")),h=a.getElementsByTagName("input")[0],j={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},h.checked=!0,j.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,j.optDisabled=!g.disabled;try{delete a.test}catch(s){j.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function b(){j.noCloneEvent=!1,a.detachEvent("onclick",b)}),a.cloneNode(!0).fireEvent("onclick")),h=c.createElement("input"),h.value="t",h.setAttribute("type","radio"),j.radioValue=h.value==="t",h.setAttribute("checked","checked"),a.appendChild(h),k=c.createDocumentFragment(),k.appendChild(a.firstChild),j.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",l=c.createElement("body"),m={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"};for(q in m)l.style[q]=m[q];l.appendChild(a),b.insertBefore(l,b.firstChild),j.appendChecked=h.checked,j.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,j.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="
",j.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="
t
",n=a.getElementsByTagName("td"),r=n[0].offsetHeight===0,n[0].style.display="",n[1].style.display="none",j.reliableHiddenOffsets=r&&n[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(i=c.createElement("div"),i.style.width="0",i.style.marginRight="0",a.appendChild(i),j.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(i,null)||{marginRight:0}).marginRight,10)||0)===0),l.innerHTML="",b.removeChild(l);if(a.attachEvent)for(q in{submit:1,change:1,focusin:1})p="on"+q,r=p in a,r||(a.setAttribute(p,"return;"),r=typeof a[p]=="function"),j[q+"Bubbles"]=r;return j}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([a-z])([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g=f.expando,h=typeof c=="string",i,j=a.nodeType,k=j?f.cache:a,l=j?a[f.expando]:a[f.expando]&&f.expando;if((!l||e&&l&&!k[l][g])&&h&&d===b)return;l||(j?a[f.expando]=l=++f.uuid:l=f.expando),k[l]||(k[l]={},j||(k[l].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?k[l][g]=f.extend(k[l][g],c):k[l]=f.extend(k[l],c);i=k[l],e&&(i[g]||(i[g]={}),i=i[g]),d!==b&&(i[f.camelCase(c)]=d);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[f.camelCase(c)]:i}},removeData:function(b,c,d){if(!!f.acceptData(b)){var e=f.expando,g=b.nodeType,h=g?f.cache:b,i=g?b[f.expando]:f.expando;if(!h[i])return;if(c){var j=d?h[i][e]:h[i];if(j){delete j[c];if(!l(j))return}}if(d){delete h[i][e];if(!l(h[i]))return}var k=h[i][e];f.support.deleteExpando||h!=a?delete h[i]:h[i]=null,k?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=k):g&&(f.support.deleteExpando?delete b[f.expando]:b.removeAttribute?b.removeAttribute(f.expando):b[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;return(e.value||"").replace(p,"")}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);c=j&&f.attrFix[c]||c,i=f.attrHooks[c],i||(!t.test(c)||typeof d!="boolean"&&d!==b&&d.toLowerCase()!==c.toLowerCase()?v&&(f.nodeName(a,"form")||u.test(c))&&(i=v):i=w);if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j)return i.get(a,c);h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.support.getSetAttribute?a.removeAttribute(b):(f.attr(a,b,""),a.removeAttributeNode(a.getAttributeNode(b))),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},tabIndex:{get:function(a){var c=a.getAttributeNode("tabIndex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);c=i&&f.propFix[c]||c,h=f.propHooks[c];return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==b?g:a[c]},propHooks:{}}),w={get:function(a,c){return a[f.propFix[c]||c]?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=b),a.setAttribute(c,c.toLowerCase()));return c}},f.attrHooks.value={get:function(a,b){if(v&&f.nodeName(a,"button"))return v.get(a,b);return a.value},set:function(a,b,c){if(v&&f.nodeName(a,"button"))return v.set(a,b,c);a.value=b}},f.support.getSetAttribute||(f.attrFix=f.propFix,v=f.attrHooks.name=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);if(d){d.nodeValue=b;return b}}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var x=Object.prototype.hasOwnProperty,y=/\.(.*)$/,z=/^(?:textarea|input|select)$/i,A=/\./g,B=/ /g,C=/[^\w\s.|`]/g,D=function(a){return a.replace(C,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=E;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=E);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),D).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem -)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},K=function(c){var d=c.target,e,g;if(!!z.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=J(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:K,beforedeactivate:K,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&K.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&K.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",J(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in I)f.event.add(this,c+".specialChange",I[c]);return z.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return z.test(this.nodeName)}},I=f.event.special.change.filters,I.focus=I.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g0)for(h=g;h0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=U.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a=="string")return f.inArray(this[0],a?f(a):this.parent().children());return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(W(c[0])||W(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=T.call(arguments);P.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!V[a]?f.unique(e):e,(this.length>1||R.test(d))&&Q.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var Y=/ jQuery\d+="(?:\d+|null)"/g,Z=/^\s+/,$=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,_=/<([\w:]+)/,ba=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Y,""):null;if(typeof a=="string"&&!bc.test(a)&&(f.support.leadingWhitespace||!Z.test(a))&&!bg[(_.exec(a)||["",""])[1].toLowerCase()]){a=a.replace($,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bj(a,d),e=bk(a),g=bk(d);for(h=0;e[h];++h)bj(e[h],g[h])}if(b){bi(a,d);if(c){e=bk(a),g=bk(d);for(h=0;e[h];++h)bi(e[h],g[h])}}return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument|| -b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!bb.test(k))k=b.createTextNode(k);else{k=k.replace($,"<$1>");var l=(_.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=ba.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&Z.test(k)&&o.insertBefore(b.createTextNode(Z.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bp.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle;c.zoom=1;var e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.filter=bo.test(g)?g.replace(bo,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,c){var d,e,g;c=c.replace(br,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bs.test(d)&&bt.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bE=/%20/g,bF=/\[\]$/,bG=/\r?\n/g,bH=/#.*$/,bI=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bJ=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bK=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bL=/^(?:GET|HEAD)$/,bM=/^\/\//,bN=/\?/,bO=/)<[^<]*)*<\/script>/gi,bP=/^(?:select|textarea)/i,bQ=/\s+/,bR=/([?&])_=[^&]*/,bS=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bT=f.fn.load,bU={},bV={},bW,bX;try{bW=e.href}catch(bY){bW=c.createElement("a"),bW.href="",bW=bW.href}bX=bS.exec(bW.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bT)return bT.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bO,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bP.test(this.nodeName)||bJ.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bG,"\r\n")}}):{name:b.name,value:c.replace(bG,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?f.extend(!0,a,f.ajaxSettings,b):(b=a,a=f.extend(!0,f.ajaxSettings,b));for(var c in{context:1,url:1})c in b?a[c]=b[c]:c in f.ajaxSettings&&(a[c]=f.ajaxSettings[c]);return a},ajaxSettings:{url:bW,isLocal:bK.test(bX[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML}},ajaxPrefilter:bZ(bU),ajaxTransport:bZ(bV),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a?4:0;var o,r,u,w=l?ca(d,v,l):b,x,y;if(a>=200&&a<300||a===304){if(d.ifModified){if(x=v.getResponseHeader("Last-Modified"))f.lastModified[k]=x;if(y=v.getResponseHeader("Etag"))f.etag[k]=y}if(a===304)c="notmodified",o=!0;else try{r=cb(d,w),c="success",o=!0}catch(z){c="parsererror",u=z}}else{u=c;if(!c||a)c="error",a<0&&(a=0)}v.status=a,v.statusText=c,o?h.resolveWith(e,[r,c,v]):h.rejectWith(e,[v,c,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,c]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bI.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bH,"").replace(bM,bX[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bQ),d.crossDomain==null&&(r=bS.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bX[1]&&r[2]==bX[2]&&(r[3]||(r[1]==="http:"?80:443))==(bX[3]||(bX[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bU,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bL.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bN.test(d.url)?"&":"?")+d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bR,"$1_="+x);d.url=y+(y===d.url?(bN.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", */*; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bV,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){status<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bE,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq,cr=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b
";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){return this[0]?parseFloat(f.css(this[0],d,"padding")):null},f.fn["outer"+c]=function(a){return this[0]?parseFloat(f.css(this[0],d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c];return e.document.compatMode==="CSS1Compat"&&g||e.document.body["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var h=f.css(e,d),i=parseFloat(h);return f.isNaN(i)?h:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window); \ No newline at end of file diff --git a/update_nation/node_modules/nano/node_modules/follow/browser/log4js.js b/update_nation/node_modules/nano/node_modules/follow/browser/log4js.js deleted file mode 100644 index 7684bc416..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/browser/log4js.js +++ /dev/null @@ -1,46 +0,0 @@ -// log4js stub -// - -define(['querystring'], function(querystring) { - function noop() {}; - function trace(str) { return console.trace(str) } - function log(str) { return console.log(str) } - - function is_verbose() { - return !! querystring.parse(window.location.search).verbose; - } - - function con(str) { - var con = jQuery('#con'); - var html = con.html(); - con.html(html + str + "
"); - } - - function debug(str) { - if(is_verbose()) - con(str); - return console.debug(str); - } - - function out(str) { - con(str); - log(str); - } - - var err = out; - - var noops = { "trace": trace - , "debug": debug - , "info" : out - , "warn" : err - , "error": err - , "fatal": err - - , "setLevel": noop - } - - return function() { - return { 'getLogger': function() { return noops } - } - } -}) diff --git a/update_nation/node_modules/nano/node_modules/follow/browser/main.js b/update_nation/node_modules/nano/node_modules/follow/browser/main.js deleted file mode 100644 index c836f7945..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/browser/main.js +++ /dev/null @@ -1,92 +0,0 @@ -window.process = { env: {} }; - -if(!Object.keys) - Object.keys = function(o){ - if(typeof o !== 'object') - throw new Error('Object.keys called on non-object: ' + JSON.stringify(o)); - var ret=[], p; - for (p in o) - if(Object.prototype.hasOwnProperty.call(o,p)) - ret.push(p); - return ret; - } - -if(!Array.isArray) - Array.isArray = function(o) { - return Object.prototype.toString.call(o) === '[object Array]'; - } - -if(!Array.prototype.forEach) - Array.prototype.forEach = function(callback) { - var i, len = this.length; - for(var i = 0; i < len; i++) - callback(this[i], i, this); - } - -if(!Array.prototype.reduce) - Array.prototype.reduce = function(callback, state) { - var i, len = this.length; - for(i = 0; i < len; i++) - state = callback(state, this[i]); - return state; - } - -if(!Array.prototype.filter) - Array.prototype.filter = function(pred) { - var i, len = this.length, result = []; - for(i = 0; i < len; i++) - if(!! pred(this[i])) - result.push(this[i]); - return result; - } - -if(!Array.prototype.map) - Array.prototype.map = function(func) { - var i, len = this.length, result = []; - for(i = 0; i < len; i++) - result.push(func(this[i], i, this)); - return result; - } - - -if(!window.console) - window.console = {}; - -; ['trace', 'debug', 'log', 'info', 'warn', 'error', 'fatal'].forEach(function(lev) { - window.console[lev] = window.console[lev] || function() {}; -}) - -define(['events', 'querystring', 'follow/cli'], function(events, querystring, cli) { - var welcome = [ 'Starting Follow.' - , 'Follow Follow' - , 'at GitHub.' - ]; - jQuery('#boot').html('

' + welcome.join(' ') + '

'); - - // Set up some faux Node stuff. - events.EventEmitter = events.EventEmitter2; - var process = window.process = new events.EventEmitter; - - process.env = querystring.parse(window.location.search.slice(1)); - - process.stdout = {}; - process.stdout.write = function(x) { - var con = jQuery('#con'); - con.append(x); - } - - process.exit = function(code) { - if(code === 0) - console.log("'EXIT' " + code); - else - console.error("'EXIT' " + code); - } - - - return function() { // main() - console.log('Main running'); - - try { cli.main() } - catch(er) { console.log("Error starting tests"); console.log(er) } - } -}) diff --git a/update_nation/node_modules/nano/node_modules/follow/browser/querystring.js b/update_nation/node_modules/nano/node_modules/follow/browser/querystring.js deleted file mode 100644 index 58b9aa22a..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/browser/querystring.js +++ /dev/null @@ -1,28 +0,0 @@ -define([], function() { - var exports = {}; - - exports.parse = function(str) { - var result = {}; - - str = str || ""; - str = str.replace(/^\?/, ""); - if(!str) return result; - - var kvs = str.split('&'); - kvs.forEach(function(pair) { - var both = pair.split('='); - result[both[0]] = both[1]; - }) - - return result; - } - - exports.stringify = function(query) { - var result = []; - for (var k in query) - result.push(k + '=' + encodeURIComponent(query[k])); - return result.join('&'); - } - - return exports; -}) diff --git a/update_nation/node_modules/nano/node_modules/follow/browser/request.jquery.js b/update_nation/node_modules/nano/node_modules/follow/browser/request.jquery.js deleted file mode 100644 index c093e089c..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/browser/request.jquery.js +++ /dev/null @@ -1,237 +0,0 @@ -(function() { -var define = window.define -if(!define) define = function(deps, definer) { - if(!window.jQuery) - throw new Error("Can't find jQuery"); - return definer(window.jQuery); -} - -define(['jquery'], function(jQuery) { - -// -// request.jquery -// - -var DEFAULT_TIMEOUT = 3 * 60 * 1000; // 3 minutes - -function request(options, callback) { - var options_onResponse = options.onResponse; // Save this for later. - - if(typeof options === 'string') - options = {'uri':options}; - else - options = JSON.parse(JSON.stringify(options)); // Use a duplicate for mutating. - - if(options.url) { - options.uri = options.url; - delete options.url; - } - - if(!options.uri && options.uri !== "") - throw new Error("options.uri is a required argument"); - - if(options.json) { - options.body = JSON.stringify(options.json); - delete options.json; - } - - if(typeof options.uri != "string") - throw new Error("options.uri must be a string"); - - ; ['proxy', '_redirectsFollowed', 'maxRedirects', 'followRedirect'].forEach(function(opt) { - if(options[opt]) - throw new Error("options." + opt + " is not supported"); - }) - - options.method = options.method || 'GET'; - options.headers = options.headers || {}; - - if(options.headers.host) - throw new Error("Options.headers.host is not supported"); - - // onResponse is just like the callback but that is not quite what Node request does. - callback = callback || options_onResponse; - - /* - // Browsers do not like this. - if(options.body) - options.headers['content-length'] = options.body.length; - */ - - var headers = {}; - var beforeSend = function(xhr, settings) { - if(!options.headers.authorization && options.auth) { - debugger - options.headers.authorization = 'Basic ' + b64_enc(options.auth.username + ':' + options.auth.password); - } - - for (var key in options.headers) - xhr.setRequestHeader(key, options.headers[key]); - } - - // Establish a place where the callback arguments will go. - var result = []; - - function fix_xhr(xhr) { - var fixed_xhr = {}; - for (var key in xhr) - fixed_xhr[key] = xhr[key]; - fixed_xhr.statusCode = xhr.status; - return fixed_xhr; - } - - var onSuccess = function(data, reason, xhr) { - result = [null, fix_xhr(xhr), data]; - } - - var onError = function (xhr, reason, er) { - var body = undefined; - - if(reason == 'timeout') { - er = er || new Error("Request timeout"); - } else if(reason == 'error') { - if(xhr.status > 299 && xhr.responseText.length > 0) { - // Looks like HTTP worked, so there is no error as far as request is concerned. Simulate a success scenario. - er = null; - body = xhr.responseText; - } - } else { - er = er || new Error("Unknown error; reason = " + reason); - } - - result = [er, fix_xhr(xhr), body]; - } - - var onComplete = function(xhr, reason) { - if(result.length === 0) - result = [new Error("Result does not exist at completion time")]; - return callback && callback.apply(this, result); - } - - - var cors_creds = !!( options.creds || options.withCredentials ); - - return jQuery.ajax({ 'async' : true - , 'cache' : (options.cache || false) - , 'contentType': (options.headers['content-type'] || 'application/x-www-form-urlencoded') - , 'type' : options.method - , 'url' : options.uri - , 'data' : (options.body || undefined) - , 'timeout' : (options.timeout || request.DEFAULT_TIMEOUT) - , 'dataType' : 'text' - , 'processData': false - , 'beforeSend' : beforeSend - , 'success' : onSuccess - , 'error' : onError - , 'complete' : onComplete - , 'xhrFields' : { 'withCredentials': cors_creds - } - }); - -}; - -request.withCredentials = false; -request.DEFAULT_TIMEOUT = DEFAULT_TIMEOUT; - -var shortcuts = [ 'get', 'put', 'post', 'head' ]; -shortcuts.forEach(function(shortcut) { - var method = shortcut.toUpperCase(); - var func = shortcut.toLowerCase(); - - request[func] = function(opts) { - if(typeof opts === 'string') - opts = {'method':method, 'uri':opts}; - else { - opts = JSON.parse(JSON.stringify(opts)); - opts.method = method; - } - - var args = [opts].concat(Array.prototype.slice.apply(arguments, [1])); - return request.apply(this, args); - } -}) - -request.json = function(options, callback) { - options = JSON.parse(JSON.stringify(options)); - options.headers = options.headers || {}; - options.headers['accept'] = options.headers['accept'] || 'application/json'; - - if(options.method !== 'GET') - options.headers['content-type'] = 'application/json'; - - return request(options, function(er, resp, body) { - if(!er) - body = JSON.parse(body) - return callback && callback(er, resp, body); - }) -} - -request.couch = function(options, callback) { - return request.json(options, function(er, resp, body) { - if(er) - return callback && callback(er, resp, body); - - if((resp.status < 200 || resp.status > 299) && body.error) - // The body is a Couch JSON object indicating the error. - return callback && callback(body, resp); - - return callback && callback(er, resp, body); - }) -} - -jQuery(document).ready(function() { - jQuery.request = request; -}) - -return request; - -}); - -// -// Utility -// - -// MIT License from http://phpjs.org/functions/base64_encode:358 -function b64_enc (data) { - // Encodes string using MIME base64 algorithm - var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; - var o1, o2, o3, h1, h2, h3, h4, bits, i = 0, ac = 0, enc="", tmp_arr = []; - - if (!data) { - return data; - } - - // assume utf8 data - // data = this.utf8_encode(data+''); - - do { // pack three octets into four hexets - o1 = data.charCodeAt(i++); - o2 = data.charCodeAt(i++); - o3 = data.charCodeAt(i++); - - bits = o1<<16 | o2<<8 | o3; - - h1 = bits>>18 & 0x3f; - h2 = bits>>12 & 0x3f; - h3 = bits>>6 & 0x3f; - h4 = bits & 0x3f; - - // use hexets to index into b64, and append result to encoded string - tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4); - } while (i < data.length); - - enc = tmp_arr.join(''); - - switch (data.length % 3) { - case 1: - enc = enc.slice(0, -2) + '=='; - break; - case 2: - enc = enc.slice(0, -1) + '='; - break; - } - - return enc; -} - -})(); diff --git a/update_nation/node_modules/nano/node_modules/follow/browser/require.js b/update_nation/node_modules/nano/node_modules/follow/browser/require.js deleted file mode 100644 index 7ab5bf190..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/browser/require.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - RequireJS 0.26.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. - Available via the MIT or new BSD license. - see: http://github.com/jrburke/requirejs for details -*/ -var requirejs,require,define; -(function(){function M(a){return $.call(a)==="[object Function]"}function E(a){return $.call(a)==="[object Array]"}function V(a,c,g){for(var e in c)if(!(e in J)&&(!(e in a)||g))a[e]=c[e];return d}function R(a,c,d){a=Error(c+"\nhttp://requirejs.org/docs/errors.html#"+a);if(d)a.originalError=d;return a}function aa(a,c,d){var e,x,j;for(e=0;j=c[e];e++){j=typeof j==="string"?{name:j}:j;x=j.location;if(d&&(!x||x.indexOf("/")!==0&&x.indexOf(":")===-1))x=d+"/"+(x||j.name);a[j.name]={name:j.name,location:x|| -j.name,main:(j.main||"main").replace(fa,"").replace(ba,"")}}}function W(a,d){a.holdReady?a.holdReady(d):d?a.readyWait+=1:a.ready(!0)}function ga(a){function c(b,h){var n,o;if(b&&b.charAt(0)==="."&&h){p.pkgs[h]?h=[h]:(h=h.split("/"),h=h.slice(0,h.length-1));n=b=h.concat(b.split("/"));var a;for(o=0;a=n[o];o++)if(a===".")n.splice(o,1),o-=1;else if(a==="..")if(o===1&&(n[2]===".."||n[0]===".."))break;else o>0&&(n.splice(o-1,2),o-=2);o=p.pkgs[n=b[0]];b=b.join("/");o&&b===n+"/"+o.main&&(b=n)}return b}function g(b, -h){var n=b?b.indexOf("!"):-1,o=null,a=h?h.name:null,ha=b,g,l;n!==-1&&(o=b.substring(0,n),b=b.substring(n+1,b.length));o&&(o=c(o,a));b&&(g=o?(n=m[o])?n.normalize?n.normalize(b,function(b){return c(b,a)}):c(b,a):"__$p"+a+"@"+(b||""):c(b,a),l=E[g],l||(l=d.toModuleUrl?d.toModuleUrl(f,g,h):f.nameToUrl(g,null,h),E[g]=l));return{prefix:o,name:g,parentMap:h,url:l,originalName:ha,fullName:o?o+"!"+(g||""):g}}function e(){var b=!0,h=p.priorityWait,n,a;if(h){for(a=0;n=h[a];a++)if(!s[n]){b=!1;break}b&&delete p.priorityWait}return b} -function x(b){return function(h){b.exports=h}}function j(b,h,n){return function(){var a=[].concat(ia.call(arguments,0)),d;if(n&&M(d=a[a.length-1]))d.__requireJsBuild=!0;a.push(h);return b.apply(null,a)}}function q(b,h){var a=j(f.require,b,h);V(a,{nameToUrl:j(f.nameToUrl,b),toUrl:j(f.toUrl,b),defined:j(f.requireDefined,b),specified:j(f.requireSpecified,b),ready:d.ready,isBrowser:d.isBrowser});if(d.paths)a.paths=d.paths;return a}function v(b){var h=b.prefix,a=b.fullName;y[a]||a in m||(h&&!K[h]&&(K[h]= -void 0,(S[h]||(S[h]=[])).push(b),(t[h]||(t[h]=[])).push({onDep:function(b){if(b===h){var a,n,d,c,f,e,j=S[h];if(j)for(d=0;a=j[d];d++)if(b=a.fullName,a=g(a.originalName,a.parentMap),a=a.fullName,n=t[b]||[],c=t[a],a!==b){b in y&&(delete y[b],y[a]=!0);t[a]=c?c.concat(n):n;delete t[b];for(c=0;c0)){if(p.priorityWait)if(e())G();else return;for(k in s)if(!(k in J)&&(c=!0,!s[k]))if(a)b+=k+" ";else{g=!0;break}if(c||f.waitCount){if(a&&b)return k=R("timeout","Load timeout for modules: "+b),k.requireType="timeout",k.requireModules= -b,d.onError(k);if(g||f.scriptCount){if((B||ca)&&!X)X=setTimeout(function(){X=0;A()},50)}else{if(f.waitCount){for(H=0;b=I[H];H++)C(b,{});Y<5&&(Y+=1,A())}Y=0;d.checkReadyState()}}}}function D(b,a){var c=a.name,e=a.fullName,g;if(!(e in m||e in s))K[b]||(K[b]=m[b]),s[e]||(s[e]=!1),g=function(g){if(d.onPluginLoad)d.onPluginLoad(f,b,c,g);w({prefix:a.prefix,name:a.name,fullName:a.fullName,callback:function(){return g}});s[e]=!0},g.fromText=function(b,a){var c=N;f.loaded[b]=!1;f.scriptCount+=1;c&&(N=!1); -d.exec(a);c&&(N=!0);f.completeLoad(b)},K[b].load(c,q(a.parentMap,!0),g,p)}function L(b){b.prefix&&b.name&&b.name.indexOf("__$p")===0&&m[b.prefix]&&(b=g(b.originalName,b.parentMap));var a=b.prefix,c=b.fullName,e=f.urlFetched;!y[c]&&!s[c]&&(y[c]=!0,a?m[a]?D(a,b):(O[a]||(O[a]=[],(t[a]||(t[a]=[])).push({onDep:function(b){if(b===a){for(var c,d=O[a],b=0;b0;m--)if(i=e.slice(0,m).join("/"),g[i]){e.splice(0,m,g[i]);break}else if(i=j[i]){b=b===i.name?i.location+"/"+i.main:i.location;e.splice(0,m,b);break}a=e.join("/")+(a||".js");a=(a.charAt(0)==="/"||a.match(/^\w+:/)?"":l.baseUrl)+a}return l.urlArgs?a+((a.indexOf("?")===-1?"?":"&")+l.urlArgs):a}};f.jQueryCheck=T;f.resume=G;return f}function la(){var a, -c,d;if(C&&C.readyState==="interactive")return C;a=document.getElementsByTagName("script");for(c=a.length-1;c>-1&&(d=a[c]);c--)if(d.readyState==="interactive")return C=d;return null}var ma=/(\/\*([\s\S]*?)\*\/|\/\/(.*)$)/mg,na=/require\(\s*["']([^'"\s]+)["']\s*\)/g,fa=/^\.\//,ba=/\.js$/,$=Object.prototype.toString,q=Array.prototype,ia=q.slice,ka=q.splice,B=!!(typeof window!=="undefined"&&navigator&&document),ca=!B&&typeof importScripts!=="undefined",oa=B&&navigator.platform==="PLAYSTATION 3"?/^complete$/: -/^(complete|loaded)$/,da=typeof opera!=="undefined"&&opera.toString()==="[object Opera]",ja="_r@@",J={},z={},U=[],C=null,Y=0,N=!1,d,q={},I,i,u,L,v,A,D,H,Q,ea,w,T,X;if(typeof define==="undefined"){if(typeof requirejs!=="undefined")if(M(requirejs))return;else q=requirejs,requirejs=void 0;typeof require!=="undefined"&&!M(require)&&(q=require,require=void 0);d=requirejs=function(a,c,d){var e="_",i;!E(a)&&typeof a!=="string"&&(i=a,E(c)?(a=c,c=d):a=[]);if(i&&i.context)e=i.context;d=z[e]||(z[e]=ga(e));i&& -d.configure(i);return d.require(a,c)};d.config=function(a){return d(a)};typeof require==="undefined"&&(require=d);d.toUrl=function(a){return z._.toUrl(a)};d.version="0.26.0";d.isArray=E;d.isFunction=M;d.mixin=V;d.jsExtRegExp=/^\/|:|\?|\.js$/;i=d.s={contexts:z,skipAsync:{},isPageLoaded:!B,readyCalls:[]};if(d.isAsync=d.isBrowser=B)if(u=i.head=document.getElementsByTagName("head")[0],L=document.getElementsByTagName("base")[0])u=i.head=L.parentNode;d.onError=function(a){throw a;};d.load=function(a,c, -g){var e=a.loaded;e[c]||(e[c]=!1);a.scriptCount+=1;d.attach(g,a,c);if(a.jQuery&&!a.jQueryIncremented)W(a.jQuery,!0),a.jQueryIncremented=!0};define=d.def=function(a,c,g){var e,i;typeof a!=="string"&&(g=c,c=a,a=null);d.isArray(c)||(g=c,c=[]);!a&&!c.length&&d.isFunction(g)&&g.length&&(g.toString().replace(ma,"").replace(na,function(a,d){c.push(d)}),c=(g.length===1?["require"]:["require","exports","module"]).concat(c));if(N&&(e=I||la()))a||(a=e.getAttribute("data-requiremodule")),i=z[e.getAttribute("data-requirecontext")]; -(i?i.defQueue:U).push([a,c,g])};define.amd={multiversion:!0,plugins:!0,jQuery:!0};d.exec=function(a){return eval(a)};d.execCb=function(a,c,d,e){return c.apply(e,d)};d.onScriptLoad=function(a){var c=a.currentTarget||a.srcElement,g;if(a.type==="load"||oa.test(c.readyState))C=null,a=c.getAttribute("data-requirecontext"),g=c.getAttribute("data-requiremodule"),z[a].completeLoad(g),c.detachEvent&&!da?c.detachEvent("onreadystatechange",d.onScriptLoad):c.removeEventListener("load",d.onScriptLoad,!1)};d.attach= -function(a,c,g,e,q){var j;if(B)return e=e||d.onScriptLoad,j=c&&c.config&&c.config.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script"),j.type=q||"text/javascript",j.charset="utf-8",j.async=!i.skipAsync[a],c&&j.setAttribute("data-requirecontext",c.contextName),j.setAttribute("data-requiremodule",g),j.attachEvent&&!da?(N=!0,j.attachEvent("onreadystatechange",e)):j.addEventListener("load",e,!1),j.src=a,I=j,L?u.insertBefore(j,L):u.appendChild(j), -I=null,j;else if(ca)e=c.loaded,e[g]=!1,importScripts(a),c.completeLoad(g);return null};if(B){v=document.getElementsByTagName("script");for(H=v.length-1;H>-1&&(A=v[H]);H--){if(!u)u=A.parentNode;if(D=A.getAttribute("data-main")){if(!q.baseUrl)v=D.split("/"),A=v.pop(),v=v.length?v.join("/")+"/":"./",q.baseUrl=v,D=A.replace(ba,"");q.deps=q.deps?q.deps.concat(D):[D];break}}}i.baseUrl=q.baseUrl;d.pageLoaded=function(){if(!i.isPageLoaded){i.isPageLoaded=!0;Q&&clearInterval(Q);if(ea)document.readyState="complete"; -d.callReady()}};d.checkReadyState=function(){var a=i.contexts,c;for(c in a)if(!(c in J)&&a[c].waitCount)return;i.isDone=!0;d.callReady()};d.callReady=function(){var a=i.readyCalls,c,d,e;if(i.isPageLoaded&&i.isDone){if(a.length){i.readyCalls=[];for(c=0;d=a[c];c++)d()}a=i.contexts;for(e in a)if(!(e in J)&&(c=a[e],c.jQueryIncremented))W(c.jQuery,!1),c.jQueryIncremented=!1}};d.ready=function(a){i.isPageLoaded&&i.isDone?a():i.readyCalls.push(a);return d};if(B){if(document.addEventListener){if(document.addEventListener("DOMContentLoaded", -d.pageLoaded,!1),window.addEventListener("load",d.pageLoaded,!1),!document.readyState)ea=!0,document.readyState="loading"}else window.attachEvent&&(window.attachEvent("onload",d.pageLoaded),self===self.top&&(Q=setInterval(function(){try{document.body&&(document.documentElement.doScroll("left"),d.pageLoaded())}catch(a){}},30)));document.readyState==="complete"&&d.pageLoaded()}d(q);if(d.isAsync&&typeof setTimeout!=="undefined")w=i.contexts[q.context||"_"],w.requireWait=!0,setTimeout(function(){w.requireWait= -!1;w.takeGlobalQueue();w.jQueryCheck();w.scriptCount||w.resume();d.checkReadyState()},0)}})(); diff --git a/update_nation/node_modules/nano/node_modules/follow/browser/util.js b/update_nation/node_modules/nano/node_modules/follow/browser/util.js deleted file mode 100644 index f4c3d3f6a..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/browser/util.js +++ /dev/null @@ -1,28 +0,0 @@ -define([], function() { - var exports = {}; - - exports.inspect = JSON.stringify; - - // Copy from Node - /** - * Inherit the prototype methods from one constructor into another. - * - * The Function.prototype.inherits from lang.js rewritten as a standalone - * function (not on Function.prototype). NOTE: If this file is to be loaded - * during bootstrapping this function needs to be revritten using some native - * functions as prototype setup using normal JavaScript does not work as - * expected during bootstrapping (see mirror.js in r114903). - * - * @param {function} ctor Constructor function which needs to inherit the - * prototype. - * @param {function} superCtor Constructor function to inherit prototype from. - */ - exports.inherits = function(ctor, superCtor) { - ctor.super_ = superCtor; - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { value: ctor, enumerable: false } - }); - }; - - return exports; -}) diff --git a/update_nation/node_modules/nano/node_modules/follow/cli.js b/update_nation/node_modules/nano/node_modules/follow/cli.js deleted file mode 100644 index cb17d36e0..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/cli.js +++ /dev/null @@ -1,101 +0,0 @@ -#!/usr/bin/env node -// The follow command-line interface. -// -// Copyright 2011 Iris Couch -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -var lib = require('./lib') - , couch_changes = require('./api') - ; - -function puts(str) { - process.stdout.write(str + "\n"); -} - -function main() { - var db = require.isBrowser ? (process.env.db || '/_users') : process.argv[2]; - puts('Watching: ' + db); - - var feed = new couch_changes.Feed(); - feed.db = db; - feed.since = (process.env.since === 'now') ? 'now' : parseInt(process.env.since || '0'); - - feed.heartbeat = (process.env.heartbeat || '3000').replace(/s$/, '000'); - feed.heartbeat = parseInt(feed.heartbeat); - - if(require.isBrowser) - feed.feed = 'longpoll'; - if(process.env.host) - feed.headers.host = process.env.host; - if(process.env.inactivity) - feed.inactivity_ms = parseInt(process.env.inactivity); - if(process.env.limit) - feed.limit = parseInt(process.env.limit); - - feed.query_params.pid = process.pid; - feed.filter = process.env.filter || example_filter; - function example_filter(doc, req) { - // This is a local filter. It runs on the client side. - var label = 'Filter ' + (req.query.pid || '::'); - - if(process.env.show_doc) - console.log(label + ' doc: ' + JSON.stringify(doc)); - if(process.env.show_req) - console.log(label + ' for ' + doc._id + ' req: ' + JSON.stringify(req)); - return true; - } - - feed.on('confirm', function() { - puts('Database confirmed: ' + db); - }) - - feed.on('change', function(change) { - puts('Change:' + JSON.stringify(change)); - }) - - feed.on('timeout', function(state) { - var seconds = state.elapsed_ms / 1000; - var hb = state.heartbeat / 1000; - puts('Timeout after ' + seconds + 's inactive, heartbeat=' + hb + 's'); - }) - - feed.on('retry', function(state) { - if(require.isBrowser) - puts('Long polling since ' + state.since); - else - puts('Retry since ' + state.since + ' after ' + state.after + 'ms'); - }) - - feed.on('response', function() { - puts('Streaming response:'); - }) - - feed.on('error', function(er) { - //console.error(er); - console.error('Changes error ============\n' + er.stack); - setTimeout(function() { process.exit(0) }, 100); - }) - - process.on('uncaughtException', function(er) { - puts('========= UNCAUGHT EXCEPTION; This is bad'); - puts(er.stack); - setTimeout(function() { process.exit(1) }, 100); - }) - - feed.follow(); -} - -exports.main = main; -if(!require.isBrowser && process.argv[1] == module.filename) - main(); diff --git a/update_nation/node_modules/nano/node_modules/follow/lib/feed.js b/update_nation/node_modules/nano/node_modules/follow/lib/feed.js deleted file mode 100644 index 858e51a2b..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/lib/feed.js +++ /dev/null @@ -1,671 +0,0 @@ -// Core routines for event emitters -// -// Copyright 2011 Iris Couch -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -var lib = require('../lib') - , util = require('util') - , events = require('events') - , request = require('request') - , Changes = require('./stream').Changes - , querystring = require('querystring') - -// Use the library timeout functions, primarily so the test suite can catch errors. -var setTimeout = lib.setTimeout - , clearTimeout = lib.clearTimeout - -var DEFAULT_HEARTBEAT = 30000; -var HEARTBEAT_TIMEOUT_COEFFICIENT = 1.25; // E.g. heartbeat 1000ms would trigger a timeout after 1250ms of no heartbeat. -var DEFAULT_MAX_RETRY_SECONDS = 60 * 60; -var INITIAL_RETRY_DELAY = 1000; -var RESPONSE_GRACE_TIME = 5000; - -var FEED_PARAMETERS = ['since', 'limit', 'feed', 'heartbeat', 'filter', 'include_docs', 'view', 'style', 'conflicts']; - -var EventEmitter = events.EventEmitter2 || events.EventEmitter; - - -util.inherits(Feed, EventEmitter); -function Feed (opts) { - var self = this; - EventEmitter.call(self); - - opts = opts || {} - - self.feed = 'continuous'; - self.heartbeat = DEFAULT_HEARTBEAT; - self.max_retry_seconds = DEFAULT_MAX_RETRY_SECONDS; - self.inactivity_ms = null; - - self.headers = {}; - self.request = opts.request || {} // Extra options for potentially future versions of request. The caller can supply them. - - self.since = 0; - self.is_paused = false - self.caught_up = false - self.retry_delay = INITIAL_RETRY_DELAY; // ms - - self.query_params = {}; // Extra `req.query` values for filter functions - - if(typeof opts === 'string') - opts = {'db': opts}; - - Object.keys(opts).forEach(function(key) { - self[key] = opts[key]; - }) - - self.pending = { request : null - , activity_at : null - }; -} // Feed - -Feed.prototype.start = -Feed.prototype.follow = function follow_feed() { - var self = this; - - self.db = self.db || self.url || self.uri - delete self.url - delete self.uri - - if(!self.db) - throw new Error('Database URL required'); - - if (self.db.match(/\/_db_updates$/)) - self.is_db_updates = true; - - if(self.is_db_updates) - delete self.since; - - if(self.feed !== 'continuous' && self.feed !== 'longpoll') - throw new Error('The only valid feed options are "continuous" and "longpoll"'); - - if(typeof self.heartbeat !== 'number') - throw new Error('Required "heartbeat" value'); - - self.log = lib.log4js.getLogger(self.db); - self.log.setLevel(process.env.follow_log_level || "info"); - - self.emit('start'); - return self.confirm(); -} - -Feed.prototype.confirm = function confirm_feed() { - var self = this; - - self.db_safe = lib.scrub_creds(self.db); - - var endpoint = self.is_db_updates ? 'server' : 'database'; - - self.log.debug('Checking ' + endpoint + ': ' + self.db_safe); - - var confirm_timeout = self.heartbeat * 3; // Give it time to look up the name, connect, etc. - var timeout_id = setTimeout(function() { - return self.die(new Error('Timeout confirming ' + endpoint + ': ' + self.db_safe)); - }, confirm_timeout); - - var headers = lib.JP(lib.JS(self.headers)); - headers.accept = 'application/json'; - - var uri = self.is_db_updates ? self.db.replace(/\/_db_updates$/, '') : self.db; - var req = {'uri':uri, 'headers':headers} - Object.keys(self.request).forEach(function(key) { - req[key] = self.request[key]; - }) - - req = request(req, db_response) - self.emit('confirm_request', req) - - function db_response(er, resp, body) { - clearTimeout(timeout_id); - - if(er) - return self.die(er); - - var db; - try { - db = JSON.parse(body) - } catch(json_er) { - return self.emit('error', json_er) - } - - if(!self.is_db_updates && !self.dead && (!db.db_name || !db.instance_start_time)) - return self.emit('error', new Error('Bad DB response: ' + body)); - - if(self.is_db_updates && !self.dead && !db.couchdb) - return self.emit('error', new Error('Bad server response: ' + body)); - - if (!self.is_db_updates) - self.original_db_seq = db.update_seq - - self.log.debug('Confirmed ' + endpoint + ': ' + self.db_safe); - self.emit('confirm', db); - - if(self.since == 'now') { - self.log.debug('Query since "now" is the same as query since -1') - self.since = -1 - } - - if(self.since == -1) { - self.log.debug('Query since '+self.since+' will start at ' + db.update_seq) - self.since = db.update_seq - } else if(self.since < 0) { - if(isNaN(db.update_seq)) - return self.emit('error', new Error('DB requires specific id in "since"')); - - self.log.debug('Query since '+self.since+' will start at ' + (db.update_seq + self.since + 1)) - self.since = db.update_seq + self.since + 1 - } - - // If the next change would come after the current update_seq, just fake a catchup event now. - if(self.original_db_seq == self.since) { - self.caught_up = true - self.emit('catchup', db.update_seq) - } - - return self.query(); - } -} - -Feed.prototype.query = function query_feed() { - var self = this; - - var query_params = JSON.parse(JSON.stringify(self.query_params)); - - FEED_PARAMETERS.forEach(function(key) { - if(key in self) - query_params[key] = self[key]; - }) - - if(typeof query_params.filter !== 'string') - delete query_params.filter; - - if(typeof self.filter === 'function' && !query_params.include_docs) { - self.log.debug('Enabling include_docs for client-side filter'); - query_params.include_docs = true; - } - - // Limit the response size for longpoll. - var poll_size = 100; - if(query_params.feed == 'longpoll' && (!query_params.limit || query_params.limit > poll_size)) - query_params.limit = poll_size; - - var feed_url = self.db + (self.is_db_updates ? '' : '/_changes') + '?' + querystring.stringify(query_params); - - self.headers.accept = self.headers.accept || 'application/json'; - var req = { method : 'GET' - , uri : feed_url - , headers: self.headers - , encoding: 'utf-8' - } - - req.changes_query = query_params; - Object.keys(self.request).forEach(function(key) { - req[key] = self.request[key]; - }) - - var now = new Date - , feed_ts = lib.JDUP(now) - , feed_id = process.env.follow_debug ? feed_ts.match(/\.(\d\d\d)Z$/)[1] : feed_ts - - self.log.debug('Feed query ' + feed_id + ': ' + lib.scrub_creds(feed_url)) - var feed_request = request(req) - - feed_request.on('response', function(res) { - self.log.debug('Remove feed from agent pool: ' + feed_id) - feed_request.req.socket.emit('agentRemove') - - // Simulate the old onResponse option. - on_feed_response(null, res, res.body) - }) - - feed_request.on('error', on_feed_response) - - // The response headers must arrive within one heartbeat. - var response_timer = setTimeout(response_timed_out, self.heartbeat + RESPONSE_GRACE_TIME) - , timed_out = false - - return self.emit('query', feed_request) - - function response_timed_out() { - self.log.debug('Feed response timed out: ' + feed_id) - timed_out = true - return self.retry() - } - - function on_feed_response(er, resp, body) { - clearTimeout(response_timer) - - if((resp !== undefined && resp.body) || body) - return self.die(new Error('Cannot handle a body in the feed response: ' + lib.JS(resp.body || body))) - - if(timed_out) { - self.log.debug('Ignoring late response: ' + feed_id); - return destroy_response(resp); - } - - if(er) { - self.log.debug('Request error ' + feed_id + ': ' + er.stack); - destroy_response(resp); - return self.retry(); - } - - if(resp.statusCode !== 200) { - self.log.debug('Bad changes response ' + feed_id + ': ' + resp.statusCode); - destroy_response(resp); - return self.retry(); - } - - self.log.debug('Good response: ' + feed_id); - self.retry_delay = INITIAL_RETRY_DELAY; - - self.emit('response', resp); - - var changes_stream = new Changes - changes_stream.log = lib.log4js.getLogger('stream ' + self.db) - changes_stream.log.setLevel(self.log.level.levelStr) - changes_stream.feed = self.feed - feed_request.pipe(changes_stream) - - changes_stream.created_at = now - changes_stream.id = function() { return feed_id } - return self.prep(changes_stream) - } -} - -Feed.prototype.prep = function prep_request(changes_stream) { - var self = this; - - var now = new Date; - self.pending.request = changes_stream; - self.pending.activity_at = now; - self.pending.wait_timer = null; - - // Just re-run the pause or resume to do the needful on changes_stream (self.pending.request). - if(self.is_paused) - self.pause() - else - self.resume() - - // The inactivity timer is for time between *changes*, or time between the - // initial connection and the first change. Therefore it goes here. - self.change_at = now; - if(self.inactivity_ms) { - clearTimeout(self.inactivity_timer); - self.inactivity_timer = setTimeout(function() { self.on_inactivity() }, self.inactivity_ms); - } - - changes_stream.on('heartbeat', handler_for('heartbeat')) - changes_stream.on('error', handler_for('error')) - changes_stream.on('data', handler_for('data')) - changes_stream.on('end', handler_for('end')) - - return self.wait(); - - function handler_for(ev) { - var name = 'on_couch_' + ev; - var inner_handler = self[name]; - - return handle_confirmed_req_event; - function handle_confirmed_req_event() { - if(self.pending.request === changes_stream) - return inner_handler.apply(self, arguments); - - if(!changes_stream.created_at) - return self.die(new Error("Received data from unknown request")); // Pretty sure this is impossible. - - var s_to_now = (new Date() - changes_stream.created_at) / 1000; - var s_to_req = '[no req]'; - if(self.pending.request) - s_to_req = (self.pending.request.created_at - changes_stream.created_at) / 1000; - - var msg = ': ' + changes_stream.id() + ' to_req=' + s_to_req + 's, to_now=' + s_to_now + 's'; - - if(ev == 'end' || ev == 'data' || ev == 'heartbeat') { - self.log.debug('Old "' + ev + '": ' + changes_stream.id()) - return destroy_req(changes_stream) - } - - self.log.warn('Old "'+ev+'"' + msg); - } - } -} - -Feed.prototype.wait = function wait_for_event() { - var self = this; - self.emit('wait'); - - if(self.pending.wait_timer) - return self.die(new Error('wait() called but there is already a wait_timer: ' + self.pending.wait_timer)); - - var timeout_ms = self.heartbeat * HEARTBEAT_TIMEOUT_COEFFICIENT; - var req_id = self.pending.request && self.pending.request.id() - var msg = 'Req ' + req_id + ' timeout=' + timeout_ms; - if(self.inactivity_ms) - msg += ', inactivity=' + self.inactivity_ms; - msg += ': ' + self.db_safe; - - self.log.debug(msg); - self.pending.wait_timer = setTimeout(function() { self.on_timeout() }, timeout_ms); -} - -Feed.prototype.got_activity = function() { - var self = this - - if (self.dead) - return - - // - // We may not have a wait_timer so just clear it and null it out if it does - // exist - // - clearTimeout(self.pending.wait_timer) - self.pending.wait_timer = null - self.pending.activity_at = new Date -} - - -Feed.prototype.pause = function() { - var self = this - , was_paused = self.is_paused - - // Emit pause after pausing the stream, to allow listeners to react. - self.is_paused = true - if(self.pending && self.pending.request && self.pending.request.pause) - self.pending.request.pause() - else - self.log.warn('No pending request to pause') - - if(!was_paused) - self.emit('pause') -} - -Feed.prototype.resume = function() { - var self = this - , was_paused = self.is_paused - - // Emit resume before resuming the data feed, to allow listeners to prepare. - self.is_paused = false - if(was_paused) - self.emit('resume') - - if(self.pending && self.pending.request && self.pending.request.resume) - self.pending.request.resume() - else - self.log.warn('No pending request to resume') -} - - -Feed.prototype.on_couch_heartbeat = function on_couch_heartbeat() { - var self = this - - self.got_activity() - if(self.dead) - return self.log.debug('Skip heartbeat processing for dead feed') - - self.emit('heartbeat') - - if(self.dead) - return self.log.debug('No wait: heartbeat listener stopped this feed') - self.wait() -} - -Feed.prototype.on_couch_data = function on_couch_data(change) { - var self = this; - self.log.debug('Data from ' + self.pending.request.id()); - - self.got_activity() - if(self.dead) - return self.log.debug('Skip data processing for dead feed') - - // The changes stream guarantees that this data is valid JSON. - change = JSON.parse(change) - - //self.log.debug('Object:\n' + util.inspect(change)); - if(!self.is_db_updates && 'last_seq' in change) { - self.log.warn('Stopping upon receiving a final message: ' + JSON.stringify(change)) - var del_er = new Error('Database deleted after change: ' + change.last_seq) - del_er.deleted = true - del_er.last_seq = change.last_seq - return self.die(del_er) - } - - if(!self.is_db_updates && !change.seq) - return self.die(new Error('Change has no .seq field: ' + JSON.stringify(change))) - - self.on_change(change) - - // on_change() might work its way all the way to a "change" event, and the listener - // might call .stop(), which means among other things that no more events are desired. - // The die() code sets a self.dead flag to indicate this. - if(self.dead) - return self.log.debug('No wait: change listener stopped this feed') - self.wait() -} - -Feed.prototype.on_timeout = function on_timeout() { - var self = this; - self.log.debug('Timeout') - - var now = new Date; - var elapsed_ms = now - self.pending.activity_at; - - self.emit('timeout', {elapsed_ms:elapsed_ms, heartbeat:self.heartbeat, id:self.pending.request.id()}); - - /* - var msg = ' for timeout after ' + elapsed_ms + 'ms; heartbeat=' + self.heartbeat; - if(!self.pending.request.id) - self.log.warn('Closing req (no id) ' + msg + ' req=' + util.inspect(self.pending.request)); - else - self.log.warn('Closing req ' + self.pending.request.id() + msg); - */ - - destroy_req(self.pending.request); - self.retry() -} - -Feed.prototype.retry = function retry() { - var self = this; - - clearTimeout(self.pending.wait_timer); - self.pending.wait_timer = null; - - self.log.debug('Retry since=' + self.since + ' after ' + self.retry_delay + 'ms ') - self.emit('retry', {since:self.since, after:self.retry_delay, db:self.db_safe}); - - self.retry_timer = setTimeout(function() { self.query() }, self.retry_delay); - - var max_retry_ms = self.max_retry_seconds * 1000; - self.retry_delay *= 2; - if(self.retry_delay > max_retry_ms) - self.retry_delay = max_retry_ms; -} - -Feed.prototype.on_couch_end = function on_couch_end() { - var self = this; - - self.log.debug('Changes feed ended ' + self.pending.request.id()); - self.pending.request = null; - return self.retry(); -} - -Feed.prototype.on_couch_error = function on_couch_error(er) { - var self = this; - - self.log.debug('Changes query eror: ' + lib.JS(er.stack)); - return self.retry(); -} - -Feed.prototype.stop = function(val) { - var self = this - self.log.debug('Stop') - - // Die with no errors. - self.die() - self.emit('stop', val); -} - -Feed.prototype.die = function(er) { - var self = this; - - if(er) - self.log.fatal('Fatal error: ' + er.stack); - - // Warn code executing later that death has occured. - self.dead = true - - clearTimeout(self.retry_timer) - clearTimeout(self.inactivity_timer) - clearTimeout(self.pending.wait_timer) - - self.inactivity_timer = null - self.pending.wait_timer = null - - var req = self.pending.request; - self.pending.request = null; - if(req) { - self.log.debug('Destroying req ' + req.id()); - destroy_req(req); - } - - if(er) - self.emit('error', er); -} - -Feed.prototype.on_change = function on_change(change) { - var self = this; - - if(!self.is_db_updates && !change.seq) - return self.die(new Error('No seq value in change: ' + lib.JS(change))); - - if(!self.is_db_updates && change.seq == self.since) { - self.log.debug('Bad seq value ' + change.seq + ' since=' + self.since); - return destroy_req(self.pending.request); - } - - if(typeof self.filter !== 'function') - return self.on_good_change(change); - - if(!change.doc) - return self.die(new Error('Internal filter needs .doc in change ' + change.seq)); - - // Don't let the filter mutate the real data. - var doc = lib.JDUP(change.doc); - var req = lib.JDUP({'query': self.pending.request.changes_query}); - - var result = false; - try { - result = self.filter.apply(null, [doc, req]); - } catch (er) { - self.log.debug('Filter error', er); - } - - result = (result && true) || false; - if(result) { - self.log.debug('Builtin filter PASS for change: ' + change.seq); - return self.on_good_change(change); - } else { - self.log.debug('Builtin filter FAIL for change: ' + change.seq); - - // Even with a filtered change, a "catchup" event might still be appropriate. - self.check_for_catchup(change.seq) - } -} - -Feed.prototype.on_good_change = function on_good_change(change) { - var self = this; - - if(self.inactivity_ms && !self.inactivity_timer) - return self.die(new Error('Cannot find inactivity timer during change')); - - clearTimeout(self.inactivity_timer); - self.inactivity_timer = null; - if(self.inactivity_ms) - self.inactivity_timer = setTimeout(function() { self.on_inactivity() }, self.inactivity_ms); - - self.change_at = new Date; - - if(!self.is_db_updates) - self.since = change.seq; - - self.emit('change', change); - - self.check_for_catchup(change.seq) -} - -Feed.prototype.check_for_catchup = function check_for_catchup(seq) { - var self = this - - if (self.is_db_updates) - return - if(self.caught_up) - return - if(seq < self.original_db_seq) - return - - self.caught_up = true - self.emit('catchup', seq) -} - -Feed.prototype.on_inactivity = function on_inactivity() { - var self = this; - var now = new Date; - var elapsed_ms = now - self.change_at; - var elapsed_s = elapsed_ms / 1000; - - // - // Since this is actually not fatal, lets just totally reset and start a new - // request, JUST in case something was bad. - // - self.log.debug('Req ' + self.pending.request.id() + ' made no changes for ' + elapsed_s + 's'); - return self.restart(); - -} - -Feed.prototype.restart = function restart() { - var self = this - - self.emit('restart') - - // Kill ourselves and then start up once again - self.stop() - self.dead = false - self.start() -} - -module.exports = { "Feed" : Feed - }; - - -/* - * Utilities - */ - -function destroy_req(req) { - if(req) - destroy_response(req.response) - - if(req && typeof req.destroy == 'function') - req.destroy() -} - -function destroy_response(response) { - if(!response) - return; - - if(typeof response.abort === 'function') - response.abort(); - - if(response.connection) - response.connection.destroy(); -} diff --git a/update_nation/node_modules/nano/node_modules/follow/lib/index.js b/update_nation/node_modules/nano/node_modules/follow/lib/index.js deleted file mode 100644 index 4b2c61c99..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/lib/index.js +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2011 Iris Couch -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -exports.scrub_creds = function scrub_creds(url) { - return url.replace(/^(https?:\/\/)[^:]+:[^@]+@(.*)$/, '$1$2'); // Scrub username and password -} - -exports.JP = JSON.parse; -exports.JS = JSON.stringify; -exports.JDUP = function(obj) { return JSON.parse(JSON.stringify(obj)) }; - -var timeouts = { 'setTimeout': setTimeout - , 'clearTimeout': clearTimeout - } - -exports.setTimeout = function() { return timeouts.setTimeout.apply(this, arguments) } -exports.clearTimeout = function() { return timeouts.clearTimeout.apply(this, arguments) } -exports.timeouts = function(set, clear) { - timeouts.setTimeout = set - timeouts.clearTimeout = clear -} - -var debug = require('debug') - -function getLogger(name) { - return { "trace": noop - , "debug": debug('follow:' + name + ':debug') - , "info" : debug('follow:' + name + ':info') - , "warn" : debug('follow:' + name + ':warn') - , "error": debug('follow:' + name + ':error') - , "fatal": debug('follow:' + name + ':fatal') - - , "level": {'level':0, 'levelStr':'noop'} - , "setLevel": noop - } -} - -function noop () {} - -exports.log4js = { 'getLogger': getLogger } diff --git a/update_nation/node_modules/nano/node_modules/follow/lib/stream.js b/update_nation/node_modules/nano/node_modules/follow/lib/stream.js deleted file mode 100644 index 29e5b9058..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/lib/stream.js +++ /dev/null @@ -1,312 +0,0 @@ -// Changes stream -// -// Copyright 2011 Iris Couch -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -var lib = require('../lib') - , util = require('util') - , stream = require('stream') - , request = require('request') - -// Use the library timeout functions, primarily so the test suite can catch errors. -var setTimeout = lib.setTimeout - , clearTimeout = lib.clearTimeout - - -var DEFS = - { 'longpoll_header': '{"results":[' - , 'log_level' : process.env.follow_log_level || 'info' - } - -module.exports = { 'Changes': Changes - } - - -util.inherits(Changes, stream) -function Changes (opts) { - var self = this - stream.call(self) - - self.readable = true - self.writable = true - - self.headers = {} - self.statusCode = null - - opts = opts || {} - self.feed = opts.feed || null // "continuous" or "longpoll" - self.encoding = opts.encoding || 'utf8' - - self.log = opts.log - if(!self.log) { - self.log = lib.log4js.getLogger('change_stream') - self.log.setLevel(DEFS.log_level) - } - - self.is_sending = true - self.is_ending = false - self.is_dead = false - - self.source = null - self.expect = null - self.buf = null - self.changes = [] - - self.on('pipe', function(src) { - if(!self.source) - self.source = src - else { - var er = new Error('Already have a pipe source') - er.source = self.source - self.error(er) - } - }) -} - - -Changes.prototype.setHeader = function(key, val) { - var self = this - self.headers[key] = val -} - -// -// Readable stream API -// - -Changes.prototype.setEncoding = function(encoding) { - var self = this - self.encoding = encoding // TODO -} - - -Changes.prototype.pause = function() { - var self = this - self.is_sending = false - - if(self.source && self.source.pause) - self.source.pause() -} - - -Changes.prototype.resume = function() { - var self = this - self.is_sending = true - if(self.source && self.source.resume) - self.source.resume() - self.emit_changes() -} - -// -// Writable stream API -// - -Changes.prototype.write = function(data, encoding) { - var self = this - - data = self.normalize_data(data, encoding) - if(typeof data != 'string') - return // Looks like normalize_data emitted an error. - - if(self.feed === 'longpoll') - return self.write_longpoll(data) - else if(self.feed === 'continuous') - return self.write_continuous(data) -} - - -Changes.prototype.write_longpoll = function(data) { - var self = this - - if(self.buf === null) - self.buf = [] - - self.buf.push(data) - return true -} - - -Changes.prototype.write_continuous = function(data) { - var self = this - - var offset, json, change - , buf = (self.buf || "") + data - - self.log.debug('write: ' + util.inspect({'data':data, 'buf':buf})) - - // Buf could have 0, 1, or many JSON objects in it. - while((offset = buf.indexOf("\n")) >= 0) { - json = buf.substr(0, offset); - buf = buf.substr(offset + 1); - self.log.debug('JSON: ' + util.inspect(json)) - - // Heartbeats (empty strings) are fine, but otherwise confirm valid JSON. - if(json === "") - ; - - else if(json[0] !== '{') - return self.error(new Error('Non-object JSON data: ' + json)) - - else { - try { change = JSON.parse(json) } - catch (er) { return self.error(er) } - - self.log.debug('Object: ' + util.inspect(change)) - json = JSON.stringify(change) - } - - // Change (or heartbeat) looks good. - self.changes.push(json) - } - - // Remember the unused data and send all known good changes (or heartbeats). The data (or heartbeat) - // event listeners may call .pause() so remember the is_sending state now before calling them. - var was_sending = self.is_sending - self.buf = buf - self.emit_changes() - return was_sending -} - - -Changes.prototype.end = function(data, encoding) { - var self = this - - self.is_ending = true - self.writable = false - - // Always call write, even with no data, so it can fire the "end" event. - self.write(data, encoding) - - if(self.feed === 'longpoll') { - var changes = [ DEFS.longpoll_header ].concat(self.buf).join('') - try { changes = JSON.parse(changes) || {} } - catch (er) { return self.error(er) } - - if(!Array.isArray(changes.results)) - return self.error(new Error('No "results" field in feed')) - if(self.changes.length !== 0) - return self.error(new Error('Changes are already queued: ' + JSON.stringify(self.changes))) - - self.changes = changes.results.map(function(change) { return JSON.stringify(change) }) - return self.emit_changes() - } - - else if(self.feed === 'continuous') { - if(self.buf !== "") - self.log.debug('Unprocessed data after "end" called: ' + util.inspect(self.buf)) - } -} - - -Changes.prototype.emit_changes = function() { - var self = this - - while(self.is_sending && self.changes.length > 0) { - var change = self.changes.shift() - if(change === "") { - self.log.debug('emit: heartbeat') - self.emit('heartbeat') - } - - else { - self.log.debug('emit: data') - self.emit('data', change) - } - } - - if(self.is_sending && self.is_ending && self.changes.length === 0) { - self.is_ending = false - self.readable = false - self.log.debug('emit: end') - self.emit('end') - } -} - -// -// Readable/writable stream API -// - -Changes.prototype.destroy = function() { - var self = this - self.log.debug('destroy') - - self.is_dead = true - self.is_ending = false - self.is_sending = false - - if(self.source && typeof self.source.abort == 'function') - return self.source.abort() - - if(self.source && typeof self.source.destroy === 'function') - self.source.destroy() - - // Often the source is from the request package, so destroy its response object. - if(self.source && self.source.__isRequestRequest && self.source.response - && typeof self.source.response.destroy === 'function') - self.source.response.destroy() -} - - -Changes.prototype.destroySoon = function() { - var self = this - throw new Error('not implemented') - //return self.request.destroySoon() -} - -// -// Internal implementation -// - -Changes.prototype.normalize_data = function(data, encoding) { - var self = this - - if(data instanceof Buffer) - data = data.toString(encoding) - else if(typeof data === 'undefined' && typeof encoding === 'undefined') - data = "" - - if(typeof data != 'string') - return self.error(new Error('Not a string or Buffer: ' + util.inspect(data))) - - if(self.feed !== 'continuous' && self.feed !== 'longpoll') - return self.error(new Error('Must set .feed to "continuous" or "longpoll" before writing data')) - - if(self.expect === null) - self.expect = (self.feed == 'longpoll') - ? DEFS.longpoll_header - : "" - - var prefix = data.substr(0, self.expect.length) - data = data.substr(prefix.length) - - var expected_part = self.expect.substr(0, prefix.length) - , expected_remainder = self.expect.substr(expected_part.length) - - if(prefix !== expected_part) - return self.error(new Error('Prefix not expected '+util.inspect(expected_part)+': ' + util.inspect(prefix))) - - self.expect = expected_remainder - return data -} - - -Changes.prototype.error = function(er) { - var self = this - - self.readable = false - self.writable = false - self.emit('error', er) - - // The write() method sometimes returns this value, so if there was an error, make write() return false. - return false -} diff --git a/update_nation/node_modules/nano/node_modules/follow/node_modules/browser-request/.npmignore b/update_nation/node_modules/nano/node_modules/follow/node_modules/browser-request/.npmignore deleted file mode 100644 index c850ae974..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/node_modules/browser-request/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -/.gitmodules -/Rakefile -/template diff --git a/update_nation/node_modules/nano/node_modules/follow/node_modules/browser-request/AUTHORS b/update_nation/node_modules/nano/node_modules/follow/node_modules/browser-request/AUTHORS deleted file mode 100644 index 0385a2e34..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/node_modules/browser-request/AUTHORS +++ /dev/null @@ -1,4 +0,0 @@ -Jason Smith Work -Jason Smith -maxogden -Abbey Sparrow via Google diff --git a/update_nation/node_modules/nano/node_modules/follow/node_modules/browser-request/LICENSE b/update_nation/node_modules/nano/node_modules/follow/node_modules/browser-request/LICENSE deleted file mode 100644 index d64569567..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/node_modules/browser-request/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/update_nation/node_modules/nano/node_modules/follow/node_modules/browser-request/README.md b/update_nation/node_modules/nano/node_modules/follow/node_modules/browser-request/README.md deleted file mode 100644 index ad962db73..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/node_modules/browser-request/README.md +++ /dev/null @@ -1,118 +0,0 @@ -# Browser Request: The easiest HTTP library you'll ever see - -Browser Request is a port of Mikeal Rogers's ubiquitous and excellent [request][req] package to the browser. - -Jealous of Node.js? Pining for clever callbacks? Request is for you. - -Don't care about Node.js? Looking for less tedium and a no-nonsense API? Request is for you too. - -[![browser support](https://ci.testling.com/iriscouch/browser-request.png)](https://ci.testling.com/maxogden/browser-request) - -# Examples - -Fetch a resource: - -```javascript -request('/some/resource.txt', function(er, response, body) { - if(er) - throw er; - console.log("I got: " + body); -}) -``` - -Send a resource: - -```javascript -request.put({uri:'/some/resource.xml', body:''}, function(er, response) { - if(er) - throw new Error("XML PUT failed (" + er + "): HTTP status was " + response.status); - console.log("Stored the XML"); -}) -``` - -To work with JSON, set `options.json` to `true`. Request will set the `Content-Type` and `Accept` headers, and handle parsing and serialization. - -```javascript -request({method:'POST', url:'/db', body:'{"relaxed":true}', json:true}, on_response) - -function on_response(er, response, body) { - if(er) - throw er - if(result.ok) - console.log('Server ok, id = ' + result.id) -} -``` - -Or, use this shorthand version (pass data into the `json` option directly): - -```javascript -request({method:'POST', url:'/db', json:{relaxed:true}}, on_response) -``` - -## Convenient CouchDB - -Browser Request provides a CouchDB wrapper. It is the same as the JSON wrapper, however it will indicate an error if the HTTP query was fine, but there was a problem at the database level. The most common example is `409 Conflict`. - -```javascript -request.couch({method:'PUT', url:'/db/existing_doc', body:{"will_conflict":"you bet!"}}, function(er, resp, result) { - if(er.error === 'conflict') - return console.error("Couch said no: " + er.reason); // Output: Couch said no: Document update conflict. - - if(er) - throw er; - - console.log("Existing doc stored. This must have been the first run."); -}) -``` - -See the [Node.js Request README][req] for several more examples. Request intends to maintain feature parity with Node request (except what the browser disallows). If you find a discrepancy, please submit a bug report. Thanks! - -# Usage - -## Browserify - -Browser Request is a [browserify][browserify]-enabled package. - -First, add `browser-request` to your Node project - - $ npm install browser-request - -Next, make a module that uses the package. - -```javascript -// example.js - Example front-end (client-side) code using browser-request via browserify -// -var request = require('browser-request') -request('/', function(er, res) { - if(!er) - return console.log('browser-request got your root path:\n' + res.body) - - console.log('There was an error, but at least browser-request loaded and ran!') - throw er -}) -``` - -To build this for the browser, run it through browserify. - - $ browserify --entry example.js --outfile example-built.js - -Deploy `example-built.js` to your web site and use it from your page. - -```html - -``` - -## UMD - -`browser-request` is [UMD](https://github.com/umdjs/umd) wrapped, allowing you to serve it directly to the browser from wherever you store the module. - -```html - -``` - -You may also use an [AMD loader](http://requirejs.org/docs/whyamd.html) by referencing the same file in your loader [config](http://requirejs.org/docs/api.html#config). - -## License - -Browser Request is licensed under the Apache 2.0 license. - diff --git a/update_nation/node_modules/nano/node_modules/follow/node_modules/browser-request/index.js b/update_nation/node_modules/nano/node_modules/follow/node_modules/browser-request/index.js deleted file mode 100644 index 51ac8b4c7..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/node_modules/browser-request/index.js +++ /dev/null @@ -1,494 +0,0 @@ -// Browser Request -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// UMD HEADER START -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define([], factory); - } else if (typeof exports === 'object') { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like enviroments that support module.exports, - // like Node. - module.exports = factory(); - } else { - // Browser globals (root is window) - root.returnExports = factory(); - } -}(this, function () { -// UMD HEADER END - -var XHR = XMLHttpRequest -if (!XHR) throw new Error('missing XMLHttpRequest') -request.log = { - 'trace': noop, 'debug': noop, 'info': noop, 'warn': noop, 'error': noop -} - -var DEFAULT_TIMEOUT = 3 * 60 * 1000 // 3 minutes - -// -// request -// - -function request(options, callback) { - // The entry-point to the API: prep the options object and pass the real work to run_xhr. - if(typeof callback !== 'function') - throw new Error('Bad callback given: ' + callback) - - if(!options) - throw new Error('No options given') - - var options_onResponse = options.onResponse; // Save this for later. - - if(typeof options === 'string') - options = {'uri':options}; - else - options = JSON.parse(JSON.stringify(options)); // Use a duplicate for mutating. - - options.onResponse = options_onResponse // And put it back. - - if (options.verbose) request.log = getLogger(); - - if(options.url) { - options.uri = options.url; - delete options.url; - } - - if(!options.uri && options.uri !== "") - throw new Error("options.uri is a required argument"); - - if(typeof options.uri != "string") - throw new Error("options.uri must be a string"); - - var unsupported_options = ['proxy', '_redirectsFollowed', 'maxRedirects', 'followRedirect'] - for (var i = 0; i < unsupported_options.length; i++) - if(options[ unsupported_options[i] ]) - throw new Error("options." + unsupported_options[i] + " is not supported") - - options.callback = callback - options.method = options.method || 'GET'; - options.headers = options.headers || {}; - options.body = options.body || null - options.timeout = options.timeout || request.DEFAULT_TIMEOUT - - if(options.headers.host) - throw new Error("Options.headers.host is not supported"); - - if(options.json) { - options.headers.accept = options.headers.accept || 'application/json' - if(options.method !== 'GET') - options.headers['content-type'] = 'application/json' - - if(typeof options.json !== 'boolean') - options.body = JSON.stringify(options.json) - else if(typeof options.body !== 'string') - options.body = JSON.stringify(options.body) - } - - //BEGIN QS Hack - var serialize = function(obj) { - var str = []; - for(var p in obj) - if (obj.hasOwnProperty(p)) { - str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); - } - return str.join("&"); - } - - if(options.qs){ - var qs = (typeof options.qs == 'string')? options.qs : serialize(options.qs); - if(options.uri.indexOf('?') !== -1){ //no get params - options.uri = options.uri+'&'+qs; - }else{ //existing get params - options.uri = options.uri+'?'+qs; - } - } - //END QS Hack - - //BEGIN FORM Hack - var multipart = function(obj) { - //todo: support file type (useful?) - var result = {}; - result.boundry = '-------------------------------'+Math.floor(Math.random()*1000000000); - var lines = []; - for(var p in obj){ - if (obj.hasOwnProperty(p)) { - lines.push( - '--'+result.boundry+"\n"+ - 'Content-Disposition: form-data; name="'+p+'"'+"\n"+ - "\n"+ - obj[p]+"\n" - ); - } - } - lines.push( '--'+result.boundry+'--' ); - result.body = lines.join(''); - result.length = result.body.length; - result.type = 'multipart/form-data; boundary='+result.boundry; - return result; - } - - if(options.form){ - if(typeof options.form == 'string') throw('form name unsupported'); - if(options.method === 'POST'){ - var encoding = (options.encoding || 'application/x-www-form-urlencoded').toLowerCase(); - options.headers['content-type'] = encoding; - switch(encoding){ - case 'application/x-www-form-urlencoded': - options.body = serialize(options.form).replace(/%20/g, "+"); - break; - case 'multipart/form-data': - var multi = multipart(options.form); - //options.headers['content-length'] = multi.length; - options.body = multi.body; - options.headers['content-type'] = multi.type; - break; - default : throw new Error('unsupported encoding:'+encoding); - } - } - } - //END FORM Hack - - // If onResponse is boolean true, call back immediately when the response is known, - // not when the full request is complete. - options.onResponse = options.onResponse || noop - if(options.onResponse === true) { - options.onResponse = callback - options.callback = noop - } - - // XXX Browsers do not like this. - //if(options.body) - // options.headers['content-length'] = options.body.length; - - // HTTP basic authentication - if(!options.headers.authorization && options.auth) - options.headers.authorization = 'Basic ' + b64_enc(options.auth.username + ':' + options.auth.password); - - return run_xhr(options) -} - -var req_seq = 0 -function run_xhr(options) { - var xhr = new XHR - , timed_out = false - , is_cors = is_crossDomain(options.uri) - , supports_cors = ('withCredentials' in xhr) - - req_seq += 1 - xhr.seq_id = req_seq - xhr.id = req_seq + ': ' + options.method + ' ' + options.uri - xhr._id = xhr.id // I know I will type "_id" from habit all the time. - - if(is_cors && !supports_cors) { - var cors_err = new Error('Browser does not support cross-origin request: ' + options.uri) - cors_err.cors = 'unsupported' - return options.callback(cors_err, xhr) - } - - xhr.timeoutTimer = setTimeout(too_late, options.timeout) - function too_late() { - timed_out = true - var er = new Error('ETIMEDOUT') - er.code = 'ETIMEDOUT' - er.duration = options.timeout - - request.log.error('Timeout', { 'id':xhr._id, 'milliseconds':options.timeout }) - return options.callback(er, xhr) - } - - // Some states can be skipped over, so remember what is still incomplete. - var did = {'response':false, 'loading':false, 'end':false} - - xhr.onreadystatechange = on_state_change - xhr.open(options.method, options.uri, true) // asynchronous - if(is_cors) - xhr.withCredentials = !! options.withCredentials - xhr.send(options.body) - return xhr - - function on_state_change(event) { - if(timed_out) - return request.log.debug('Ignoring timed out state change', {'state':xhr.readyState, 'id':xhr.id}) - - request.log.debug('State change', {'state':xhr.readyState, 'id':xhr.id, 'timed_out':timed_out}) - - if(xhr.readyState === XHR.OPENED) { - request.log.debug('Request started', {'id':xhr.id}) - for (var key in options.headers) - xhr.setRequestHeader(key, options.headers[key]) - } - - else if(xhr.readyState === XHR.HEADERS_RECEIVED) - on_response() - - else if(xhr.readyState === XHR.LOADING) { - on_response() - on_loading() - } - - else if(xhr.readyState === XHR.DONE) { - on_response() - on_loading() - on_end() - } - } - - function on_response() { - if(did.response) - return - - did.response = true - request.log.debug('Got response', {'id':xhr.id, 'status':xhr.status}) - clearTimeout(xhr.timeoutTimer) - xhr.statusCode = xhr.status // Node request compatibility - - // Detect failed CORS requests. - if(is_cors && xhr.statusCode == 0) { - var cors_err = new Error('CORS request rejected: ' + options.uri) - cors_err.cors = 'rejected' - - // Do not process this request further. - did.loading = true - did.end = true - - return options.callback(cors_err, xhr) - } - - options.onResponse(null, xhr) - } - - function on_loading() { - if(did.loading) - return - - did.loading = true - request.log.debug('Response body loading', {'id':xhr.id}) - // TODO: Maybe simulate "data" events by watching xhr.responseText - } - - function on_end() { - if(did.end) - return - - did.end = true - request.log.debug('Request done', {'id':xhr.id}) - - xhr.body = xhr.responseText - if(options.json) { - try { xhr.body = JSON.parse(xhr.responseText) } - catch (er) { return options.callback(er, xhr) } - } - - options.callback(null, xhr, xhr.body) - } - -} // request - -request.withCredentials = false; -request.DEFAULT_TIMEOUT = DEFAULT_TIMEOUT; - -// -// defaults -// - -request.defaults = function(options, requester) { - var def = function (method) { - var d = function (params, callback) { - if(typeof params === 'string') - params = {'uri': params}; - else { - params = JSON.parse(JSON.stringify(params)); - } - for (var i in options) { - if (params[i] === undefined) params[i] = options[i] - } - return method(params, callback) - } - return d - } - var de = def(request) - de.get = def(request.get) - de.post = def(request.post) - de.put = def(request.put) - de.head = def(request.head) - return de -} - -// -// HTTP method shortcuts -// - -var shortcuts = [ 'get', 'put', 'post', 'head' ]; -shortcuts.forEach(function(shortcut) { - var method = shortcut.toUpperCase(); - var func = shortcut.toLowerCase(); - - request[func] = function(opts) { - if(typeof opts === 'string') - opts = {'method':method, 'uri':opts}; - else { - opts = JSON.parse(JSON.stringify(opts)); - opts.method = method; - } - - var args = [opts].concat(Array.prototype.slice.apply(arguments, [1])); - return request.apply(this, args); - } -}) - -// -// CouchDB shortcut -// - -request.couch = function(options, callback) { - if(typeof options === 'string') - options = {'uri':options} - - // Just use the request API to do JSON. - options.json = true - if(options.body) - options.json = options.body - delete options.body - - callback = callback || noop - - var xhr = request(options, couch_handler) - return xhr - - function couch_handler(er, resp, body) { - if(er) - return callback(er, resp, body) - - if((resp.statusCode < 200 || resp.statusCode > 299) && body.error) { - // The body is a Couch JSON object indicating the error. - er = new Error('CouchDB error: ' + (body.error.reason || body.error.error)) - for (var key in body) - er[key] = body[key] - return callback(er, resp, body); - } - - return callback(er, resp, body); - } -} - -// -// Utility -// - -function noop() {} - -function getLogger() { - var logger = {} - , levels = ['trace', 'debug', 'info', 'warn', 'error'] - , level, i - - for(i = 0; i < levels.length; i++) { - level = levels[i] - - logger[level] = noop - if(typeof console !== 'undefined' && console && console[level]) - logger[level] = formatted(console, level) - } - - return logger -} - -function formatted(obj, method) { - return formatted_logger - - function formatted_logger(str, context) { - if(typeof context === 'object') - str += ' ' + JSON.stringify(context) - - return obj[method].call(obj, str) - } -} - -// Return whether a URL is a cross-domain request. -function is_crossDomain(url) { - var rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/ - - // jQuery #8138, IE may throw an exception when accessing - // a field from window.location if document.domain has been set - var ajaxLocation - try { ajaxLocation = location.href } - catch (e) { - // Use the href attribute of an A element since IE will modify it given document.location - ajaxLocation = document.createElement( "a" ); - ajaxLocation.href = ""; - ajaxLocation = ajaxLocation.href; - } - - var ajaxLocParts = rurl.exec(ajaxLocation.toLowerCase()) || [] - , parts = rurl.exec(url.toLowerCase() ) - - var result = !!( - parts && - ( parts[1] != ajaxLocParts[1] - || parts[2] != ajaxLocParts[2] - || (parts[3] || (parts[1] === "http:" ? 80 : 443)) != (ajaxLocParts[3] || (ajaxLocParts[1] === "http:" ? 80 : 443)) - ) - ) - - //console.debug('is_crossDomain('+url+') -> ' + result) - return result -} - -// MIT License from http://phpjs.org/functions/base64_encode:358 -function b64_enc (data) { - // Encodes string using MIME base64 algorithm - var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; - var o1, o2, o3, h1, h2, h3, h4, bits, i = 0, ac = 0, enc="", tmp_arr = []; - - if (!data) { - return data; - } - - // assume utf8 data - // data = this.utf8_encode(data+''); - - do { // pack three octets into four hexets - o1 = data.charCodeAt(i++); - o2 = data.charCodeAt(i++); - o3 = data.charCodeAt(i++); - - bits = o1<<16 | o2<<8 | o3; - - h1 = bits>>18 & 0x3f; - h2 = bits>>12 & 0x3f; - h3 = bits>>6 & 0x3f; - h4 = bits & 0x3f; - - // use hexets to index into b64, and append result to encoded string - tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4); - } while (i < data.length); - - enc = tmp_arr.join(''); - - switch (data.length % 3) { - case 1: - enc = enc.slice(0, -2) + '=='; - break; - case 2: - enc = enc.slice(0, -1) + '='; - break; - } - - return enc; -} - return request; -//UMD FOOTER START -})); -//UMD FOOTER END diff --git a/update_nation/node_modules/nano/node_modules/follow/node_modules/browser-request/package.json b/update_nation/node_modules/nano/node_modules/follow/node_modules/browser-request/package.json deleted file mode 100644 index 4689df279..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/node_modules/browser-request/package.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "name": "browser-request", - "version": "0.3.3", - "author": { - "name": "Jason Smith", - "email": "jhs@iriscouch.com" - }, - "description": "Browser port of the Node.js 'request' package", - "keywords": [ - "request", - "http", - "browser", - "browserify" - ], - "homepage": "http://github.com/iriscouch/browser-request", - "repository": { - "type": "git", - "url": "git://github.com/iriscouch/browser-request" - }, - "scripts": { - "test": "beefy test.js" - }, - "devDependencies": { - "tape": "~1.0.4", - "beefy": "~0.4.0", - "browserify": "~2.25.0" - }, - "engines": [ - "node" - ], - "testling": { - "files": "test.js", - "browsers": [ - "ie/6..latest", - "firefox/3..5", - "firefox/19..nightly", - "chrome/4..7", - "chrome/24..canary", - "opera/10..next", - "safari/4..latest", - "iphone/6", - "ipad/6" - ] - }, - "contributors": [ - { - "name": "Jason Smith Work", - "email": "jhs@iriscouch.com" - }, - { - "name": "Jason Smith", - "email": "jason.h.smith@gmail.com" - }, - { - "name": "maxogden", - "email": "max@maxogden.com" - }, - { - "name": "Abbey Sparrow via Google", - "email": "abbeys@google.com" - } - ], - "bugs": { - "url": "https://github.com/iriscouch/browser-request/issues" - }, - "_id": "browser-request@0.3.3", - "dist": { - "shasum": "9ece5b5aca89a29932242e18bf933def9876cc17", - "tarball": "http://registry.npmjs.org/browser-request/-/browser-request-0.3.3.tgz" - }, - "_from": "browser-request@~0.3.0", - "_npmVersion": "1.3.24", - "_npmUser": { - "name": "jhs", - "email": "jhs@iriscouch.com" - }, - "maintainers": [ - { - "name": "jhs", - "email": "jhs@iriscouch.com" - }, - { - "name": "maxogden", - "email": "max@maxogden.com" - } - ], - "directories": {}, - "_shasum": "9ece5b5aca89a29932242e18bf933def9876cc17", - "_resolved": "https://registry.npmjs.org/browser-request/-/browser-request-0.3.3.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/update_nation/node_modules/nano/node_modules/follow/node_modules/browser-request/test.js b/update_nation/node_modules/nano/node_modules/follow/node_modules/browser-request/test.js deleted file mode 100644 index f427f233e..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/node_modules/browser-request/test.js +++ /dev/null @@ -1,20 +0,0 @@ -var test = require('tape') - -var request = require('./') - -test('try a CORS GET', function (t) { - var url = 'https://www.googleapis.com/plus/v1/activities' - request(url, function(err, resp, body) { - t.equal(resp.statusCode, 400) - t.equal(!!resp.body.match(/Required parameter/), true) - t.end() - }) -}) - -test('json true', function (t) { - var url = 'https://www.googleapis.com/plus/v1/activities' - request({url: url, json: true}, function(err, resp, body) { - t.equal(body.error.code, 400) - t.end() - }) -}) diff --git a/update_nation/node_modules/nano/node_modules/follow/node_modules/debug/Readme.md b/update_nation/node_modules/nano/node_modules/follow/node_modules/debug/Readme.md deleted file mode 100644 index c5a34e8b8..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/node_modules/debug/Readme.md +++ /dev/null @@ -1,115 +0,0 @@ -# debug - - tiny node.js debugging utility modelled after node core's debugging technique. - -## Installation - -``` -$ npm install debug -``` - -## Usage - - With `debug` you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated `console.error`, so all of the `console` format string goodies you're used to work fine. A unique color is selected per-function for visibility. - -Example _app.js_: - -```js -var debug = require('debug')('http') - , http = require('http') - , name = 'My App'; - -// fake app - -debug('booting %s', name); - -http.createServer(function(req, res){ - debug(req.method + ' ' + req.url); - res.end('hello\n'); -}).listen(3000, function(){ - debug('listening'); -}); - -// fake worker of some kind - -require('./worker'); -``` - -Example _worker.js_: - -```js -var debug = require('debug')('worker'); - -setInterval(function(){ - debug('doing some work'); -}, 1000); -``` - - The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples: - - ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png) - - ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png) - -## Millisecond diff - - When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. - - ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png) - - When stderr is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below: - _(NOTE: Debug now uses stderr instead of stdout, so the correct shell command for this example is actually `DEBUG=* node example/worker 2> out &`)_ - - ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png) - -## Conventions - - If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". - -## Wildcards - - The "*" character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect.compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. - - You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=* -connect:*` would include all debuggers except those starting with "connect:". - -## Browser support - - Debug works in the browser as well, currently persisted by `localStorage`. For example if you have `worker:a` and `worker:b` as shown below, and wish to debug both type `debug.enable('worker:*')` in the console and refresh the page, this will remain until you disable with `debug.disable()`. - -```js -a = debug('worker:a'); -b = debug('worker:b'); - -setInterval(function(){ - a('doing some work'); -}, 1000); - -setInterval(function(){ - a('doing some work'); -}, 1200); -``` - -## License - -(The MIT License) - -Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca> - -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/update_nation/node_modules/nano/node_modules/follow/node_modules/debug/debug.js b/update_nation/node_modules/nano/node_modules/follow/node_modules/debug/debug.js deleted file mode 100644 index 509dc0ded..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/node_modules/debug/debug.js +++ /dev/null @@ -1,137 +0,0 @@ - -/** - * Expose `debug()` as the module. - */ - -module.exports = debug; - -/** - * Create a debugger with the given `name`. - * - * @param {String} name - * @return {Type} - * @api public - */ - -function debug(name) { - if (!debug.enabled(name)) return function(){}; - - return function(fmt){ - fmt = coerce(fmt); - - var curr = new Date; - var ms = curr - (debug[name] || curr); - debug[name] = curr; - - fmt = name - + ' ' - + fmt - + ' +' + debug.humanize(ms); - - // This hackery is required for IE8 - // where `console.log` doesn't have 'apply' - window.console - && console.log - && Function.prototype.apply.call(console.log, console, arguments); - } -} - -/** - * The currently active debug mode names. - */ - -debug.names = []; -debug.skips = []; - -/** - * Enables a debug mode by name. This can include modes - * separated by a colon and wildcards. - * - * @param {String} name - * @api public - */ - -debug.enable = function(name) { - try { - localStorage.debug = name; - } catch(e){} - - var split = (name || '').split(/[\s,]+/) - , len = split.length; - - for (var i = 0; i < len; i++) { - name = split[i].replace('*', '.*?'); - if (name[0] === '-') { - debug.skips.push(new RegExp('^' + name.substr(1) + '$')); - } - else { - debug.names.push(new RegExp('^' + name + '$')); - } - } -}; - -/** - * Disable debug output. - * - * @api public - */ - -debug.disable = function(){ - debug.enable(''); -}; - -/** - * Humanize the given `ms`. - * - * @param {Number} m - * @return {String} - * @api private - */ - -debug.humanize = function(ms) { - var sec = 1000 - , min = 60 * 1000 - , hour = 60 * min; - - if (ms >= hour) return (ms / hour).toFixed(1) + 'h'; - if (ms >= min) return (ms / min).toFixed(1) + 'm'; - if (ms >= sec) return (ms / sec | 0) + 's'; - return ms + 'ms'; -}; - -/** - * Returns true if the given mode name is enabled, false otherwise. - * - * @param {String} name - * @return {Boolean} - * @api public - */ - -debug.enabled = function(name) { - for (var i = 0, len = debug.skips.length; i < len; i++) { - if (debug.skips[i].test(name)) { - return false; - } - } - for (var i = 0, len = debug.names.length; i < len; i++) { - if (debug.names[i].test(name)) { - return true; - } - } - return false; -}; - -/** - * Coerce `val`. - */ - -function coerce(val) { - if (val instanceof Error) return val.stack || val.message; - return val; -} - -// persist - -try { - if (window.localStorage) debug.enable(localStorage.debug); -} catch(e){} diff --git a/update_nation/node_modules/nano/node_modules/follow/node_modules/debug/index.js b/update_nation/node_modules/nano/node_modules/follow/node_modules/debug/index.js deleted file mode 100644 index e02c13b7f..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/node_modules/debug/index.js +++ /dev/null @@ -1,5 +0,0 @@ -if ('undefined' == typeof window) { - module.exports = require('./lib/debug'); -} else { - module.exports = require('./debug'); -} diff --git a/update_nation/node_modules/nano/node_modules/follow/node_modules/debug/lib/debug.js b/update_nation/node_modules/nano/node_modules/follow/node_modules/debug/lib/debug.js deleted file mode 100644 index 3b0a9183d..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/node_modules/debug/lib/debug.js +++ /dev/null @@ -1,147 +0,0 @@ -/** - * Module dependencies. - */ - -var tty = require('tty'); - -/** - * Expose `debug()` as the module. - */ - -module.exports = debug; - -/** - * Enabled debuggers. - */ - -var names = [] - , skips = []; - -(process.env.DEBUG || '') - .split(/[\s,]+/) - .forEach(function(name){ - name = name.replace('*', '.*?'); - if (name[0] === '-') { - skips.push(new RegExp('^' + name.substr(1) + '$')); - } else { - names.push(new RegExp('^' + name + '$')); - } - }); - -/** - * Colors. - */ - -var colors = [6, 2, 3, 4, 5, 1]; - -/** - * Previous debug() call. - */ - -var prev = {}; - -/** - * Previously assigned color. - */ - -var prevColor = 0; - -/** - * Is stdout a TTY? Colored output is disabled when `true`. - */ - -var isatty = tty.isatty(2); - -/** - * Select a color. - * - * @return {Number} - * @api private - */ - -function color() { - return colors[prevColor++ % colors.length]; -} - -/** - * Humanize the given `ms`. - * - * @param {Number} m - * @return {String} - * @api private - */ - -function humanize(ms) { - var sec = 1000 - , min = 60 * 1000 - , hour = 60 * min; - - if (ms >= hour) return (ms / hour).toFixed(1) + 'h'; - if (ms >= min) return (ms / min).toFixed(1) + 'm'; - if (ms >= sec) return (ms / sec | 0) + 's'; - return ms + 'ms'; -} - -/** - * Create a debugger with the given `name`. - * - * @param {String} name - * @return {Type} - * @api public - */ - -function debug(name) { - function disabled(){} - disabled.enabled = false; - - var match = skips.some(function(re){ - return re.test(name); - }); - - if (match) return disabled; - - match = names.some(function(re){ - return re.test(name); - }); - - if (!match) return disabled; - var c = color(); - - function colored(fmt) { - fmt = coerce(fmt); - - var curr = new Date; - var ms = curr - (prev[name] || curr); - prev[name] = curr; - - fmt = ' \u001b[9' + c + 'm' + name + ' ' - + '\u001b[3' + c + 'm\u001b[90m' - + fmt + '\u001b[3' + c + 'm' - + ' +' + humanize(ms) + '\u001b[0m'; - - console.error.apply(this, arguments); - } - - function plain(fmt) { - fmt = coerce(fmt); - - fmt = new Date().toUTCString() - + ' ' + name + ' ' + fmt; - console.error.apply(this, arguments); - } - - colored.enabled = plain.enabled = true; - - return isatty || process.env.DEBUG_COLORS - ? colored - : plain; -} - -/** - * Coerce `val`. - */ - -function coerce(val) { - if (val instanceof Error) return val.stack || val.message; - return val; -} diff --git a/update_nation/node_modules/nano/node_modules/follow/node_modules/debug/package.json b/update_nation/node_modules/nano/node_modules/follow/node_modules/debug/package.json deleted file mode 100644 index 0944d2496..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/node_modules/debug/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "debug", - "version": "0.7.4", - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/debug.git" - }, - "description": "small debugging utility", - "keywords": [ - "debug", - "log", - "debugger" - ], - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "dependencies": {}, - "devDependencies": { - "mocha": "*" - }, - "main": "lib/debug.js", - "browser": "./debug.js", - "engines": { - "node": "*" - }, - "files": [ - "lib/debug.js", - "debug.js", - "index.js" - ], - "component": { - "scripts": { - "debug/index.js": "index.js", - "debug/debug.js": "debug.js" - } - }, - "bugs": { - "url": "https://github.com/visionmedia/debug/issues" - }, - "homepage": "https://github.com/visionmedia/debug", - "_id": "debug@0.7.4", - "dist": { - "shasum": "06e1ea8082c2cb14e39806e22e2f6f757f92af39", - "tarball": "http://registry.npmjs.org/debug/-/debug-0.7.4.tgz" - }, - "_from": "debug@~0.7.2", - "_npmVersion": "1.3.13", - "_npmUser": { - "name": "tjholowaychuk", - "email": "tj@vision-media.ca" - }, - "maintainers": [ - { - "name": "tjholowaychuk", - "email": "tj@vision-media.ca" - } - ], - "directories": {}, - "_shasum": "06e1ea8082c2cb14e39806e22e2f6f757f92af39", - "_resolved": "https://registry.npmjs.org/debug/-/debug-0.7.4.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/update_nation/node_modules/nano/node_modules/follow/package.json b/update_nation/node_modules/nano/node_modules/follow/package.json deleted file mode 100644 index e1e04ab58..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/package.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "name": "follow", - "version": "0.11.4", - "author": { - "name": "Jason Smith", - "email": "jhs@iriscouch.com" - }, - "contributors": [ - { - "name": "Jarrett Cruger", - "email": "jcrugzz@gmail.com" - } - ], - "description": "Extremely robust, fault-tolerant CouchDB changes follower", - "license": "Apache 2.0", - "keywords": [ - "couchdb", - "changes", - "sleep", - "sleepy" - ], - "homepage": "http://github.com/iriscouch/follow", - "repository": { - "type": "git", - "url": "git://github.com/iriscouch/follow" - }, - "engines": { - "node": "0.10.x || 0.8.x" - }, - "dependencies": { - "request": "^2.44.0", - "browser-request": "~0.3.0", - "debug": "~0.7.2" - }, - "devDependencies": { - "tap": "~0.4.0", - "traceback": "~0.3.0" - }, - "browser": { - "request": "browser-request" - }, - "main": "./api.js", - "scripts": { - "test": "tap test/*.js" - }, - "bin": { - "follow": "./cli.js" - }, - "gitHead": "58ce4d429c163e4b4ddc7f066e4b3c3afaa0b034", - "bugs": { - "url": "https://github.com/iriscouch/follow/issues" - }, - "_id": "follow@0.11.4", - "_shasum": "87e9a50d443f921d05704ebac412a14ab9d9232f", - "_from": "follow@^0.11.3", - "_npmVersion": "2.1.7", - "_nodeVersion": "0.11.14", - "_npmUser": { - "name": "jcrugzz", - "email": "jcrugzz@gmail.com" - }, - "maintainers": [ - { - "name": "jhs", - "email": "jhs@iriscouch.com" - }, - { - "name": "jhs", - "email": "jhs@couchone.com" - }, - { - "name": "jcrugzz", - "email": "jcrugzz@gmail.com" - } - ], - "dist": { - "shasum": "87e9a50d443f921d05704ebac412a14ab9d9232f", - "tarball": "http://registry.npmjs.org/follow/-/follow-0.11.4.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/follow/-/follow-0.11.4.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/update_nation/node_modules/nano/node_modules/follow/test/couch.js b/update_nation/node_modules/nano/node_modules/follow/test/couch.js deleted file mode 100644 index 7d4ee455e..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/test/couch.js +++ /dev/null @@ -1,153 +0,0 @@ -// CouchDB tests -// -// This module is also a library for other test modules. - -var tap = require('tap') - , util = require('util') - , assert = require('assert') - , request = require('request') - -var follow = require('../api') - , DB = process.env.db || 'http://localhost:5984/follow_test' - , RTT = null - - -module.exports = { 'DB': DB - , 'rtt' : get_rtt - , 'redo': redo_couch - , 'setup': setup_test - , 'make_data': make_data - } - - -function get_rtt() { - if(!RTT) - throw new Error('RTT was not set. Use setup(test) or redo(callback)') - return RTT -} - - -// Basically a redo but testing along the way. -function setup_test(test_func) { - assert.equal(typeof test_func, 'function', 'Please provide tap.test function') - - test_func('Initialize CouchDB', function(t) { - init_db(t, function(er, rtt) { - RTT = rtt - t.end() - }) - }) -} - -function redo_couch(callback) { - function noop() {} - var t = { 'ok':noop, 'false':noop, 'equal':noop, 'end':noop } - init_db(t, function(er, rtt) { - if(rtt) - RTT = rtt - return callback(er) - }) -} - -function init_db(t, callback) { - var create_begin = new Date - - request.del({uri:DB, json:true}, function(er, res) { - t.false(er, 'Clear old test DB: ' + DB) - t.ok(!res.body.error || res.body.error == 'not_found', 'Couch cleared old test DB: ' + DB) - - request.put({uri:DB, json:true}, function(er, res) { - t.false(er, 'Create new test DB: ' + DB) - t.false(res.body.error, 'Couch created new test DB: ' + DB) - - var values = ['first', 'second', 'third'] - , stores = 0 - values.forEach(function(val) { - var doc = { _id:'doc_'+val, value:val } - - request.post({uri:DB, json:doc}, function(er, res) { - t.false(er, 'POST document') - t.equal(res.statusCode, 201, 'Couch stored test document') - - stores += 1 - if(stores == values.length) { - var rtt = (new Date) - create_begin - callback(null, rtt) - //request.post({uri:DB, json:{_id:'_local/rtt', ms:(new Date)-begin}}, function(er, res) { - // t.false(er, 'Store RTT value') - // t.equal(res.statusCode, 201, 'Couch stored RTT value') - // t.end() - //}) - } - }) - }) - }) - }) -} - - -function make_data(minimum_size, callback) { - var payload = {'docs':[]} - , size = 0 - - // TODO: Make document number 20 really large, at least over 9kb. - while(size < minimum_size) { - var doc = {} - , key_count = rndint(0, 25) - - while(key_count-- > 0) - doc[rndstr(8)] = rndstr(20) - - // The 20th document has one really large string value. - if(payload.docs.length == 19) { - var big_str = rndstr(9000, 15000) - doc.big = {'length':big_str.length, 'value':big_str} - } - - size += JSON.stringify(doc).length // This is an underestimate because an _id and _rev will be added. - payload.docs.push(doc) - } - - request.post({'uri':DB+'/_bulk_docs', 'json':payload}, function(er, res) { - if(er) throw er - - if(res.statusCode != 201) - throw new Error('Bad bulk_docs update: ' + util.inspect(res.body)) - - if(res.body.length != payload.docs.length) - throw new Error('Should have results for '+payload.docs.length+' doc insertions') - - if(res.body.length < 1500) - throw new Error('Seems like at least 1,500 docs should have been added: ' + res.body.length) - - res.body.forEach(function(result) { - if(!result || !result.id || !result.rev) - throw new Error('Bad bulk_docs response: ' + util.inspect(result)) - }) - - return callback(payload.docs.length) - }) - - function rndstr(minlen, maxlen) { - if(!maxlen) { - maxlen = minlen - minlen = 1 - } - - var str = "" - , length = rndint(minlen, maxlen) - - while(length-- > 0) - str += String.fromCharCode(rndint(97, 122)) - - return str - } - - function rndint(min, max) { - return min + Math.floor(Math.random() * (max - min + 1)) - } -} - - -if(require.main === module) - setup_test(tap.test) diff --git a/update_nation/node_modules/nano/node_modules/follow/test/follow.js b/update_nation/node_modules/nano/node_modules/follow/test/follow.js deleted file mode 100644 index 711ebcc9a..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/test/follow.js +++ /dev/null @@ -1,247 +0,0 @@ -var tap = require('tap') - , test = tap.test - , util = require('util') - , request = require('request') - -var couch = require('./couch') - , follow = require('../api') - - -couch.setup(test) - -test('Follow API', function(t) { - var i = 0 - , saw = {} - - var feed = follow(couch.DB, function(er, change) { - t.is(this, feed, 'Callback "this" value is the feed object') - - i += 1 - t.false(er, 'No error coming back from follow: ' + i) - t.equal(change.seq, i, 'Change #'+i+' should have seq_id='+i) - saw[change.id] = true - - if(i == 3) { - t.ok(saw.doc_first, 'Got the first document') - t.ok(saw.doc_second, 'Got the second document') - t.ok(saw.doc_third , 'Got the third document') - - t.doesNotThrow(function() { feed.stop() }, 'No problem calling stop()') - - t.end() - } - }) -}) - -test("Confirmation request behavior", function(t) { - var feed = follow(couch.DB, function() {}) - - var confirm_req = null - , follow_req = null - - feed.on('confirm_request', function(req) { confirm_req = req }) - feed.on('query', function(req) { follow_req = req }) - - setTimeout(check_req, couch.rtt() * 2) - function check_req() { - t.ok(confirm_req, 'The confirm_request event should have fired by now') - t.ok(confirm_req.agent, 'The confirm request has an agent') - - t.ok(follow_req, 'The follow_request event should have fired by now') - t.ok(follow_req.agent, 'The follow request has an agent') - - // Confirm that the changes follower is not still in the pool. - var host = 'localhost:5984' - var sockets = follow_req.req.agent.sockets[host] || [] - sockets.forEach(function(socket, i) { - t.isNot(socket, follow_req.req.connection, 'The changes follower is not socket '+i+' in the agent pool') - }) - - feed.stop() - t.end() - } -}) - -test('Heartbeats', function(t) { - t.ok(couch.rtt(), 'The couch RTT is known') - var check_time = couch.rtt() * 3.5 // Enough time for 3 heartbeats. - - var beats = 0 - , retries = 0 - - var feed = follow(couch.DB, function() {}) - feed.heartbeat = couch.rtt() - feed.on('response', function() { feed.retry_delay = 1 }) - - feed.on('heartbeat', function() { beats += 1 }) - feed.on('retry', function() { retries += 1 }) - - feed.on('catchup', function() { - t.equal(beats, 0, 'Still 0 heartbeats after receiving changes') - t.equal(retries, 0, 'Still 0 retries after receiving changes') - - //console.error('Waiting ' + couch.rtt() + ' * 3 = ' + check_time + ' to check stuff') - setTimeout(check_counters, check_time) - function check_counters() { - t.equal(beats, 3, 'Three heartbeats ('+couch.rtt()+') fired after '+check_time+' ms') - t.equal(retries, 0, 'No retries after '+check_time+' ms') - - feed.stop() - t.end() - } - }) -}) - -test('Catchup events', function(t) { - t.ok(couch.rtt(), 'The couch RTT is known') - - var feed = follow(couch.DB, function() {}) - var last_seen = 0 - - feed.on('change', function(change) { last_seen = change.seq }) - feed.on('catchup', function(id) { - t.equal(last_seen, 3, 'The catchup event fires after the change event that triggered it') - t.equal(id , 3, 'The catchup event fires on the seq_id of the latest change') - feed.stop() - t.end() - }) -}) - -test('Data due on a paused feed', function(t) { - t.ok(couch.rtt(), 'The couch RTT is known') - var HB = couch.rtt() * 5 - , HB_DUE = HB * 1.25 // This comes from the hard-coded constant in feed.js. - - var events = [] - , last_event = new Date - - function ev(type) { - var now = new Date - events.push({'elapsed':now - last_event, 'event':type}) - last_event = now - } - - var feed = follow(couch.DB, function() {}) - feed.heartbeat = HB - feed.on('response', function() { feed.retry_delay = 1 }) - // TODO - // feed.pause() - - feed.on('heartbeat', function() { ev('heartbeat') }) - feed.on('change' , function() { ev('change') }) - feed.on('timeout' , function() { ev('timeout') }) - feed.on('retry' , function() { ev('retry') }) - feed.on('pause' , function() { ev('pause') }) - feed.on('resume' , function() { ev('resume') }) - feed.on('stop' , function() { ev('stop') }) - - feed.on('change', function(change) { - if(change.seq == 1) { - feed.pause() - // Stay paused long enough for three heartbeats to be overdue. - setTimeout(function() { feed.resume() }, HB_DUE * 3 * 1.1) - } - - if(change.seq == 3) { - feed.stop() - setTimeout(check_results, couch.rtt()) - } - }) - - function check_results() { - console.error('rtt=%j HB=%j', couch.rtt(), HB) - events.forEach(function(event, i) { console.error('Event %d: %j', i, event) }) - - t.equal(events[0].event, 'change', 'First event was a change') - t.ok(events[0].elapsed < couch.rtt(), 'First change came quickly') - - t.equal(events[1].event, 'pause', 'Second event was a pause, reacting to the first change') - t.ok(events[1].elapsed < 10, 'Pause called/fired immediately after the change') - - t.equal(events[2].event, 'timeout', 'Third event was the first timeout') - t.ok(percent(events[2].elapsed, HB_DUE) > 95, 'First timeout fired when the heartbeat was due') - - t.equal(events[3].event, 'retry', 'Fourth event is a retry') - t.ok(events[3].elapsed < 10, 'First retry fires immediately after the first timeout') - - t.equal(events[4].event, 'timeout', 'Fifth event was the second timeout') - t.ok(percent(events[4].elapsed, HB_DUE) > 95, 'Second timeout fired when the heartbeat was due') - - t.equal(events[5].event, 'retry', 'Sixth event is a retry') - t.ok(events[5].elapsed < 10, 'Second retry fires immediately after the second timeout') - - t.equal(events[6].event, 'timeout', 'Seventh event was the third timeout') - t.ok(percent(events[6].elapsed, HB_DUE) > 95, 'Third timeout fired when the heartbeat was due') - - t.equal(events[7].event, 'retry', 'Eighth event is a retry') - t.ok(events[7].elapsed < 10, 'Third retry fires immediately after the third timeout') - - t.equal(events[8].event, 'resume', 'Ninth event resumed the feed') - - t.equal(events[9].event, 'change', 'Tenth event was the second change') - t.ok(events[9].elapsed < 10, 'Second change came immediately after resume') - - t.equal(events[10].event, 'change', 'Eleventh event was the third change') - t.ok(events[10].elapsed < 10, 'Third change came immediately after the second change') - - t.equal(events[11].event, 'stop', 'Twelfth event was the feed stopping') - t.ok(events[11].elapsed < 10, 'Stop event came immediately in response to the third change') - - t.notOk(events[12], 'No thirteenth event') - - return t.end() - } - - function percent(a, b) { - var num = Math.min(a, b) - , denom = Math.max(a, b) - return 100 * num / denom - } -}) - -test('Events for DB confirmation and hitting the original seq', function(t) { - t.plan(7) - var feed = follow(couch.DB, on_change) - - var events = { 'confirm':null } - feed.on('confirm', function(db) { events.confirm = db }) - feed.on('catchup', caught_up) - - // This will run 3 times. - function on_change(er, ch) { - t.false(er, 'No problem with the feed') - if(ch.seq == 3) { - t.ok(events.confirm, 'Confirm event fired') - t.equal(events.confirm && events.confirm.db_name, 'follow_test', 'Confirm event returned the Couch DB object') - t.equal(events.confirm && events.confirm.update_seq, 3, 'Confirm event got the update_seq right') - } - } - - function caught_up(seq) { - t.equal(seq, 3, 'Catchup event fired on update 3') - - feed.stop() - t.end() - } -}) - -test('Handle a deleted database', function(t) { - var feed = follow(couch.DB, function(er, change) { - if(er) - return t.equal(er.last_seq, 3, 'Got an error for the deletion event') - - if(change.seq < 3) - return - - t.equal(change.seq, 3, 'Got change number 3') - - var redo_er - couch.redo(function(er) { redo_er = er }) - - setTimeout(check_results, couch.rtt() * 2) - function check_results() { - t.false(er, 'No problem redoing the couch') - t.end() - } - }) -}) diff --git a/update_nation/node_modules/nano/node_modules/follow/test/issues.js b/update_nation/node_modules/nano/node_modules/follow/test/issues.js deleted file mode 100644 index 32b0650a8..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/test/issues.js +++ /dev/null @@ -1,178 +0,0 @@ -var tap = require('tap') - , test = tap.test - , util = require('util') - , request = require('request') - , traceback = require('traceback') - -var lib = require('../lib') - , couch = require('./couch') - , follow = require('../api') - -couch.setup(test) - -test('Issue #5', function(t) { - var saw = { loops:0, seqs:{} } - - var saw_change = false - // -2 means I want to see the last change. - var feed = follow({'db':couch.DB, since:-2}, function(er, change) { - t.equal(change.seq, 3, 'Got the latest change, 3') - t.false(saw_change, 'Only one callback run for since=-2 (assuming no subsequent change') - saw_change = true - - process.nextTick(function() { feed.stop() }) - feed.on('stop', function() { - // Test using since=-1 (AKA since="now"). - follow({'db':couch.DB, since:'now'}, function(er, change) { - t.equal(change.seq, 4, 'Only get changes made after starting the feed') - t.equal(change.id, "You're in now, now", 'Got the subsequent change') - - this.stop() - t.end() - }) - - // Let that follower settle in, then send it something - setTimeout(function() { - var doc = { _id:"You're in now, now", movie:"Spaceballs" } - request.post({uri:couch.DB, json:doc}, function(er) { - if(er) throw er - }) - }, couch.rtt()) - }) - }) -}) - -couch.setup(test) // Back to the expected documents - -test('Issue #6', function(t) { - // When we see change 1, delete the database. The rest should still come in, then the error indicating deletion. - var saw = { seqs:{}, redid:false, redo_err:null } - - follow(couch.DB, function(er, change) { - if(!er) { - saw.seqs[change.seq] = true - t.notOk(change.last_seq, 'Change '+change.seq+' ha no .last_seq') - if(change.seq == 1) { - couch.redo(function(er) { - saw.redid = true - saw.redo_err = er - }) - } - } - - else setTimeout(function() { - // Give the redo time to finish, then confirm that everything happened as expected. - // Hopefully this error indicates the database was deleted. - t.ok(er.message.match(/deleted .* 3$/), 'Got delete error after change 3') - t.ok(er.deleted, 'Error object indicates database deletion') - t.equal(er.last_seq, 3, 'Error object indicates the last change number') - - t.ok(saw.seqs[1], 'Change 1 was processed') - t.ok(saw.seqs[2], 'Change 2 was processed') - t.ok(saw.seqs[3], 'Change 3 was processed') - t.ok(saw.redid, 'The redo function ran') - t.false(saw.redo_err, 'No problem redoing the database') - - return t.end() - }, couch.rtt() * 2) - }) -}) - -test('Issue #8', function(t) { - var timeouts = timeout_tracker() - - // Detect inappropriate timeouts after the run. - var runs = {'set':false, 'clear':false} - function badSetT() { - runs.set = true - return setTimeout.apply(this, arguments) - } - - function badClearT() { - runs.clear = true - return clearTimeout.apply(this, arguments) - } - - follow(couch.DB, function(er, change) { - t.false(er, 'Got a feed') - t.equal(change.seq, 1, 'Handler only runs for one change') - - this.on('stop', check_timeouts) - this.stop() - - function check_timeouts() { - t.equal(timeouts().length, 0, 'No timeouts by the time stop fires') - - lib.timeouts(badSetT, badClearT) - - // And give it a moment to try something bad. - setTimeout(final_timeout_check, 250) - function final_timeout_check() { - t.equal(timeouts().length, 0, 'No lingering timeouts after teardown: ' + tims(timeouts())) - t.false(runs.set, 'No more setTimeouts ran') - t.false(runs.clear, 'No more clearTimeouts ran') - - t.end() - } - } - }) -}) - -test('Issue #9', function(t) { - var timeouts = timeout_tracker() - - follow({db:couch.DB, inactivity_ms:30000}, function(er, change) { - if(change.seq == 1) - return // Let it run through once, just for fun. - - t.equal(change.seq, 2, 'The second change will be the last') - this.stop() - - setTimeout(check_inactivity_timer, 250) - function check_inactivity_timer() { - t.equal(timeouts().length, 0, 'No lingering timeouts after teardown: ' + tims(timeouts())) - timeouts().forEach(function(id) { clearTimeout(id) }) - t.end() - } - }) -}) - -// -// Utilities -// - -function timeout_tracker() { - // Return an array tracking in-flight timeouts. - var timeouts = [] - var set_num = 0 - - lib.timeouts(set, clear) - return function() { return timeouts } - - function set() { - var result = setTimeout.apply(this, arguments) - - var caller = traceback()[2] - set_num += 1 - result.caller = '('+set_num+') ' + (caller.method || caller.name || '') + ' in ' + caller.file + ':' + caller.line - //console.error('setTimeout: ' + result.caller) - - timeouts.push(result) - //console.error('inflight ('+timeouts.length+'): ' + tims(timeouts)) - return result - } - - function clear(id) { - //var caller = traceback()[2] - //caller = (caller.method || caller.name || '') + ' in ' + caller.file + ':' + caller.line - //console.error('clearTimeout: ' + (id && id.caller) + ' <- ' + caller) - - timeouts = timeouts.filter(function(element) { return element !== id }) - //console.error('inflight ('+timeouts.length+'): ' + tims(timeouts)) - return clearTimeout.apply(this, arguments) - } -} - -function tims(arr) { - return JSON.stringify(arr.map(function(timer) { return timer.caller })) -} diff --git a/update_nation/node_modules/nano/node_modules/follow/test/issues/10.js b/update_nation/node_modules/nano/node_modules/follow/test/issues/10.js deleted file mode 100644 index ed5997043..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/test/issues/10.js +++ /dev/null @@ -1,24 +0,0 @@ -var tap = require('tap') - , test = tap.test - , util = require('util') - -// Issue #10 is about missing log4js. This file sets the environment variable to disable it. -process.env.log_plain = true - -var lib = require('../../lib') - , couch = require('../couch') - , follow = require('../../api') - -couch.setup(test) - -test('Issue #10', function(t) { - follow({db:couch.DB, inactivity_ms:30000}, function(er, change) { - console.error('Change: ' + JSON.stringify(change)) - if(change.seq == 2) - this.stop() - - this.on('stop', function() { - t.end() - }) - }) -}) diff --git a/update_nation/node_modules/nano/node_modules/follow/test/issues/43.js b/update_nation/node_modules/nano/node_modules/follow/test/issues/43.js deleted file mode 100644 index e7a0d144d..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/test/issues/43.js +++ /dev/null @@ -1,33 +0,0 @@ -var tap = require('tap') -var test = tap.test -var util = require('util') - -var lib = require('../../lib') -var couch = require('../couch') -var follow = require('../../api') - -couch.setup(test) - -test('Issue #43', function(t) { - var changes = 0 - - var feed = follow({'db':couch.DB, 'inactivity_ms':couch.rtt()*3}, on_change) - feed.on('stop', on_stop) - feed.on('error', on_err) - - function on_err(er) { - t.false(er, 'Error event should never fire') - t.end() - } - - function on_change(er, change) { - changes += 1 - this.stop() - } - - function on_stop(er) { - t.false(er, 'No problem stopping') - t.equal(changes, 1, 'Only one change seen since stop was called in its callback') - t.end() - } -}) diff --git a/update_nation/node_modules/nano/node_modules/follow/test/stream.js b/update_nation/node_modules/nano/node_modules/follow/test/stream.js deleted file mode 100644 index b429a5de3..000000000 --- a/update_nation/node_modules/nano/node_modules/follow/test/stream.js +++ /dev/null @@ -1,574 +0,0 @@ -var tap = require('tap') - , test = tap.test - , util = require('util') - , request = require('request') - -var couch = require('./couch') - , follow = require('../api') - - -couch.setup(test) - -test('The Changes stream API', function(t) { - var feed = new follow.Changes - - t.type(feed.statusCode, 'null', 'Changes has a .statusCode (initially null)') - t.type(feed.setHeader, 'function', 'Changes has a .setHeader() method') - t.type(feed.headers, 'object', 'Changes has a .headers object') - t.same(feed.headers, {}, 'Changes headers are initially empty') - - t.end() -}) - -test('Readable Stream API', function(t) { - var feed = new follow.Changes - - t.is(feed.readable, true, 'Changes is a readable stream') - - t.type(feed.setEncoding, 'function', 'Changes has .setEncoding() method') - t.type(feed.pause, 'function', 'Changes has .pause() method') - t.type(feed.resume, 'function', 'Changes has .resume() method') - t.type(feed.destroy, 'function', 'Changes has .destroy() method') - t.type(feed.destroySoon, 'function', 'Changes has .destroySoon() method') - t.type(feed.pipe, 'function', 'Changes has .pipe() method') - - t.end() -}) - -test('Writatable Stream API', function(t) { - var feed = new follow.Changes - - t.is(feed.writable, true, 'Changes is a writable stream') - - t.type(feed.write, 'function', 'Changes has .write() method') - t.type(feed.end, 'function', 'Changes has .end() method') - t.type(feed.destroy, 'function', 'Changes has .destroy() method') - t.type(feed.destroySoon, 'function', 'Changes has .destroySoon() method') - - t.end() -}) - -test('Error conditions', function(t) { - var feed = new follow.Changes - t.throws(write, 'Throw if the feed type is not defined') - - feed = new follow.Changes - feed.feed = 'neither longpoll nor continuous' - t.throws(write, 'Throw if the feed type is not longpoll nor continuous') - - feed = new follow.Changes({'feed':'longpoll'}) - t.throws(write('stuff'), 'Throw if the "results" line is not sent first') - - feed = new follow.Changes({'feed':'longpoll'}) - t.doesNotThrow(write('') , 'Empty string is fine waiting for "results"') - t.doesNotThrow(write('{') , 'This could be the "results" line') - t.doesNotThrow(write('"resu', 'Another part of the "results" line')) - t.doesNotThrow(write('') , 'Another empty string is still fine') - t.doesNotThrow(write('lts":', 'Final part of "results" line still good')) - t.throws(write(']'), 'First line was not {"results":[') - - feed = new follow.Changes - feed.feed = 'continuous' - t.doesNotThrow(write(''), 'Empty string is fine for a continuous feed') - t.throws(end('{"results":[\n'), 'Continuous stream does not want a header') - - feed = new follow.Changes({'feed':'continuous'}) - t.throws(write('hi\n'), 'Continuous stream wants objects') - - feed = new follow.Changes({'feed':'continuous'}) - t.throws(end('[]\n'), 'Continuous stream wants "real" objects, not Array') - - feed = new follow.Changes({'feed':'continuous'}) - t.throws(write('{"seq":1,"id":"hi","changes":[{"rev":"1-869df2efe56ff5228e613ceb4d561b35"}]},\n'), - 'Continuous stream does not want a comma') - - var types = ['longpoll', 'continuous'] - types.forEach(function(type) { - var bad_writes = [ {}, null, ['a string (array)'], {'an':'object'}] - bad_writes.forEach(function(obj) { - feed = new follow.Changes - feed.feed = type - - t.throws(write(obj), 'Throw for bad write to '+type+': ' + util.inspect(obj)) - }) - - feed = new follow.Changes - feed.feed = type - - var valid = (type == 'longpoll') - ? '{"results":[\n{}\n],\n"last_seq":1}' - : '{"seq":1,"id":"doc"}' - - t.throws(buf(valid, 'but_invalid_encoding'), 'Throw for buffer with bad encoding') - }) - - t.end() - - function buf(data, encoding) { - return write(new Buffer(data), encoding) - } - - function write(data, encoding) { - if(data === undefined) - return feed.write('blah') - return function() { feed.write(data, encoding) } - } - - function end(data, encoding) { - return function() { feed.end(data, encoding) } - } -}) - -test('Longpoll feed', function(t) { - for(var i = 0; i < 2; i++) { - var feed = new follow.Changes({'feed':'longpoll'}) - - var data = [] - feed.on('data', function(d) { data.push(d) }) - - function encode(data) { return (i == 0) ? data : new Buffer(data) } - function write(data) { return function() { feed.write(encode(data)) } } - function end(data) { return function() { feed.end(encode(data)) } } - - t.doesNotThrow(write('{"results":[') , 'Longpoll header') - t.doesNotThrow(write('{}') , 'Empty object') - t.doesNotThrow(write(',{"foo":"bar"},') , 'Comma prefix and suffix') - t.doesNotThrow(write('{"two":"bar"},') , 'Comma suffix') - t.doesNotThrow(write('{"three":3},{"four":4}'), 'Two objects on one line') - t.doesNotThrow(end('],\n"last_seq":3}\n') , 'Longpoll footer') - - t.equal(data.length, 5, 'Five data events fired') - t.equal(data[0], '{}', 'First object emitted') - t.equal(data[1], '{"foo":"bar"}', 'Second object emitted') - t.equal(data[2], '{"two":"bar"}', 'Third object emitted') - t.equal(data[3], '{"three":3}', 'Fourth object emitted') - t.equal(data[4], '{"four":4}', 'Fifth object emitted') - } - - t.end() -}) - -test('Longpoll pause', function(t) { - var feed = new follow.Changes({'feed':'longpoll'}) - , all = {'results':[{'change':1}, {'second':'change'},{'change':'#3'}], 'last_seq':3} - , start = new Date - - var events = [] - - feed.on('data', function(change) { - change = JSON.parse(change) - change.elapsed = new Date - start - events.push(change) - }) - - feed.once('data', function(data) { - t.equal(data, '{"change":1}', 'First data event was the first change') - feed.pause() - setTimeout(function() { feed.resume() }, 100) - }) - - feed.on('end', function() { - t.equal(feed.readable, false, 'Feed is no longer readable') - events.push('END') - }) - - setTimeout(check_events, 150) - feed.end(JSON.stringify(all)) - - function check_events() { - t.equal(events.length, 3+1, 'Three data events, plus the end event') - - t.ok(events[0].elapsed < 10, 'Immediate emit first data event') - t.ok(events[1].elapsed >= 100 && events[1].elapsed < 125, 'About 100ms delay until the second event') - t.ok(events[2].elapsed - events[1].elapsed < 10, 'Immediate emit of subsequent event after resume') - t.equal(events[3], 'END', 'End event was fired') - - t.end() - } -}) - -test('Continuous feed', function(t) { - for(var i = 0; i < 2; i++) { - var feed = new follow.Changes({'feed':'continuous'}) - - var data = [] - feed.on('data', function(d) { data.push(d) }) - feed.on('end', function() { data.push('END') }) - - var beats = 0 - feed.on('heartbeat', function() { beats += 1 }) - - function encode(data) { return (i == 0) ? data : new Buffer(data) } - function write(data) { return function() { feed.write(encode(data)) } } - function end(data) { return function() { feed.end(encode(data)) } } - - // This also tests whether the feed is compacting or tightening up the JSON. - t.doesNotThrow(write('{ }\n') , 'Empty object') - t.doesNotThrow(write('\n') , 'Heartbeat') - t.doesNotThrow(write('{ "foo" : "bar" }\n') , 'One object') - t.doesNotThrow(write('{"three":3}\n{ "four": 4}\n'), 'Two objects sent in one chunk') - t.doesNotThrow(write('') , 'Empty string') - t.doesNotThrow(write('\n') , 'Another heartbeat') - t.doesNotThrow(write('') , 'Another empty string') - t.doesNotThrow(write('{ "end" ') , 'Partial object 1/4') - t.doesNotThrow(write(':') , 'Partial object 2/4') - t.doesNotThrow(write('tru') , 'Partial object 3/4') - t.doesNotThrow(end('e}\n') , 'Partial object 4/4') - - t.equal(data.length, 6, 'Five objects emitted, plus the end event') - t.equal(beats, 2, 'Two heartbeats emitted') - - t.equal(data[0], '{}', 'First object emitted') - t.equal(data[1], '{"foo":"bar"}', 'Second object emitted') - t.equal(data[2], '{"three":3}', 'Third object emitted') - t.equal(data[3], '{"four":4}', 'Fourth object emitted') - t.equal(data[4], '{"end":true}', 'Fifth object emitted') - t.equal(data[5], 'END', 'End event fired') - } - - t.end() -}) - -test('Continuous pause', function(t) { - var feed = new follow.Changes({'feed':'continuous'}) - , all = [{'change':1}, {'second':'change'},{'#3':'change'}] - , start = new Date - - var events = [] - - feed.on('end', function() { - t.equal(feed.readable, false, 'Feed is not readable after "end" event') - events.push('END') - }) - - feed.on('data', function(change) { - change = JSON.parse(change) - change.elapsed = new Date - start - events.push(change) - }) - - feed.once('data', function(data) { - t.equal(data, '{"change":1}', 'First data event was the first change') - t.equal(feed.readable, true, 'Feed is readable after first data event') - feed.pause() - t.equal(feed.readable, true, 'Feed is readable after pause()') - - setTimeout(unpause, 100) - function unpause() { - t.equal(feed.readable, true, 'Feed is readable just before resume()') - feed.resume() - } - }) - - setTimeout(check_events, 150) - all.forEach(function(obj) { - feed.write(JSON.stringify(obj)) - feed.write("\r\n") - }) - feed.end() - - function check_events() { - t.equal(events.length, 3+1, 'Three data events, plus the end event') - - t.ok(events[0].elapsed < 10, 'Immediate emit first data event') - t.ok(events[1].elapsed >= 100 && events[1].elapsed < 125, 'About 100ms delay until the second event') - t.ok(events[2].elapsed - events[1].elapsed < 10, 'Immediate emit of subsequent event after resume') - t.equal(events[3], 'END', 'End event was fired') - - t.end() - } -}) - -test('Paused while heartbeats are arriving', function(t) { - var feed = new follow.Changes({'feed':'continuous'}) - , start = new Date - - var events = [] - - feed.on('data', function(change) { - change = JSON.parse(change) - change.elapsed = new Date - start - events.push(change) - }) - - feed.on('heartbeat', function(hb) { - var hb = {'heartbeat':true, 'elapsed':(new Date) - start} - events.push(hb) - }) - - feed.once('data', function(data) { - t.equal(data, '{"change":1}', 'First data event was the first change') - feed.pause() - t.equal(feed.readable, true, 'Feed is readable after pause()') - - setTimeout(unpause, 350) - function unpause() { - t.equal(feed.readable, true, 'Feed is readable just before resume()') - feed.resume() - } - }) - - // Simulate a change, then a couple heartbeats every 100ms, then more changes. - var writes = [] - function write(data) { - var result = feed.write(data) - writes.push(result) - } - - setTimeout(function() { write('{"change":1}\n') }, 0) - setTimeout(function() { write('\n') }, 100) - setTimeout(function() { write('\n') }, 200) - setTimeout(function() { write('\n') }, 300) - setTimeout(function() { write('\n') }, 400) - setTimeout(function() { write('{"change":2}\n') }, 415) - setTimeout(function() { write('{"change":3}\n') }, 430) - - setTimeout(check_events, 500) - function check_events() { - t.ok(events[0].change , 'First event was data (a change)') - t.ok(events[1].heartbeat, 'Second event was a heartbeat') - t.ok(events[2].heartbeat, 'Third event was a heartbeat') - t.ok(events[3].heartbeat, 'Fourth event was a heartbeat') - t.ok(events[4].heartbeat, 'Fifth event was a heartbeat') - t.ok(events[5].change , 'Sixth event was data') - t.ok(events[6].change , 'Seventh event was data') - - t.ok(events[0].elapsed < 10, 'Immediate emit first data event') - t.ok(events[1].elapsed > 350, 'First heartbeat comes after the pause') - t.ok(events[2].elapsed > 350, 'Second heartbeat comes after the pause') - t.ok(events[3].elapsed > 350, 'Third heartbeat comes after the pause') - t.ok(events[4].elapsed > 350, 'Fourth heartbeat comes after the pause') - - t.ok(events[3].elapsed < 360, 'Third heartbeat came right after the resume') - t.ok(events[4].elapsed >= 400, 'Fourth heartbeat came at the normal time') - - t.equal(writes[0], true , 'First write flushed') - t.equal(writes[1], false, 'Second write (first heartbeat) did not flush because the feed was paused') - t.equal(writes[2], false, 'Third write did not flush due to pause') - t.equal(writes[3], false, 'Fourth write did not flush due to pause') - t.equal(writes[4], true , 'Fifth write (fourth heartbeat) flushed due to resume()') - t.equal(writes[5], true , 'Sixth write flushed normally') - t.equal(writes[6], true , 'Seventh write flushed normally') - - feed.end() - t.end() - } -}) - -test('Feeds from couch', function(t) { - t.ok(couch.rtt(), 'RTT to couch is known') - - var did = 0 - function done() { - did += 1 - if(did == 2) - t.end() - } - - var types = [ 'longpoll', 'continuous' ] - types.forEach(function(type) { - var feed = new follow.Changes({'feed':type}) - setTimeout(check_changes, couch.rtt() * 2) - - var events = [] - feed.on('data', function(data) { events.push(JSON.parse(data)) }) - feed.on('end', function() { events.push('END') }) - - var uri = couch.DB + '/_changes?feed=' + type - var req = request({'uri':uri}) - - // Compatibility with the old onResponse option. - req.on('response', function(res) { on_response(null, res, res.body) }) - - // Disconnect the continuous feed after a while. - if(type == 'continuous') - setTimeout(function() { feed.destroy() }, couch.rtt() * 1) - - function on_response(er, res, body) { - t.false(er, 'No problem fetching '+type+' feed: ' + uri) - t.type(body, 'undefined', 'No data in '+type+' callback. This is an onResponse callback') - t.type(res.body, 'undefined', 'No response body in '+type+' callback. This is an onResponse callback') - t.ok(req.response, 'The request object has its '+type+' response by now') - - req.pipe(feed) - - t.equal(feed.statusCode, 200, 'Upon piping from request, the statusCode is set') - t.ok('content-type' in feed.headers, 'Upon piping from request, feed has headers set') - } - - function check_changes() { - var expected_count = 3 - if(type == 'longpoll') - expected_count += 1 // For the "end" event - - t.equal(events.length, expected_count, 'Change event count for ' + type) - - t.equal(events[0].seq, 1, 'First '+type+' update sequence id') - t.equal(events[1].seq, 2, 'Second '+type+' update sequence id') - t.equal(events[2].seq, 3, 'Third '+type+' update sequence id') - - t.equal(good_id(events[0]), true, 'First '+type+' update is a good doc id: ' + events[0].id) - t.equal(good_id(events[1]), true, 'Second '+type+' update is a good doc id: ' + events[1].id) - t.equal(good_id(events[2]), true, 'Third '+type+' update is a good doc id: ' + events[2].id) - - if(type == 'longpoll') - t.equal(events[3], 'END', 'End event fired for '+type) - else - t.type(events[3], 'undefined', 'No end event for a destroyed continuous feed') - - done() - } - - var good_ids = {'doc_first':true, 'doc_second':true, 'doc_third':true} - function good_id(event) { - var is_good = good_ids[event.id] - delete good_ids[event.id] - return is_good - } - }) -}) - -test('Pausing and destroying a feed mid-stream', function(t) { - t.ok(couch.rtt(), 'RTT to couch is known') - var IMMEDIATE = 20 - , FIRST_PAUSE = couch.rtt() * 8 - , SECOND_PAUSE = couch.rtt() * 12 - - // To be really, really sure that backpressure goes all the way to couch, create more - // documents than could possibly be buffered. Linux and OSX seem to have a 16k MTU for - // the local interface, so a few hundred kb worth of document data should cover it. - couch.make_data(512 * 1024, check) - - var types = ['longpoll', 'continuous'] - function check(bulk_docs_count) { - var type = types.shift() - if(!type) - return t.end() - - var feed = new follow.Changes - feed.feed = type - - var destroys = 0 - function destroy() { - destroys += 1 - feed.destroy() - - // Give one more RTT time for everything to wind down before checking how it all went. - if(destroys == 1) - setTimeout(check_events, couch.rtt()) - } - - var events = {'feed':[], 'http':[], 'request':[]} - , firsts = {'feed':null, 'http':null, 'request':null} - - function ev(type, value) { - var now = new Date - firsts[type] = firsts[type] || now - events[type].push({'elapsed':now - firsts[type], 'at':now, 'val':value, 'before_destroy':(destroys == 0)}) - } - - feed.on('heartbeat', function() { ev('feed', 'heartbeat') }) - feed.on('error', function(er) { ev('feed', er) }) - feed.on('close', function() { ev('feed', 'close') }) - feed.on('data', function(data) { ev('feed', data) }) - feed.on('end', function() { ev('feed', 'end') }) - - var data_count = 0 - feed.on('data', function() { - data_count += 1 - if(data_count == 4) { - feed.pause() - setTimeout(function() { feed.resume() }, FIRST_PAUSE) - } - - if(data_count == 7) { - feed.pause() - setTimeout(function() { feed.resume() }, SECOND_PAUSE - FIRST_PAUSE) - } - - if(data_count >= 10) - destroy() - }) - - var uri = couch.DB + '/_changes?include_docs=true&feed=' + type - if(type == 'continuous') - uri += '&heartbeat=' + Math.floor(couch.rtt()) - - var req = request({'uri':uri}) - req.on('response', function(res) { feed_response(null, res, res.body) }) - req.on('error', function(er) { ev('request', er) }) - req.on('close', function() { ev('request', 'close') }) - req.on('data', function(d) { ev('request', d) }) - req.on('end', function() { ev('request', 'end') }) - req.pipe(feed) - - function feed_response(er, res) { - if(er) throw er - - res.on('error', function(er) { ev('http', er) }) - res.on('close', function() { ev('http', 'close') }) - res.on('data', function(d) { ev('http', d) }) - res.on('end', function() { ev('http', 'end') }) - - t.equal(events.feed.length, 0, 'No feed events yet: ' + type) - t.equal(events.http.length, 0, 'No http events yet: ' + type) - t.equal(events.request.length, 0, 'No request events yet: ' + type) - } - - function check_events() { - t.equal(destroys, 1, 'Only necessary to call destroy once: ' + type) - t.equal(events.feed.length, 10, 'Ten '+type+' data events fired') - if(events.feed.length != 10) - events.feed.forEach(function(e, i) { - console.error((i+1) + ') ' + util.inspect(e)) - }) - - events.feed.forEach(function(event, i) { - var label = type + ' event #' + (i+1) + ' at ' + event.elapsed + ' ms' - - t.type(event.val, 'string', label+' was a data string') - t.equal(event.before_destroy, true, label+' fired before the destroy') - - var change = null - t.doesNotThrow(function() { change = JSON.parse(event.val) }, label+' was JSON: ' + type) - t.ok(change && change.seq > 0 && change.id, label+' was change data: ' + type) - - // The first batch of events should have fired quickly (IMMEDIATE), then silence. Then another batch - // of events at the FIRST_PAUSE mark. Then more silence. Then a final batch at the SECOND_PAUSE mark. - if(i < 4) - t.ok(event.elapsed < IMMEDIATE, label+' was immediate (within '+IMMEDIATE+' ms)') - else if(i < 7) - t.ok(is_almost(event.elapsed, FIRST_PAUSE), label+' was after the first pause (about '+FIRST_PAUSE+' ms)') - else - t.ok(is_almost(event.elapsed, SECOND_PAUSE), label+' was after the second pause (about '+SECOND_PAUSE+' ms)') - }) - - if(type == 'continuous') { - t.ok(events.http.length >= 6, 'Should have at least seven '+type+' HTTP events') - t.ok(events.request.length >= 6, 'Should have at least seven '+type+' request events') - - t.ok(events.http.length < 200, type+' HTTP events ('+events.http.length+') stop before 200') - t.ok(events.request.length < 200, type+' request events ('+events.request.length+') stop before 200') - - var frac = events.http.length / bulk_docs_count - t.ok(frac < 0.10, 'Percent of http events received ('+frac.toFixed(1)+'%) is less than 10% of the data') - - frac = events.request.length / bulk_docs_count - t.ok(frac < 0.10, type+' request events received ('+frac.toFixed(1)+'%) is less than 10% of the data') - } - - return check(bulk_docs_count) - } - } -}) - -// -// Utilities -// - -function is_almost(actual, expected) { - var tolerance = 0.10 // 10% - , diff = Math.abs(actual - expected) - , fraction = diff / expected - return fraction < tolerance -} diff --git a/update_nation/node_modules/nano/node_modules/request/.eslintrc b/update_nation/node_modules/nano/node_modules/request/.eslintrc deleted file mode 100644 index 9c3350d6b..000000000 --- a/update_nation/node_modules/nano/node_modules/request/.eslintrc +++ /dev/null @@ -1,22 +0,0 @@ -{ - "env": { - "node": true - }, - "rules": { - // Disallow semi-colons, unless needed to disambiguate statement - "semi": [2, "never"], - // Require strings to use single quotes - "quotes": [2, "single"], - // Require curly braces for all control statements - "curly": 2, - // Disallow using variables and functions before they've been defined - "no-use-before-define": 2, - // Allow any case for variable naming - "camelcase": 0, - // Disallow unused variables, except as function arguments - "no-unused-vars": [2, {"args":"none"}], - // Allow leading underscores for method names - // REASON: we use underscores to denote private methods - "no-underscore-dangle": 0 - } -} diff --git a/update_nation/node_modules/nano/node_modules/request/.npmignore b/update_nation/node_modules/nano/node_modules/request/.npmignore deleted file mode 100644 index 80e59ef52..000000000 --- a/update_nation/node_modules/nano/node_modules/request/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -tests -node_modules diff --git a/update_nation/node_modules/nano/node_modules/request/.travis.yml b/update_nation/node_modules/nano/node_modules/request/.travis.yml deleted file mode 100644 index 742c7dfa0..000000000 --- a/update_nation/node_modules/nano/node_modules/request/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" -webhooks: - urls: https://webhooks.gitter.im/e/237280ed4796c19cc626 - on_success: change # options: [always|never|change] default: always - on_failure: always # options: [always|never|change] default: always - on_start: false # default: false diff --git a/update_nation/node_modules/nano/node_modules/request/CHANGELOG.md b/update_nation/node_modules/nano/node_modules/request/CHANGELOG.md deleted file mode 100644 index 11f571f23..000000000 --- a/update_nation/node_modules/nano/node_modules/request/CHANGELOG.md +++ /dev/null @@ -1,954 +0,0 @@ -## Change Log - -### upcoming (2014/07/09 12:10 +00:00) -- [#946](https://github.com/mikeal/request/pull/946) defaults: merge headers (@aj0strow) -- [#844](https://github.com/mikeal/request/pull/844) Add support for HTTP[S]_PROXY environment variables. Fixes #595. (@jvmccarthy) - -### v2.37.1 (2014/07/07 17:25 +00:00) -- [8711b2f](https://github.com/mikeal/request/commit/8711b2f3489553a7ddae69fa8c9f538182c9d5c8) 2.37.1 (@mikeal) - -### v2.37.0 (2014/07/07 17:25 +00:00) -- [79472b2](https://github.com/mikeal/request/commit/79472b263cde77504a354913a16bdc9fbdc9ed5d) append secureOptions to poolKey (@medovob) -- [#907](https://github.com/mikeal/request/pull/907) append secureOptions to poolKey (@medovob) -- [b223a8a](https://github.com/mikeal/request/commit/b223a8add0cbdd4e699a52da66aeb0f0cb17a0c3) expose tough-cookie's getCookiesSync (@charlespwd) -- [f4dcad0](https://github.com/mikeal/request/commit/f4dcad0fa6e2f2388abae508ad7256a1e1214ab2) test getCookies method (@charlespwd) -- [adcf62b](https://github.com/mikeal/request/commit/adcf62bf45ec19a28198ca8d3f37e7d7babc883a) update readme (@charlespwd) -- [4fdf13b](https://github.com/mikeal/request/commit/4fdf13b57dcd20b9fe03c0956f5df70c82d6e4a3) Merge branch 'charlespwd-master' (@lalitkapoor) -- [83e370d](https://github.com/mikeal/request/commit/83e370d54ca2a5fb162e40e7e705e1e9d702ba0a) Bump version of hawk dep. (@samccone) -- [#927](https://github.com/mikeal/request/pull/927) Bump version of hawk dep. (@samccone) -- [c42dcec](https://github.com/mikeal/request/commit/c42dcec10a307cb2299861f87720d491a89142b4) package.json: use OSI-style license name (@isaacs) -- [8892cb7](https://github.com/mikeal/request/commit/8892cb7bb8945807ff25038e888222d4e902acc8) Swap mime module. (@eiriksm) -- [d92395e](https://github.com/mikeal/request/commit/d92395e638cbfe5c31eb4ff54941b98b09057486) Make package.json so node .8 understands it. (@eiriksm) -- [6ebd748](https://github.com/mikeal/request/commit/6ebd748a02a49976d41ebbc4f8396acf8fda1c14) Add some additional hacks to work in the browser. (@eiriksm) -- [#943](https://github.com/mikeal/request/pull/943) New mime module (@eiriksm) -- [561454d](https://github.com/mikeal/request/commit/561454d18a68b7a03163308f6d29e127afe97426) Add some code comments about why we do the extra checks. (@eiriksm) -- [#944](https://github.com/mikeal/request/pull/944) Make request work with browserify (@eiriksm) -- [6a0add7](https://github.com/mikeal/request/commit/6a0add70b2687cf751b3446a15a513a1fd141738) defaults: merge headers (@aj0strow) -- [407c1ad](https://github.com/mikeal/request/commit/407c1ada61afca4d4ba50155c6d9430754541df1) prefer late return statement (@aj0strow) -- [4ab40ba](https://github.com/mikeal/request/commit/4ab40ba2f9aca8958cab149eb9cfbd9edb5534aa) Added support for manual querystring in form option (@charlespwd) -- [a55627c](https://github.com/mikeal/request/commit/a55627cd9f468cefb2971bb501ebc0c2fc27aa8b) Updated README (@charlespwd) -- [#949](https://github.com/mikeal/request/pull/949) Manually enter querystring in form option (@charlespwd) -- [10246c8](https://github.com/mikeal/request/commit/10246c84819db14b32fccca040029b06449242a3) [PATCH v2] Add support for gzip content decoding (@kevinoid) -- [6180c5f](https://github.com/mikeal/request/commit/6180c5f45c01fb2158b9a44f894a34263479fa84) check for content-length header before setting it in nextTick (@camilleanne) -- [#951](https://github.com/mikeal/request/pull/951) Add support for gzip content decoding (@kevinoid) -- [849c681](https://github.com/mikeal/request/commit/849c681846ce3b5492bd47261de391377a3ac19b) Silence EventEmitter memory leak warning #311 (@watson) -- [#955](https://github.com/mikeal/request/pull/955) check for content-length header before setting it in nextTick (@camilleanne) -- [#957](https://github.com/mikeal/request/pull/957) Silence EventEmitter memory leak warning #311 (@watson) -- [c1d951e](https://github.com/mikeal/request/commit/c1d951e536bd41c957f0cade41d051c9d41d1462) Fixing for 0.8 (@mikeal) -- [4851118](https://github.com/mikeal/request/commit/48511186495888a5f0cb15a107325001ac91990e) 2.37.0 (@mikeal) - -### v2.36.1 (2014/05/19 20:59 +00:00) -- [c3914fc](https://github.com/mikeal/request/commit/c3914fcd4a74faf6dbf0fb6a4a188e871e0c51b8) 2.36.1 (@mikeal) - -### v2.36.0 (2014/05/19 20:59 +00:00) -- [76a96de](https://github.com/mikeal/request/commit/76a96de75580042aa780e9587ff7a22522119c3f) Reventing lodash merge change. (@mikeal) -- [b8bb57e](https://github.com/mikeal/request/commit/b8bb57efb17e72e2ac6d957c05c3f2570c7ba6a0) 2.36.0 (@mikeal) - -### v2.35.1 (2014/05/17 20:57 +00:00) -- [4bbd153](https://github.com/mikeal/request/commit/4bbd1532a68cadf1a88dd69c277645e9b781f364) 2.35.1 (@mikeal) - -### v2.35.0 (2014/05/17 20:57 +00:00) -- [2833da3](https://github.com/mikeal/request/commit/2833da3c3c1c34f4130ad1ba470354fc32410691) initial changelog (@lalitkapoor) -- [49319e6](https://github.com/mikeal/request/commit/49319e6c09a8a169c95a8d282c900f9fecd50371) Merge branch 'master' of https://github.com/mikeal/request into create-changelog-based-on-pull-requests (@lalitkapoor) -- [#815](https://github.com/mikeal/request/pull/815) Create changelog based on pull requests (@lalitkapoor) -- [4b6ce1a](https://github.com/mikeal/request/commit/4b6ce1ac0f79cb8fa633e281d3eb4c0cb61794e1) It appears that secureOptions is an undocumented feature to fix issues with broken server. See joynet/node #5119 (@nw) -- [#821](https://github.com/mikeal/request/pull/821) added secureOptions back (@nw) -- [eddd488](https://github.com/mikeal/request/commit/eddd4889fb1bc95c741749e79d9749aab3e103fc) Fixing #825 (@mikeal) -- [4627a7a](https://github.com/mikeal/request/commit/4627a7a14078494ded8c66c19c43efd07324cbd8) improve error reporting for invalid protocols (@FND) -- [#840](https://github.com/mikeal/request/pull/840) improve error reporting for invalid protocols (@FND) -- [#810](https://github.com/mikeal/request/pull/810) add some exposition to mpu example in README.md (@mikermcneil) -- [8a0e2d6](https://github.com/mikeal/request/commit/8a0e2d65351560858275c73505df12b537f4d001) Added support for HTTP_PROXY and HTTPS_PROXY environment variables, if the proxy option isn't already set. (@jvmccarthy) -- [f60d348](https://github.com/mikeal/request/commit/f60d348dc1840ee6d7b709efcc2b3cd1a03aef63) Fix word consistency -- [#850](https://github.com/mikeal/request/pull/850) Fix word consistency in readme (@0xNobody) -- [#809](https://github.com/mikeal/request/pull/809) upgrade tunnel-proxy to 0.4.0 (@ksato9700) -- [e86377c](https://github.com/mikeal/request/commit/e86377c0c1e7695c3997f7802175ca37f5a5113b) Won't use HTTP(S)_PROXY env var if proxy explicitly set to null. (@jvmccarthy) -- [f1bb537](https://github.com/mikeal/request/commit/f1bb537ee2440bd664ea8c445ac3a2c6e31e9932) Add support for RFC 6750 Bearer Tokens -- [ba51a26](https://github.com/mikeal/request/commit/ba51a26079ec52c0a9145fbe8b6796d46e79bb8e) Add documentation about auth.bearer (@phedny) -- [#861](https://github.com/mikeal/request/pull/861) Add support for RFC 6750 Bearer Tokens (@phedny) -- [b8ee579](https://github.com/mikeal/request/commit/b8ee5790ace95440a56074f6afe866f4662e9e88) Fix typo (@dandv) -- [#866](https://github.com/mikeal/request/pull/866) Fix typo (@dandv) -- [b292b59](https://github.com/mikeal/request/commit/b292b59fadecb35dac3bee0959c4b4b782e772e3) Clean code syntax in test-pipes.js (@tgohn) -- [f7996d5](https://github.com/mikeal/request/commit/f7996d5fcfed85e03f293a7c9739e385b64ecaad) Add test for request.pipefilter (@tgohn) -- [#869](https://github.com/mikeal/request/pull/869) Pipefilter test (@tgohn) -- [86b99b6](https://github.com/mikeal/request/commit/86b99b671a3c86f4f963a6c67047343fd8edae8f) Fix typo in form example (@mscdex) -- [2ba4808](https://github.com/mikeal/request/commit/2ba48083ddf2607f85e2c479e0d254483c2610fe) failing test (@lalitkapoor) -- [39396b0](https://github.com/mikeal/request/commit/39396b0bb2e90eb7ec4dfcf5d2e731a2cb156f5c) extend passed in options (@lalitkapoor) -- [#891](https://github.com/mikeal/request/pull/891) fixes 857 - options object is mutated by calling request (@lalitkapoor) -- [54a51c6](https://github.com/mikeal/request/commit/54a51c665887e162ccb9f6b17b9c1f3b017ccc29) merge options (@vohof) -- [25b95db](https://github.com/mikeal/request/commit/25b95dbdddf874f014386a0a9fe35a7c903b7415) tilde? (@vohof) -- [#897](https://github.com/mikeal/request/pull/897) merge with default options (@vohof) -- [a1e4b1a](https://github.com/mikeal/request/commit/a1e4b1a9c2f39ce565fd023bb604da139f689d43) Fixes #555 (@pigulla) -- [#901](https://github.com/mikeal/request/pull/901) Fixes #555 (@pigulla) -- [6498a5f](https://github.com/mikeal/request/commit/6498a5f1ae68050cfeabf8f34f75bc72b08f1805) 2.35.0 (@mikeal) - -### v2.34.1 (2014/02/18 19:35 +00:00) -- [aefea20](https://github.com/mikeal/request/commit/aefea20b215ff1a48f0d8d27dcac0186604e3b2d) 2.34.1 (@mikeal) - -### v2.34.0 (2014/02/18 19:35 +00:00) -- [46edc90](https://github.com/mikeal/request/commit/46edc902e6ffdee39038a6702021728cb9d9b8fa) simpler (@joaojeronimo) -- [#781](https://github.com/mikeal/request/pull/781) simpler isReadStream function (@joaojeronimo) -- [fe2f59f](https://github.com/mikeal/request/commit/fe2f59fdc72de5c86404e51ab6bc4e0e8ece95f2) Provide ability to override content-type when `json` option used (@vvo) -- [#785](https://github.com/mikeal/request/pull/785) Provide ability to override content-type when `json` option used (@vvo) -- [d134f01](https://github.com/mikeal/request/commit/d134f012e64702e8f4070d61504b39524e1a07ba) Adds content-length calculation when submitting forms using form-data library. This is related to issue 345. (@Juul) -- [#793](https://github.com/mikeal/request/pull/793) Adds content-length calculation when submitting forms using form-data li... (@Juul) -- [3ebf25c](https://github.com/mikeal/request/commit/3ebf25c5af1194d8f7b3a3330fe89e729532809b) adding failing test (@lalitkapoor) -- [0f57a90](https://github.com/mikeal/request/commit/0f57a90384588727a5446bb1f5bf4e0be2d85780) accept options in arguments (@lalitkapoor) -- [7fb1647](https://github.com/mikeal/request/commit/7fb164731a5aad80c6539e33eda4ad4a51bb7871) silently ignore errors when adding cookie to jar (@lalitkapoor) -- [d6b2b1c](https://github.com/mikeal/request/commit/d6b2b1c279d12cdddc6593060672d49b12e63fea) add additional header test (@lalitkapoor) -- [f29e6df](https://github.com/mikeal/request/commit/f29e6dfadc6c3a45b6190998b6608059f87f3c32) Added the Apache license to the package.json. (@keskival) -- [#802](https://github.com/mikeal/request/pull/802) Added the Apache license to the package.json. (@keskival) -- [#801](https://github.com/mikeal/request/pull/801) 794 ignore cookie parsing and domain errors (@lalitkapoor) -- [54e6dfb](https://github.com/mikeal/request/commit/54e6dfb77d57757d4006982f813ebaab9e005cd5) Rewrite UNIX Domain Socket support into 2.33.1. Add test. (@lyuzashi) -- [3eaed2f](https://github.com/mikeal/request/commit/3eaed2f2e82d9d17a583bcc54270c16a7b674206) Use setImmediate when available, otherwise fallback to nextTick (@lyuzashi) -- [746ca75](https://github.com/mikeal/request/commit/746ca757da24d5011e92e04cb00c90098a7680fd) Indent wrapped buildRequest function (@lyuzashi) -- [#516](https://github.com/mikeal/request/pull/516) UNIX Socket URL Support (@native-digital) -- [9a5b0a8](https://github.com/mikeal/request/commit/9a5b0a81eca9836f05b0192c05c0d41e79034461) initial format (@lalitkapoor) -- [9380a49](https://github.com/mikeal/request/commit/9380a49779ddb081eba5d0ee51e4396d72d52066) upgrade tunnel-proxy to 0.4.0 (@ksato9700) -- [1efea37](https://github.com/mikeal/request/commit/1efea374286c728c3c988ee2264fb44cd8c41d88) add some exposition to mpu example in README.md (@mikermcneil) -- [ba0d63a](https://github.com/mikeal/request/commit/ba0d63ae23a3fc95dfe012df0bd6c8d7e87b1df7) made the language clearer (@mikermcneil) -- [b43aa81](https://github.com/mikeal/request/commit/b43aa81789c0b8c7ae90d2b983f79dde4a125470) 2.34.0 (@mikeal) - -### v2.33.1 (2014/01/16 19:48 +00:00) -- [afcf827](https://github.com/mikeal/request/commit/afcf827559b3223c96ac1bbd19bd1e4a6d7771e3) 2.33.1 (@mikeal) - -### v2.33.0 (2014/01/16 19:48 +00:00) -- [7f1cc8f](https://github.com/mikeal/request/commit/7f1cc8ff5a8d9443e7a793f4655487e722b75b0d) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [3e43d3d](https://github.com/mikeal/request/commit/3e43d3d5175f5f18d1e97b2f5d4ca6ac6c216e4a) 2.33.0 (@mikeal) - -### v2.32.1 (2014/01/16 19:33 +00:00) -- [dd44f39](https://github.com/mikeal/request/commit/dd44f39d37daacbbeb21f9e960f13adbb44eea0a) 2.32.1 (@mikeal) - -### v2.32.0 (2014/01/16 19:33 +00:00) -- [#757](https://github.com/mikeal/request/pull/757) require aws-sign2 (@mafintosh) -- [#744](https://github.com/mikeal/request/pull/744) Use Cookie.parse (@lalitkapoor) -- [5eaee1c](https://github.com/mikeal/request/commit/5eaee1ce4008ede1df15201622ac478c892d6a8a) Upgrade tough-cookie to 0.10.0 (@stash) -- [#763](https://github.com/mikeal/request/pull/763) Upgrade tough-cookie to 0.10.0 (@stash) -- [d2489d0](https://github.com/mikeal/request/commit/d2489d0e24d9a538224f5c8c090dcdeb1f8d4969) Fixed auth error for some servers like twisted. According to rfc 2617 auth scheme token should be case-insensitive. (@bobyrizov) -- [#764](https://github.com/mikeal/request/pull/764) Case-insensitive authentication scheme (@bobyrizov) -- [cbee3d0](https://github.com/mikeal/request/commit/cbee3d04ee9f704501a64edb7b9b6d201e98494b) Use tough-cookie CookieJar sync API (@stash) -- [3eeaf6a](https://github.com/mikeal/request/commit/3eeaf6a90df7b806d91ae1e8e2f56862ece2ea33) Emit error, not cookieError (@stash) -- [#767](https://github.com/mikeal/request/pull/767) Use tough-cookie CookieJar sync API (@stash) -- [9eac534](https://github.com/mikeal/request/commit/9eac534dd11e40bba65456491cb62ad68d8f41fa) 2.32.0 (@mikeal) - -### v2.31.1 (2014/01/08 02:57 +00:00) -- [b1b5e91](https://github.com/mikeal/request/commit/b1b5e9161e149574ba5528c401a70bfadef1a98a) 2.31.1 (@mikeal) - -### v2.31.0 (2014/01/08 02:57 +00:00) -- [dd2577f](https://github.com/mikeal/request/commit/dd2577f8264d4d4b07484dec7094b72c00c8416f) Removing s3 test. (@mikeal) -- [fef5bf3](https://github.com/mikeal/request/commit/fef5bf34258e3695b61c048c683f1d4a7f99b368) Fix callback arguments documentation (@mmalecki) -- [#736](https://github.com/mikeal/request/pull/736) Fix callback arguments documentation (@mmalecki) -- [5531c20](https://github.com/mikeal/request/commit/5531c208678145ef35b06e948190be2fd6a8a1c8) updating README example: cookie jar api changed cookie module changed to tough-cookie (@emkay) -- [#741](https://github.com/mikeal/request/pull/741) README example is using old cookie jar api (@emkay) -- [9d73e5a](https://github.com/mikeal/request/commit/9d73e5a277af141a6e4fa9dbcae5d0c3b755d277) add note about JSON output body type (@iansltx) -- [#742](https://github.com/mikeal/request/pull/742) Add note about JSON output body type (@iansltx) -- [41e20a4](https://github.com/mikeal/request/commit/41e20a4d288e30101e493b383a0e4852a3271a98) Use Cookie.parse (@lalitkapoor) -- [4d09556](https://github.com/mikeal/request/commit/4d095562a5c42ffb41b0ff194e9e6f32c0f44372) updating setCookie example to make it clear that the callback is required (@emkay) -- [#745](https://github.com/mikeal/request/pull/745) updating setCookie example to make it clear that the callback is required (@emkay) -- [b7ede1d](https://github.com/mikeal/request/commit/b7ede1d56f9a2764e4bf764687b81419df817e5a) README: Markdown code highlight (@weakish) -- [#746](https://github.com/mikeal/request/pull/746) README: Markdown code highlight (@weakish) -- [#645](https://github.com/mikeal/request/pull/645) update twitter api url to v1.1 (@mick) -- [20dcd18](https://github.com/mikeal/request/commit/20dcd18ce8e3397ba7e0213da9c760b048ca5b49) require aws-sign2 (@mafintosh) -- [df2c426](https://github.com/mikeal/request/commit/df2c4264321c3db1387ddf9a945d63b9ae7d57b8) 2.31.0 (@mikeal) - -### v2.30.1 (2013/12/13 19:17 +00:00) -- [eba2d40](https://github.com/mikeal/request/commit/eba2d402fcdcf1ac878de8672b1c9f5da856dcc1) 2.30.1 (@mikeal) - -### v2.30.0 (2013/12/13 19:17 +00:00) -- [aee3819](https://github.com/mikeal/request/commit/aee38191557574ef570fd9c764af0af7072cc92a) Fix TypeError when calling request.cookie -- [#728](https://github.com/mikeal/request/pull/728) Fix TypeError when calling request.cookie (@scarletmeow) -- [628ef76](https://github.com/mikeal/request/commit/628ef768b1f52710b8eb4e14be4db69d174d1dcb) better DIGEST support (@dai-shi) -- [d919bc1](https://github.com/mikeal/request/commit/d919bc1ce97fa461c365437a0c739bbaa6b86de7) ignore null authValues (DIGEST) (@dai-shi) -- [75fc209](https://github.com/mikeal/request/commit/75fc209c5a9e6c647a04e42048c30f46c66fc103) DIGEST support: pass algoritm and opaque, add TODO items, test case for compatible mode (@dai-shi) -- [#730](https://github.com/mikeal/request/pull/730) better HTTP DIGEST support (@dai-shi) -- [937a24a](https://github.com/mikeal/request/commit/937a24a168a126f406ee8eb55eb78169ddc53497) JSHINT: Creating global 'for' variable. Should be 'for (var ...'. -- [#732](https://github.com/mikeal/request/pull/732) JSHINT: Creating global 'for' variable. Should be 'for (var ...'. (@Fritz-Lium) -- [f03be23](https://github.com/mikeal/request/commit/f03be2309bd85a89d2e3c208b2fb4be1a2b95c79) Make digest qop regex more robust (see #730) (@nylen) -- [c7d97ae](https://github.com/mikeal/request/commit/c7d97aefaebf773ce62c72e9ec656f0250b7a1e7) 2.30.0 (@mikeal) - -### v2.29.1 (2013/12/06 20:05 +00:00) -- [e0f2c41](https://github.com/mikeal/request/commit/e0f2c41bd4e15518e97dd2f4c134be51ed4cb68b) 2.29.1 (@mikeal) - -### v2.29.0 (2013/12/06 20:05 +00:00) -- [3c2cad1](https://github.com/mikeal/request/commit/3c2cad11301380f4056eb3ca4c0c124f7f7f72f5) make request.defaults(options, requester) run the requester for all methods (@jchris) -- [#727](https://github.com/mikeal/request/pull/727) fix requester bug (@jchris) -- [0c9f875](https://github.com/mikeal/request/commit/0c9f87542cd1f919751d3ed1f00208ce7705f8e7) 2.29.0 (@mikeal) - -### v2.28.1 (2013/12/04 19:42 +00:00) -- [3e6a300](https://github.com/mikeal/request/commit/3e6a300121586da81b871f759a9feec52810474a) 2.28.1 (@mikeal) - -### v2.28.0 (2013/12/04 19:42 +00:00) -- [ac26f43](https://github.com/mikeal/request/commit/ac26f43d9a8212289f92056d3029c207f755cef4) Update request.js (@wprl) -- [adc2cb6](https://github.com/mikeal/request/commit/adc2cb6721e5980e8ed667a3f558cce8c89ee6c2) Use random cnonce (@wprl) -- [ff16a9d](https://github.com/mikeal/request/commit/ff16a9daf93e01cecee7fabec64c3e1b423f7db5) Add test for random cnonce (@wprl) -- [df64c2b](https://github.com/mikeal/request/commit/df64c2bc8f691ecc6f6c214e2254bab439830b88) Restore whitespace (@wprl) -- [#630](https://github.com/mikeal/request/pull/630) Send random cnonce for HTTP Digest requests (@wprl) -- [aca5a16](https://github.com/mikeal/request/commit/aca5a169c44cc658e8310691a2ae1cfc4c2b0958) update twitter api url to v1.1 (@mick) -- [abcbadd](https://github.com/mikeal/request/commit/abcbadd1b2a113c34a37b62d36ddcfd74452850e) Test case for #304. (@diversario) -- [b8cf874](https://github.com/mikeal/request/commit/b8cf8743b66d8eee4048561a7d81659f053393c8) fix failure when running with NODE_DEBUG=request, and a test for that (@jrgm) -- [e6c7d1f](https://github.com/mikeal/request/commit/e6c7d1f6d23922480c09427d5f54f84eec60b7af) quiet, but check that stderr output has something reasonable for debug (@jrgm) -- [#659](https://github.com/mikeal/request/pull/659) fix failure when running with NODE_DEBUG=request, and a test for that (@jrgm) -- [23164e4](https://github.com/mikeal/request/commit/23164e4f33bd0837d796037c3d0121db23653c34) option.tunnel to explicitly disable tunneling (@seanmonstar) -- [#662](https://github.com/mikeal/request/pull/662) option.tunnel to explicitly disable tunneling (@seanmonstar) -- [#656](https://github.com/mikeal/request/pull/656) Test case for #304. (@diversario) -- [da16120](https://github.com/mikeal/request/commit/da16120a8f0751b305a341c012dbdcfd62e83585) Change `secureOptions' to `secureProtocol' for HTTPS request (@richarddong) -- [43d9d0a](https://github.com/mikeal/request/commit/43d9d0a76974d2c61681ddee04479d514ebfa320) add `ciphers' and `secureProtocol' to `options' in `getAgent' (@richarddong) -- [#666](https://github.com/mikeal/request/pull/666) make `ciphers` and `secureProtocol` to work in https request (@richarddong) -- [524e035](https://github.com/mikeal/request/commit/524e0356b73240409a11989d369511419526b5ed) change cookie module (@sxyizhiren) -- [#674](https://github.com/mikeal/request/pull/674) change cookie module,to tough-cookie.please check it . (@sxyizhiren) -- [e8dbcc8](https://github.com/mikeal/request/commit/e8dbcc83d4eff3c14e03bd754174e2c5d45f2872) tests: Fixed test-timeout.js events unit test (@Turbo87) -- [aed1c71](https://github.com/mikeal/request/commit/aed1c71fac0047b66a236a990a5569445cfe995d) Added Travis CI configuration file (@Turbo87) -- [#683](https://github.com/mikeal/request/pull/683) Travis CI support (@Turbo87) -- [8bfa640](https://github.com/mikeal/request/commit/8bfa6403ce03cbd3f3de6b82388bfcc314e56c61) dependencies: Set `tough-cookie` as optional dependency (@Turbo87) -- [bcc138d](https://github.com/mikeal/request/commit/bcc138da67b7e1cf29dc7d264a73d8b1d1f4b0e4) dependencies: Set `form-data` as optional dependency (@Turbo87) -- [751ac28](https://github.com/mikeal/request/commit/751ac28b7f13bfeff2a0e920ca2926a005dcb6f0) dependencies: Set `tunnel-agent` as optional dependency (@Turbo87) -- [6d7c1c9](https://github.com/mikeal/request/commit/6d7c1c9d8e3a300ff6f2a93e7f3361799acf716b) dependencies: Set `http-signature` as optional dependency (@Turbo87) -- [733f1e3](https://github.com/mikeal/request/commit/733f1e3ae042a513a18cde1c6e444b18ee07ad66) Added .npmignore file (@Turbo87) -- [e2fc346](https://github.com/mikeal/request/commit/e2fc346b7e5e470fcd36189bcadf63c53feebb22) dependencies: Set `hawk` as optional dependency (@Turbo87) -- [e87d45f](https://github.com/mikeal/request/commit/e87d45fe89ea220035bf07696a70292763f7135f) dependencies: Set `aws-sign` as optional dependency (@Turbo87) -- [1cd81ba](https://github.com/mikeal/request/commit/1cd81ba30908b77cff2fa618aeb232fefaa53ada) lib: Added optional() function (@Turbo87) -- [28c2c38](https://github.com/mikeal/request/commit/28c2c3820feab0cc719df213a60838db019f3e1a) dependencies: Set `oauth-sign` as optional dependency (@Turbo87) -- [2ceddf7](https://github.com/mikeal/request/commit/2ceddf7e793feb99c5b6a76998efe238965b22cd) TravisCI: Test with and without optional dependencies (@Turbo87) -- [#682](https://github.com/mikeal/request/pull/682) Optional dependencies (@Turbo87) -- [2afab5b](https://github.com/mikeal/request/commit/2afab5b665a2e03becbc4a42ad481bb737405655) Handle blank password in basic auth. (@diversario) -- [cabe5a6](https://github.com/mikeal/request/commit/cabe5a62dc71282ce8725672184efe9d97ba79a5) Handle `auth.password` and `auth.username`. (@diversario) -- [#690](https://github.com/mikeal/request/pull/690) Handle blank password in basic auth. (@diversario) -- [33100c3](https://github.com/mikeal/request/commit/33100c3c7fa678f592374f7b2526fe9a0499b6f6) Typo (@VRMink) -- [#694](https://github.com/mikeal/request/pull/694) Typo in README (@ExxKA) -- [9072ff1](https://github.com/mikeal/request/commit/9072ff1556bcb002772838a94e1541585ef68f02) Edited README.md for formatting and clarity of phrasing (@Zearin) -- [#696](https://github.com/mikeal/request/pull/696) Edited README.md for formatting and clarity of phrasing (@Zearin) -- [07ee58d](https://github.com/mikeal/request/commit/07ee58d3a8145740ba34cc724f123518e4b3d1c3) Fixing listing in callback part of docs. (@lukasz-zak) -- [#710](https://github.com/mikeal/request/pull/710) Fixing listing in callback part of docs. (@lukasz-zak) -- [8ee21d0](https://github.com/mikeal/request/commit/8ee21d0dcc637090f98251eba22b9f4fd1602f0e) Request.multipart no longer crashes when header 'Content-type' is present (@pastaclub) -- [#715](https://github.com/mikeal/request/pull/715) Request.multipart no longer crashes when header 'Content-type' present (@pastaclub) -- [8b04ca6](https://github.com/mikeal/request/commit/8b04ca6ad8d025c275e40b806a69112ac53bd416) doc: Removed use of gendered pronouns (@oztu) -- [#719](https://github.com/mikeal/request/pull/719) Made a comment gender neutral. (@oztu) -- [8795fc6](https://github.com/mikeal/request/commit/8795fc68cce26b9a45d10db9eaffd4bc943aca3a) README.md: add custom HTTP Headers example. (@tcort) -- [#724](https://github.com/mikeal/request/pull/724) README.md: add custom HTTP Headers example. (@tcort) -- [c5d5b1f](https://github.com/mikeal/request/commit/c5d5b1fcf348e768943fe632a9a313d704d35c65) Changing dep. (@mikeal) -- [bf04163](https://github.com/mikeal/request/commit/bf04163883fa9c62d4e1a9fdd64d6efd7723d5f8) 2.28.0 (@mikeal) - -### v2.27.1 (2013/08/15 21:30 +00:00) -- [a80a026](https://github.com/mikeal/request/commit/a80a026e362a9462d6948adc1b0d2831432147d2) 2.27.1 (@mikeal) - -### v2.27.0 (2013/08/15 21:30 +00:00) -- [3627b9c](https://github.com/mikeal/request/commit/3627b9cc7752cfe57ac609ed613509ff61017045) rename Request and remove .DS_Store (@joaojeronimo) -- [920f9b8](https://github.com/mikeal/request/commit/920f9b88f7dd8f8d153e72371b1bf2d16d5e4160) rename Request (@joaojeronimo) -- [c243cc6](https://github.com/mikeal/request/commit/c243cc66131216bb57bcc0fd79c250a7927ee424) for some reason it removed request.js (@joaojeronimo) -- [#619](https://github.com/mikeal/request/pull/619) decouple things a bit (@CrowdProcess) -- [ed4ecc5](https://github.com/mikeal/request/commit/ed4ecc5ae5cd1d9559a937e84638c9234244878b) Try normal stringify first, then fall back to safe stringify (@mikeal) -- [5642ff5](https://github.com/mikeal/request/commit/5642ff56e64c19e8183dcd5b6f9d07cca295a79e) 2.27.0 (@mikeal) - -### v2.26.1 (2013/08/07 16:31 +00:00) -- [b422510](https://github.com/mikeal/request/commit/b422510ba16315c3e0e1293a17f3a8fa7a653a77) 2.26.1 (@mikeal) - -### v2.26.0 (2013/08/07 16:31 +00:00) -- [3b5b62c](https://github.com/mikeal/request/commit/3b5b62cdd4f3b92e63a65d3a7265f5a85b11c4c9) Only include :password in Basic Auth if it's defined (fixes #602) (@bendrucker) -- [#605](https://github.com/mikeal/request/pull/605) Only include ":" + pass in Basic Auth if it's defined (fixes #602) (@bendrucker) -- [cce2c2c](https://github.com/mikeal/request/commit/cce2c2c8ea5b0136932b2432e4e25c0124d58d5a) Moved init of self.uri.pathname (@lexander) -- [08793ec](https://github.com/mikeal/request/commit/08793ec2f266ef88fbe6c947e6b334e04d4b9dc9) Fix all header casing issues forever. (@mikeal) -- [#613](https://github.com/mikeal/request/pull/613) Fixes #583, moved initialization of self.uri.pathname (@lexander) -- [f98ff99](https://github.com/mikeal/request/commit/f98ff990d294165498c9fbf79b2de12722e5c842) Update this old ass readme with some new HOTNESS! (@mikeal) -- [3312010](https://github.com/mikeal/request/commit/3312010f72d035f22b87a6d8d463f0d91b88fea1) markdown badge instead. (@mikeal) -- [9cf657c](https://github.com/mikeal/request/commit/9cf657c1f08bf460911b8bb0a8c5c0d3ae6135c7) Shorter title. (@mikeal) -- [2c61d66](https://github.com/mikeal/request/commit/2c61d66f1dc323bb612729c7320797b79b22034c) put Request out (@joaojeronimo) -- [28513a1](https://github.com/mikeal/request/commit/28513a1b371452699438c0eb73471f8969146264) 2.26.0 (@mikeal) - -### v2.25.1 (2013/07/23 21:51 +00:00) -- [6387b21](https://github.com/mikeal/request/commit/6387b21a9fb2e16ee4dd2ab73b757eca298587b5) 2.25.1 (@mikeal) - -### v2.25.0 (2013/07/23 21:51 +00:00) -- [828f12a](https://github.com/mikeal/request/commit/828f12a1ae0f187deee4d531b2eaf7531169aaf2) 2.25.0 (@mikeal) - -### v2.24.1 (2013/07/23 20:51 +00:00) -- [29ae1bc](https://github.com/mikeal/request/commit/29ae1bc454c03216beeea69d65b538ce4f61e8c1) 2.24.1 (@mikeal) - -### v2.24.0 (2013/07/23 20:51 +00:00) -- [f667318](https://github.com/mikeal/request/commit/f66731870d5f3e0e5655cd89612049b540c34714) Fixed a small typo (@michalstanko) -- [#601](https://github.com/mikeal/request/pull/601) Fixed a small typo (@michalstanko) -- [#594](https://github.com/mikeal/request/pull/594) Emit complete event when there is no callback (@RomainLK) -- [#596](https://github.com/mikeal/request/pull/596) Global agent is being used when pool is specified (@Cauldrath) -- [41ce492](https://github.com/mikeal/request/commit/41ce4926fb08242f19135fd3ae10b18991bc3ee0) New deps. (@mikeal) -- [8176c94](https://github.com/mikeal/request/commit/8176c94d5d17bd14ef4bfe459fbfe9cee5cbcc6f) 2.24.0 (@mikeal) - -### v2.23.1 (2013/07/23 02:45 +00:00) -- [63f31cb](https://github.com/mikeal/request/commit/63f31cb1d170a4af498fbdd7566f867423caf8e3) 2.23.1 (@mikeal) - -### v2.23.0 (2013/07/23 02:44 +00:00) -- [758f598](https://github.com/mikeal/request/commit/758f598de8d6024db3fa8ee7d0a1fc3e45c50f53) Initial commit. Request package. (@mikeal) -- [104cc94](https://github.com/mikeal/request/commit/104cc94839d4b71aaf3681142daefba7ace78c94) Removing unnecessary markup. (@mikeal) -- [12a4cb8](https://github.com/mikeal/request/commit/12a4cb88b949cb4a81d51189d432c25c08522a87) Matching node documentation style. (@mikeal) -- [ab96993](https://github.com/mikeal/request/commit/ab969931106b10b5f8658dc9e0f512c5dfc2a7da) Release tarball. (@mikeal) -- [e7e37ad](https://github.com/mikeal/request/commit/e7e37ad537081a040ea3e527aac23ae859b40b2c) Removing old tarball. (@mikeal) -- [e66e90d](https://github.com/mikeal/request/commit/e66e90dd814ae7bfbcd52003609d7bde9eafea57) Adding automatic redirect following. (@mikeal) -- [2fc5b84](https://github.com/mikeal/request/commit/2fc5b84832ae42f6ddb081b1909d0a6ca00c8d51) Adding SSL support. (@mikeal) -- [a3ac375](https://github.com/mikeal/request/commit/a3ac375d4b5800a038ae26233425fadc26866fbc) Fixing bug where callback fired for every redirect. (@mikeal) -- [1139efe](https://github.com/mikeal/request/commit/1139efedb5aad4a328c1d8ff45fe77839a69169f) Cleaning up tests. (@mikeal) -- [bb49fe6](https://github.com/mikeal/request/commit/bb49fe6709fa06257f4b7aadc2e450fd45a41328) Rolling version. (@mikeal) -- [4ff3493](https://github.com/mikeal/request/commit/4ff349371931ec837339aa9082c4ac7ddd4c7c35) Updates to README.md (@mikeal) -- [1c9cf71](https://github.com/mikeal/request/commit/1c9cf719c92b02ba85c4e47bd2b92a3303cbe1cf) Adding optional body buffer. (@mikeal) -- [49dfef4](https://github.com/mikeal/request/commit/49dfef42630c4fda6fb208534c00638dc0f06a6b) Rolling version. (@mikeal) -- [ab40cc8](https://github.com/mikeal/request/commit/ab40cc850652e325fcc3b0a44ee7303ae0a7b77f) Preserve the original full path. (@mikeal) -- [6d70f62](https://github.com/mikeal/request/commit/6d70f62c356f18098ca738b3dbedcf212ac3d8d8) Rolling version. (@mikeal) -- [e2ca15a](https://github.com/mikeal/request/commit/e2ca15a0f7e986e3063977ee9bd2eb69e86bdb1f) Fixing bugs and rolling version. (@mikeal) -- [8165254](https://github.com/mikeal/request/commit/81652543d3a09553cbf33095a7932dec53ccecc2) Cleanup. Fixing '' === '/' path bug. (@mikeal) -- [a0536a4](https://github.com/mikeal/request/commit/a0536a46d0b91e204fbde1e4341461bc827c9542) Rolling version. (@mikeal) -- [9ccaad7](https://github.com/mikeal/request/commit/9ccaad7dce05e5dcc3eacaf1500404622a0d8067) Adding stream support for request and response bodies. (@mikeal) -- [585166d](https://github.com/mikeal/request/commit/585166d979d4476e460e9835cc0516d04a9a3e11) Rolling version. (@mikeal) -- [41111c8](https://github.com/mikeal/request/commit/41111c88d711da80ea123df238d62038b89769bf) Bugfix release for response stream. (@mikeal) -- [86e375d](https://github.com/mikeal/request/commit/86e375d093700affe4d6d2b76a7acedbe8da140c) Remove host header when we add it. (@mikeal) -- [3a6277c](https://github.com/mikeal/request/commit/3a6277c81cfd3457c760f2aaea44852ef832a1e8) Rolling version. (@mikeal) -- [7a11f69](https://github.com/mikeal/request/commit/7a11f69d5353ecc1319e2e91ca4aefbaf0338136) writing requestBodyStream into request (@beanieboi) -- [186e9cf](https://github.com/mikeal/request/commit/186e9cf692511d768f8016d311609a0a0a315af6) Using sys.pump (@mikeal) -- [09e7ade](https://github.com/mikeal/request/commit/09e7ade541e1d40316a3f153128871a353e707b1) Fixing host port addition. Rolling version. (@mikeal) -- [cec3f3f](https://github.com/mikeal/request/commit/cec3f3f619322f27e2a82c7fd8971722f98d04d6) Using builtin base64. (@mikeal) -- [2a2e2a2](https://github.com/mikeal/request/commit/2a2e2a2f5c4760d4da3caa1a0f2d14c31a4222dc) new structure. new convenience methods (@mikeal) -- [f835b5f](https://github.com/mikeal/request/commit/f835b5fb605506b8ecd3c17bebe9ed54f0066cfc) removing old files. (@mikeal) -- [91616c4](https://github.com/mikeal/request/commit/91616c4e4f488f75a8b04b5b6f0ceef7e814cffd) Adding better redirect handling. (@mikeal) -- [3a95433](https://github.com/mikeal/request/commit/3a95433cbec9693a16ff365148489a058720ae7c) Fixing tests. (@mikeal) -- [38eb1d2](https://github.com/mikeal/request/commit/38eb1d2fa8dea582bb7c3fb37a7b05ff91857a46) By popular demand, proxy support! Not really tested yet but it seems to kinda work. (@mikeal) -- [45d41df](https://github.com/mikeal/request/commit/45d41dff63f36b25b3403e59c8b172b7aa9ed373) Added proxy auth. (@mikeal) -- [85e3d97](https://github.com/mikeal/request/commit/85e3d97e0dced39a3769c4e3f2707ba3aaab1eaa) Fixing for non-proxy case. (@mikeal) -- [f796da7](https://github.com/mikeal/request/commit/f796da74849d2b0732bd1bae1d2dcaf1243142c1) Fixing relative uri's for forwards. (@mikeal) -- [dead30e](https://github.com/mikeal/request/commit/dead30ebef9c3ff806b895e2bd32f52ba3988c69) Adding support for specifying an encoding for the response body. (@mikeal) -- [9433344](https://github.com/mikeal/request/commit/943334488dcc8e7f90727b86f9eb1bc502c33b4f) Removing debugging statement (@mikeal) -- [41efb7a](https://github.com/mikeal/request/commit/41efb7a7dcca3b47e97c23c6cdbd3e860d3bd82b) Error on maxRedirects exceeded. (@mikeal) -- [9549570](https://github.com/mikeal/request/commit/95495701fa4e99a3ab85acdab71ecdaabe0dbd45) Allow options.url, people do it all the time, might as well just support it. (@mikeal) -- [21a53c0](https://github.com/mikeal/request/commit/21a53c016edcc113e809219639807b46d29dba36) Pumping version. (@mikeal) -- [aca9782](https://github.com/mikeal/request/commit/aca9782285fe1d727570fe8d799561f45d49048e) Fixing byteLength !== string lenght issues. (@mikeal) -- [a77c296](https://github.com/mikeal/request/commit/a77c296431eda2a211f59bdb88654c4a64ed4ef3) Don't rely on automatic semicolon insertion (pretty please :) (@papandreou) -- [8b02f29](https://github.com/mikeal/request/commit/8b02f29c9019dd1d1dd291dd85889b26f592a137) Also set content-length when options.body is the empty string. (@papandreou) -- [023281c](https://github.com/mikeal/request/commit/023281ca9b4414a9bc0170c2b08aaf886a7a08f7) Simplified boolean logic. (@papandreou) -- [4f897fd](https://github.com/mikeal/request/commit/4f897fdd6c7c93bea73dbf34623f09af63bb1ed4) Simplified check for whether response.headers.location starts with "http:" or "https:". (@papandreou) -- [6d7db85](https://github.com/mikeal/request/commit/6d7db85cadf401dffdec07a4d66822207898c69e) Fixed double var declaration. (@papandreou) -- [97255cf](https://github.com/mikeal/request/commit/97255cfd2a4aa8f34d307e7cd96fe1c1f13cb26a) Process redirects as soon as the response arrives. Prevents the uninteresting redirect response from being pumped into responseBodyStream. (@papandreou) -- [b2af15f](https://github.com/mikeal/request/commit/b2af15f4fcbe1115cf8b53c5ae89fbf2365bfffc) New feature: If options.noBuffer is true, don't buffer up the response, just return it. Most of the time getting a readable stream is much more flexible than having the option to pipe the response into a writable stream. For one thing, the stream can be paused. (@papandreou) -- [fee5f89](https://github.com/mikeal/request/commit/fee5f89159a8f36b25df509c55093bf7ebd1c993) A few fixes/changes from papandreou's code, also added new semantics for onResponse. (@mikeal) -- [fa72fcb](https://github.com/mikeal/request/commit/fa72fcb950029b222f0621e2d49304e35d08c380) Updated documentation. (@mikeal) -- [4fc7209](https://github.com/mikeal/request/commit/4fc72098e7eeb9518951b9306115340ffdcce7ce) Fix for both onResponse and callback (@mikeal) -- [3153436](https://github.com/mikeal/request/commit/3153436404fca865a65649d46eb22d9797128c9d) Adding license information. (@mikeal) -- [59570de](https://github.com/mikeal/request/commit/59570dec37913c7e530303a83f03781d9aca958c) Fix for unescaping passwords for basic auth. (@notmatt) -- [0d771ab](https://github.com/mikeal/request/commit/0d771ab7882b97d776179972c51c59386f91b953) require querystring (@notmatt) -- [875f79b](https://github.com/mikeal/request/commit/875f79b6a40340457fafafdadac813cfa5343689) Allow request's body to be an object. (@Stanley) -- [86895b9](https://github.com/mikeal/request/commit/86895b9c37f7b412b7df963c2a75361ff402d8c5) Merge branch 'master' of github.com:Stanley/request (@Stanley) -- [4c9c984](https://github.com/mikeal/request/commit/4c9c984cb37bfd4e901ce24b0e9b283604c27bf4) Better tests. (@mikeal) -- [02f6b38](https://github.com/mikeal/request/commit/02f6b38c1697a55ed43940d1fd0bef6225d4faa2) Added specs for body option (@Stanley) -- [af66607](https://github.com/mikeal/request/commit/af666072a22b8df4d75fe71885139059f56ea5ee) Made specs pass (@Stanley) -- [641ec05](https://github.com/mikeal/request/commit/641ec052dd95797816e781b2c3ac2524841db7cb) Merge branch 'master' of https://github.com/Stanley/request into jsonbody (@mikeal) -- [ab4c96b](https://github.com/mikeal/request/commit/ab4c96be1c002c10806d967a4b266543f8b0267c) Moved spec tests to normal node script tests. Style changes to code and docs. (@mikeal) -- [fc2a7ef](https://github.com/mikeal/request/commit/fc2a7ef301c1266938a5aeb539e4f3fc3b5191dd) Clearer wording for json option. (@mikeal) -- [01371d7](https://github.com/mikeal/request/commit/01371d728082e22aabeb840da82a30aec62d7d8a) Removing specs loader. (@mikeal) -- [560dadd](https://github.com/mikeal/request/commit/560dadd6cbd293622c66cd82b5506704c9850b13) Adding newline to end of test files, makes for cleaner diffs in the future. (@mikeal) -- [a0348dd](https://github.com/mikeal/request/commit/a0348dd0fef462c3c678a639619c27101c757035) Add pass message when tests finish. (@mikeal) -- [da77a0e](https://github.com/mikeal/request/commit/da77a0e152c1dd43f5c1e698110d23e4d32280db) Adding better debug message on failures for GET tests. (@mikeal) -- [6aade82](https://github.com/mikeal/request/commit/6aade822a90724a47176771d137e30b0a702e7ef) throw on error. (@mikeal) -- [4f41b8d](https://github.com/mikeal/request/commit/4f41b8dbbf9a93c53d5ccdf483c9d7803e279916) Rolling version. (@mikeal) -- [7cf01f0](https://github.com/mikeal/request/commit/7cf01f0481afb367b5d0d4878645ac535cfe9a2e) master is moving to node v0.3.6+ (@mikeal) -- [cb403a4](https://github.com/mikeal/request/commit/cb403a4cfdbe3d98feb9151fdbdae1e1436e59ab) Initial support for 0.3.6+.\n\nExperimental support for Request objects as streams. It's untested and requires a pending patch to node.js (@mikeal) -- [a3c80f9](https://github.com/mikeal/request/commit/a3c80f98f42f25d4cb02d5d9e34ba0e67cc89293) Adding defaults call. (@mikeal) -- [55f22f9](https://github.com/mikeal/request/commit/55f22f96365c57aa8687de951e3f9ed982eba408) Request will keep it's own agent pool so that it can expose a maxSockets setting for easy pool sizing. (@mikeal) -- [004741c](https://github.com/mikeal/request/commit/004741c23dc0eaf61f111161bb913ba418e033e4) Fixing reference error. (@mikeal) -- [8548541](https://github.com/mikeal/request/commit/85485414150fbac58b08126b3684f81dcb930bf1) Simplified pool implementation. (@mikeal) -- [9121c47](https://github.com/mikeal/request/commit/9121c47e4cbe47bccc20a75e0e6c6c098dce04fb) Default to globalPool. (@mikeal) -- [9ec3490](https://github.com/mikeal/request/commit/9ec3490aefd52f05b57e6db13730ace54b4439d1) Support for https. Requires pending patch in node core for consistent Agent API. (@mikeal) -- [146b154](https://github.com/mikeal/request/commit/146b154a1a31ae7a30aa9f28e891e4824af548fa) Fixes for reference errors. (@mikeal) -- [8756120](https://github.com/mikeal/request/commit/8756120f83ceb94f8ba600acba274ba512696eef) Only create an agent when a relevant option is passed. (@mikeal) -- [cc3cf03](https://github.com/mikeal/request/commit/cc3cf0322847982875ff32a7cef25c39c29630ba) New HTTP client doesn't require such explicit error listener management. (@mikeal) -- [f7c0379](https://github.com/mikeal/request/commit/f7c0379b99ac7989df7f934be67cc3ae979591bb) Fixing bug in .pipe() handling. Thanks tanepiper. (@mikeal) -- [897a7ef](https://github.com/mikeal/request/commit/897a7ef020cefcb7a36c04a11e286238df8ecdaa) Fixes for streams, docs, and convenience methods. (@mikeal) -- [7c2899a](https://github.com/mikeal/request/commit/7c2899a046b750eda495b23b2d58604260deddbc) Doc fixes. (@mikeal) -- [f535fe1](https://github.com/mikeal/request/commit/f535fe1008c8f11bb37e16f95fe287ed93343704) Doc fixes. (@mikeal) -- [d1deb5b](https://github.com/mikeal/request/commit/d1deb5b4dda4474fe9d480ad42ace664d89e73ee) Pipe tests, all passing! (@mikeal) -- [d67a041](https://github.com/mikeal/request/commit/d67a041783df8d724662d82f9fb792db1be3f4f0) Moving basic example to the top. (@mikeal) -- [6a98b9e](https://github.com/mikeal/request/commit/6a98b9e4a561b516b14d325c48785a9d6f40c514) Do not mix encoding option with pipeing. (@mikeal) -- [06b67ef](https://github.com/mikeal/request/commit/06b67ef01f73572a6a9b586854d4c21be427bdb2) Disable pooling with {pool:false} (@mikeal) -- [1c24881](https://github.com/mikeal/request/commit/1c248815b5dfffda43541e367bd4d66955ca0325) Send all arguments passed to stream methods. (@mikeal) -- [7946393](https://github.com/mikeal/request/commit/7946393893e75df24b390b7ab19eb5b9d6c23891) Better errors and warnings for different pipe conditions. (@mikeal) -- [ee2108d](https://github.com/mikeal/request/commit/ee2108db592113a0fe3840c361277fdd89f0c89c) Removing commented out legacy code. (@mikeal) -- [5f838b3](https://github.com/mikeal/request/commit/5f838b3582eda465f366d7df89c6dd69920405f2) Fixing redirect issue, thanks @linus (@mikeal) -- [c08758e](https://github.com/mikeal/request/commit/c08758e25290ee12278b3eb95d502645e0d66e4e) Adding del alias, thanks tanepiper. (@mikeal) -- [0b7d675](https://github.com/mikeal/request/commit/0b7d6756c120ebf17ce6c70fc1ff4ecd6850e704) Keep require('https') from throwing if node is compiled with --without-ssl. This will still throw for Invalid Protocol if https is used. Which makes more sense and makes request work without SSl support. (@davglass) -- [02fc9f7](https://github.com/mikeal/request/commit/02fc9f7cc8912402a5a98ddefaffa5f6da870562) Rolling version. Pushed new version to npm. (@mikeal) -- [0b30532](https://github.com/mikeal/request/commit/0b30532ee1a3cabb177017acfa7885b157031df2) Sent a patch today to fix this in core but this hack will fix node that predates that fix to core. (@mikeal) -- [5d5d8f4](https://github.com/mikeal/request/commit/5d5d8f43156b04fd3ceb312cfdf47cc2b0c4104d) Rolling version. Pushed new version to npm. (@mikeal) -- [1c00080](https://github.com/mikeal/request/commit/1c000809f1795d2e21635a626cf730aba2049d3e) Fixing reference to tls. (@mikeal) -- [4c355d1](https://github.com/mikeal/request/commit/4c355d1f87fced167e4b21770bfe6f8208f32b53) Be a better stream. (@mikeal) -- [9bed22f](https://github.com/mikeal/request/commit/9bed22f22e007201d4faeebdb486603c3bb088c3) Rolled version and pushed to npm (@mikeal) -- [34df8e2](https://github.com/mikeal/request/commit/34df8e2301dcfd10705b9ff3b257741b0816c8a1) typo in `request.defaults` (@clement) -- [4d7a6d4](https://github.com/mikeal/request/commit/4d7a6d46fa481e43fe873b8c8fad2f7dd816dbb5) default value only if undefined in `request.defaults` + misplaced `return` statement (@clement) -- [243a565](https://github.com/mikeal/request/commit/243a56563f1014318a467e46113b2c61b485f377) Adding support for request(url) (@mikeal) -- [83a9cec](https://github.com/mikeal/request/commit/83a9cec3cb2f7a43a1e10c13da8d0dd72b937965) Fixing case where + is in user or password. (@mikeal) -- [8bb7f98](https://github.com/mikeal/request/commit/8bb7f98ba8b78c217552c979811c07f1299318fe) making Request a duplex stream rather than adding special handling for pipes out. (@mikeal) -- [55a1fde](https://github.com/mikeal/request/commit/55a1fdedcad1e291502ce10010dda7e478a1b503) pause and resume should act on response instead of request (@tobowers) -- [63125a3](https://github.com/mikeal/request/commit/63125a33523e72e449ceef76da57b63522998282) Making request really smart about pipeing to itself so that we can do simple proxy cats (@mikeal) -- [2f9e257](https://github.com/mikeal/request/commit/2f9e257bc39eb329eec660c6d675fb40172fc5a5) Rolling version since master right now has some pretty hot new code in it. (@mikeal) -- [#31](https://github.com/mikeal/request/pull/31) Error on piping a request to a destination (@tobowers) -- [b1f3d54](https://github.com/mikeal/request/commit/b1f3d5439d24b848b2bf3a6459eea74cb0e43df3) The "end" event that was supposed to be emitted to fix a core bug in NodeJS wasn't fired because it wasn't emitted on the response object. (@voxpelli) -- [#35](https://github.com/mikeal/request/pull/35) The "end" event isn't emitted for some responses (@voxpelli) -- [40b1c67](https://github.com/mikeal/request/commit/40b1c676e1d3a292719ad2dd9cf9354c101bad47) Rolling version. (@mikeal) -- [9a28022](https://github.com/mikeal/request/commit/9a28022d0e438d0028e61a53e897689470025e50) Fixing bug in forwarding with new pipes logic. (@mikeal) -- [44e4e56](https://github.com/mikeal/request/commit/44e4e5605b0a9e02036393bcbd3a8d91280f5611) Fixing big bug in forwarding logic. (@mikeal) -- [b0cff72](https://github.com/mikeal/request/commit/b0cff72d63689d96e0b1d49a8a5aef9ccc71cb8b) Added timeout option to abort the request before the response starts responding (@mbrevoort) -- [cc76b10](https://github.com/mikeal/request/commit/cc76b109590437bfae54116e3424b2c6e44a3b3e) corrected spelling error in README (@mbrevoort) -- [#45](https://github.com/mikeal/request/pull/45) Added timeout option (@mbrevoort) -- [1cca56b](https://github.com/mikeal/request/commit/1cca56b29bb670c53d5995e76c0b075a747b5ad7) Fixing for node http client refactor. (@mikeal) -- [2a78aa3](https://github.com/mikeal/request/commit/2a78aa3f827e76c548e001fa519448b24466b518) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [ce12273](https://github.com/mikeal/request/commit/ce12273d3990c1446d3166bbd9e35c0e2435f137) New fs.ReadStream handling hotness. (@mikeal) -- [535e30a](https://github.com/mikeal/request/commit/535e30a4bd4a8e41d97ffa6a4e99630ac09a4bcb) Adding pipe support to HTTP ServerResponse objects. (@mikeal) -- [2f0cf6b](https://github.com/mikeal/request/commit/2f0cf6bf44edbaec4c0a0cb15a679302de7f0aff) Setting proper statusCode. (@mikeal) -- [6e3ecb1](https://github.com/mikeal/request/commit/6e3ecb106c3a32101d80ac0f87968fddd3ac5e2c) Adding test for pipeing file to disc. (@mikeal) -- [bbbb52e](https://github.com/mikeal/request/commit/bbbb52e406b65100b557caa3687a1aa04fab6ff3) Pumping version. (@mikeal) -- [a10b6e4](https://github.com/mikeal/request/commit/a10b6e4c08478364b8079801fdb23f3530fcc85f) Adding reference to Request instance on response to make it easier on inline callbacks. fixes #43. (@mikeal) -- [b9aff1f](https://github.com/mikeal/request/commit/b9aff1fe007dab3f93e666f047fa03a4e8f5f8b7) Add body property to resp when we have it as a shorthand. fixes #28 (@mikeal) -- [411b30d](https://github.com/mikeal/request/commit/411b30dab1fe5b20880113aa801a2fdbb7c35c40) If the error is handled and not throw we would still process redirects. Fixes #34. (@mikeal) -- [8f3c2b4](https://github.com/mikeal/request/commit/8f3c2b4f6dee8838f30e2430a23d5071128148f0) w00t! request 2.0 (@mikeal) -- [9957542](https://github.com/mikeal/request/commit/9957542cc6928443f3a7769510673665b5a90040) valid semver. (@mikeal) -- [31f5ee2](https://github.com/mikeal/request/commit/31f5ee28726ac7e14355cad0c6d2785f9ca422c6) Drastically improved header handling. (@mikeal) -- [c99b8fc](https://github.com/mikeal/request/commit/c99b8fcd706ae035f6248669b017ac2995e45f31) Return destination stream from pipe(). (@mikeal) -- [cba588c](https://github.com/mikeal/request/commit/cba588cec1e204d70f40f8bd11df0e27dc78ef0c) Style fixes. Bye Bye semi-colons. Mostly lined up with npm style. (@mikeal) -- [8515a51](https://github.com/mikeal/request/commit/8515a510ccc0a661d7c28fce6e513a7d71be7f8f) Clearer spacing. Slightly more consistent. (@mikeal) -- [3acd82a](https://github.com/mikeal/request/commit/3acd82a10e7d973fc5dbaa574c2e8906e48e1ee9) add failing test for issue #51 (@benatkin) -- [68c17f6](https://github.com/mikeal/request/commit/68c17f6c9a3d7217368b3b8bc61203e6a14eb4f0) implement parsing json response when json is truthy (@benatkin) -- [1cb1ec1](https://github.com/mikeal/request/commit/1cb1ec114b03394a0a530f245a857d8424cad02d) allow empty string (@benatkin) -- [4f8d2df](https://github.com/mikeal/request/commit/4f8d2df9f845690667a56e7698dbaf23b5028177) support JSON APIs that don't set the write content type (@benatkin) -- [#53](https://github.com/mikeal/request/pull/53) Parse json: Issue #51 (@benatkin) -- [c63e6e9](https://github.com/mikeal/request/commit/c63e6e96378a2b050bddbe1b39337662f304dc95) Adding proxy to docs, don't know why this wasn't already in. (@mikeal) -- [ef767d1](https://github.com/mikeal/request/commit/ef767d12f13a9c78d3df89add7556f5421204843) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [1b12d3a](https://github.com/mikeal/request/commit/1b12d3a9f48a6142d75fa1790c80eb313388ca44) Emit a proper error. (@mikeal) -- [47314d7](https://github.com/mikeal/request/commit/47314d7cb41fe9c3a7717a502bed9cf1b6074ffc) Greatly expanded documentation. (@mikeal) -- [e477369](https://github.com/mikeal/request/commit/e477369b4bbc271248ee8b686c556567570a6cca) Doc refinements. (@mikeal) -- [fe4d221](https://github.com/mikeal/request/commit/fe4d22109bc1411c29b253756d609856327ff146) Fix for newer npm (@mikeal) -- [7b2f788](https://github.com/mikeal/request/commit/7b2f788293e205edc7b46a7fd5304296b5e800e3) More doc cleanup. (@mikeal) -- [f8eb2e2](https://github.com/mikeal/request/commit/f8eb2e229aca38547236d48066a0b3f9f8f67638) Copy headers so that they survive mutation. (@mikeal) -- [59eab0e](https://github.com/mikeal/request/commit/59eab0e5e49c6d32697822f712ed725843e70010) Rolling version. (@mikeal) -- [76bf5f6](https://github.com/mikeal/request/commit/76bf5f6c6e37f6cb972b3d4f1ac495a4ceaaa00d) Improvements to json handling and defaults. (@mikeal) -- [81e2c40](https://github.com/mikeal/request/commit/81e2c4040a9911a242148e1d4a482ac6c745d8eb) Rolling version. (@mikeal) -- [76d8924](https://github.com/mikeal/request/commit/76d8924cab295f80518a71d5903f1e815618414f) Proper checking and handling of json bodies (@mikeal) -- [a8422a8](https://github.com/mikeal/request/commit/a8422a80895ed70e3871c7826a51933a75c51b69) Rolling version. (@mikeal) -- [f236376](https://github.com/mikeal/request/commit/f2363760782c3d532900a86d383c34f3c94f6d5f) Adding pipefilter. (@mikeal) -- [dd85f8d](https://github.com/mikeal/request/commit/dd85f8da969c2cc1825a7dfec6eac430de36440c) Rolling version. (@mikeal) -- [#66](https://github.com/mikeal/request/pull/66) Do not overwrite established content-type headers for read stream deliver (@voodootikigod) -- [b09212f](https://github.com/mikeal/request/commit/b09212f38fe736c2c92a1ee076cae9d0f4c612c3) Do not overwrite established content-type headers for read stream deliveries. (@voodootikigod) -- [01bc25d](https://github.com/mikeal/request/commit/01bc25d25343d73e9f5731b3d0df1cf5923398d4) Only apply workaround on pre-0.5 node.js and move test to assert.equal (@mikeal) -- [d487131](https://github.com/mikeal/request/commit/d487131ebc2f7a4bf265061845f7f3ea2fd3ed34) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [1200df5](https://github.com/mikeal/request/commit/1200df52bd334f9a44a43846159146b8f938fd9e) Rolling version. (@mikeal) -- [8279362](https://github.com/mikeal/request/commit/82793626f6965884a3720d66f5a276d7d4d30873) fix global var leaks (@aheckmann) -- [#67](https://github.com/mikeal/request/pull/67) fixed global variable leaks (@aheckmann) -- [ab91204](https://github.com/mikeal/request/commit/ab9120495a89536c7152e3cdf17d684323b40474) Test that chunked responses are properly toString'ed (@isaacs) -- [9bff39f](https://github.com/mikeal/request/commit/9bff39fa485f28d7f1754e72f026418ca1186783) Properly flatten chunked responses (@isaacs) -- [8e4e956](https://github.com/mikeal/request/commit/8e4e95654391c71c22933ffd422fdc82d20ac059) Fix #52 Make the tests runnable with npm (@isaacs) -- [a9aa9d6](https://github.com/mikeal/request/commit/a9aa9d6d50ef0481553da3e50e40e723a58de10a) Fix #71 Respect the strictSSL flag (@isaacs) -- [#69](https://github.com/mikeal/request/pull/69) Flatten chunked requests properly (@isaacs) -- [#73](https://github.com/mikeal/request/pull/73) Fix #71 Respect the strictSSL flag (@isaacs) -- [#70](https://github.com/mikeal/request/pull/70) add test script to package.json (@isaacs) -- [08ca561](https://github.com/mikeal/request/commit/08ca5617e0d8bcadee98f10f94a49cbf2dd02862) Fixing case where encoding is set. Also cleaning up trailing whitespace because my editor likes to do that now. (@mikeal) -- [0be269f](https://github.com/mikeal/request/commit/0be269f7d9da6c3a14a59d5579546fee9d038960) Fixing case where no body exists. (@mikeal) -- [2f37bbc](https://github.com/mikeal/request/commit/2f37bbc51ff84c3c28ae419138a19bd33a9f0103) Fixing timeout tests. (@mikeal) -- [f551a2f](https://github.com/mikeal/request/commit/f551a2f02a87994249c2fd37dc8f20a29e8bf529) Fixing legacy naming of self as options. (@mikeal) -- [717789e](https://github.com/mikeal/request/commit/717789ec9f690e9d5216ce1c27688eef822940cc) Avoid duplicate emit when using a timeout (@Marsup) -- [#76](https://github.com/mikeal/request/pull/76) Bug when a request fails and a timeout is set (@Marsup) -- [c1d255e](https://github.com/mikeal/request/commit/c1d255e5bcc5791ab69809913fe6d917ab93c8b7) global leakage in request.defaults (@isaacs) -- [14070f2](https://github.com/mikeal/request/commit/14070f269c79cae6ef9e7f7a415867150599bb8e) Don't require SSL for non-SSL requests (@isaacs) -- [4b8f696](https://github.com/mikeal/request/commit/4b8f6965e14c6fb704cf16f5bc011e4787cf32b2) Set proxy auth instead of just setting auth a second time (@isaacs) -- [cd22fbd](https://github.com/mikeal/request/commit/cd22fbdb00b90c5c75187ecf41373cfbb4af5bcd) Merge branch 'proxy-auth-bug' (@isaacs) -- [#78](https://github.com/mikeal/request/pull/78) Don't try to do strictSSL for non-ssl connections (@isaacs) -- [d8c53fc](https://github.com/mikeal/request/commit/d8c53fceca3af385753880395c680f6ec3d4d560) Removing legacy call to sys.puts (@mikeal) -- [731b32b](https://github.com/mikeal/request/commit/731b32b654bb217de3466b8d149ce480988bb24b) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [9c897df](https://github.com/mikeal/request/commit/9c897dffc7e238f10eb7e14c61978d6821c70f56) Enhance redirect handling: (1) response._redirectsFollowed reports the total number of redirects followed instead of being reset to 0; (2) add response.redirects, an array of the response.statusCode and response.headers.location for each redirect. (@danmactough) -- [#81](https://github.com/mikeal/request/pull/81) Enhance redirect handling (@danmactough) -- [4c84001](https://github.com/mikeal/request/commit/4c8400103ec18a0729e29e9ffb17dda65ce02f6d) Document strictSSL option (@isaacs) -- [d517ac0](https://github.com/mikeal/request/commit/d517ac03278b3ebd9a46ca9f263bea68d655822b) allow passing in buffers as multipart bodies (@kkaefer) -- [6563865](https://github.com/mikeal/request/commit/6563865b80573ad3c68834a6633aff6d322b59d5) bugs[web] should be bugs[url] (@isaacs) -- [2625854](https://github.com/mikeal/request/commit/262585480c148c56772dfc8386cfc59d5d262ca0) add option followAllRedirects to follow post/put redirects -- [bc057af](https://github.com/mikeal/request/commit/bc057affb58272d9152766956e5cde4ea51ca043) fix typo, force redirects to always use GET -- [d68b434](https://github.com/mikeal/request/commit/d68b434693dbf848dff4c570c4249a35329cc24f) Support node 0.5.11-style url parsing (@isaacs) -- [#96](https://github.com/mikeal/request/pull/96) Authless parsed url host support (@isaacs) -- [9f66c6d](https://github.com/mikeal/request/commit/9f66c6d79bc6515d870b906df39bd9d6d9164994) Typo, causing 'TypeError: Cannot read property 'length' of undefined' (@isaacs) -- [#97](https://github.com/mikeal/request/pull/97) Typo in previous pull causes TypeError in non-0.5.11 versions (@isaacs) -- [b320e05](https://github.com/mikeal/request/commit/b320e05f2d84510f47a6b6857d091c8cd4d3ae2e) When no request body is being sent set 'content-length':0. fixes #89 (@mikeal) -- [059916c](https://github.com/mikeal/request/commit/059916c545a0faa953cb8ac66b8c3ae243b1c8ce) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [248e9d6](https://github.com/mikeal/request/commit/248e9d65e73ac868948a82d07feaf33387723a1d) Fix for pipe() after response. Added response event, fixed and updated tests, removed deprecated stream objects. (@mikeal) -- [a2e5d6e](https://github.com/mikeal/request/commit/a2e5d6e30d3e101f8c5a034ef0401fdde8608ccf) Fixing double callback firing. node 0.5 is much better about calling errors on the client object which, when aborting on timeout, predictable emits an error which then triggers a double callback. (@mikeal) -- [5f80577](https://github.com/mikeal/request/commit/5f805775e6aeaaf229cc781439b29108fb69f373) Release for 0.6 (@mikeal) -- [bf906de](https://github.com/mikeal/request/commit/bf906de601121b52c433b0af208550f1db892cde) Adding some oauth support, tested with Twitter. (@mikeal) -- [8869b2e](https://github.com/mikeal/request/commit/8869b2e88cc305e224556c5ca75b7b59311911d9) Removing irrelevant comments. (@mikeal) -- [8323eed](https://github.com/mikeal/request/commit/8323eed4915bb73b33544bc276f3840c13969134) Closed issue 82 : handling cookies - added tests too -- [739f841](https://github.com/mikeal/request/commit/739f84166d619778ab96fd0b0f4f1f43e8b0fdda) Closed issue 82 : handling cookies - added tests too -- [7daf841](https://github.com/mikeal/request/commit/7daf8415fb1a4e707ec54eb413169e49d8bbe521) Closed issue 82 : handling cookies - added tests too -- [6c22041](https://github.com/mikeal/request/commit/6c22041a4719bf081c827dda8f35e7b79b4c39d9) changed README -- [3db7f7d](https://github.com/mikeal/request/commit/3db7f7d38e95406b84f06fed52b69038b0250904) Updated README -- [6181b7a](https://github.com/mikeal/request/commit/6181b7a8a4be75bcf75cd3ff6dacb8e910737e92) Documented request.cookie() and request.jar() -- [fc44260](https://github.com/mikeal/request/commit/fc44260d13f0094bfe96d18878a11c6fe88b69e5) Tiny cookie example error on README -- [366831b](https://github.com/mikeal/request/commit/366831b705b5d5ebfbec5f63b4b140cbafcb4515) Remove instanceof check for CookieJar (mikeal suggestion) -- [88488cf](https://github.com/mikeal/request/commit/88488cf076efbd916b0326e0981e280c993963a7) Also add cookie to the user defined cookie jar (mikeal's suggestion) -- [f6fef5b](https://github.com/mikeal/request/commit/f6fef5bfa4ba8e1dfa3022df8991716e5cba7264) Updated cookie documentation in README file -- [b519044](https://github.com/mikeal/request/commit/b5190441a889164dfeb4148fac643fd7a87cfb51) request.defaults({jar: false}) disables cookies && also updated README -- [856a65c](https://github.com/mikeal/request/commit/856a65cd28402efbe3831a68d73937564a27ea9b) Update jar documentation in the options also -- [#102](https://github.com/mikeal/request/pull/102) Implemented cookies - closes issue 82: https://github.com/mikeal/request/issues/82 (@alessioalex) -- [62592e7](https://github.com/mikeal/request/commit/62592e7fe9ee5ecaee80b8f5bc2400e4a277e694) Cookie bugs (@janjongboom) -- [a06ad2f](https://github.com/mikeal/request/commit/a06ad2f955270974409e75c088e1f5d1f5298ff5) Follow redirects should work on PUT and POST requests as well. This is more consistent to other frameworks, e.g. .NET (@janjongboom) -- [bf3f5d3](https://github.com/mikeal/request/commit/bf3f5d30fdabf6946096623fc3398bb66ed19a1f) Cookies shouldn't be discarded when followRedirect = true (@janjongboom) -- [16db85c](https://github.com/mikeal/request/commit/16db85c07e6c2516269299640fdddca6db7bc051) Revert "Follow redirects should work on PUT and POST requests as well. This is more consistent to other frameworks, e.g. .NET" (@janjongboom) -- [841664e](https://github.com/mikeal/request/commit/841664e309f329be98c1a011c634f5291af1eebc) Add test for proxy option (@dominictarr) -- [#105](https://github.com/mikeal/request/pull/105) added test for proxy option. (@dominictarr) -- [50d2d39](https://github.com/mikeal/request/commit/50d2d3934cd86d7142a4aab66017bb1ef82329cf) Fixing test, emitter matches on req.url so it needs the full url. (@mikeal) -- [668a291](https://github.com/mikeal/request/commit/668a291013380af305eba12b1d5c7a5376a74c76) Adding some documentation for OAuth signing support. (@mikeal) -- [04faa3b](https://github.com/mikeal/request/commit/04faa3bf2b1f4ec710414c6ec7231b24767b2f89) Minor improvements in example (@mikeal) -- [0fddc17](https://github.com/mikeal/request/commit/0fddc1798dcd9b213e3f8aec504c61cecf4d7997) Another small fix to the url in the docs. (@mikeal) -- [337649a](https://github.com/mikeal/request/commit/337649a08b4263c0d108cd4621475c8ff9cf8dd0) Add oauth to options. (@mikeal) -- [#86](https://github.com/mikeal/request/pull/86) Can't post binary to multipart requests (@developmentseed) -- [4e4d428](https://github.com/mikeal/request/commit/4e4d4285490be20abf89ff1fb54fb5088c01c00e) Update to Iris Couch URL (@jhs) -- [#110](https://github.com/mikeal/request/pull/110) Update to Iris Couch URL (@iriscouch) -- [d7af099](https://github.com/mikeal/request/commit/d7af0994b382466367f2cafc5376150e661eeb9d) Remove the global `i` as it's causing my test suites to fail with leak detection turned on. (@3rd-Eden) -- [#117](https://github.com/mikeal/request/pull/117) Remove the global `i` (@3rd-Eden) -- [b2a4ad1](https://github.com/mikeal/request/commit/b2a4ad1e7d7553230e932ea093d7f77f38147ef9) Force all cookie keys into lower case as suggested by LinusU (@jhurliman) -- [055a726](https://github.com/mikeal/request/commit/055a7268b40425643d23bd6a4f09c7268dbab680) Applying a modified version of pull request #106 as suggested by janjongboom (@jhurliman) -- [#121](https://github.com/mikeal/request/pull/121) Another patch for cookie handling regression (@jhurliman) -- [a353f4e](https://github.com/mikeal/request/commit/a353f4eeb312ea378d34b624f5c4df33eefa152c) Merge remote-tracking branch 'upstream/master' (@janjongboom) -- [#104](https://github.com/mikeal/request/pull/104) Cookie handling contains bugs (@janjongboom) -- [a3be5ad](https://github.com/mikeal/request/commit/a3be5ad5ea112422ed00da632530b93bcf54727c) Fix encoding of characters like ( (@mikeal) -- [dd2067b](https://github.com/mikeal/request/commit/dd2067bbbf77d1132c9ed480848645136b8a5521) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [ddc4e45](https://github.com/mikeal/request/commit/ddc4e453c3b9a0e11da4df156c5e15206abfc1ef) Pushed new version to npm (@mikeal) -- [feee5eb](https://github.com/mikeal/request/commit/feee5ebd2ca8c09db25b5cb13cd951f7c4322a49) Real fix for encoding issues in javascript and oauth. (@mikeal) -- [23896cd](https://github.com/mikeal/request/commit/23896cdc66d75ec176876167ff21da72b7ff181b) Pushed new version to npm. (@mikeal) -- [a471ed2](https://github.com/mikeal/request/commit/a471ed2ca8acdca1010a0fc20434c5c9956b0d0c) HTTP redirect tests (@jhs) -- [a4a9aa1](https://github.com/mikeal/request/commit/a4a9aa199ff958630791e131092ec332ada00a49) A self-signed certificate for upcoming HTTPS testing (@jhs) -- [10ac6b9](https://github.com/mikeal/request/commit/10ac6b9db40263bec1bf63ee7e057000ffd2d7e9) HTTPS tests, for now a copy of the test-body tests (@jhs) -- [105aed1](https://github.com/mikeal/request/commit/105aed1ff99add1957f91df7efabf406e262f463) Support an "httpModules" object for custom http/https module behavior (@jhs) -- [#112](https://github.com/mikeal/request/pull/112) Support using a custom http-like module (@iriscouch) -- [d05a875](https://github.com/mikeal/request/commit/d05a8753af576fc1adccc7ffe9633690371c05ee) Test for #129 (@mikeal) -- [06cdfaa](https://github.com/mikeal/request/commit/06cdfaa3c29233dac3f47e156f2b5b3a0f0ae4b8) return body as buffer when encoding is null -- [#132](https://github.com/mikeal/request/pull/132) return the body as a Buffer when encoding is set to null (@jahewson) -- [4882e51](https://github.com/mikeal/request/commit/4882e519ed6b8d08795da5de37166148ce0ee440) fixed cookies parsing, updated tests (@afanasy) -- [2be228e](https://github.com/mikeal/request/commit/2be228ec8b48a60028bd1d80c8cbebf23964f913) Change `host` to `hostname` in request hash -- [#135](https://github.com/mikeal/request/pull/135) host vs hostname (@iangreenleaf) -- [e24abc5](https://github.com/mikeal/request/commit/e24abc5cc2c6fa154ae04fe58a16d135eeba4951) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [c99c809](https://github.com/mikeal/request/commit/c99c809bb48b9c0193aae3789c5c844f7f6cbe92) Reverting host -> hostname because it breaks in pre-0.6. (@mikeal) -- [a1134d8](https://github.com/mikeal/request/commit/a1134d855f928fde5c4fe9ee255c111da0195bfc) adding logging (@mikeal) -- [#133](https://github.com/mikeal/request/pull/133) Fixed cookies parsing (@afanasy) -- [9179471](https://github.com/mikeal/request/commit/9179471f9f63b6ba9c9078a35cb888337ce295e8) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [cbb180b](https://github.com/mikeal/request/commit/cbb180b0399074995c235a555e3e3e162d738f7c) Fixes to oauth test. (@mikeal) -- [e1c351f](https://github.com/mikeal/request/commit/e1c351f92958634ccf3fbe78aa2f5b06d9c9a5fa) Published new version. (@mikeal) -- [3ceee86](https://github.com/mikeal/request/commit/3ceee86f1f3aad3a6877d6d3813e087549f3b485) Formatting fixes. (@mikeal) -- [18e1af5](https://github.com/mikeal/request/commit/18e1af5e38168dcb95c8ae29bb234f1ad9bbbdf9) Fixing log error. (@mikeal) -- [edc19b5](https://github.com/mikeal/request/commit/edc19b5249f655714efa0f8fa110cf663b742921) Pushed new version. (@mikeal) -- [f51c32b](https://github.com/mikeal/request/commit/f51c32bd6f4da0419ed8404b610c43ee3f21cf92) added "form" option to readme. (@petejkim) -- [#144](https://github.com/mikeal/request/pull/144) added "form" option to readme (@petejkim) -- [b58022e](https://github.com/mikeal/request/commit/b58022ecda782af93e35e5f9601013b90b09ca73) add "forever" method (@thejh) -- [79d4651](https://github.com/mikeal/request/commit/79d46510ddff2e2c12c69f7ae4072ec489e27b0e) remove logging (@thejh) -- [f87cbf6](https://github.com/mikeal/request/commit/f87cbf6ec6fc0fc2869c340114514c887b304a80) retry on ECONNRESET on reused socket (@thejh) -- [1a91675](https://github.com/mikeal/request/commit/1a916757f4ec48b1282fddfa0aaa0fa6a1bf1267) Multipart requests should respect content-type if set; Issue #145 (@apeace) -- [#146](https://github.com/mikeal/request/pull/146) Multipart should respect content-type if previously set (@apeace) -- [#148](https://github.com/mikeal/request/pull/148) Retry Agent (@thejh) -- [70c5b63](https://github.com/mikeal/request/commit/70c5b63aca29a7d1629fa2909ff5b7199bbf0fd1) Publishing new version to npm. (@mikeal) -- [fc0f04b](https://github.com/mikeal/request/commit/fc0f04bab5d6be56a2c19d47d3e8386bd9a0b29e) Fix: timeout on socket, timeout after redirect -- [ef79e59](https://github.com/mikeal/request/commit/ef79e59bbb88ed3e7d4368fe3ca5eee411bda345) Fix: timeout after redirect 2 -- [c32a218](https://github.com/mikeal/request/commit/c32a218da2296e89a269f1832d95b12c4aa10852) merge master (@jroes) -- [d2d9b54](https://github.com/mikeal/request/commit/d2d9b545e5679b829d33deeba0b22f9050fd78b1) add line to docs describing followAllRedirects option (@jroes) -- [#90](https://github.com/mikeal/request/pull/90) add option followAllRedirects to follow post/put redirects (@jroes) -- [c08ab7e](https://github.com/mikeal/request/commit/c08ab7efaefd39c04deb6986716efe5a6069528e) Emit an event after we create the request object so that people can manipulate it before nextTick(). (@mikeal) -- [#162](https://github.com/mikeal/request/pull/162) Fix issue #159 (@dpetukhov) -- [e77a169](https://github.com/mikeal/request/commit/e77a1695c5c632c067857e99274f28a1d74301fe) fixing streaming example. fixes #164 (@mikeal) -- [ee53386](https://github.com/mikeal/request/commit/ee53386d85975c79b801edbb4f5bb7ff4c5dc90b) fixes #127 (@mikeal) -- [e2cd9de](https://github.com/mikeal/request/commit/e2cd9de9a9d10e1aa4cf4e26006bb30fa5086f0b) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [a0ab977](https://github.com/mikeal/request/commit/a0ab9770a8fb89f970bb3783ed4e6dde9e33511b) Added failing test for #125. (@papandreou) -- [c80800a](https://github.com/mikeal/request/commit/c80800a834b0f8bc0fb40d1fad4d4165a83369fd) Fix cookie jar/headers.cookie collision. Closes #125. (@papandreou) -- [1ac9e2d](https://github.com/mikeal/request/commit/1ac9e2d1bf776728a1fe676dd3693ef66f50f7f7) Redirect test: Also assert that the request cookie doesn't get doubled in the request for the landing page. (@papandreou) -- [07bbf33](https://github.com/mikeal/request/commit/07bbf331e2a0d40d261487f6222e8cafee0e50e3) Fixes #150 (@mikeal) -- [c640eed](https://github.com/mikeal/request/commit/c640eed292c06eac3ec89f60031ddf0fc0add732) Cookie jar handling: Don't double the cookies on each redirect (see discussion on #139). (@papandreou) -- [808de8b](https://github.com/mikeal/request/commit/808de8b0ba49d4bb81590ec37a873e6be4d9a416) Adding some missing mime types #138 (@serby) -- [#161](https://github.com/mikeal/request/pull/161) Fix cookie jar/headers.cookie collision (#125) (@papandreou) -- [#168](https://github.com/mikeal/request/pull/168) Picking off an EasyFix by adding some missing mimetypes. (@serby) -- [2a30487](https://github.com/mikeal/request/commit/2a304879f4218c1e46195d882bc81c0f874be329) bugfix - allow add cookie to wrapped request (defaults) (@fabianonunes) -- [a18b4f1](https://github.com/mikeal/request/commit/a18b4f14559f56cf52ca1b421daa6a934d28d51b) Making pipeDest a public prototype method rather than keeping it private. (@mikeal) -- [#170](https://github.com/mikeal/request/pull/170) can't create a cookie in a wrapped request (defaults) (@fabianonunes) -- [49a0f60](https://github.com/mikeal/request/commit/49a0f604779c91dd1759a02cbb195ccbd8d73f5d) Structural refactor, getting read for composable API. (@mikeal) -- [5daa0b2](https://github.com/mikeal/request/commit/5daa0b28b06cf109614f19e76b0e0b9b25ee3baf) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [e4df85c](https://github.com/mikeal/request/commit/e4df85c72221bf09ee7e1eb54f6c881851bd4164) Composable API for OAuth. (@mikeal) -- [945ec40](https://github.com/mikeal/request/commit/945ec40baef968ddd468c3b4dfce01621e4a0e31) Composable form API (@mikeal) -- [c30b47f](https://github.com/mikeal/request/commit/c30b47f229522a75af85da269157377b4a7dc37d) Use this, return this. (@mikeal) -- [e908644](https://github.com/mikeal/request/commit/e908644a69f9107b954f13635736f1e640216aec) Composable multipart API. (@mikeal) -- [e115677](https://github.com/mikeal/request/commit/e115677b1a03576eb96386986c350f211a4f38cd) Composable jar. Guard against overwrites on retry. (@mikeal) -- [a482e48](https://github.com/mikeal/request/commit/a482e4802e11fd122b12e18d1b18b49850fef823) Updating copyright for the new year. (@mikeal) -- [3c6581a](https://github.com/mikeal/request/commit/3c6581a9d4508fe5d75e111ae0fb94c5e0078404) Adding clobber argument for appending to headers. thanks @isaacs (@mikeal) -- [54e6aca](https://github.com/mikeal/request/commit/54e6aca0ab5982621fc9b35500f2154e50c0c95d) Fixes #144. (@mikeal) -- [12f4997](https://github.com/mikeal/request/commit/12f4997ed83bfbfefa3fc5b5635bc9a6829aa0d7) Fixing clobber. (@mikeal) -- [2f34fd1](https://github.com/mikeal/request/commit/2f34fd13b7ec86cb1c67e0a58664b9e060a34a50) Added support for a "query" option value that is a hash of querystring values that is merged (taking precedence over) with the querystring passed in the uri string. (@csainty) -- [a32d9e7](https://github.com/mikeal/request/commit/a32d9e7069533fb727a71730dbaa0f62ebefb731) Added a js based test runner so I can run tests on windows. (@csainty) -- [e0b6ce0](https://github.com/mikeal/request/commit/e0b6ce063de0c4223c97982128bb8203caf4a331) Tidied up an issue where ?> was being appended to URLs. (@csainty) -- [d47150d](https://github.com/mikeal/request/commit/d47150d6748a452df336d8de9743218028a876db) Refactored to match the composable style (@csainty) -- [b7e0929](https://github.com/mikeal/request/commit/b7e0929837873a8132476bb2b4d2e2a0fdc7cd0f) implemented issue #173 allow uri to be first argument (@twilson63) -- [b7264a6](https://github.com/mikeal/request/commit/b7264a6626481d5da50a28c91ea0be7b688c9daf) removed debug line and reset ports (@twilson63) -- [76598c9](https://github.com/mikeal/request/commit/76598c92bee64376e5d431285ac1bf6783140dbb) removed npm-debug (@twilson63) -- [#177](https://github.com/mikeal/request/pull/177) Issue #173 Support uri as first and optional config as second argument (@twilson63) -- [0f24051](https://github.com/mikeal/request/commit/0f240517dea65337636a49cb1cc2b5327504430e) Renamed query to qs. It was actually my first choice, but there appeared to be conflicts with the qs = require('querystring'). These are no longer present though and must have been unrelated. (@csainty) -- [becedaa](https://github.com/mikeal/request/commit/becedaaa7681b0c4ad5c0a9b9922fc950f091af2) Changed test structure to no longer require a server, modeled on the oauth tests. This also lets me revert some of the changes I had to make to the test server and proxy tests (@csainty) -- [9b2bbf0](https://github.com/mikeal/request/commit/9b2bbf0c12e87a59320efac67759041cd4af913f) Modified how the qs function works, it now no longer tweaks the existing request uri, instead it recreates a new one. This allows me to revert all the other changes I had to make previously and gives a nice clean commit that is self contained. (@csainty) -- [5ac7e26](https://github.com/mikeal/request/commit/5ac7e26ce4f7bf5a334df91df83699891171c0ae) failing test for .pipe(dst, opts) (@substack) -- [3b2422e](https://github.com/mikeal/request/commit/3b2422e62fbd6359b841e59a2c1888db71a22c2c) fix for failing pipe opts test (@substack) -- [8788c8b](https://github.com/mikeal/request/commit/8788c8b8cba96662e9d94a96eb04d96b904adea3) added uri param for post, put, head, del shortcuts (@twilson63) -- [#179](https://github.com/mikeal/request/pull/179) fix to add opts in .pipe(stream, opts) (@substack) -- [#180](https://github.com/mikeal/request/pull/180) Modified the post, put, head and del shortcuts to support uri optional param (@twilson63) -- [37d0699](https://github.com/mikeal/request/commit/37d0699eb681e85b7df4896b0a68b6865e596cb3) Fixing end bug i introduced being stupid. (@mikeal) -- [3a97292](https://github.com/mikeal/request/commit/3a97292f45273fa2cc937c0698ba19964780b4bb) fixed defaults functionality to support (uri, options, callback) (@twilson63) -- [#182](https://github.com/mikeal/request/pull/182) Fix request.defaults to support (uri, options, callback) api (@twilson63) -- [c94b200](https://github.com/mikeal/request/commit/c94b200258fa48697e386121a3e114ab7bed2ecf) Switched npm test from the bash script to a node script so that it is cross-platform. (@csainty) -- [#176](https://github.com/mikeal/request/pull/176) Querystring option (@csainty) -- [3b1e609](https://github.com/mikeal/request/commit/3b1e6094451e8d34c93353177de9d76e9a805e43) Adding defaults test back in. (@mikeal) -- [b4ae0c2](https://github.com/mikeal/request/commit/b4ae0c2d50f018a90a3ec8daa1d14c92a99873b9) Fixing idiotic bug I introduced. (@mikeal) -- [32f76c8](https://github.com/mikeal/request/commit/32f76c8baaf784dc2f4f1871153b1796bcebdcfe) Pushed new version to npm. (@mikeal) -- [00d0d9f](https://github.com/mikeal/request/commit/00d0d9f432182f13a5b8aa2e3a2a144b5c179015) Adding accept header to json support. (@mikeal) -- [0f580e6](https://github.com/mikeal/request/commit/0f580e6f6317c5301a52c0b6963d58e27112abca) Add abort support to the returned request (@itay) -- [4505e6d](https://github.com/mikeal/request/commit/4505e6d39a44229bfe5dc4d9a920233e05a7dfdb) Fixing some edge streaming cases with redirects by reusing the Request object. (@mikeal) -- [eed57af](https://github.com/mikeal/request/commit/eed57af8fe3e16632e9e0043d4d7f4d147dbfb8f) Published new version. (@mikeal) -- [97386b5](https://github.com/mikeal/request/commit/97386b5d7315b5c83702ffc7d0b09e34ecb67e04) Fixing pretty bad bug from the composable refactor. (@mikeal) -- [b693ce6](https://github.com/mikeal/request/commit/b693ce64e16aaa859d4edc86f82fbb11e00d33c0) Move abort to a prototype method, don't raise error (@itay) -- [1330eef](https://github.com/mikeal/request/commit/1330eef3ec84a651a435c95cf1ff1a4003086440) Merge branch 'master' of git://github.com/mikeal/request (@itay) -- [#188](https://github.com/mikeal/request/pull/188) Add abort support to the returned request (@itay) -- [5ff4645](https://github.com/mikeal/request/commit/5ff46453e713da1ae66a0d510eda4919e4080abe) Style changes. (@mikeal) -- [2dbd1e4](https://github.com/mikeal/request/commit/2dbd1e4350c2941b795b0e5ee7c0a00cd04cce09) Fixing new params style on master for head request. (@mikeal) -- [14989b2](https://github.com/mikeal/request/commit/14989b2dfc6830dbdad5364930fba1d2995aba06) Pushed new version to npm. (@mikeal) -- [0ea2351](https://github.com/mikeal/request/commit/0ea2351ef017ada9b8472f8d73086715ebe30c6a) Fixes #190. outdated check on options.json from before we had boolean support. (@mikeal) -- [21bf78c](https://github.com/mikeal/request/commit/21bf78c264316f75f4e6c571461521cda6ccf088) Adds a block on DELETE requests in status 300-400 (@goatslacker) -- [0c0c201](https://github.com/mikeal/request/commit/0c0c20139b28b21a860f72b8ce0124046fae421d) Adds tests for GH-119 Fix (@goatslacker) -- [#193](https://github.com/mikeal/request/pull/193) Fixes GH-119 (@goatslacker) -- [5815a69](https://github.com/mikeal/request/commit/5815a697347f20658dc2bdfd0d06e41d0aa0dac4) Fixes #194. setTimeout only works on node 0.6+ (@mikeal) -- [1ddcd60](https://github.com/mikeal/request/commit/1ddcd605bc8936c5b3534e1cf9aa1b29fa2b060b) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [7b35b4f](https://github.com/mikeal/request/commit/7b35b4ff63bbdf133f0f600a88a87b5723d29bdf) Removing old checks for self.req, it's ensured if start() is called. Implementing early pause/resume for when streams try to pause/resume before any data is emitted. Fixes #195. (@mikeal) -- [f01b79b](https://github.com/mikeal/request/commit/f01b79bb651f64065bac8877739223527f5b5592) Make ForeverAgent work with HTTPS (@isaacs) -- [#197](https://github.com/mikeal/request/pull/197) Make ForeverAgent work with HTTPS (@isaacs) -- [8d85b57](https://github.com/mikeal/request/commit/8d85b57ebb81c9d2d0a6b94aed41bf2ab0e3ad09) Forever inherits bugfix (@isaacs) -- [#198](https://github.com/mikeal/request/pull/198) Bugfix on forever usage of util.inherits (@isaacs) -- [37446f5](https://github.com/mikeal/request/commit/37446f54bb21cf9c83ffa81d354d799ae7ecf9ed) Add a test of HTTPS strict with CA checking (@isaacs) -- [8378d2e](https://github.com/mikeal/request/commit/8378d2ef9b8121a9851d21b3f6ec8304bde61c9d) Support tunneling HTTPS requests over proxies (@isaacs) -- [#199](https://github.com/mikeal/request/pull/199) Tunnel (@isaacs) -- [f0052ac](https://github.com/mikeal/request/commit/f0052ac5e6ca9f3f4aa49f6cda6ba15eb5d8b8e6) Published new version to npm. (@mikeal) -- [cea668f](https://github.com/mikeal/request/commit/cea668f6f7d444831313ccc0e0d301d25f2bd421) Adding more explicit error when undefined is passed as uri or options. (@mikeal) -- [047b7b5](https://github.com/mikeal/request/commit/047b7b52f3b11f4c44a02aeb1c3583940ddb59c7) Fix special method functions that get passed an options object. (@mikeal) -- [746de0e](https://github.com/mikeal/request/commit/746de0ef2f564534b29eeb8f296a59bd2c3086a7) pass through Basic authorization option for HTTPS tunneling -- [6fda9d7](https://github.com/mikeal/request/commit/6fda9d7d75e24cc1302995e41e26a91e03fdfc9a) Always clobber internal objects for qs but preserve old querystring args when clobber is present. (@mikeal) -- [75ca7a2](https://github.com/mikeal/request/commit/75ca7a25bc9c6102e87f3660a25835c7fcd70edb) Merge branch 'master' of https://github.com/mikeal/request -- [3b9f0fd](https://github.com/mikeal/request/commit/3b9f0fd3da4ae74de9ec76e7c66c57a7f8641df2) Fix cookies so that attributes are case insensitive -- [fddbd6e](https://github.com/mikeal/request/commit/fddbd6ee7d531bc4a82f629633b9d1637cb039e8) Properly set cookies during redirects -- [0d0bdb7](https://github.com/mikeal/request/commit/0d0bdb793f908492d4086fae8744f1e33e68d8c6) Remove request body when following non-GET redirects -- [#203](https://github.com/mikeal/request/pull/203) Fix cookie and redirect bugs and add auth support for HTTPS tunnel (@milewise) -- [b5fa773](https://github.com/mikeal/request/commit/b5fa773994de1799cf53491db7f5f3ba32825b20) Replace all occurrences of special chars in RFC3986 (@chriso) -- [bc6cd6c](https://github.com/mikeal/request/commit/bc6cd6ca6c6157bad76f0b2b23d4993f389ba977) documenting additional behavior of json option (@jphaas) -- [80e4e43](https://github.com/mikeal/request/commit/80e4e43186de1e9dcfaa1c9a921451560b91267c) Fixes #215. (@mikeal) -- [51f343b](https://github.com/mikeal/request/commit/51f343b9adfc11ec1b2ddcfb52a57e1e13feacb2) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [89c0f1d](https://github.com/mikeal/request/commit/89c0f1dd324bc65ad9c07436fb2c8220de388c42) titlecase authorization for oauth (@visnup) -- [#217](https://github.com/mikeal/request/pull/217) need to use Authorization (titlecase) header with Tumblr OAuth (@visnup) -- [8c163eb](https://github.com/mikeal/request/commit/8c163eb9349459839fc720658979d5c97a955825) Double quotes are optional, and the space after the ; could be required (@janjongboom) -- [#224](https://github.com/mikeal/request/pull/224) Multipart content-type change (@janjongboom) -- [96f4b9b](https://github.com/mikeal/request/commit/96f4b9b1f7b937a92f3f94f10d6d02f8878b6107) Style changes. (@mikeal) -- [b131c64](https://github.com/mikeal/request/commit/b131c64816f621cf15f8c51e76eb105778b4aad8) Adding safe .toJSON method. fixes #167 (@mikeal) -- [05d6e02](https://github.com/mikeal/request/commit/05d6e02c31ec4e6fcfadbfbe5414e701710f6e55) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [74ca9a4](https://github.com/mikeal/request/commit/74ca9a4852b666d30dd71421e8cc8b8a83177148) Unified error and complete handling. Fixes #171 (@mikeal) -- [a86c7dc](https://github.com/mikeal/request/commit/a86c7dc7d0a7c640c7def4c0215e46e76a11ff56) Fixing followAllRedirects and all the redirect tests. (@mikeal) -- [#211](https://github.com/mikeal/request/pull/211) Replace all occurrences of special chars in RFC3986 (@chriso) -- [7e24e8a](https://github.com/mikeal/request/commit/7e24e8a48d0dcfe10d0cc08b3c4e9627b9a95a97) New version on npm, first 3.0 release candidate. (@mikeal) -- [22e0f0d](https://github.com/mikeal/request/commit/22e0f0d73459c11b81b0f66a2cde85492dd8e38f) Added test for .toJSON() (@mikeal) -- [df32746](https://github.com/mikeal/request/commit/df32746f157948b6ae05e87a35cf1768e065ef0b) Adding toJSON to npm test. (@mikeal) -- [e65bfba](https://github.com/mikeal/request/commit/e65bfba98f0886a059a268dcdceabf41aec1e5cc) New version in npm. (@mikeal) -- [2b95921](https://github.com/mikeal/request/commit/2b959217151aaff7a6e7cc15e2acfccd1bbb9b85) Fixing defaults when url is passed instead of uri. (@mikeal) -- [e0534d8](https://github.com/mikeal/request/commit/e0534d860b4931a7a6e645b328fd4418a5433057) Pushed new version to npm. (@mikeal) -- [d2dc835](https://github.com/mikeal/request/commit/d2dc83538379e9e1fafb94f5698c56b4a5318d8d) don't error when null is passed for options (@polotek) -- [db80bf0](https://github.com/mikeal/request/commit/db80bf0444bd98c45f635f305154b9da20eed328) expose initParams (@polotek) -- [8cf019c](https://github.com/mikeal/request/commit/8cf019c9f9f719694408840823e92da08ab9dac3) allow request.defaults to override the main request method (@polotek) -- [#240](https://github.com/mikeal/request/pull/240) don't error when null is passed for options (@polotek) -- [69d017d](https://github.com/mikeal/request/commit/69d017de57622429f123235cc5855f36b3e18d1c) added dynamic boundary for multipart requests (@zephrax) -- [fc13e18](https://github.com/mikeal/request/commit/fc13e185f5e28a280d347e61622ba708e1cd7bbc) added dynamic boundary for multipart requests (@zephrax) -- [#243](https://github.com/mikeal/request/pull/243) Dynamic boundary (@zephrax) -- [1764176](https://github.com/mikeal/request/commit/176417698a84c53c0a69bdfd2a05a2942919816c) Fixing the set-cookie header (@jeromegn) -- [#246](https://github.com/mikeal/request/pull/246) Fixing the set-cookie header (@jeromegn) -- [6f9da89](https://github.com/mikeal/request/commit/6f9da89348b848479c23192c04b3c0ddd5a4c8bc) do not set content-length header to 0 when self.method is GET or self.method is undefined (@sethbridges) -- [efc0ea4](https://github.com/mikeal/request/commit/efc0ea44d63372a30011822ad9d37bd3d7b85952) Experimental AWS signing. Signing code from knox. (@mikeal) -- [4c08a1c](https://github.com/mikeal/request/commit/4c08a1c10bc0ebb679e212ad87419f6c4cc341eb) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [fdb10eb](https://github.com/mikeal/request/commit/fdb10eb493110b8e6e4f679524f38cef946e3f08) Adding support for aws in options. (@mikeal) -- [dac6a30](https://github.com/mikeal/request/commit/dac6a301ae03207af88fae6f5017e82157b79b41) Fixing upgraded stat size and supporting content-type and content-md5 properly. (@mikeal) -- [98cb503](https://github.com/mikeal/request/commit/98cb50325e1d7789fd9f44523d2315df5f890d10) Allow body === '' /* the empty string */. (@Filirom1) -- [0e9ac12](https://github.com/mikeal/request/commit/0e9ac12c69aaca370fbca94b41358e1c3a2f6170) fixed just another global leak of i (@sreuter) -- [#260](https://github.com/mikeal/request/pull/260) fixed just another leak of 'i' (@sreuter) -- [#255](https://github.com/mikeal/request/pull/255) multipart allow body === '' ( the empty string ) (@Filirom1) -- [#249](https://github.com/mikeal/request/pull/249) Fix for the fix of your (closed) issue #89 where self.headers[content-length] is set to 0 for all methods (@sethbridges) -- [adc9ab1](https://github.com/mikeal/request/commit/adc9ab1f563f3cb4681ac8241fcc75e6099efde2) style changes. making @rwaldron cry (@mikeal) -- [155e6ee](https://github.com/mikeal/request/commit/155e6ee270924d5698d3fea37cefc1926cbaf998) Fixed `pool: false` to not use the global agent (@timshadel) -- [1232a8e](https://github.com/mikeal/request/commit/1232a8e46752619d4d4b51d558e6725faf7bf3aa) JSON test should check for equality (@timshadel) -- [#261](https://github.com/mikeal/request/pull/261) Setting 'pool' to 'false' does NOT disable Agent pooling (@timshadel) -- [#262](https://github.com/mikeal/request/pull/262) JSON test should check for equality (@timshadel) -- [914a723](https://github.com/mikeal/request/commit/914a72300702a78a08263fe98a43d25e25713a70) consumer_key and token_secret need to be encoded for OAuth v1 (@nanodocumet) -- [500e790](https://github.com/mikeal/request/commit/500e790f8773f245ff43dd9c14ec3d5c92fe0b9e) Fix uncontrolled crash when "this.uri" is an invalid URI (@naholyr) -- [#265](https://github.com/mikeal/request/pull/265) uncaughtException when redirected to invalid URI (@naholyr) -- [#263](https://github.com/mikeal/request/pull/263) Bug in OAuth key generation for sha1 (@nanodocumet) -- [f4b87cf](https://github.com/mikeal/request/commit/f4b87cf439453b3ca1d63e85b3aeb3373ee1f17e) I'm not OCD seriously (@TehShrike) -- [#268](https://github.com/mikeal/request/pull/268) I'm not OCD seriously (@TehShrike) -- [fcab7f1](https://github.com/mikeal/request/commit/fcab7f1953cd6fb141a7d98f60580c50b59fb73f) Adding a line break to the preamble as the first part of a multipart was not recognized by a server I was communicating with. (@proksoup) -- [661b62e](https://github.com/mikeal/request/commit/661b62e5319bf0143312404f1fc81c895c46f6e6) Commenting out failing post test. Need to figure out a way to test this now that the default is to use a UUID for the frontier. (@mikeal) -- [7165c86](https://github.com/mikeal/request/commit/7165c867fa5dea4dcb0aab74d2bf8ab5541e3f1b) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [5a7ca9b](https://github.com/mikeal/request/commit/5a7ca9b398c1300c08a28fb7f266054c3ce8c57a) Added drain event and returning the boolean from write to proper handle back pressure when piping. (@mafintosh) -- [#273](https://github.com/mikeal/request/pull/273) Pipe back pressure issue (@mafintosh) -- [f8ae8d1](https://github.com/mikeal/request/commit/f8ae8d18627e4743996d8600f77f4e4c05a2a590) New version in npm. (@mikeal) -- [7ff5dae](https://github.com/mikeal/request/commit/7ff5daef152bcfac5b02e661e5476a57b9693489) Merge remote-tracking branch 'upstream/master' (@proksoup) -- [1f34700](https://github.com/mikeal/request/commit/1f34700e5614ea2a2d78b80dd467c002c3e91cb3) fix tests with boundary by injecting boundry from header (@benatkin) -- [ee2b2c2](https://github.com/mikeal/request/commit/ee2b2c2f7a8625fde4d71d79e19cdc5d98f09955) Like in [node.js](https://github.com/joyent/node/blob/master/lib/net.js#L52) print logs if NODE_DEBUG contains the word request (@Filirom1) -- [#279](https://github.com/mikeal/request/pull/279) fix tests with boundary by injecting boundry from header (@benatkin) -- [3daebaf](https://github.com/mikeal/request/commit/3daebaf2551c8d0df7dac1ebff0af4fe08608768) Merge branch 'master' of https://github.com/mikeal/request (@proksoup) -- [dba2ebf](https://github.com/mikeal/request/commit/dba2ebf09552258f37b60122c19b236064b0d216) Updating with corresponding tests. (@proksoup) -- [396531d](https://github.com/mikeal/request/commit/396531d083c94bc807a25f7c3a50a0c92a00c5f7) Removing console.log of multipart (@proksoup) -- [54226a3](https://github.com/mikeal/request/commit/54226a38816b4169e0a7a5d8b1a7feba78235fec) Okay, trying it as an optional parameter, with a new test in test-body.js to verify (@proksoup) -- [23ae7d5](https://github.com/mikeal/request/commit/23ae7d576cc63d645eecf057112b71d6cb73e7b1) Remove non-"oauth_" parameters from being added into the OAuth Authorization header (@jplock) -- [8b82ef4](https://github.com/mikeal/request/commit/8b82ef4ff0b50b0c8dcfb830f62466fa30662666) Removing guard, there are some cases where this is valid. (@mikeal) -- [82440f7](https://github.com/mikeal/request/commit/82440f76f22a5fca856735af66e2dc3fcf240c0d) Adding back in guard for _started, need to keep some measure of safety but we should defer this restriction for as long as possible. (@mikeal) -- [#282](https://github.com/mikeal/request/pull/282) OAuth Authorization header contains non-"oauth_" parameters (@jplock) -- [087be3e](https://github.com/mikeal/request/commit/087be3ebbada53699d14839374f1679f63f3138f) Remove stray `console.log()` call in multipart generator. (@bcherry) -- [0a8a5ab](https://github.com/mikeal/request/commit/0a8a5ab6a08eaeffd45ef4e028be2259d61bb0ee) Merge remote-tracking branch 'upstream/master' (@proksoup) -- [#241](https://github.com/mikeal/request/pull/241) Composability updates suggested by issue #239 (@polotek) -- [#284](https://github.com/mikeal/request/pull/284) Remove stray `console.log()` call in multipart generator. (@bcherry) -- [8344666](https://github.com/mikeal/request/commit/8344666f682a302c914cce7ae9cea8de054f9240) Fix #206 Change HTTP/HTTPS agent when redirecting between protocols (@isaacs) -- [#272](https://github.com/mikeal/request/pull/272) Boundary begins with CRLF? (@proksoup) -- [#214](https://github.com/mikeal/request/pull/214) documenting additional behavior of json option (@jphaas) -- [#207](https://github.com/mikeal/request/pull/207) Fix #206 Change HTTP/HTTPS agent when redirecting between protocols (@isaacs) -- [9cadd61](https://github.com/mikeal/request/commit/9cadd61d989e85715ea07da8770a3077db41cca3) Allow parser errors to bubble up to request (@mscdex) -- [6a00fea](https://github.com/mikeal/request/commit/6a00fea09eed99257c0aec2bb66fbf109b0f573a) Only add socket error handler callback once (@mscdex) -- [975ea90](https://github.com/mikeal/request/commit/975ea90bed9503c67055b20e36baf4bcba54a052) Fix style (@mscdex) -- [205dfd2](https://github.com/mikeal/request/commit/205dfd2e21c13407d89d3ed92dc2b44b987d962b) Use .once() when listening for parser error (@mscdex) -- [ff9b564](https://github.com/mikeal/request/commit/ff9b5643d6b5679a9e7d7997ec6275dac10b000e) Add a space after if (@Filirom1) -- [#280](https://github.com/mikeal/request/pull/280) Like in node.js print options if NODE_DEBUG contains the word request (@Filirom1) -- [d38e57b](https://github.com/mikeal/request/commit/d38e57bbb3d827aa87427f2130aa5a5a3a973161) Test for #289 (@isaacs) -- [820af58](https://github.com/mikeal/request/commit/820af5839f2a193d091d98f23fd588bd919e3e58) A test of POST redirect following with 303 status (@isaacs) -- [7adc5a2](https://github.com/mikeal/request/commit/7adc5a21869bc92cc3b5e84d32c585952c8e5e87) Use self.encoding when calling Buffer.toString() (@isaacs) -- [#290](https://github.com/mikeal/request/pull/290) A test for #289 (@isaacs) -- [#293](https://github.com/mikeal/request/pull/293) Allow parser errors to bubble up to request (@mscdex) -- [ed68b8d](https://github.com/mikeal/request/commit/ed68b8dd024561e9d47d80df255fb79d783c13a7) Updated the twitter oauth dance. The comments weren't clear. Also removed token_key. No longer needed with twitter oauth. (@joemccann) -- [6bc19cd](https://github.com/mikeal/request/commit/6bc19cda351b59f8e45405499a100abd0b456e42) Forgot to remove token_secret; no longer needed for twitter. (@joemccann) -- [1f21b17](https://github.com/mikeal/request/commit/1f21b17fc4ff3a7011b23e3c9261d66effa3aa40) Adding form-data support. (@mikeal) -- [827e950](https://github.com/mikeal/request/commit/827e950500746eb9d3a3fa6f174416b194c9dedf) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [b211200](https://github.com/mikeal/request/commit/b2112009a31fc7f9122970d392750f62b6e77111) Test fixes for relative import. Adding to run all (@mikeal) -- [1268195](https://github.com/mikeal/request/commit/1268195b75bd5bb3954b4c4f2d9feb80a97994d1) Bundling mime module rather than keep around our own mime-map. (@mikeal) -- [4f51cec](https://github.com/mikeal/request/commit/4f51cecdc363946b957585c3deccfd8c37e19aa0) Docs for the form API, pumping version. (@mikeal) -- [90245d7](https://github.com/mikeal/request/commit/90245d7199215d7b195cf7e36b203ca0bd0a6bd3) Doc fixes. (@mikeal) -- [d98ef41](https://github.com/mikeal/request/commit/d98ef411c560bd1168f242c524a378914ff8eac4) Pushed new version to npm. (@mikeal) -- [3e11937](https://github.com/mikeal/request/commit/3e119375acda2da225afdb1596f6346dbd551fba) Pass servername to tunneling secure socket creation (@isaacs) -- [7725b23](https://github.com/mikeal/request/commit/7725b235fdec8889c0c91d55c99992dc683e2e22) Declare dependencies more sanely (@isaacs) -- [#317](https://github.com/mikeal/request/pull/317) Workaround for #313 (@isaacs) -- [#318](https://github.com/mikeal/request/pull/318) Pass servername to tunneling secure socket creation (@isaacs) -- [0c470bc](https://github.com/mikeal/request/commit/0c470bccf1ec097ae600b6116e6244cb624dc00e) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [0d98e5b](https://github.com/mikeal/request/commit/0d98e5b7ea6bd9c4f21535d3682bbed2f2e05df4) Pushed new version to npm. (@mikeal) -- [64a4448](https://github.com/mikeal/request/commit/64a44488ac8c792a1f548f305fc5c61efe0d77fb) when setting defaults, the wrapper adds the jar method assuming it has the same signature as get, meaning undefined is passed into initParams, which subsequently fails. now passing jar function directly as it has no need of defaults anyway seeing as it only creates a new cookie jar (@StuartHarris) -- [48c9881](https://github.com/mikeal/request/commit/48c988118bda4691fffbfcf30d5a39b6c1438736) Added test to illustrate #321 (@alexindigo) -- [8ce0f2a](https://github.com/mikeal/request/commit/8ce0f2a3b6929cd0f7998e00d850eaf5401afdb7) Added *src* stream removal on redirect. #321 (@alexindigo) -- [c32f0bb](https://github.com/mikeal/request/commit/c32f0bb9feaa71917843856c23b4aae99f78ad4d) Do not try to remove listener from an undefined connection (@strk) -- [#326](https://github.com/mikeal/request/pull/326) Do not try to remove listener from an undefined connection (@CartoDB) -- [#322](https://github.com/mikeal/request/pull/322) Fix + test for piped into request bumped into redirect. #321 (@alexindigo) -- [85b6a63](https://github.com/mikeal/request/commit/85b6a632ac7d3456485fbf931043f10f5f6344a5) New version in npm. (@mikeal) -- [f462bd3](https://github.com/mikeal/request/commit/f462bd3fa421fa5e5ca6c91852333db90297b80e) Rolling trunk version. (@mikeal) -- [8a82c5b](https://github.com/mikeal/request/commit/8a82c5b0990cc58fa4cb7f81814d13ba7ae35453) Adding url to redirect error for better debugging. (@mikeal) -- [013c986](https://github.com/mikeal/request/commit/013c986d0a8b5b2811cd06dd3733f4a3d37df1cc) Better debugging of max redirect errors. (@mikeal) -- [#320](https://github.com/mikeal/request/pull/320) request.defaults() doesn't need to wrap jar() (@redbadger) -- [4797f88](https://github.com/mikeal/request/commit/4797f88b42c3cf8680cbde09bf473678a5707aed) Fix #296 - Only set Content-Type if body exists (@Marsup) -- [f6bcf3e](https://github.com/mikeal/request/commit/f6bcf3eb51982180e813c69cccb942734f815ffe) fixup aws function to work in more situations (@nlf) -- [ba6c88a](https://github.com/mikeal/request/commit/ba6c88af5e771c2a0e007e6166e037a149561e09) added short blurb on using aws (@nlf) -- [#343](https://github.com/mikeal/request/pull/343) Allow AWS to work in more situations, added a note in the README on its usage (@nathan-lafreniere) -- [288c52a](https://github.com/mikeal/request/commit/288c52a2a1579164500c26136552827112801ff1) switch to a case insensitive getter when fetching headers for aws auth signing (@nlf) -- [#332](https://github.com/mikeal/request/pull/332) Fix #296 - Only set Content-Type if body exists (@Marsup) -- [7a16286](https://github.com/mikeal/request/commit/7a162868de65b6de15e00c1f707b5e0f292c5f86) Emit errors for anything in init so that it is catchable in a redirect. (@mikeal) -- [d288d21](https://github.com/mikeal/request/commit/d288d21d709fa81067f5af53737dfde06f842262) fix bug (@azylman) -- [#355](https://github.com/mikeal/request/pull/355) stop sending erroneous headers on redirected requests (@azylman) -- [b0b97f5](https://github.com/mikeal/request/commit/b0b97f53a9e94f3aeaa05e2cda5b820668f6e3b2) delete _form along with everything else on a redirect (@jgautier) -- [#360](https://github.com/mikeal/request/pull/360) Delete self._form along with everything else on redirect (@jgautier) -- [61e3850](https://github.com/mikeal/request/commit/61e3850f0f91ca6732fbd06b46796fbcd2fea1ad) Made it so that if we pass in Content-Length or content-length in the headers, don't make a new version (@danjenkins) -- [#361](https://github.com/mikeal/request/pull/361) Don't create a Content-Length header if we already have it set (@danjenkins) -- [590452d](https://github.com/mikeal/request/commit/590452d6569e68e480d4f40b88022f1b81914ad6) inside oauth.hmacsign: running rfc3986 on base_uri instead of just encodeURIComponent. -- [#362](https://github.com/mikeal/request/pull/362) Running `rfc3986` on `base_uri` in `oauth.hmacsign` instead of just `encodeURIComponent` (@jeffmarshall) -- [f7dc90c](https://github.com/mikeal/request/commit/f7dc90c8dae743d5736dc6c807eecde613eb4fd4) Revert "Merge pull request #362 from jeffmarshall/master" (@mikeal) -- [d631a26](https://github.com/mikeal/request/commit/d631a26e263077eca3d4925de9b0a8d57365ba90) reintroducing the WTF escape + encoding, also fixing a typo. -- [#363](https://github.com/mikeal/request/pull/363) rfc3986 on base_uri, now passes tests (@jeffmarshall) -- [bfe2791](https://github.com/mikeal/request/commit/bfe2791f596b749eed6961159d41a404c3aba0d0) oauth fix. (@mikeal) -- [#344](https://github.com/mikeal/request/pull/344) Make AWS auth signing find headers correctly (@nathan-lafreniere) -- [e863f25](https://github.com/mikeal/request/commit/e863f25336abc7b9f9936c20e0c06da8db0c6593) style change. (@mikeal) -- [3e5a87c](https://github.com/mikeal/request/commit/3e5a87ce28b3bb45861b32f283cd20d0084d78a7) Don't remove x_auth_type for Twitter reverse auth (@drudge) -- [#369](https://github.com/mikeal/request/pull/369) Don't remove x_auth_mode for Twitter reverse auth (@drudge) -- [25d4667](https://github.com/mikeal/request/commit/25d466773c43949e2eea4236ffc62841757fd1f0) x_auth_mode not x_auth_type (@drudge) -- [#370](https://github.com/mikeal/request/pull/370) Twitter reverse auth uses x_auth_mode not x_auth_type (@drudge) -- [cadf4dc](https://github.com/mikeal/request/commit/cadf4dc54f4ee3fae821f6beb1ea6443e528bf6f) massive style commit. (@mikeal) -- [33453a5](https://github.com/mikeal/request/commit/33453a53bc37e4499853b9d929b3603cdf7a31cd) New version in npm. (@mikeal) -- [b638185](https://github.com/mikeal/request/commit/b6381854006470af1d0607f636992c7247b6720f) Setting master version. (@mikeal) -- [8014d2a](https://github.com/mikeal/request/commit/8014d2a5b797f07cf56d2f39a346031436e1b064) correct Host header for proxy tunnel CONNECT (@ypocat) -- [#374](https://github.com/mikeal/request/pull/374) Correct Host header for proxy tunnel CONNECT (@ypocat) -- [8c3e9cb](https://github.com/mikeal/request/commit/8c3e9cb529767cff5e7206e2e76531183085b42a) If one of the request parameters is called "timestamp", the "oauth_timestamp" OAuth parameter will get removed during the parameter cleanup loop. (@jplock) -- [#375](https://github.com/mikeal/request/pull/375) Fix for missing oauth_timestamp parameter (@jplock) -- [69e6dc5](https://github.com/mikeal/request/commit/69e6dc5c80e67bbd7d135c3ceb657a1b2df58763) Fixed headers piping on redirects (@kapetan) -- [#376](https://github.com/mikeal/request/pull/376) Headers lost on redirect (@kapetan) -- [62dbbf3](https://github.com/mikeal/request/commit/62dbbf3d77b0851ba424d4f09d1d0c0be91c1f2d) Resolving the Invalid signature when using "qs" (@landeiro) -- [d4cf4f9](https://github.com/mikeal/request/commit/d4cf4f98e11f9a85b6bdfd0481c85c8ac34061ce) fixes missing host header on retried request when using forever agent -- [#380](https://github.com/mikeal/request/pull/380) Fixes missing host header on retried request when using forever agent (@mac-) -- [#381](https://github.com/mikeal/request/pull/381) Resolving "Invalid signature. Expected signature base string: " (@landeiro) -- [ea2f975](https://github.com/mikeal/request/commit/ea2f975ae83efe956b77cbcd0fd9ad42c0d5192f) Ensure that uuid is treated as a property name, not an index. (@othiym23) -- [#388](https://github.com/mikeal/request/pull/388) Ensure "safe" toJSON doesn't break EventEmitters (@othiym23) -- [11a3bc0](https://github.com/mikeal/request/commit/11a3bc0ea3063f6f0071248e03c8595bfa9fd046) Add more reporting to tests (@mmalecki) -- [#398](https://github.com/mikeal/request/pull/398) Add more reporting to tests (@mmalecki) -- [b85bf63](https://github.com/mikeal/request/commit/b85bf633fe8197dc38855f10016a0a76a8ab600a) Optimize environment lookup to happen once only (@mmalecki) -- [#403](https://github.com/mikeal/request/pull/403) Optimize environment lookup to happen once only (@mmalecki) -- [dbb9a20](https://github.com/mikeal/request/commit/dbb9a205fafd7bf5a05d2dbe7eb2c6833b4387dc) renaming tests/googledoodle.png to match it's actual image type of jpeg (@nfriedly) -- [e2d7d4f](https://github.com/mikeal/request/commit/e2d7d4fd35869354ba14a333a4b4989b648e1971) Add more auth options, including digest support (@nylen) -- [d0d536c](https://github.com/mikeal/request/commit/d0d536c1e5a9a342694ffa5f14ef8fbe8dcfa8bd) Add tests for basic and digest auth (@nylen) -- [85fd359](https://github.com/mikeal/request/commit/85fd359890646ef9f55cc6e5c6a32e74f4fbb786) Document new auth options (@nylen) -- [#338](https://github.com/mikeal/request/pull/338) Add more auth options, including digest support (@nylen) -- [fd2e2fa](https://github.com/mikeal/request/commit/fd2e2fa1e6d580cbc34afd3ae1200682cecb3cf9) Fixed a typo. (@jerem) -- [#415](https://github.com/mikeal/request/pull/415) Fixed a typo. (@jerem) -- [53c1508](https://github.com/mikeal/request/commit/53c1508c9c6a58f7d846de82cad36402497a4a4f) Fix for #417 (@mikeal) -- [b23f985](https://github.com/mikeal/request/commit/b23f985e02da4a96f1369541a128c4204a355666) Fixing merge conflict. (@mikeal) -- [28e8be5](https://github.com/mikeal/request/commit/28e8be5175793ac99236df88e26c0139a143e32d) Lost a forever fix in the previous merge. Fixing. (@mikeal) -- [e4d1e25](https://github.com/mikeal/request/commit/e4d1e25c1648ef91f6baf1ef407c712509af4b66) Copy options before adding callback. (@nrn) -- [22bc67d](https://github.com/mikeal/request/commit/22bc67d7ac739e9c9f74c026f875a0a7c686e29d) Respect specified {Host,host} headers, not just {host} (@andrewschaaf) -- [#430](https://github.com/mikeal/request/pull/430) Respect specified {Host,host} headers, not just {host} (@andrewschaaf) -- [6b11acf](https://github.com/mikeal/request/commit/6b11acf3e29fb84daef4e940314cae5ac2e580c6) Updating form-data. (@mikeal) -- [d195845](https://github.com/mikeal/request/commit/d195845c3e1de42c9aee752eec8efa4dda87ec74) Updating mime (@mikeal) -- [20ba1d6](https://github.com/mikeal/request/commit/20ba1d6d38191aa7545b927a7262a18c5c63575b) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [0150d9f](https://github.com/mikeal/request/commit/0150d9fa13e51d99880013b9ec29343850b40c2f) Consider `options.rejectUnauthorized` when pooling https agents (@mmalecki) -- [3e07b6d](https://github.com/mikeal/request/commit/3e07b6d4b81037d0e6e595670db483708ffa8698) Use `rejectUnauthorized: false` in tests (@mmalecki) -- [3995878](https://github.com/mikeal/request/commit/3995878d9fff18a8707f27ffeb4ed6401086adce) Support `key` and `cert` options (@mmalecki) -- [#433](https://github.com/mikeal/request/pull/433) Added support for HTTPS cert & key (@indexzero) -- [8b0f4e8](https://github.com/mikeal/request/commit/8b0f4e8fba33d578a891218201d87e3316ea9844) Released 2.14.0 (@mikeal) -- [54172c6](https://github.com/mikeal/request/commit/54172c68cab8360372e1e64e3fa14902662950bd) Rolling master version. (@mikeal) -- [aa4a285](https://github.com/mikeal/request/commit/aa4a28586354901b0c9b298a0aa79abb5ed175af) Add patch convenience method. (@mloar) -- [66501b9](https://github.com/mikeal/request/commit/66501b9872abc9a2065430cd5ed4a34dd45c8bee) protect against double callback (@spollack) -- [#444](https://github.com/mikeal/request/pull/444) protect against double callbacks on error path (@spollack) -- [#448](https://github.com/mikeal/request/pull/448) Convenience method for PATCH (@mloar) -- [6f0f8c5](https://github.com/mikeal/request/commit/6f0f8c5ee2b2fdc7118804664c2215fe9cb5a2f2) No longer doing bundle dependencies (@mikeal) -- [3997f98](https://github.com/mikeal/request/commit/3997f980722241c18454a00aeeda07d701c27a8f) No longer using bundle dependencies (@mikeal) -- [cba36ce](https://github.com/mikeal/request/commit/cba36ce64e68bd26e230b65f81256776ac66e686) Adding hawk signing to request. (@mikeal) -- [c7a8be6](https://github.com/mikeal/request/commit/c7a8be6d174eff05a9cb2fda987979e475d8543f) Fixing bug in empty options. (@mikeal) -- [67d753f](https://github.com/mikeal/request/commit/67d753fec99fa1f5a3b35ec0bbbc98896418d86c) node-uuid is much better. (@mikeal) -- [337718b](https://github.com/mikeal/request/commit/337718baa08cafb3e706d275fd7344a3c92363bb) Smarter test runner. (@mikeal) -- [bcc33ac](https://github.com/mikeal/request/commit/bcc33aca57baf6fe2a81fbf5983048c9220c71b1) Moved the cookie jar in to it's own module. (@mikeal) -- [3261be4](https://github.com/mikeal/request/commit/3261be4b5d6f45f62b9f50bec18af770cbb70957) Put aws signing in its own package. (@mikeal) -- [fbed723](https://github.com/mikeal/request/commit/fbed7234d7b532813105efdc4c54777396a6773b) OAuth signing is now in its own library. (@mikeal) -- [ef5ab90](https://github.com/mikeal/request/commit/ef5ab90277fb00d0e8eb1c565b0f6ef8c52601d3) Forever agent is now it's own package. (@mikeal) -- [ca1ed81](https://github.com/mikeal/request/commit/ca1ed813c62c7493dc77108b3efc907cc36930cb) tunneling agent is now it's own library. (@mikeal) -- [5c75621](https://github.com/mikeal/request/commit/5c75621ba5cea18bcf114117112121d361e5f3c9) Moving from main.js to index. cause it's not 2010 anymore. (@mikeal) -- [#413](https://github.com/mikeal/request/pull/413) rename googledoodle.png to .jpg (@nfriedly) -- [b4c4c28](https://github.com/mikeal/request/commit/b4c4c28424d906cd96a2131010b21d7facf8b666) Merge branch 'master' of github.com:mikeal/request (@nrn) -- [#310](https://github.com/mikeal/request/pull/310) Twitter Oauth Stuff Out of Date; Now Updated (@joemccann) -- [8b0e7e8](https://github.com/mikeal/request/commit/8b0e7e8c9d196d7286d1563aa54affcc4c8b0e1d) Comment to explain init() and start(). (@mikeal) -- [43d578d](https://github.com/mikeal/request/commit/43d578dc0206388eeae9584f540d550a06308fc8) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [b7c5ed4](https://github.com/mikeal/request/commit/b7c5ed48b618f71f138f9f08f8d705336f907e01) destroy the response if present when destroying the request (@mafintosh) -- [b279277](https://github.com/mikeal/request/commit/b279277dc2fb4b649640322980315d74db0d13f3) response.abort should be response.destroy (@mafintosh) -- [#454](https://github.com/mikeal/request/pull/454) Destroy the response if present when destroying the request (clean merge) (@mafintosh) -- [#429](https://github.com/mikeal/request/pull/429) Copy options before adding callback. (@nrn) -- [e0e0fb4](https://github.com/mikeal/request/commit/e0e0fb451f17945a02203639e4836aa327b4e30b) hawk 0.9.0 (@hueniverse) -- [#456](https://github.com/mikeal/request/pull/456) hawk 0.9.0 (@hueniverse) -- [2f60bc2](https://github.com/mikeal/request/commit/2f60bc253ff6e28df58a33da24b710b6d506849f) Fixes #453 (@mikeal) -- [805b6e4](https://github.com/mikeal/request/commit/805b6e4fe3afeeb407b4fca2e34e9caabe30f747) Fixing hawk README to match new usage. (@mikeal) -- [8feb957](https://github.com/mikeal/request/commit/8feb957911083bce552d1898b7ffcaa87104cd21) Removing old logref code. (@mikeal) -- [fcf6d67](https://github.com/mikeal/request/commit/fcf6d6765247a2645a233d95468ade2960294074) Safe stringify. (@mikeal) -- [62455bc](https://github.com/mikeal/request/commit/62455bca81e8760f25a2bf1dec2b06c8e915de79) hawk 0.10 (@hueniverse) -- [c361b41](https://github.com/mikeal/request/commit/c361b4140e7e6e4fe2a8f039951b65d54af65f42) hawk 0.10 (@hueniverse) -- [fa1ef30](https://github.com/mikeal/request/commit/fa1ef30dcdac83b271ce38c71975df0ed96b08f7) Strip the UTF8 BOM from a UTF encoded response (@kppullin) -- [9d636c0](https://github.com/mikeal/request/commit/9d636c0b3e882742e15ba989d0c2413f95364680) if query params are empty, then request path shouldn't end with a '?' (@jaipandya) -- [#462](https://github.com/mikeal/request/pull/462) if query params are empty, then request path shouldn't end with a '?' (merges cleanly now) (@jaipandya) -- [#460](https://github.com/mikeal/request/pull/460) hawk 0.10.0 (@hueniverse) -- [#461](https://github.com/mikeal/request/pull/461) Strip the UTF8 BOM from a UTF encoded response (@kppullin) -- [6d29ed7](https://github.com/mikeal/request/commit/6d29ed72e34f3b2b6d8a5cfadd96dd26b3dd246d) Moving response handlers to onResponse. (@mikeal) -- [885d6eb](https://github.com/mikeal/request/commit/885d6ebeb6130c2ab7624304f4a01a898573390b) Using querystring library from visionmedia (@kbackowski) -- [#471](https://github.com/mikeal/request/pull/471) Using querystring library from visionmedia (@kbackowski) -- [346bb42](https://github.com/mikeal/request/commit/346bb42898c5804576d9e9b3adf40123260bf73b) On strictSSL set rejectUnauthorized. (@mikeal) -- [8a45365](https://github.com/mikeal/request/commit/8a453656a705d2fa98fbf9092b1600d2ddadbb5a) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [32cfd3c](https://github.com/mikeal/request/commit/32cfd3cf7b3f23c2b1d36c5ccb475cbb3a4693ff) Style changes. (@mikeal) -- [ec07ee2](https://github.com/mikeal/request/commit/ec07ee2d3eeb90b6d0ad9f6d7f3a36da72276841) Print debug logs NODE_DEBUG=request in environment (@isaacs) -- [681af64](https://github.com/mikeal/request/commit/681af644a2ebccad8bcccb75984f7f10f909b382) Flow data in v0.10-style streams (@isaacs) -- [#473](https://github.com/mikeal/request/pull/473) V0.10 compat (@isaacs) -- [f07a8ba](https://github.com/mikeal/request/commit/f07a8baebf7001addbc0f7d7c869adddc21768ce) Release. (@mikeal) -- [1f947a1](https://github.com/mikeal/request/commit/1f947a1d2728147fbf4f57aa361d0bedcebfc206) Rolling master version. (@mikeal) -- [7a217bb](https://github.com/mikeal/request/commit/7a217bbdced9a05a786fe6534ab52734df342d3e) Reinstate querystring for `unescape` (@shimaore) -- [b0b4ca9](https://github.com/mikeal/request/commit/b0b4ca913e119337e9313a157eee2f08f77ddc38) Test for `unescape` (@shimaore) -- [#475](https://github.com/mikeal/request/pull/475) Use `unescape` from `querystring` (@shimaore) -- [28fc741](https://github.com/mikeal/request/commit/28fc741fa958a9783031189964ef6f6d7e3f3264) Release. (@mikeal) -- [d3e28ef](https://github.com/mikeal/request/commit/d3e28ef7144da4d9f22f8fb475bd5aa6a80fb947) Rolling master version. (@mikeal) -- [8f8bb9e](https://github.com/mikeal/request/commit/8f8bb9ee8c4dcd9eb815249fbe2a7cf54f61b56f) Changing so if Accept header is explicitly set, sending json does not overwrite. (@RoryH) -- [#479](https://github.com/mikeal/request/pull/479) Changing so if Accept header is explicitly set, sending json does not ov... (@RoryH) -- [7694372](https://github.com/mikeal/request/commit/7694372f3dc9d57ac29ca7ee5c00146aa5e1e747) Proper version for latest. (@mikeal) -- [aa208cf](https://github.com/mikeal/request/commit/aa208cf5c682262529d749f592db147182cacfaf) 0.8+ only now (@mikeal) -- [16b5ab9](https://github.com/mikeal/request/commit/16b5ab9151823067b05b382241483ef10811c3e1) Upgrading qs. (@mikeal) -- [7d10c1e](https://github.com/mikeal/request/commit/7d10c1e83b4663f592c773e7fece83435585a06f) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [b8ca4b4](https://github.com/mikeal/request/commit/b8ca4b474b8215cab44ef8ef789303571b3d016f) pumping hawk version. (@mikeal) -- [9c0e484](https://github.com/mikeal/request/commit/9c0e48430e3a9de8715e77c07c98301399eaf6e3) release (@mikeal) -- [a9f1896](https://github.com/mikeal/request/commit/a9f189697e2a813bee9bff31de32a25e99e55cf2) rolling master version. (@mikeal) -- [560a1f8](https://github.com/mikeal/request/commit/560a1f8b927099e44b75274375a690df2a05de67) Set content-type on input. (@mikeal) -- [5fec436](https://github.com/mikeal/request/commit/5fec436b6602bc8c76133664bca23e98f511b096) Release. (@mikeal) -- [88d8d5b](https://github.com/mikeal/request/commit/88d8d5bc80679b78a39cab8e6d8295728a0a150d) Rolling version. (@mikeal) -- [d05b6ba](https://github.com/mikeal/request/commit/d05b6ba72702c2411b4627d4d89190a5f2aba562) Empty body must be passed as empty string, exclude JSON case (@Olegas) -- [#490](https://github.com/mikeal/request/pull/490) Empty response body (3-rd argument) must be passed to callback as an empty string (@Olegas) -- [8aa13cd](https://github.com/mikeal/request/commit/8aa13cd5b5e22b24466ef0e59fa8b5f1d0f0795a) Added redirect event (@Cauldrath) -- [4d63a04](https://github.com/mikeal/request/commit/4d63a042553c90718bf0b90652921b26c52dcb31) Moving response emit above setHeaders on destination streams (@kenperkins) -- [#498](https://github.com/mikeal/request/pull/498) Moving response emit above setHeaders on destination streams (@kenperkins) -- [c40993f](https://github.com/mikeal/request/commit/c40993fc987b1a8a3cb08cd5699b2f1b2bd4b28b) Fix a regression introduced by cba36ce6 (@nylen) -- [edc2e17](https://github.com/mikeal/request/commit/edc2e17e8154239efa6bd2914435798c18882635) Don't delete headers when retrying a request with proper authentication (@nylen) -- [a375ac1](https://github.com/mikeal/request/commit/a375ac15460f4f3b679f4418d7fc467a5cc94499) Refactor and expand basic auth tests (@nylen) -- [9bc28bf](https://github.com/mikeal/request/commit/9bc28bf912fb0afdd14b36b0ccbafb185a32546a) Cleanup whitespace. (@mikeal) -- [9a35cd2](https://github.com/mikeal/request/commit/9a35cd2248d9492b099c7ee46d68ca017b6a701c) Fix basic auth for passwords that contain colons (@tonistiigi) -- [f724810](https://github.com/mikeal/request/commit/f724810c7b9f82fa1423d0a4d19fcb5aaca98137) Honor the .strictSSL option when using proxies (tunnel-agent) (@jhs) -- [95a2558](https://github.com/mikeal/request/commit/95a25580375be1b9c39cc2e88a36a8387395bc13) Add HTTP Signature support. (@davidlehn) -- [921c973](https://github.com/mikeal/request/commit/921c973015721ee0f92ed670f5e88bca057104cc) * Make password optional to support the format: http://username@hostname/ -- [2759ebb](https://github.com/mikeal/request/commit/2759ebbe07e8563fd3ded698d2236309fb28176b) add 'localAddress' support (@yyfrankyy) -- [#513](https://github.com/mikeal/request/pull/513) add 'localAddress' support (@yyfrankyy) -- [#512](https://github.com/mikeal/request/pull/512) Make password optional to support the format: http://username@hostname/ (@pajato1) -- [#508](https://github.com/mikeal/request/pull/508) Honor the .strictSSL option when using proxies (tunnel-agent) (@iriscouch) -- [5f036e6](https://github.com/mikeal/request/commit/5f036e6f5d3102a89e5401a53090a0627a7850a8) Conflicts: index.js (@nylen) -- [89d2602](https://github.com/mikeal/request/commit/89d2602ef4e3a4e6e51284f6a29b5767c79ffaba) Conflicts: README.md (@davidlehn) -- [#502](https://github.com/mikeal/request/pull/502) Fix POST (and probably other) requests that are retried after 401 Unauthorized (@nylen) -- [eb3e033](https://github.com/mikeal/request/commit/eb3e033170403832fe7070955db32112ec46005f) Merge branch 'master' of git://github.com/mikeal/request (@davidlehn) -- [#510](https://github.com/mikeal/request/pull/510) Add HTTP Signature support. (@digitalbazaar) -- [227d998](https://github.com/mikeal/request/commit/227d9985426214b6ac68702933346000298d7790) Update the internal path variable when querystring is changed (@jblebrun) -- [#519](https://github.com/mikeal/request/pull/519) Update internal path state on post-creation QS changes (@incredible-labs) -- [428b9c1](https://github.com/mikeal/request/commit/428b9c1ad9831b7dfd6cec4ce68df358590c6d65) Fixing test-tunnel.js (@noway421) -- [2417599](https://github.com/mikeal/request/commit/24175993f6c362f7fca5965feb0a11756f00baf3) Improving test-localAddress.js (@noway421) -- [#520](https://github.com/mikeal/request/pull/520) Fixing test-tunnel.js (@noway421) -- [1e37f1b](https://github.com/mikeal/request/commit/1e37f1bea45174e09e6450bc71dfc081c8cd94de) Some explaining comments (@noway421) -- [909b024](https://github.com/mikeal/request/commit/909b024619c9e47f615749661d610cccd8421d80) Updating dependencies (@noway421) -- [#523](https://github.com/mikeal/request/pull/523) Updating dependencies (@noway421) -- [47191e1](https://github.com/mikeal/request/commit/47191e1a5e29714fb0c5f8b2162b2971570df644) 2.17.0 (@mikeal) -- [14def5a](https://github.com/mikeal/request/commit/14def5af5903d03f66bd6c9be534e6b76f47c063) 2.18.0 (@mikeal) -- [56fd6b7](https://github.com/mikeal/request/commit/56fd6b7ec6da162894df0809126d688f30900d25) 2.18.1 (@mikeal) -- [37dd689](https://github.com/mikeal/request/commit/37dd68989670f8937b537579a4299d9649b8aa16) Fixing dep. (@mikeal) -- [dd7209a](https://github.com/mikeal/request/commit/dd7209a84dd40afe87db31c6ab66885e2015cb8f) 2.19.0 (@mikeal) -- [62f3b92](https://github.com/mikeal/request/commit/62f3b9203690d4ad34486fc506fc78a1c9971e03) 2.19.1 (@mikeal) -- [74c6b2e](https://github.com/mikeal/request/commit/74c6b2e315872980ee9a9a000d25e724138f28b1) Adding test for onelineproxy. (@mikeal) -- [2a01cc0](https://github.com/mikeal/request/commit/2a01cc082f544647f7176a992e02668519a694be) Fixing onelineproxy. (@mikeal) -- [8b4c920](https://github.com/mikeal/request/commit/8b4c9203adb372f2ee99b1b012406b482b27c68d) 2.20.0 (@mikeal) -- [d8d4a33](https://github.com/mikeal/request/commit/d8d4a3311d8d31df88fa8a2ab3265872e5cb97ae) 2.20.1 (@mikeal) -- [5937012](https://github.com/mikeal/request/commit/59370123b22e8c971e4ee48c3d0caf920d890bda) dependencies versions bump (@jodaka) -- [#529](https://github.com/mikeal/request/pull/529) dependencies versions bump (@jodaka) -- [#521](https://github.com/mikeal/request/pull/521) Improving test-localAddress.js (@noway421) -- [#503](https://github.com/mikeal/request/pull/503) Fix basic auth for passwords that contain colons (@tonistiigi) -- [#497](https://github.com/mikeal/request/pull/497) Added redirect event (@Cauldrath) -- [297a9ea](https://github.com/mikeal/request/commit/297a9ea827655e5fb406a86907bb0d89b01deae8) fix typo (@fredericosilva) -- [#532](https://github.com/mikeal/request/pull/532) fix typo (@fredericosilva) -- [3691db5](https://github.com/mikeal/request/commit/3691db5a2d0981d4aeabfda5b988a5c69074e187) Allow explicitly empty user field for basic authentication. (@mikeando) -- [#536](https://github.com/mikeal/request/pull/536) Allow explicitly empty user field for basic authentication. (@mikeando) -- [5d36e32](https://github.com/mikeal/request/commit/5d36e324047f79cbbf3bb9b71fef633f02b36367) 2.21.0 (@mikeal) -- [9bd98d6](https://github.com/mikeal/request/commit/9bd98d6052f222aa348635c1acb2e2c99eed0f8c) 2.21.1 (@mikeal) -- [a918e04](https://github.com/mikeal/request/commit/a918e04a8d767a2948567ea29ed3fdd1650c16b1) The exported request function doesn't have an auth method (@tschaub) -- [1ebe1ac](https://github.com/mikeal/request/commit/1ebe1ac2f78e8a6149c03ce68fcb23d56df2316e) exposing Request class (@regality) -- [#542](https://github.com/mikeal/request/pull/542) Expose Request class (@ifit) -- [467573d](https://github.com/mikeal/request/commit/467573d17b4db5f93ed425ace0594370a7820c7c) Update http-signatures version. (@davidlehn) -- [#541](https://github.com/mikeal/request/pull/541) The exported request function doesn't have an auth method (@tschaub) -- [3040bbe](https://github.com/mikeal/request/commit/3040bbe5de846811151dab8dc09944acc93a338e) Fix redirections, (@criloz) -- [#564](https://github.com/mikeal/request/pull/564) Fix redirections (@NebTex) -- [397b435](https://github.com/mikeal/request/commit/397b4350fcf885460d7dced94cf1db1f5c167f80) handle ciphers and secureOptions in agentOptions (@SamPlacette) -- [65a2778](https://github.com/mikeal/request/commit/65a27782db7d2798b6490ea08efacb8f3b0a401c) tests and fix for null agentOptions case (@SamPlacette) -- [#568](https://github.com/mikeal/request/pull/568) use agentOptions to create agent when specified in request (@SamPlacette) -- [c116920](https://github.com/mikeal/request/commit/c116920a2cbef25afe2e1bbcf4df074e1e2f9dbb) Let's see how we do with only the main guard. (@mikeal) -- [f54a335](https://github.com/mikeal/request/commit/f54a3358119298634a7b0c29a21bf1471fc23d98) Fix spelling of "ignoring." (@bigeasy) -- [5cd215f](https://github.com/mikeal/request/commit/5cd215f327e113dc6c062634e405c577986cfd3c) Change isUrl regex to accept mixed case (@lexander) -- [02c8e74](https://github.com/mikeal/request/commit/02c8e749360a47d45e3e7b51b7f751fe498d2f25) #583 added tests for isUrl regex change. (@lexander) -- [#581](https://github.com/mikeal/request/pull/581) Fix spelling of "ignoring." (@bigeasy) -- [#544](https://github.com/mikeal/request/pull/544) Update http-signature version. (@digitalbazaar) -- [e77746b](https://github.com/mikeal/request/commit/e77746bf42e974dc91a84d03f44f750dd7ee0989) global cookie jar disabled by default, send jar: true to enable. (@threepointone) -- [46015ac](https://github.com/mikeal/request/commit/46015ac8d5b74f8107a6ec9fd07c133f46c5d833) 2.22.0 (@mikeal) -- [e5da4a5](https://github.com/mikeal/request/commit/e5da4a5e1a20bf4f23681f7b996f22c5fadae91d) 2.22.1 (@mikeal) -- [#587](https://github.com/mikeal/request/pull/587) Global cookie jar disabled by default (@threepointone) -- [fac9da1](https://github.com/mikeal/request/commit/fac9da1cc426bf0a4bcc5f0b7d0d0aea8b1cce38) Prevent setting headers after they are sent (@wpreul) -- [#589](https://github.com/mikeal/request/pull/589) Prevent setting headers after they are sent (@wpreul) -- [bc1537a](https://github.com/mikeal/request/commit/bc1537ab79064cea532b0d14110ce4e49a663bde) Emit complete event when there is no callback -- [de8508e](https://github.com/mikeal/request/commit/de8508e9feac10563596aeee26727567b3c2e33c) Added check to see if the global pool is being used before using the global agent (@Cauldrath) -- [03441ef](https://github.com/mikeal/request/commit/03441ef919e51a742aaf9e168d917e97e2d9eb6b) 2.23.0 (@mikeal) diff --git a/update_nation/node_modules/nano/node_modules/request/CONTRIBUTING.md b/update_nation/node_modules/nano/node_modules/request/CONTRIBUTING.md deleted file mode 100644 index 17d383e8e..000000000 --- a/update_nation/node_modules/nano/node_modules/request/CONTRIBUTING.md +++ /dev/null @@ -1,44 +0,0 @@ -# This is an OPEN Open Source Project - ------------------------------------------ - -## What? - -Individuals making significant and valuable contributions are given -commit-access to the project to contribute as they see fit. This project is -more like an open wiki than a standard guarded open source project. - -## Rules - -There are a few basic ground-rules for contributors: - -1. **No `--force` pushes** or modifying the Git history in any way. -1. **Non-master branches** ought to be used for ongoing work. -1. **External API changes and significant modifications** ought to be subject - to an **internal pull-request** to solicit feedback from other contributors. -1. Internal pull-requests to solicit feedback are *encouraged* for any other - non-trivial contribution but left to the discretion of the contributor. -1. For significant changes wait a full 24 hours before merging so that active - contributors who are distributed throughout the world have a chance to weigh - in. -1. Contributors should attempt to adhere to the prevailing code-style. -1. Run `npm test` locally before submitting your PR, to catch any easy to miss - style & testing issues. To diagnose test failures, there are two ways to - run a single test file: - - `node_modules/.bin/taper tests/test-file.js` - run using the default - [`taper`](/nylen/taper) test reporter. - - `node tests/test-file.js` - view the raw - [tap](https://testanything.org/) output. - - -## Releases - -Declaring formal releases remains the prerogative of the project maintainer. - -## Changes to this arrangement - -This is an experiment and feedback is welcome! This document may also be -subject to pull-requests or changes by contributors where you believe you have -something valuable to add or change. - ------------------------------------------ diff --git a/update_nation/node_modules/nano/node_modules/request/LICENSE b/update_nation/node_modules/nano/node_modules/request/LICENSE deleted file mode 100644 index a4a9aee0c..000000000 --- a/update_nation/node_modules/nano/node_modules/request/LICENSE +++ /dev/null @@ -1,55 +0,0 @@ -Apache License - -Version 2.0, January 2004 - -http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - -"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. - -"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. - -"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. - -"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. - -"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. - -"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. - -"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). - -"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. - -"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." - -"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: - -You must give any other recipients of the Work or Derivative Works a copy of this License; and - -You must cause any modified files to carry prominent notices stating that You changed the files; and - -You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and - -If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/update_nation/node_modules/nano/node_modules/request/README.md b/update_nation/node_modules/nano/node_modules/request/README.md deleted file mode 100644 index 566042078..000000000 --- a/update_nation/node_modules/nano/node_modules/request/README.md +++ /dev/null @@ -1,719 +0,0 @@ -# Request — Simplified HTTP client -[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/mikeal/request?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) - -[![NPM](https://nodei.co/npm/request.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/request/) - -## Super simple to use - -Request is designed to be the simplest way possible to make http calls. It supports HTTPS and follows redirects by default. - -```javascript -var request = require('request'); -request('http://www.google.com', function (error, response, body) { - if (!error && response.statusCode == 200) { - console.log(body) // Print the google web page. - } -}) -``` - -## Streaming - -You can stream any response to a file stream. - -```javascript -request('http://google.com/doodle.png').pipe(fs.createWriteStream('doodle.png')) -``` - -You can also stream a file to a PUT or POST request. This method will also check the file extension against a mapping of file extensions to content-types (in this case `application/json`) and use the proper `content-type` in the PUT request (if the headers don’t already provide one). - -```javascript -fs.createReadStream('file.json').pipe(request.put('http://mysite.com/obj.json')) -``` - -Request can also `pipe` to itself. When doing so, `content-type` and `content-length` are preserved in the PUT headers. - -```javascript -request.get('http://google.com/img.png').pipe(request.put('http://mysite.com/img.png')) -``` - -Request emits a "response" event when a response is received. The `response` argument will be an instance of [http.IncomingMessage](http://nodejs.org/api/http.html#http_http_incomingmessage). - -```javascript -request - .get('http://google.com/img.png') - .on('response', function(response) { - console.log(response.statusCode) // 200 - console.log(response.headers['content-type']) // 'image/png' - }) - .pipe(request.put('http://mysite.com/img.png')) -``` - -Now let’s get fancy. - -```javascript -http.createServer(function (req, resp) { - if (req.url === '/doodle.png') { - if (req.method === 'PUT') { - req.pipe(request.put('http://mysite.com/doodle.png')) - } else if (req.method === 'GET' || req.method === 'HEAD') { - request.get('http://mysite.com/doodle.png').pipe(resp) - } - } -}) -``` - -You can also `pipe()` from `http.ServerRequest` instances, as well as to `http.ServerResponse` instances. The HTTP method, headers, and entity-body data will be sent. Which means that, if you don't really care about security, you can do: - -```javascript -http.createServer(function (req, resp) { - if (req.url === '/doodle.png') { - var x = request('http://mysite.com/doodle.png') - req.pipe(x) - x.pipe(resp) - } -}) -``` - -And since `pipe()` returns the destination stream in ≥ Node 0.5.x you can do one line proxying. :) - -```javascript -req.pipe(request('http://mysite.com/doodle.png')).pipe(resp) -``` - -Also, none of this new functionality conflicts with requests previous features, it just expands them. - -```javascript -var r = request.defaults({'proxy':'http://localproxy.com'}) - -http.createServer(function (req, resp) { - if (req.url === '/doodle.png') { - r.get('http://google.com/doodle.png').pipe(resp) - } -}) -``` - -You can still use intermediate proxies, the requests will still follow HTTP forwards, etc. - -## Proxies - -If you specify a `proxy` option, then the request (and any subsequent -redirects) will be sent via a connection to the proxy server. - -If your endpoint is an `https` url, and you are using a proxy, then -request will send a `CONNECT` request to the proxy server *first*, and -then use the supplied connection to connect to the endpoint. - -That is, first it will make a request like: - -``` -HTTP/1.1 CONNECT endpoint-server.com:80 -Host: proxy-server.com -User-Agent: whatever user agent you specify -``` - -and then the proxy server make a TCP connection to `endpoint-server` -on port `80`, and return a response that looks like: - -``` -HTTP/1.1 200 OK -``` - -At this point, the connection is left open, and the client is -communicating directly with the `endpoint-server.com` machine. - -See [the wikipedia page on HTTP Tunneling](http://en.wikipedia.org/wiki/HTTP_tunnel) -for more information. - -By default, when proxying `http` traffic, request will simply make a -standard proxied `http` request. This is done by making the `url` -section of the initial line of the request a fully qualified url to -the endpoint. - -For example, it will make a single request that looks like: - -``` -HTTP/1.1 GET http://endpoint-server.com/some-url -Host: proxy-server.com -Other-Headers: all go here - -request body or whatever -``` - -Because a pure "http over http" tunnel offers no additional security -or other features, it is generally simpler to go with a -straightforward HTTP proxy in this case. However, if you would like -to force a tunneling proxy, you may set the `tunnel` option to `true`. - -If you are using a tunneling proxy, you may set the -`proxyHeaderWhiteList` to share certain headers with the proxy. - -By default, this set is: - -``` -accept -accept-charset -accept-encoding -accept-language -accept-ranges -cache-control -content-encoding -content-language -content-length -content-location -content-md5 -content-range -content-type -connection -date -expect -max-forwards -pragma -proxy-authorization -referer -te -transfer-encoding -user-agent -via -``` - -Note that, when using a tunneling proxy, the `proxy-authorization` -header is *never* sent to the endpoint server, but only to the proxy -server. All other headers are sent as-is over the established -connection. - -### Controlling proxy behaviour using environment variables - -The following environment variables are respected by `request`: - - * `HTTP_PROXY` / `http_proxy` - * `HTTPS_PROXY` / `https_proxy` - * `NO_PROXY` / `no_proxy` - -When `HTTP_PROXY` / `http_proxy` are set, they will be used to proxy non-SSL requests that do not have an explicit `proxy` configuration option present. Similarly, `HTTPS_PROXY` / `https_proxy` will be respected for SSL requests that do not have an explicit `proxy` configuration option. It is valid to define a proxy in one of the environment variables, but then override it for a specific request, using the `proxy` configuration option. Furthermore, the `proxy` configuration option can be explicitly set to false / null to opt out of proxying altogether for that request. - -`request` is also aware of the `NO_PROXY`/`no_proxy` environment variables. These variables provide a granular way to opt out of proxying, on a per-host basis. It should contain a comma separated list of hosts to opt out of proxying. It is also possible to opt of proxying when a particular destination port is used. Finally, the variable may be set to `*` to opt out of the implicit proxy configuration of the other environment variables. - -Here's some examples of valid `no_proxy` values: - - * `google.com` - don't proxy HTTP/HTTPS requests to Google. - * `google.com:443` - don't proxy HTTPS requests to Google, but *do* proxy HTTP requests to Google. - * `google.com:443, yahoo.com:80` - don't proxy HTTPS requests to Google, and don't proxy HTTP requests to Yahoo! - * `*` - ignore `https_proxy`/`http_proxy` environment variables altogether. - -## UNIX Socket - -`request` supports making requests to [UNIX Domain Sockets](http://en.wikipedia.org/wiki/Unix_domain_socket). To make one, use the following URL scheme: - -```javascript -/* Pattern */ 'http://unix:SOCKET:PATH' -/* Example */ request.get('http://unix:/absolute/path/to/unix.socket:/request/path') -``` - -Note: The `SOCKET` path is assumed to be absolute to the root of the host file system. - - -## Forms - -`request` supports `application/x-www-form-urlencoded` and `multipart/form-data` form uploads. For `multipart/related` refer to the `multipart` API. - -#### application/x-www-form-urlencoded (URL-Encoded Forms) - -URL-encoded forms are simple. - -```javascript -request.post('http://service.com/upload', {form:{key:'value'}}) -// or -request.post('http://service.com/upload').form({key:'value'}) -// or -request.post({url:'http://service.com/upload', form: {key:'value'}}, function(err,httpResponse,body){ /* ... */ }) -``` - -#### multipart/form-data (Multipart Form Uploads) - -For `multipart/form-data` we use the [form-data](https://github.com/felixge/node-form-data) library by [@felixge](https://github.com/felixge). For the most cases, you can pass your upload form data via the `formData` option. - - -```javascript -var formData = { - // Pass a simple key-value pair - my_field: 'my_value', - // Pass data via Buffers - my_buffer: new Buffer([1, 2, 3]), - // Pass data via Streams - my_file: fs.createReadStream(__dirname + '/unicycle.jpg'), - // Pass multiple values /w an Array - attachments: [ - fs.createReadStream(__dirname + '/attacment1.jpg') - fs.createReadStream(__dirname + '/attachment2.jpg') - ], - // Pass optional meta-data with an 'options' object with style: {value: DATA, options: OPTIONS} - // See the `form-data` README for more information about options: https://github.com/felixge/node-form-data - custom_file: { - value: fs.createReadStream('/dev/urandom'), - options: { - filename: 'topsecret.jpg', - contentType: 'image/jpg' - } - } -}; -request.post({url:'http://service.com/upload', formData: formData}, function optionalCallback(err, httpResponse, body) { - if (err) { - return console.error('upload failed:', err); - } - console.log('Upload successful! Server responded with:', body); -}); -``` - -For advanced cases, you can the form-data object itself via `r.form()`. This can be modified until the request is fired on the next cycle of the event-loop. (Note that this calling `form()` will clear the currently set form data for that request.) - -```javascript -// NOTE: Advanced use-case, for normal use see 'formData' usage above -var r = request.post('http://service.com/upload', function optionalCallback(err, httpResponse, body) { // ... - -var form = r.form(); -form.append('my_field', 'my_value'); -form.append('my_buffer', new Buffer([1, 2, 3])); -form.append('custom_file', fs.createReadStream(__dirname + '/unicycle.jpg'), {filename: 'unicycle.jpg'}); -``` -See the [form-data README](https://github.com/felixge/node-form-data) for more information & examples. - -#### multipart/related - -Some variations in different HTTP implementations require a newline/CRLF before, after, or both before and after the boundary of a `multipart/related` request (using the multipart option). This has been observed in the .NET WebAPI version 4.0. You can turn on a boundary preambleCRLF or postamble by passing them as `true` to your request options. - -```javascript - request( - { method: 'PUT' - , preambleCRLF: true - , postambleCRLF: true - , uri: 'http://service.com/upload' - , multipart: - [ { 'content-type': 'application/json' - , body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}}) - } - , { body: 'I am an attachment' } - ] - } - , function (error, response, body) { - if (err) { - return console.error('upload failed:', err); - } - console.log('Upload successful! Server responded with:', body); - } - ) -``` - - -## HTTP Authentication - -```javascript -request.get('http://some.server.com/').auth('username', 'password', false); -// or -request.get('http://some.server.com/', { - 'auth': { - 'user': 'username', - 'pass': 'password', - 'sendImmediately': false - } -}); -// or -request.get('http://some.server.com/').auth(null, null, true, 'bearerToken'); -// or -request.get('http://some.server.com/', { - 'auth': { - 'bearer': 'bearerToken' - } -}); -``` - -If passed as an option, `auth` should be a hash containing values `user` || `username`, `pass` || `password`, and `sendImmediately` (optional). The method form takes parameters `auth(username, password, sendImmediately)`. - -`sendImmediately` defaults to `true`, which causes a basic authentication header to be sent. If `sendImmediately` is `false`, then `request` will retry with a proper authentication header after receiving a `401` response from the server (which must contain a `WWW-Authenticate` header indicating the required authentication method). - -Note that you can also use for basic authentication a trick using the URL itself, as specified in [RFC 1738](http://www.ietf.org/rfc/rfc1738.txt). -Simply pass the `user:password` before the host with an `@` sign. - -```javascript -var username = 'username', - password = 'password', - url = 'http://' + username + ':' + password + '@some.server.com'; - -request({url: url}, function (error, response, body) { - // Do more stuff with 'body' here -}); -``` - -Digest authentication is supported, but it only works with `sendImmediately` set to `false`; otherwise `request` will send basic authentication on the initial request, which will probably cause the request to fail. - -Bearer authentication is supported, and is activated when the `bearer` value is available. The value may be either a `String` or a `Function` returning a `String`. Using a function to supply the bearer token is particularly useful if used in conjuction with `defaults` to allow a single function to supply the last known token at the time or sending a request or to compute one on the fly. - -## OAuth Signing - -```javascript -// Twitter OAuth -var qs = require('querystring') - , oauth = - { callback: 'http://mysite.com/callback/' - , consumer_key: CONSUMER_KEY - , consumer_secret: CONSUMER_SECRET - } - , url = 'https://api.twitter.com/oauth/request_token' - ; -request.post({url:url, oauth:oauth}, function (e, r, body) { - // Ideally, you would take the body in the response - // and construct a URL that a user clicks on (like a sign in button). - // The verifier is only available in the response after a user has - // verified with twitter that they are authorizing your app. - var access_token = qs.parse(body) - , oauth = - { consumer_key: CONSUMER_KEY - , consumer_secret: CONSUMER_SECRET - , token: access_token.oauth_token - , verifier: access_token.oauth_verifier - } - , url = 'https://api.twitter.com/oauth/access_token' - ; - request.post({url:url, oauth:oauth}, function (e, r, body) { - var perm_token = qs.parse(body) - , oauth = - { consumer_key: CONSUMER_KEY - , consumer_secret: CONSUMER_SECRET - , token: perm_token.oauth_token - , token_secret: perm_token.oauth_token_secret - } - , url = 'https://api.twitter.com/1.1/users/show.json?' - , params = - { screen_name: perm_token.screen_name - , user_id: perm_token.user_id - } - ; - url += qs.stringify(params) - request.get({url:url, oauth:oauth, json:true}, function (e, r, user) { - console.log(user) - }) - }) -}) -``` - -## Custom HTTP Headers - -HTTP Headers, such as `User-Agent`, can be set in the `options` object. -In the example below, we call the github API to find out the number -of stars and forks for the request repository. This requires a -custom `User-Agent` header as well as https. - -```javascript -var request = require('request'); - -var options = { - url: 'https://api.github.com/repos/mikeal/request', - headers: { - 'User-Agent': 'request' - } -}; - -function callback(error, response, body) { - if (!error && response.statusCode == 200) { - var info = JSON.parse(body); - console.log(info.stargazers_count + " Stars"); - console.log(info.forks_count + " Forks"); - } -} - -request(options, callback); -``` - -## TLS/SSL Protocol - -TLS/SSL Protocol options, such as `cert`, `key` and `passphrase`, can be -set in the `agentOptions` property of the `options` object. -In the example below, we call an API requires client side SSL certificate -(in PEM format) with passphrase protected private key (in PEM format) and disable the SSLv3 protocol: - -```javascript -var fs = require('fs') - , path = require('path') - , certFile = path.resolve(__dirname, 'ssl/client.crt') - , keyFile = path.resolve(__dirname, 'ssl/client.key') - , request = require('request'); - -var options = { - url: 'https://api.some-server.com/', - agentOptions: { - 'cert': fs.readFileSync(certFile), - 'key': fs.readFileSync(keyFile), - // Or use `pfx` property replacing `cert` and `key` when using private key, certificate and CA certs in PFX or PKCS12 format: - // 'pfx': fs.readFileSync(pfxFilePath), - 'passphrase': 'password', - 'securityOptions': 'SSL_OP_NO_SSLv3' - } -}; - -request.get(options); -``` - -It is able to force using SSLv3 only by specifying `secureProtocol`: - -```javascript - -request.get({ - url: 'https://api.some-server.com/', - agentOptions: { - 'secureProtocol': 'SSLv3_method' - } -}); -``` - -## request(options, callback) - -The first argument can be either a `url` or an `options` object. The only required option is `uri`; all others are optional. - -* `uri` || `url` - fully qualified uri or a parsed url object from `url.parse()` -* `qs` - object containing querystring values to be appended to the `uri` -* `useQuerystring` - If true, use `querystring` to stringify and parse - querystrings, otherwise use `qs` (default: `false`). Set this option to - `true` if you need arrays to be serialized as `foo=bar&foo=baz` instead of the - default `foo[0]=bar&foo[1]=baz`. -* `method` - http method (default: `"GET"`) -* `headers` - http headers (default: `{}`) -* `body` - entity body for PATCH, POST and PUT requests. Must be a `Buffer` or `String`, unless `json` is `true`. If `json` is `true`, then `body` must be a JSON-serializable object. -* `form` - when passed an object or a querystring, this sets `body` to a querystring representation of value, and adds `Content-type: application/x-www-form-urlencoded` header. When passed no options, a `FormData` instance is returned (and is piped to request). See "Forms" section above. -* `formData` - Data to pass for a `multipart/form-data` request. See "Forms" section above. -* `multipart` - (experimental) Data to pass for a `multipart/related` request. See "Forms" section above -* `auth` - A hash containing values `user` || `username`, `pass` || `password`, and `sendImmediately` (optional). See documentation above. -* `json` - sets `body` but to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as JSON. -* `multipart` - (experimental) array of objects which contains their own headers and `body` attribute. Sends `multipart/related` request. See example below. -* `preambleCRLF` - append a newline/CRLF before the boundary of your `multipart/form-data` request. -* `postambleCRLF` - append a newline/CRLF at the end of the boundary of your `multipart/form-data` request. -* `followRedirect` - follow HTTP 3xx responses as redirects (default: `true`). This property can also be implemented as function which gets `response` object as a single argument and should return `true` if redirects should continue or `false` otherwise. -* `followAllRedirects` - follow non-GET HTTP 3xx responses as redirects (default: `false`) -* `maxRedirects` - the maximum number of redirects to follow (default: `10`) -* `encoding` - Encoding to be used on `setEncoding` of response data. If `null`, the `body` is returned as a `Buffer`. Anything else **(including the default value of `undefined`)** will be passed as the [encoding](http://nodejs.org/api/buffer.html#buffer_buffer) parameter to `toString()` (meaning this is effectively `utf8` by default). -* `pool` - An object describing which agents to use for the request. If this option is omitted the request will use the global agent (as long as [your options allow for it](request.js#L747)). Otherwise, request will search the pool for your custom agent. If no custom agent is found, a new agent will be created and added to the pool. - * A `maxSockets` property can also be provided on the `pool` object to set the max number of sockets for all agents created (ex: `pool: {maxSockets: Infinity}`). -* `timeout` - Integer containing the number of milliseconds to wait for a request to respond before aborting the request -* `proxy` - An HTTP proxy to be used. Supports proxy Auth with Basic Auth, identical to support for the `url` parameter (by embedding the auth info in the `uri`) -* `oauth` - Options for OAuth HMAC-SHA1 signing. See documentation above. -* `hawk` - Options for [Hawk signing](https://github.com/hueniverse/hawk). The `credentials` key must contain the necessary signing info, [see hawk docs for details](https://github.com/hueniverse/hawk#usage-example). -* `strictSSL` - If `true`, requires SSL certificates be valid. **Note:** to use your own certificate authority, you need to specify an agent that was created with that CA as an option. -* `agentOptions` - Object containing user agent options. See documentation above. **Note:** [see tls API doc for TLS/SSL options](http://nodejs.org/api/tls.html#tls_tls_connect_options_callback). - -* `jar` - If `true` and `tough-cookie` is installed, remember cookies for future use (or define your custom cookie jar; see examples section) -* `aws` - `object` containing AWS signing information. Should have the properties `key`, `secret`. Also requires the property `bucket`, unless you’re specifying your `bucket` as part of the path, or the request doesn’t use a bucket (i.e. GET Services) -* `httpSignature` - Options for the [HTTP Signature Scheme](https://github.com/joyent/node-http-signature/blob/master/http_signing.md) using [Joyent's library](https://github.com/joyent/node-http-signature). The `keyId` and `key` properties must be specified. See the docs for other options. -* `localAddress` - Local interface to bind for network connections. -* `gzip` - If `true`, add an `Accept-Encoding` header to request compressed content encodings from the server (if not already present) and decode supported content encodings in the response. **Note:** Automatic decoding of the response content is performed on the body data returned through `request` (both through the `request` stream and passed to the callback function) but is not performed on the `response` stream (available from the `response` event) which is the unmodified `http.IncomingMessage` object which may contain compressed data. See example below. -* `tunnel` - If `true`, then *always* use a tunneling proxy. If - `false` (default), then tunneling will only be used if the - destination is `https`, or if a previous request in the redirect - chain used a tunneling proxy. -* `proxyHeaderWhiteList` - A whitelist of headers to send to a - tunneling proxy. - - -The callback argument gets 3 arguments: - -1. An `error` when applicable (usually from [`http.ClientRequest`](http://nodejs.org/api/http.html#http_class_http_clientrequest) object) -2. An [`http.IncomingMessage`](http://nodejs.org/api/http.html#http_http_incomingmessage) object -3. The third is the `response` body (`String` or `Buffer`, or JSON object if the `json` option is supplied) - -## Convenience methods - -There are also shorthand methods for different HTTP METHODs and some other conveniences. - -### request.defaults(options) - -This method returns a wrapper around the normal request API that defaults to whatever options you pass in to it. - -**Note:** You can call `.defaults()` on the wrapper that is returned from `request.defaults` to add/override defaults that were previously defaulted. - -For example: -```javascript -//requests using baseRequest() will set the 'x-token' header -var baseRequest = request.defaults({ - headers: {x-token: 'my-token'} -}) - -//requests using specialRequest() will include the 'x-token' header set in -//baseRequest and will also include the 'special' header -var specialRequest = baseRequest.defaults({ - headers: {special: 'special value'} -}) -``` - -### request.put - -Same as `request()`, but defaults to `method: "PUT"`. - -```javascript -request.put(url) -``` - -### request.patch - -Same as `request()`, but defaults to `method: "PATCH"`. - -```javascript -request.patch(url) -``` - -### request.post - -Same as `request()`, but defaults to `method: "POST"`. - -```javascript -request.post(url) -``` - -### request.head - -Same as request() but defaults to `method: "HEAD"`. - -```javascript -request.head(url) -``` - -### request.del - -Same as `request()`, but defaults to `method: "DELETE"`. - -```javascript -request.del(url) -``` - -### request.get - -Same as `request()` (for uniformity). - -```javascript -request.get(url) -``` -### request.cookie - -Function that creates a new cookie. - -```javascript -request.cookie('key1=value1') -``` -### request.jar - -Function that creates a new cookie jar. - -```javascript -request.jar() -``` - - -## Examples: - -```javascript - var request = require('request') - , rand = Math.floor(Math.random()*100000000).toString() - ; - request( - { method: 'PUT' - , uri: 'http://mikeal.iriscouch.com/testjs/' + rand - , multipart: - [ { 'content-type': 'application/json' - , body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}}) - } - , { body: 'I am an attachment' } - ] - } - , function (error, response, body) { - if(response.statusCode == 201){ - console.log('document saved as: http://mikeal.iriscouch.com/testjs/'+ rand) - } else { - console.log('error: '+ response.statusCode) - console.log(body) - } - } - ) -``` - -For backwards-compatibility, response compression is not supported by default. -To accept gzip-compressed responses, set the `gzip` option to `true`. Note -that the body data passed through `request` is automatically decompressed -while the response object is unmodified and will contain compressed data if -the server sent a compressed response. - -```javascript - var request = require('request') - request( - { method: 'GET' - , uri: 'http://www.google.com' - , gzip: true - } - , function (error, response, body) { - // body is the decompressed response body - console.log('server encoded the data as: ' + (response.headers['content-encoding'] || 'identity')) - console.log('the decoded data is: ' + body) - } - ).on('data', function(data) { - // decompressed data as it is received - console.log('decoded chunk: ' + data) - }) - .on('response', function(response) { - // unmodified http.IncomingMessage object - response.on('data', function(data) { - // compressed data as it is received - console.log('received ' + data.length + ' bytes of compressed data') - }) - }) -``` - -Cookies are disabled by default (else, they would be used in subsequent requests). To enable cookies, set `jar` to `true` (either in `defaults` or `options`) and install `tough-cookie`. - -```javascript -var request = request.defaults({jar: true}) -request('http://www.google.com', function () { - request('http://images.google.com') -}) -``` - -To use a custom cookie jar (instead of `request`’s global cookie jar), set `jar` to an instance of `request.jar()` (either in `defaults` or `options`) - -```javascript -var j = request.jar() -var request = request.defaults({jar:j}) -request('http://www.google.com', function () { - request('http://images.google.com') -}) -``` - -OR - -```javascript -// `npm install --save tough-cookie` before this works -var j = request.jar(); -var cookie = request.cookie('key1=value1'); -var url = 'http://www.google.com'; -j.setCookie(cookie, url); -request({url: url, jar: j}, function () { - request('http://images.google.com') -}) -``` - -To inspect your cookie jar after a request - -```javascript -var j = request.jar() -request({url: 'http://www.google.com', jar: j}, function () { - var cookie_string = j.getCookieString(uri); // "key1=value1; key2=value2; ..." - var cookies = j.getCookies(uri); - // [{key: 'key1', value: 'value1', domain: "www.google.com", ...}, ...] -}) -``` - -## Debugging - -There are at least three ways to debug the operation of `request`: - -1. Launch the node process like `NODE_DEBUG=request node script.js` - (`lib,request,otherlib` works too). - -2. Set `require('request').debug = true` at any time (this does the same thing - as #1). - -3. Use the [request-debug module](https://github.com/nylen/request-debug) to - view request and response headers and bodies. diff --git a/update_nation/node_modules/nano/node_modules/request/disabled.appveyor.yml b/update_nation/node_modules/nano/node_modules/request/disabled.appveyor.yml deleted file mode 100644 index 238f3d695..000000000 --- a/update_nation/node_modules/nano/node_modules/request/disabled.appveyor.yml +++ /dev/null @@ -1,36 +0,0 @@ -# http://www.appveyor.com/docs/appveyor-yml - -# Fix line endings in Windows. (runs before repo cloning) -init: - - git config --global core.autocrlf input - -# Test against these versions of Node.js. -environment: - matrix: - - nodejs_version: "0.10" - - nodejs_version: "0.8" - - nodejs_version: "0.11" - -# Allow failing jobs for bleeding-edge Node.js versions. -matrix: - allow_failures: - - nodejs_version: "0.11" - -# Install scripts. (runs after repo cloning) -install: - # Get the latest stable version of Node 0.STABLE.latest - - ps: Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version) - # Typical npm stuff. - - npm install - -# Post-install test scripts. -test_script: - # Output useful info for debugging. - - ps: "npm test # PowerShell" # Pass comment to PS for easier debugging - - cmd: npm test - -# Don't actually build. -build: off - -# Set build version format here instead of in the admin panel. -version: "{build}" diff --git a/update_nation/node_modules/nano/node_modules/request/index.js b/update_nation/node_modules/nano/node_modules/request/index.js deleted file mode 100644 index 033268405..000000000 --- a/update_nation/node_modules/nano/node_modules/request/index.js +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright 2010-2012 Mikeal Rogers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -'use strict' - -var extend = require('util')._extend - , cookies = require('./lib/cookies') - , helpers = require('./lib/helpers') - -var isFunction = helpers.isFunction - , constructObject = helpers.constructObject - , filterForCallback = helpers.filterForCallback - , constructOptionsFrom = helpers.constructOptionsFrom - , paramsHaveRequestBody = helpers.paramsHaveRequestBody - - -// organize params for patch, post, put, head, del -function initParams(uri, options, callback) { - callback = filterForCallback([options, callback]) - options = constructOptionsFrom(uri, options) - - return constructObject() - .extend({callback: callback}) - .extend({options: options}) - .extend({uri: options.uri}) - .done() -} - -function request (uri, options, callback) { - if (typeof uri === 'undefined') { - throw new Error('undefined is not a valid uri or options object.') - } - - var params = initParams(uri, options, callback) - options = params.options - options.callback = params.callback - options.uri = params.uri - - return new request.Request(options) -} - -function requester(params) { - if(typeof params.options._requester === 'function') { - return params.options._requester - } - return request -} - -request.get = function (uri, options, callback) { - var params = initParams(uri, options, callback) - params.options.method = 'GET' - return requester(params)(params.uri || null, params.options, params.callback) -} - -request.head = function (uri, options, callback) { - var params = initParams(uri, options, callback) - params.options.method = 'HEAD' - - if (paramsHaveRequestBody(params)) { - throw new Error('HTTP HEAD requests MUST NOT include a request body.') - } - - return requester(params)(params.uri || null, params.options, params.callback) -} - -request.post = function (uri, options, callback) { - var params = initParams(uri, options, callback) - params.options.method = 'POST' - return requester(params)(params.uri || null, params.options, params.callback) -} - -request.put = function (uri, options, callback) { - var params = initParams(uri, options, callback) - params.options.method = 'PUT' - return requester(params)(params.uri || null, params.options, params.callback) -} - -request.patch = function (uri, options, callback) { - var params = initParams(uri, options, callback) - params.options.method = 'PATCH' - return requester(params)(params.uri || null, params.options, params.callback) -} - -request.del = function (uri, options, callback) { - var params = initParams(uri, options, callback) - params.options.method = 'DELETE' - return requester(params)(params.uri || null, params.options, params.callback) -} - -request.jar = function () { - return cookies.jar() -} - -request.cookie = function (str) { - return cookies.parse(str) -} - -request.defaults = function (options, requester) { - var self = this - var wrap = function (method) { - var headerlessOptions = function (options) { - options = extend({}, options) - delete options.headers - return options - } - - var getHeaders = function (params, options) { - return constructObject() - .extend(options.headers) - .extend(params.options.headers) - .done() - } - - return function (uri, opts, callback) { - var params = initParams(uri, opts, callback) - params.options = extend(headerlessOptions(options), params.options) - - if (options.headers) { - params.options.headers = getHeaders(params, options) - } - - if (isFunction(requester)) { - if (method === self) { - method = requester - } else { - params.options._requester = requester - } - } - - return method(params.options, params.callback) - } - } - - var defaults = wrap(self) - defaults.get = wrap(self.get) - defaults.patch = wrap(self.patch) - defaults.post = wrap(self.post) - defaults.put = wrap(self.put) - defaults.head = wrap(self.head) - defaults.del = wrap(self.del) - defaults.cookie = wrap(self.cookie) - defaults.jar = self.jar - defaults.defaults = self.defaults - return defaults -} - -request.forever = function (agentOptions, optionsArg) { - var options = constructObject() - if (optionsArg) { - options.extend(optionsArg) - } - if (agentOptions) { - options.agentOptions = agentOptions - } - - options.extend({forever: true}) - return request.defaults(options.done()) -} - -// Exports - -module.exports = request -request.Request = require('./request') -request.debug = process.env.NODE_DEBUG && /\brequest\b/.test(process.env.NODE_DEBUG) -request.initParams = initParams diff --git a/update_nation/node_modules/nano/node_modules/request/lib/cookies.js b/update_nation/node_modules/nano/node_modules/request/lib/cookies.js deleted file mode 100644 index 017bdb467..000000000 --- a/update_nation/node_modules/nano/node_modules/request/lib/cookies.js +++ /dev/null @@ -1,50 +0,0 @@ -'use strict' - -var tough = require('tough-cookie') - -var Cookie = tough.Cookie - , CookieJar = tough.CookieJar - - -exports.parse = function(str) { - if (str && str.uri) { - str = str.uri - } - if (typeof str !== 'string') { - throw new Error('The cookie function only accepts STRING as param') - } - if (!Cookie) { - return null - } - return Cookie.parse(str) -} - -// Adapt the sometimes-Async api of tough.CookieJar to our requirements -function RequestJar() { - var self = this - self._jar = new CookieJar() -} -RequestJar.prototype.setCookie = function(cookieOrStr, uri, options) { - var self = this - return self._jar.setCookieSync(cookieOrStr, uri, options || {}) -} -RequestJar.prototype.getCookieString = function(uri) { - var self = this - return self._jar.getCookieStringSync(uri) -} -RequestJar.prototype.getCookies = function(uri) { - var self = this - return self._jar.getCookiesSync(uri) -} - -exports.jar = function() { - if (!CookieJar) { - // tough-cookie not loaded, return a stub object: - return { - setCookie: function(){}, - getCookieString: function(){}, - getCookies: function(){} - } - } - return new RequestJar() -} diff --git a/update_nation/node_modules/nano/node_modules/request/lib/copy.js b/update_nation/node_modules/nano/node_modules/request/lib/copy.js deleted file mode 100644 index ad162a508..000000000 --- a/update_nation/node_modules/nano/node_modules/request/lib/copy.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict' - -module.exports = -function copy (obj) { - var o = {} - Object.keys(obj).forEach(function (i) { - o[i] = obj[i] - }) - return o -} diff --git a/update_nation/node_modules/nano/node_modules/request/lib/debug.js b/update_nation/node_modules/nano/node_modules/request/lib/debug.js deleted file mode 100644 index 25e3dedc7..000000000 --- a/update_nation/node_modules/nano/node_modules/request/lib/debug.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict' - -var util = require('util') - , request = require('../index') - - -module.exports = function debug() { - if (request.debug) { - console.error('REQUEST %s', util.format.apply(util, arguments)) - } -} diff --git a/update_nation/node_modules/nano/node_modules/request/lib/helpers.js b/update_nation/node_modules/nano/node_modules/request/lib/helpers.js deleted file mode 100644 index fa5712ffb..000000000 --- a/update_nation/node_modules/nano/node_modules/request/lib/helpers.js +++ /dev/null @@ -1,89 +0,0 @@ -'use strict' - -var extend = require('util')._extend - , jsonSafeStringify = require('json-stringify-safe') - , crypto = require('crypto') - -function deferMethod() { - if(typeof setImmediate === 'undefined') { - return process.nextTick - } - - return setImmediate -} - -function constructObject(initialObject) { - initialObject = initialObject || {} - - return { - extend: function (object) { - return constructObject(extend(initialObject, object)) - }, - done: function () { - return initialObject - } - } -} - -function constructOptionsFrom(uri, options) { - var params = constructObject() - if (typeof options === 'object') { - params.extend(options).extend({uri: uri}) - } else if (typeof uri === 'string') { - params.extend({uri: uri}) - } else { - params.extend(uri) - } - return params.done() -} - -function isFunction(value) { - return typeof value === 'function' -} - -function filterForCallback(values) { - var callbacks = values.filter(isFunction) - return callbacks[0] -} - -function paramsHaveRequestBody(params) { - return ( - params.options.body || - params.options.requestBodyStream || - (params.options.json && typeof params.options.json !== 'boolean') || - params.options.multipart - ) -} - -function safeStringify (obj) { - var ret - try { - ret = JSON.stringify(obj) - } catch (e) { - ret = jsonSafeStringify(obj) - } - return ret -} - -function md5 (str) { - return crypto.createHash('md5').update(str).digest('hex') -} - -function isReadStream (rs) { - return rs.readable && rs.path && rs.mode -} - -function toBase64 (str) { - return (new Buffer(str || '', 'ascii')).toString('base64') -} - -exports.isFunction = isFunction -exports.constructObject = constructObject -exports.constructOptionsFrom = constructOptionsFrom -exports.filterForCallback = filterForCallback -exports.paramsHaveRequestBody = paramsHaveRequestBody -exports.safeStringify = safeStringify -exports.md5 = md5 -exports.isReadStream = isReadStream -exports.toBase64 = toBase64 -exports.defer = deferMethod() diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/.bin/uuid b/update_nation/node_modules/nano/node_modules/request/node_modules/.bin/uuid deleted file mode 100644 index ca9624d48..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/.bin/uuid +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -basedir=`dirname "$0"` - -case `uname` in - *CYGWIN*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - "$basedir/node" "$basedir/../node-uuid/bin/uuid" "$@" - ret=$? -else - node "$basedir/../node-uuid/bin/uuid" "$@" - ret=$? -fi -exit $ret diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/aws-sign2/LICENSE b/update_nation/node_modules/nano/node_modules/request/node_modules/aws-sign2/LICENSE deleted file mode 100644 index a4a9aee0c..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/aws-sign2/LICENSE +++ /dev/null @@ -1,55 +0,0 @@ -Apache License - -Version 2.0, January 2004 - -http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - -"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. - -"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. - -"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. - -"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. - -"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. - -"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. - -"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). - -"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. - -"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." - -"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: - -You must give any other recipients of the Work or Derivative Works a copy of this License; and - -You must cause any modified files to carry prominent notices stating that You changed the files; and - -You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and - -If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/aws-sign2/README.md b/update_nation/node_modules/nano/node_modules/request/node_modules/aws-sign2/README.md deleted file mode 100644 index 763564e0a..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/aws-sign2/README.md +++ /dev/null @@ -1,4 +0,0 @@ -aws-sign -======== - -AWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module. diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/aws-sign2/index.js b/update_nation/node_modules/nano/node_modules/request/node_modules/aws-sign2/index.js deleted file mode 100644 index 576e49ddf..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/aws-sign2/index.js +++ /dev/null @@ -1,202 +0,0 @@ - -/*! - * knox - auth - * Copyright(c) 2010 LearnBoost - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var crypto = require('crypto') - , parse = require('url').parse - ; - -/** - * Valid keys. - */ - -var keys = - [ 'acl' - , 'location' - , 'logging' - , 'notification' - , 'partNumber' - , 'policy' - , 'requestPayment' - , 'torrent' - , 'uploadId' - , 'uploads' - , 'versionId' - , 'versioning' - , 'versions' - , 'website' - ] - -/** - * Return an "Authorization" header value with the given `options` - * in the form of "AWS :" - * - * @param {Object} options - * @return {String} - * @api private - */ - -function authorization (options) { - return 'AWS ' + options.key + ':' + sign(options) -} - -module.exports = authorization -module.exports.authorization = authorization - -/** - * Simple HMAC-SHA1 Wrapper - * - * @param {Object} options - * @return {String} - * @api private - */ - -function hmacSha1 (options) { - return crypto.createHmac('sha1', options.secret).update(options.message).digest('base64') -} - -module.exports.hmacSha1 = hmacSha1 - -/** - * Create a base64 sha1 HMAC for `options`. - * - * @param {Object} options - * @return {String} - * @api private - */ - -function sign (options) { - options.message = stringToSign(options) - return hmacSha1(options) -} -module.exports.sign = sign - -/** - * Create a base64 sha1 HMAC for `options`. - * - * Specifically to be used with S3 presigned URLs - * - * @param {Object} options - * @return {String} - * @api private - */ - -function signQuery (options) { - options.message = queryStringToSign(options) - return hmacSha1(options) -} -module.exports.signQuery= signQuery - -/** - * Return a string for sign() with the given `options`. - * - * Spec: - * - * \n - * \n - * \n - * \n - * [headers\n] - * - * - * @param {Object} options - * @return {String} - * @api private - */ - -function stringToSign (options) { - var headers = options.amazonHeaders || '' - if (headers) headers += '\n' - var r = - [ options.verb - , options.md5 - , options.contentType - , options.date ? options.date.toUTCString() : '' - , headers + options.resource - ] - return r.join('\n') -} -module.exports.queryStringToSign = stringToSign - -/** - * Return a string for sign() with the given `options`, but is meant exclusively - * for S3 presigned URLs - * - * Spec: - * - * \n - * - * - * @param {Object} options - * @return {String} - * @api private - */ - -function queryStringToSign (options){ - return 'GET\n\n\n' + options.date + '\n' + options.resource -} -module.exports.queryStringToSign = queryStringToSign - -/** - * Perform the following: - * - * - ignore non-amazon headers - * - lowercase fields - * - sort lexicographically - * - trim whitespace between ":" - * - join with newline - * - * @param {Object} headers - * @return {String} - * @api private - */ - -function canonicalizeHeaders (headers) { - var buf = [] - , fields = Object.keys(headers) - ; - for (var i = 0, len = fields.length; i < len; ++i) { - var field = fields[i] - , val = headers[field] - , field = field.toLowerCase() - ; - if (0 !== field.indexOf('x-amz')) continue - buf.push(field + ':' + val) - } - return buf.sort().join('\n') -} -module.exports.canonicalizeHeaders = canonicalizeHeaders - -/** - * Perform the following: - * - * - ignore non sub-resources - * - sort lexicographically - * - * @param {String} resource - * @return {String} - * @api private - */ - -function canonicalizeResource (resource) { - var url = parse(resource, true) - , path = url.pathname - , buf = [] - ; - - Object.keys(url.query).forEach(function(key){ - if (!~keys.indexOf(key)) return - var val = '' == url.query[key] ? '' : '=' + encodeURIComponent(url.query[key]) - buf.push(key + val) - }) - - return path + (buf.length ? '?' + buf.sort().join('&') : '') -} -module.exports.canonicalizeResource = canonicalizeResource diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/aws-sign2/package.json b/update_nation/node_modules/nano/node_modules/request/node_modules/aws-sign2/package.json deleted file mode 100644 index c72ab54f2..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/aws-sign2/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "author": { - "name": "Mikeal Rogers", - "email": "mikeal.rogers@gmail.com", - "url": "http://www.futurealoof.com" - }, - "name": "aws-sign2", - "description": "AWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.", - "version": "0.5.0", - "repository": { - "url": "https://github.com/mikeal/aws-sign" - }, - "main": "index.js", - "dependencies": {}, - "devDependencies": {}, - "optionalDependencies": {}, - "engines": { - "node": "*" - }, - "readme": "aws-sign\n========\n\nAWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/mikeal/aws-sign/issues" - }, - "_id": "aws-sign2@0.5.0", - "dist": { - "shasum": "c57103f7a17fc037f02d7c2e64b602ea223f7d63", - "tarball": "http://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz" - }, - "_from": "aws-sign2@~0.5.0", - "_npmVersion": "1.3.2", - "_npmUser": { - "name": "mikeal", - "email": "mikeal.rogers@gmail.com" - }, - "maintainers": [ - { - "name": "mikeal", - "email": "mikeal.rogers@gmail.com" - } - ], - "directories": {}, - "_shasum": "c57103f7a17fc037f02d7c2e64b602ea223f7d63", - "_resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz", - "homepage": "https://github.com/mikeal/aws-sign", - "scripts": {} -} diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/.jshintrc b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/.jshintrc deleted file mode 100644 index c8ef3ca40..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/.jshintrc +++ /dev/null @@ -1,59 +0,0 @@ -{ - "predef": [ ] - , "bitwise": false - , "camelcase": false - , "curly": false - , "eqeqeq": false - , "forin": false - , "immed": false - , "latedef": false - , "noarg": true - , "noempty": true - , "nonew": true - , "plusplus": false - , "quotmark": true - , "regexp": false - , "undef": true - , "unused": true - , "strict": false - , "trailing": true - , "maxlen": 120 - , "asi": true - , "boss": true - , "debug": true - , "eqnull": true - , "esnext": true - , "evil": true - , "expr": true - , "funcscope": false - , "globalstrict": false - , "iterator": false - , "lastsemic": true - , "laxbreak": true - , "laxcomma": true - , "loopfunc": true - , "multistr": false - , "onecase": false - , "proto": false - , "regexdash": false - , "scripturl": true - , "smarttabs": false - , "shadow": false - , "sub": true - , "supernew": false - , "validthis": true - , "browser": true - , "couch": false - , "devel": false - , "dojo": false - , "mootools": false - , "node": true - , "nonstandard": true - , "prototypejs": false - , "rhino": false - , "worker": true - , "wsh": false - , "nomen": false - , "onevar": false - , "passfail": false -} \ No newline at end of file diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/.npmignore b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/.npmignore deleted file mode 100644 index 40b878db5..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ \ No newline at end of file diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/.travis.yml b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/.travis.yml deleted file mode 100644 index 7ddb9c975..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -language: node_js -node_js: - - 0.8 - - "0.10" -branches: - only: - - master -notifications: - email: - - rod@vagg.org -script: npm test \ No newline at end of file diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/LICENSE.md b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/LICENSE.md deleted file mode 100644 index ccb24797c..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/LICENSE.md +++ /dev/null @@ -1,13 +0,0 @@ -The MIT License (MIT) -===================== - -Copyright (c) 2014 bl contributors ----------------------------------- - -*bl contributors listed at * - -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/update_nation/node_modules/nano/node_modules/request/node_modules/bl/README.md b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/README.md deleted file mode 100644 index 6b7fb6d34..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/README.md +++ /dev/null @@ -1,198 +0,0 @@ -# bl *(BufferList)* - -**A Node.js Buffer list collector, reader and streamer thingy.** - -[![NPM](https://nodei.co/npm/bl.png?downloads=true&downloadRank=true)](https://nodei.co/npm/bl/) -[![NPM](https://nodei.co/npm-dl/bl.png?months=6&height=3)](https://nodei.co/npm/bl/) - -**bl** is a storage object for collections of Node Buffers, exposing them with the main Buffer readable API. Also works as a duplex stream so you can collect buffers from a stream that emits them and emit buffers to a stream that consumes them! - -The original buffers are kept intact and copies are only done as necessary. Any reads that require the use of a single original buffer will return a slice of that buffer only (which references the same memory as the original buffer). Reads that span buffers perform concatenation as required and return the results transparently. - -```js -const BufferList = require('bl') - -var bl = new BufferList() -bl.append(new Buffer('abcd')) -bl.append(new Buffer('efg')) -bl.append('hi') // bl will also accept & convert Strings -bl.append(new Buffer('j')) -bl.append(new Buffer([ 0x3, 0x4 ])) - -console.log(bl.length) // 12 - -console.log(bl.slice(0, 10).toString('ascii')) // 'abcdefghij' -console.log(bl.slice(3, 10).toString('ascii')) // 'defghij' -console.log(bl.slice(3, 6).toString('ascii')) // 'def' -console.log(bl.slice(3, 8).toString('ascii')) // 'defgh' -console.log(bl.slice(5, 10).toString('ascii')) // 'fghij' - -// or just use toString! -console.log(bl.toString()) // 'abcdefghij\u0003\u0004' -console.log(bl.toString('ascii', 3, 8)) // 'defgh' -console.log(bl.toString('ascii', 5, 10)) // 'fghij' - -// other standard Buffer readables -console.log(bl.readUInt16BE(10)) // 0x0304 -console.log(bl.readUInt16LE(10)) // 0x0403 -``` - -Give it a callback in the constructor and use it just like **[concat-stream](https://github.com/maxogden/node-concat-stream)**: - -```js -const bl = require('bl') - , fs = require('fs') - -fs.createReadStream('README.md') - .pipe(bl(function (err, data) { // note 'new' isn't strictly required - // `data` is a complete Buffer object containing the full data - console.log(data.toString()) - })) -``` - -Note that when you use the *callback* method like this, the resulting `data` parameter is a concatenation of all `Buffer` objects in the list. If you want to avoid the overhead of this concatenation (in cases of extreme performance consciousness), then avoid the *callback* method and just listen to `'end'` instead, like a standard Stream. - -Or to fetch a URL using [hyperquest](https://github.com/substack/hyperquest) (should work with [request](http://github.com/mikeal/request) and even plain Node http too!): -```js -const hyperquest = require('hyperquest') - , bl = require('bl') - , url = 'https://raw.github.com/rvagg/bl/master/README.md' - -hyperquest(url).pipe(bl(function (err, data) { - console.log(data.toString()) -})) -``` - -Or, use it as a readable stream to recompose a list of Buffers to an output source: - -```js -const BufferList = require('bl') - , fs = require('fs') - -var bl = new BufferList() -bl.append(new Buffer('abcd')) -bl.append(new Buffer('efg')) -bl.append(new Buffer('hi')) -bl.append(new Buffer('j')) - -bl.pipe(fs.createWriteStream('gibberish.txt')) -``` - -## API - - * new BufferList([ callback ]) - * bl.length - * bl.append(buffer) - * bl.get(index) - * bl.slice([ start[, end ] ]) - * bl.copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ]) - * bl.duplicate() - * bl.consume(bytes) - * bl.toString([encoding, [ start, [ end ]]]) - * bl.readDoubleBE(), bl.readDoubleLE(), bl.readFloatBE(), bl.readFloatLE(), bl.readInt32BE(), bl.readInt32LE(), bl.readUInt32BE(), bl.readUInt32LE(), bl.readInt16BE(), bl.readInt16LE(), bl.readUInt16BE(), bl.readUInt16LE(), bl.readInt8(), bl.readUInt8() - * Streams - --------------------------------------------------------- - -### new BufferList([ callback | buffer | buffer array ]) -The constructor takes an optional callback, if supplied, the callback will be called with an error argument followed by a reference to the **bl** instance, when `bl.end()` is called (i.e. from a piped stream). This is a convenient method of collecting the entire contents of a stream, particularly when the stream is *chunky*, such as a network stream. - -Normally, no arguments are required for the constructor, but you can initialise the list by passing in a single `Buffer` object or an array of `Buffer` object. - -`new` is not strictly required, if you don't instantiate a new object, it will be done automatically for you so you can create a new instance simply with: - -```js -var bl = require('bl') -var myinstance = bl() - -// equivilant to: - -var BufferList = require('bl') -var myinstance = new BufferList() -``` - --------------------------------------------------------- - -### bl.length -Get the length of the list in bytes. This is the sum of the lengths of all of the buffers contained in the list, minus any initial offset for a semi-consumed buffer at the beginning. Should accurately represent the total number of bytes that can be read from the list. - --------------------------------------------------------- - -### bl.append(buffer) -`append(buffer)` adds an additional buffer or BufferList to the internal list. - --------------------------------------------------------- - -### bl.get(index) -`get()` will return the byte at the specified index. - --------------------------------------------------------- - -### bl.slice([ start, [ end ] ]) -`slice()` returns a new `Buffer` object containing the bytes within the range specified. Both `start` and `end` are optional and will default to the beginning and end of the list respectively. - -If the requested range spans a single internal buffer then a slice of that buffer will be returned which shares the original memory range of that Buffer. If the range spans multiple buffers then copy operations will likely occur to give you a uniform Buffer. - --------------------------------------------------------- - -### bl.copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ]) -`copy()` copies the content of the list in the `dest` buffer, starting from `destStart` and containing the bytes within the range specified with `srcStart` to `srcEnd`. `destStart`, `start` and `end` are optional and will default to the beginning of the `dest` buffer, and the beginning and end of the list respectively. - --------------------------------------------------------- - -### bl.duplicate() -`duplicate()` performs a **shallow-copy** of the list. The internal Buffers remains the same, so if you change the underlying Buffers, the change will be reflected in both the original and the duplicate. This method is needed if you want to call `consume()` or `pipe()` and still keep the original list.Example: - -```js -var bl = new BufferList() - -bl.append('hello') -bl.append(' world') -bl.append('\n') - -bl.duplicate().pipe(process.stdout, { end: false }) - -console.log(bl.toString()) -``` - --------------------------------------------------------- - -### bl.consume(bytes) -`consume()` will shift bytes *off the start of the list*. The number of bytes consumed don't need to line up with the sizes of the internal Buffers—initial offsets will be calculated accordingly in order to give you a consistent view of the data. - --------------------------------------------------------- - -### bl.toString([encoding, [ start, [ end ]]]) -`toString()` will return a string representation of the buffer. The optional `start` and `end` arguments are passed on to `slice()`, while the `encoding` is passed on to `toString()` of the resulting Buffer. See the [Buffer#toString()](http://nodejs.org/docs/latest/api/buffer.html#buffer_buf_tostring_encoding_start_end) documentation for more information. - --------------------------------------------------------- - -### bl.readDoubleBE(), bl.readDoubleLE(), bl.readFloatBE(), bl.readFloatLE(), bl.readInt32BE(), bl.readInt32LE(), bl.readUInt32BE(), bl.readUInt32LE(), bl.readInt16BE(), bl.readInt16LE(), bl.readUInt16BE(), bl.readUInt16LE(), bl.readInt8(), bl.readUInt8() - -All of the standard byte-reading methods of the `Buffer` interface are implemented and will operate across internal Buffer boundaries transparently. - -See the [Buffer](http://nodejs.org/docs/latest/api/buffer.html) documentation for how these work. - --------------------------------------------------------- - -### Streams -**bl** is a Node **[Duplex Stream](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_duplex)**, so it can be read from and written to like a standard Node stream. You can also `pipe()` to and from a **bl** instance. - --------------------------------------------------------- - -## Contributors - -**bl** is brought to you by the following hackers: - - * [Rod Vagg](https://github.com/rvagg) - * [Matteo Collina](https://github.com/mcollina) - * [Jarett Cruger](https://github.com/jcrugzz) - -======= - - -## License & copyright - -Copyright (c) 2013-2014 bl contributors (listed above). - -bl is licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details. diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/bl.js b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/bl.js deleted file mode 100644 index 7a2f99788..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/bl.js +++ /dev/null @@ -1,216 +0,0 @@ -var DuplexStream = require('readable-stream/duplex') - , util = require('util') - -function BufferList (callback) { - if (!(this instanceof BufferList)) - return new BufferList(callback) - - this._bufs = [] - this.length = 0 - - if (typeof callback == 'function') { - this._callback = callback - - var piper = function (err) { - if (this._callback) { - this._callback(err) - this._callback = null - } - }.bind(this) - - this.on('pipe', function (src) { - src.on('error', piper) - }) - this.on('unpipe', function (src) { - src.removeListener('error', piper) - }) - } - else if (Buffer.isBuffer(callback)) - this.append(callback) - else if (Array.isArray(callback)) { - callback.forEach(function (b) { - Buffer.isBuffer(b) && this.append(b) - }.bind(this)) - } - - DuplexStream.call(this) -} - -util.inherits(BufferList, DuplexStream) - -BufferList.prototype._offset = function (offset) { - var tot = 0, i = 0, _t - for (; i < this._bufs.length; i++) { - _t = tot + this._bufs[i].length - if (offset < _t) - return [ i, offset - tot ] - tot = _t - } -} - -BufferList.prototype.append = function (buf) { - var isBuffer = Buffer.isBuffer(buf) || - buf instanceof BufferList - - this._bufs.push(isBuffer ? buf : new Buffer(buf)) - this.length += buf.length - return this -} - -BufferList.prototype._write = function (buf, encoding, callback) { - this.append(buf) - if (callback) - callback() -} - -BufferList.prototype._read = function (size) { - if (!this.length) - return this.push(null) - size = Math.min(size, this.length) - this.push(this.slice(0, size)) - this.consume(size) -} - -BufferList.prototype.end = function (chunk) { - DuplexStream.prototype.end.call(this, chunk) - - if (this._callback) { - this._callback(null, this.slice()) - this._callback = null - } -} - -BufferList.prototype.get = function (index) { - return this.slice(index, index + 1)[0] -} - -BufferList.prototype.slice = function (start, end) { - return this.copy(null, 0, start, end) -} - -BufferList.prototype.copy = function (dst, dstStart, srcStart, srcEnd) { - if (typeof srcStart != 'number' || srcStart < 0) - srcStart = 0 - if (typeof srcEnd != 'number' || srcEnd > this.length) - srcEnd = this.length - if (srcStart >= this.length) - return dst || new Buffer(0) - if (srcEnd <= 0) - return dst || new Buffer(0) - - var copy = !!dst - , off = this._offset(srcStart) - , len = srcEnd - srcStart - , bytes = len - , bufoff = (copy && dstStart) || 0 - , start = off[1] - , l - , i - - // copy/slice everything - if (srcStart === 0 && srcEnd == this.length) { - if (!copy) // slice, just return a full concat - return Buffer.concat(this._bufs) - - // copy, need to copy individual buffers - for (i = 0; i < this._bufs.length; i++) { - this._bufs[i].copy(dst, bufoff) - bufoff += this._bufs[i].length - } - - return dst - } - - // easy, cheap case where it's a subset of one of the buffers - if (bytes <= this._bufs[off[0]].length - start) { - return copy - ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes) - : this._bufs[off[0]].slice(start, start + bytes) - } - - if (!copy) // a slice, we need something to copy in to - dst = new Buffer(len) - - for (i = off[0]; i < this._bufs.length; i++) { - l = this._bufs[i].length - start - - if (bytes > l) { - this._bufs[i].copy(dst, bufoff, start) - } else { - this._bufs[i].copy(dst, bufoff, start, start + bytes) - break - } - - bufoff += l - bytes -= l - - if (start) - start = 0 - } - - return dst -} - -BufferList.prototype.toString = function (encoding, start, end) { - return this.slice(start, end).toString(encoding) -} - -BufferList.prototype.consume = function (bytes) { - while (this._bufs.length) { - if (bytes > this._bufs[0].length) { - bytes -= this._bufs[0].length - this.length -= this._bufs[0].length - this._bufs.shift() - } else { - this._bufs[0] = this._bufs[0].slice(bytes) - this.length -= bytes - break - } - } - return this -} - -BufferList.prototype.duplicate = function () { - var i = 0 - , copy = new BufferList() - - for (; i < this._bufs.length; i++) - copy.append(this._bufs[i]) - - return copy -} - -BufferList.prototype.destroy = function () { - this._bufs.length = 0; - this.length = 0; - this.push(null); -} - -;(function () { - var methods = { - 'readDoubleBE' : 8 - , 'readDoubleLE' : 8 - , 'readFloatBE' : 4 - , 'readFloatLE' : 4 - , 'readInt32BE' : 4 - , 'readInt32LE' : 4 - , 'readUInt32BE' : 4 - , 'readUInt32LE' : 4 - , 'readInt16BE' : 2 - , 'readInt16LE' : 2 - , 'readUInt16BE' : 2 - , 'readUInt16LE' : 2 - , 'readInt8' : 1 - , 'readUInt8' : 1 - } - - for (var m in methods) { - (function (m) { - BufferList.prototype[m] = function (offset) { - return this.slice(offset, offset + methods[m])[m](0) - } - }(m)) - } -}()) - -module.exports = BufferList diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/.npmignore b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/.npmignore deleted file mode 100644 index 38344f87a..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -build/ -test/ -examples/ -fs.js -zlib.js \ No newline at end of file diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/LICENSE b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/LICENSE deleted file mode 100644 index e3d4e695a..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -Copyright Joyent, Inc. and other Node contributors. 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/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/README.md b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/README.md deleted file mode 100644 index 3fb3e8023..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# readable-stream - -***Node-core streams for userland*** - -[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) -[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) - -This package is a mirror of the Streams2 and Streams3 implementations in Node-core. - -If you want to guarantee a stable streams base, regardless of what version of Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core. - -**readable-stream** comes in two major versions, v1.0.x and v1.1.x. The former tracks the Streams2 implementation in Node 0.10, including bug-fixes and minor improvements as they are added. The latter tracks Streams3 as it develops in Node 0.11; we will likely see a v1.2.x branch for Node 0.12. - -**readable-stream** uses proper patch-level versioning so if you pin to `"~1.0.0"` you’ll get the latest Node 0.10 Streams2 implementation, including any fixes and minor non-breaking improvements. The patch-level versions of 1.0.x and 1.1.x should mirror the patch-level versions of Node-core releases. You should prefer the **1.0.x** releases for now and when you’re ready to start using Streams3, pin to `"~1.1.0"` - diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/duplex.js b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/duplex.js deleted file mode 100644 index ca807af87..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/duplex.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_duplex.js") diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js deleted file mode 100644 index b513d61a9..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -// a duplex stream is just a stream that is both readable and writable. -// Since JS doesn't have multiple prototypal inheritance, this class -// prototypally inherits from Readable, and then parasitically from -// Writable. - -module.exports = Duplex; - -/**/ -var objectKeys = Object.keys || function (obj) { - var keys = []; - for (var key in obj) keys.push(key); - return keys; -} -/**/ - - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -var Readable = require('./_stream_readable'); -var Writable = require('./_stream_writable'); - -util.inherits(Duplex, Readable); - -forEach(objectKeys(Writable.prototype), function(method) { - if (!Duplex.prototype[method]) - Duplex.prototype[method] = Writable.prototype[method]; -}); - -function Duplex(options) { - if (!(this instanceof Duplex)) - return new Duplex(options); - - Readable.call(this, options); - Writable.call(this, options); - - if (options && options.readable === false) - this.readable = false; - - if (options && options.writable === false) - this.writable = false; - - this.allowHalfOpen = true; - if (options && options.allowHalfOpen === false) - this.allowHalfOpen = false; - - this.once('end', onend); -} - -// the no-half-open enforcer -function onend() { - // if we allow half-open state, or if the writable side ended, - // then we're ok. - if (this.allowHalfOpen || this._writableState.ended) - return; - - // no more data can be written. - // But allow more writes to happen in this tick. - process.nextTick(this.end.bind(this)); -} - -function forEach (xs, f) { - for (var i = 0, l = xs.length; i < l; i++) { - f(xs[i], i); - } -} diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js deleted file mode 100644 index 895ca50a1..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -// a passthrough stream. -// basically just the most minimal sort of Transform stream. -// Every written chunk gets output as-is. - -module.exports = PassThrough; - -var Transform = require('./_stream_transform'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -util.inherits(PassThrough, Transform); - -function PassThrough(options) { - if (!(this instanceof PassThrough)) - return new PassThrough(options); - - Transform.call(this, options); -} - -PassThrough.prototype._transform = function(chunk, encoding, cb) { - cb(null, chunk); -}; diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js deleted file mode 100644 index 630722099..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js +++ /dev/null @@ -1,982 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -module.exports = Readable; - -/**/ -var isArray = require('isarray'); -/**/ - - -/**/ -var Buffer = require('buffer').Buffer; -/**/ - -Readable.ReadableState = ReadableState; - -var EE = require('events').EventEmitter; - -/**/ -if (!EE.listenerCount) EE.listenerCount = function(emitter, type) { - return emitter.listeners(type).length; -}; -/**/ - -var Stream = require('stream'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -var StringDecoder; - -util.inherits(Readable, Stream); - -function ReadableState(options, stream) { - options = options || {}; - - // the point at which it stops calling _read() to fill the buffer - // Note: 0 is a valid value, means "don't call _read preemptively ever" - var hwm = options.highWaterMark; - this.highWaterMark = (hwm || hwm === 0) ? hwm : 16 * 1024; - - // cast to ints. - this.highWaterMark = ~~this.highWaterMark; - - this.buffer = []; - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = false; - this.ended = false; - this.endEmitted = false; - this.reading = false; - - // In streams that never have any data, and do push(null) right away, - // the consumer can miss the 'end' event if they do some I/O before - // consuming the stream. So, we don't emit('end') until some reading - // happens. - this.calledRead = false; - - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, becuase any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; - - // whenever we return null, then we set a flag to say - // that we're awaiting a 'readable' event emission. - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - - - // object stream flag. Used to make read(n) ignore n and to - // make all the buffer merging and length checks go away - this.objectMode = !!options.objectMode; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // when piping, we only care about 'readable' events that happen - // after read()ing all the bytes and not getting any pushback. - this.ranOut = false; - - // the number of writers that are awaiting a drain event in .pipe()s - this.awaitDrain = 0; - - // if true, a maybeReadMore has been scheduled - this.readingMore = false; - - this.decoder = null; - this.encoding = null; - if (options.encoding) { - if (!StringDecoder) - StringDecoder = require('string_decoder/').StringDecoder; - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; - } -} - -function Readable(options) { - if (!(this instanceof Readable)) - return new Readable(options); - - this._readableState = new ReadableState(options, this); - - // legacy - this.readable = true; - - Stream.call(this); -} - -// Manually shove something into the read() buffer. -// This returns true if the highWaterMark has not been hit yet, -// similar to how Writable.write() returns true if you should -// write() some more. -Readable.prototype.push = function(chunk, encoding) { - var state = this._readableState; - - if (typeof chunk === 'string' && !state.objectMode) { - encoding = encoding || state.defaultEncoding; - if (encoding !== state.encoding) { - chunk = new Buffer(chunk, encoding); - encoding = ''; - } - } - - return readableAddChunk(this, state, chunk, encoding, false); -}; - -// Unshift should *always* be something directly out of read() -Readable.prototype.unshift = function(chunk) { - var state = this._readableState; - return readableAddChunk(this, state, chunk, '', true); -}; - -function readableAddChunk(stream, state, chunk, encoding, addToFront) { - var er = chunkInvalid(state, chunk); - if (er) { - stream.emit('error', er); - } else if (chunk === null || chunk === undefined) { - state.reading = false; - if (!state.ended) - onEofChunk(stream, state); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (state.ended && !addToFront) { - var e = new Error('stream.push() after EOF'); - stream.emit('error', e); - } else if (state.endEmitted && addToFront) { - var e = new Error('stream.unshift() after end event'); - stream.emit('error', e); - } else { - if (state.decoder && !addToFront && !encoding) - chunk = state.decoder.write(chunk); - - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) { - state.buffer.unshift(chunk); - } else { - state.reading = false; - state.buffer.push(chunk); - } - - if (state.needReadable) - emitReadable(stream); - - maybeReadMore(stream, state); - } - } else if (!addToFront) { - state.reading = false; - } - - return needMoreData(state); -} - - - -// if it's past the high water mark, we can push in some more. -// Also, if we have no data yet, we can stand some -// more bytes. This is to work around cases where hwm=0, -// such as the repl. Also, if the push() triggered a -// readable event, and the user called read(largeNumber) such that -// needReadable was set, then we ought to push more, so that another -// 'readable' event will be triggered. -function needMoreData(state) { - return !state.ended && - (state.needReadable || - state.length < state.highWaterMark || - state.length === 0); -} - -// backwards compatibility. -Readable.prototype.setEncoding = function(enc) { - if (!StringDecoder) - StringDecoder = require('string_decoder/').StringDecoder; - this._readableState.decoder = new StringDecoder(enc); - this._readableState.encoding = enc; -}; - -// Don't raise the hwm > 128MB -var MAX_HWM = 0x800000; -function roundUpToNextPowerOf2(n) { - if (n >= MAX_HWM) { - n = MAX_HWM; - } else { - // Get the next highest power of 2 - n--; - for (var p = 1; p < 32; p <<= 1) n |= n >> p; - n++; - } - return n; -} - -function howMuchToRead(n, state) { - if (state.length === 0 && state.ended) - return 0; - - if (state.objectMode) - return n === 0 ? 0 : 1; - - if (n === null || isNaN(n)) { - // only flow one buffer at a time - if (state.flowing && state.buffer.length) - return state.buffer[0].length; - else - return state.length; - } - - if (n <= 0) - return 0; - - // If we're asking for more than the target buffer level, - // then raise the water mark. Bump up to the next highest - // power of 2, to prevent increasing it excessively in tiny - // amounts. - if (n > state.highWaterMark) - state.highWaterMark = roundUpToNextPowerOf2(n); - - // don't have that much. return null, unless we've ended. - if (n > state.length) { - if (!state.ended) { - state.needReadable = true; - return 0; - } else - return state.length; - } - - return n; -} - -// you can override either this method, or the async _read(n) below. -Readable.prototype.read = function(n) { - var state = this._readableState; - state.calledRead = true; - var nOrig = n; - var ret; - - if (typeof n !== 'number' || n > 0) - state.emittedReadable = false; - - // if we're doing read(0) to trigger a readable event, but we - // already have a bunch of data in the buffer, then just trigger - // the 'readable' event and move on. - if (n === 0 && - state.needReadable && - (state.length >= state.highWaterMark || state.ended)) { - emitReadable(this); - return null; - } - - n = howMuchToRead(n, state); - - // if we've ended, and we're now clear, then finish it up. - if (n === 0 && state.ended) { - ret = null; - - // In cases where the decoder did not receive enough data - // to produce a full chunk, then immediately received an - // EOF, state.buffer will contain [, ]. - // howMuchToRead will see this and coerce the amount to - // read to zero (because it's looking at the length of the - // first in state.buffer), and we'll end up here. - // - // This can only happen via state.decoder -- no other venue - // exists for pushing a zero-length chunk into state.buffer - // and triggering this behavior. In this case, we return our - // remaining data and end the stream, if appropriate. - if (state.length > 0 && state.decoder) { - ret = fromList(n, state); - state.length -= ret.length; - } - - if (state.length === 0) - endReadable(this); - - return ret; - } - - // All the actual chunk generation logic needs to be - // *below* the call to _read. The reason is that in certain - // synthetic stream cases, such as passthrough streams, _read - // may be a completely synchronous operation which may change - // the state of the read buffer, providing enough data when - // before there was *not* enough. - // - // So, the steps are: - // 1. Figure out what the state of things will be after we do - // a read from the buffer. - // - // 2. If that resulting state will trigger a _read, then call _read. - // Note that this may be asynchronous, or synchronous. Yes, it is - // deeply ugly to write APIs this way, but that still doesn't mean - // that the Readable class should behave improperly, as streams are - // designed to be sync/async agnostic. - // Take note if the _read call is sync or async (ie, if the read call - // has returned yet), so that we know whether or not it's safe to emit - // 'readable' etc. - // - // 3. Actually pull the requested chunks out of the buffer and return. - - // if we need a readable event, then we need to do some reading. - var doRead = state.needReadable; - - // if we currently have less than the highWaterMark, then also read some - if (state.length - n <= state.highWaterMark) - doRead = true; - - // however, if we've ended, then there's no point, and if we're already - // reading, then it's unnecessary. - if (state.ended || state.reading) - doRead = false; - - if (doRead) { - state.reading = true; - state.sync = true; - // if the length is currently zero, then we *need* a readable event. - if (state.length === 0) - state.needReadable = true; - // call internal read method - this._read(state.highWaterMark); - state.sync = false; - } - - // If _read called its callback synchronously, then `reading` - // will be false, and we need to re-evaluate how much data we - // can return to the user. - if (doRead && !state.reading) - n = howMuchToRead(nOrig, state); - - if (n > 0) - ret = fromList(n, state); - else - ret = null; - - if (ret === null) { - state.needReadable = true; - n = 0; - } - - state.length -= n; - - // If we have nothing in the buffer, then we want to know - // as soon as we *do* get something into the buffer. - if (state.length === 0 && !state.ended) - state.needReadable = true; - - // If we happened to read() exactly the remaining amount in the - // buffer, and the EOF has been seen at this point, then make sure - // that we emit 'end' on the very next tick. - if (state.ended && !state.endEmitted && state.length === 0) - endReadable(this); - - return ret; -}; - -function chunkInvalid(state, chunk) { - var er = null; - if (!Buffer.isBuffer(chunk) && - 'string' !== typeof chunk && - chunk !== null && - chunk !== undefined && - !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - return er; -} - - -function onEofChunk(stream, state) { - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; - } - } - state.ended = true; - - // if we've ended and we have some data left, then emit - // 'readable' now to make sure it gets picked up. - if (state.length > 0) - emitReadable(stream); - else - endReadable(stream); -} - -// Don't emit readable right away in sync mode, because this can trigger -// another read() call => stack overflow. This way, it might trigger -// a nextTick recursion warning, but that's not so bad. -function emitReadable(stream) { - var state = stream._readableState; - state.needReadable = false; - if (state.emittedReadable) - return; - - state.emittedReadable = true; - if (state.sync) - process.nextTick(function() { - emitReadable_(stream); - }); - else - emitReadable_(stream); -} - -function emitReadable_(stream) { - stream.emit('readable'); -} - - -// at this point, the user has presumably seen the 'readable' event, -// and called read() to consume some data. that may have triggered -// in turn another _read(n) call, in which case reading = true if -// it's in progress. -// However, if we're not ended, or reading, and the length < hwm, -// then go ahead and try to read some more preemptively. -function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - process.nextTick(function() { - maybeReadMore_(stream, state); - }); - } -} - -function maybeReadMore_(stream, state) { - var len = state.length; - while (!state.reading && !state.flowing && !state.ended && - state.length < state.highWaterMark) { - stream.read(0); - if (len === state.length) - // didn't get any data, stop spinning. - break; - else - len = state.length; - } - state.readingMore = false; -} - -// abstract method. to be overridden in specific implementation classes. -// call cb(er, data) where data is <= n in length. -// for virtual (non-string, non-buffer) streams, "length" is somewhat -// arbitrary, and perhaps not very meaningful. -Readable.prototype._read = function(n) { - this.emit('error', new Error('not implemented')); -}; - -Readable.prototype.pipe = function(dest, pipeOpts) { - var src = this; - var state = this._readableState; - - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - case 1: - state.pipes = [state.pipes, dest]; - break; - default: - state.pipes.push(dest); - break; - } - state.pipesCount += 1; - - var doEnd = (!pipeOpts || pipeOpts.end !== false) && - dest !== process.stdout && - dest !== process.stderr; - - var endFn = doEnd ? onend : cleanup; - if (state.endEmitted) - process.nextTick(endFn); - else - src.once('end', endFn); - - dest.on('unpipe', onunpipe); - function onunpipe(readable) { - if (readable !== src) return; - cleanup(); - } - - function onend() { - dest.end(); - } - - // when the dest drains, it reduces the awaitDrain counter - // on the source. This would be more elegant with a .once() - // handler in flow(), but adding and removing repeatedly is - // too slow. - var ondrain = pipeOnDrain(src); - dest.on('drain', ondrain); - - function cleanup() { - // cleanup event handlers once the pipe is broken - dest.removeListener('close', onclose); - dest.removeListener('finish', onfinish); - dest.removeListener('drain', ondrain); - dest.removeListener('error', onerror); - dest.removeListener('unpipe', onunpipe); - src.removeListener('end', onend); - src.removeListener('end', cleanup); - - // if the reader is waiting for a drain event from this - // specific writer, then it would cause it to never start - // flowing again. - // So, if this is awaiting a drain, then we just call it now. - // If we don't know, then assume that we are waiting for one. - if (!dest._writableState || dest._writableState.needDrain) - ondrain(); - } - - // if the dest has an error, then stop piping into it. - // however, don't suppress the throwing behavior for this. - function onerror(er) { - unpipe(); - dest.removeListener('error', onerror); - if (EE.listenerCount(dest, 'error') === 0) - dest.emit('error', er); - } - // This is a brutally ugly hack to make sure that our error handler - // is attached before any userland ones. NEVER DO THIS. - if (!dest._events || !dest._events.error) - dest.on('error', onerror); - else if (isArray(dest._events.error)) - dest._events.error.unshift(onerror); - else - dest._events.error = [onerror, dest._events.error]; - - - - // Both close and finish should trigger unpipe, but only once. - function onclose() { - dest.removeListener('finish', onfinish); - unpipe(); - } - dest.once('close', onclose); - function onfinish() { - dest.removeListener('close', onclose); - unpipe(); - } - dest.once('finish', onfinish); - - function unpipe() { - src.unpipe(dest); - } - - // tell the dest that it's being piped to - dest.emit('pipe', src); - - // start the flow if it hasn't been started already. - if (!state.flowing) { - // the handler that waits for readable events after all - // the data gets sucked out in flow. - // This would be easier to follow with a .once() handler - // in flow(), but that is too slow. - this.on('readable', pipeOnReadable); - - state.flowing = true; - process.nextTick(function() { - flow(src); - }); - } - - return dest; -}; - -function pipeOnDrain(src) { - return function() { - var dest = this; - var state = src._readableState; - state.awaitDrain--; - if (state.awaitDrain === 0) - flow(src); - }; -} - -function flow(src) { - var state = src._readableState; - var chunk; - state.awaitDrain = 0; - - function write(dest, i, list) { - var written = dest.write(chunk); - if (false === written) { - state.awaitDrain++; - } - } - - while (state.pipesCount && null !== (chunk = src.read())) { - - if (state.pipesCount === 1) - write(state.pipes, 0, null); - else - forEach(state.pipes, write); - - src.emit('data', chunk); - - // if anyone needs a drain, then we have to wait for that. - if (state.awaitDrain > 0) - return; - } - - // if every destination was unpiped, either before entering this - // function, or in the while loop, then stop flowing. - // - // NB: This is a pretty rare edge case. - if (state.pipesCount === 0) { - state.flowing = false; - - // if there were data event listeners added, then switch to old mode. - if (EE.listenerCount(src, 'data') > 0) - emitDataEvents(src); - return; - } - - // at this point, no one needed a drain, so we just ran out of data - // on the next readable event, start it over again. - state.ranOut = true; -} - -function pipeOnReadable() { - if (this._readableState.ranOut) { - this._readableState.ranOut = false; - flow(this); - } -} - - -Readable.prototype.unpipe = function(dest) { - var state = this._readableState; - - // if we're not piping anywhere, then do nothing. - if (state.pipesCount === 0) - return this; - - // just one destination. most common case. - if (state.pipesCount === 1) { - // passed in one, but it's not the right one. - if (dest && dest !== state.pipes) - return this; - - if (!dest) - dest = state.pipes; - - // got a match. - state.pipes = null; - state.pipesCount = 0; - this.removeListener('readable', pipeOnReadable); - state.flowing = false; - if (dest) - dest.emit('unpipe', this); - return this; - } - - // slow case. multiple pipe destinations. - - if (!dest) { - // remove all. - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - this.removeListener('readable', pipeOnReadable); - state.flowing = false; - - for (var i = 0; i < len; i++) - dests[i].emit('unpipe', this); - return this; - } - - // try to find the right one. - var i = indexOf(state.pipes, dest); - if (i === -1) - return this; - - state.pipes.splice(i, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) - state.pipes = state.pipes[0]; - - dest.emit('unpipe', this); - - return this; -}; - -// set up data events if they are asked for -// Ensure readable listeners eventually get something -Readable.prototype.on = function(ev, fn) { - var res = Stream.prototype.on.call(this, ev, fn); - - if (ev === 'data' && !this._readableState.flowing) - emitDataEvents(this); - - if (ev === 'readable' && this.readable) { - var state = this._readableState; - if (!state.readableListening) { - state.readableListening = true; - state.emittedReadable = false; - state.needReadable = true; - if (!state.reading) { - this.read(0); - } else if (state.length) { - emitReadable(this, state); - } - } - } - - return res; -}; -Readable.prototype.addListener = Readable.prototype.on; - -// pause() and resume() are remnants of the legacy readable stream API -// If the user uses them, then switch into old mode. -Readable.prototype.resume = function() { - emitDataEvents(this); - this.read(0); - this.emit('resume'); -}; - -Readable.prototype.pause = function() { - emitDataEvents(this, true); - this.emit('pause'); -}; - -function emitDataEvents(stream, startPaused) { - var state = stream._readableState; - - if (state.flowing) { - // https://github.com/isaacs/readable-stream/issues/16 - throw new Error('Cannot switch to old mode now.'); - } - - var paused = startPaused || false; - var readable = false; - - // convert to an old-style stream. - stream.readable = true; - stream.pipe = Stream.prototype.pipe; - stream.on = stream.addListener = Stream.prototype.on; - - stream.on('readable', function() { - readable = true; - - var c; - while (!paused && (null !== (c = stream.read()))) - stream.emit('data', c); - - if (c === null) { - readable = false; - stream._readableState.needReadable = true; - } - }); - - stream.pause = function() { - paused = true; - this.emit('pause'); - }; - - stream.resume = function() { - paused = false; - if (readable) - process.nextTick(function() { - stream.emit('readable'); - }); - else - this.read(0); - this.emit('resume'); - }; - - // now make it start, just in case it hadn't already. - stream.emit('readable'); -} - -// wrap an old-style stream as the async data source. -// This is *not* part of the readable stream interface. -// It is an ugly unfortunate mess of history. -Readable.prototype.wrap = function(stream) { - var state = this._readableState; - var paused = false; - - var self = this; - stream.on('end', function() { - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) - self.push(chunk); - } - - self.push(null); - }); - - stream.on('data', function(chunk) { - if (state.decoder) - chunk = state.decoder.write(chunk); - - // don't skip over falsy values in objectMode - //if (state.objectMode && util.isNullOrUndefined(chunk)) - if (state.objectMode && (chunk === null || chunk === undefined)) - return; - else if (!state.objectMode && (!chunk || !chunk.length)) - return; - - var ret = self.push(chunk); - if (!ret) { - paused = true; - stream.pause(); - } - }); - - // proxy all the other methods. - // important when wrapping filters and duplexes. - for (var i in stream) { - if (typeof stream[i] === 'function' && - typeof this[i] === 'undefined') { - this[i] = function(method) { return function() { - return stream[method].apply(stream, arguments); - }}(i); - } - } - - // proxy certain important events. - var events = ['error', 'close', 'destroy', 'pause', 'resume']; - forEach(events, function(ev) { - stream.on(ev, self.emit.bind(self, ev)); - }); - - // when we try to consume some more bytes, simply unpause the - // underlying stream. - self._read = function(n) { - if (paused) { - paused = false; - stream.resume(); - } - }; - - return self; -}; - - - -// exposed for testing purposes only. -Readable._fromList = fromList; - -// Pluck off n bytes from an array of buffers. -// Length is the combined lengths of all the buffers in the list. -function fromList(n, state) { - var list = state.buffer; - var length = state.length; - var stringMode = !!state.decoder; - var objectMode = !!state.objectMode; - var ret; - - // nothing in the list, definitely empty. - if (list.length === 0) - return null; - - if (length === 0) - ret = null; - else if (objectMode) - ret = list.shift(); - else if (!n || n >= length) { - // read it all, truncate the array. - if (stringMode) - ret = list.join(''); - else - ret = Buffer.concat(list, length); - list.length = 0; - } else { - // read just some of it. - if (n < list[0].length) { - // just take a part of the first list item. - // slice is the same for buffers and strings. - var buf = list[0]; - ret = buf.slice(0, n); - list[0] = buf.slice(n); - } else if (n === list[0].length) { - // first list is a perfect match - ret = list.shift(); - } else { - // complex case. - // we have enough to cover it, but it spans past the first buffer. - if (stringMode) - ret = ''; - else - ret = new Buffer(n); - - var c = 0; - for (var i = 0, l = list.length; i < l && c < n; i++) { - var buf = list[0]; - var cpy = Math.min(n - c, buf.length); - - if (stringMode) - ret += buf.slice(0, cpy); - else - buf.copy(ret, c, 0, cpy); - - if (cpy < buf.length) - list[0] = buf.slice(cpy); - else - list.shift(); - - c += cpy; - } - } - } - - return ret; -} - -function endReadable(stream) { - var state = stream._readableState; - - // If we get here before consuming all the bytes, then that is a - // bug in node. Should never happen. - if (state.length > 0) - throw new Error('endReadable called on non-empty stream'); - - if (!state.endEmitted && state.calledRead) { - state.ended = true; - process.nextTick(function() { - // Check that we didn't get one last unshift. - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); - } - }); - } -} - -function forEach (xs, f) { - for (var i = 0, l = xs.length; i < l; i++) { - f(xs[i], i); - } -} - -function indexOf (xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; - } - return -1; -} diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js deleted file mode 100644 index eb188df3e..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - - -// a transform stream is a readable/writable stream where you do -// something with the data. Sometimes it's called a "filter", -// but that's not a great name for it, since that implies a thing where -// some bits pass through, and others are simply ignored. (That would -// be a valid example of a transform, of course.) -// -// While the output is causally related to the input, it's not a -// necessarily symmetric or synchronous transformation. For example, -// a zlib stream might take multiple plain-text writes(), and then -// emit a single compressed chunk some time in the future. -// -// Here's how this works: -// -// The Transform stream has all the aspects of the readable and writable -// stream classes. When you write(chunk), that calls _write(chunk,cb) -// internally, and returns false if there's a lot of pending writes -// buffered up. When you call read(), that calls _read(n) until -// there's enough pending readable data buffered up. -// -// In a transform stream, the written data is placed in a buffer. When -// _read(n) is called, it transforms the queued up data, calling the -// buffered _write cb's as it consumes chunks. If consuming a single -// written chunk would result in multiple output chunks, then the first -// outputted bit calls the readcb, and subsequent chunks just go into -// the read buffer, and will cause it to emit 'readable' if necessary. -// -// This way, back-pressure is actually determined by the reading side, -// since _read has to be called to start processing a new chunk. However, -// a pathological inflate type of transform can cause excessive buffering -// here. For example, imagine a stream where every byte of input is -// interpreted as an integer from 0-255, and then results in that many -// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in -// 1kb of data being output. In this case, you could write a very small -// amount of input, and end up with a very large amount of output. In -// such a pathological inflating mechanism, there'd be no way to tell -// the system to stop doing the transform. A single 4MB write could -// cause the system to run out of memory. -// -// However, even in such a pathological case, only a single written chunk -// would be consumed, and then the rest would wait (un-transformed) until -// the results of the previous transformed chunk were consumed. - -module.exports = Transform; - -var Duplex = require('./_stream_duplex'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -util.inherits(Transform, Duplex); - - -function TransformState(options, stream) { - this.afterTransform = function(er, data) { - return afterTransform(stream, er, data); - }; - - this.needTransform = false; - this.transforming = false; - this.writecb = null; - this.writechunk = null; -} - -function afterTransform(stream, er, data) { - var ts = stream._transformState; - ts.transforming = false; - - var cb = ts.writecb; - - if (!cb) - return stream.emit('error', new Error('no writecb in Transform class')); - - ts.writechunk = null; - ts.writecb = null; - - if (data !== null && data !== undefined) - stream.push(data); - - if (cb) - cb(er); - - var rs = stream._readableState; - rs.reading = false; - if (rs.needReadable || rs.length < rs.highWaterMark) { - stream._read(rs.highWaterMark); - } -} - - -function Transform(options) { - if (!(this instanceof Transform)) - return new Transform(options); - - Duplex.call(this, options); - - var ts = this._transformState = new TransformState(options, this); - - // when the writable side finishes, then flush out anything remaining. - var stream = this; - - // start out asking for a readable event once data is transformed. - this._readableState.needReadable = true; - - // we have implemented the _read method, and done the other things - // that Readable wants before the first _read call, so unset the - // sync guard flag. - this._readableState.sync = false; - - this.once('finish', function() { - if ('function' === typeof this._flush) - this._flush(function(er) { - done(stream, er); - }); - else - done(stream); - }); -} - -Transform.prototype.push = function(chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); -}; - -// This is the part where you do stuff! -// override this function in implementation classes. -// 'chunk' is an input chunk. -// -// Call `push(newChunk)` to pass along transformed output -// to the readable side. You may call 'push' zero or more times. -// -// Call `cb(err)` when you are done with this chunk. If you pass -// an error, then that'll put the hurt on the whole operation. If you -// never call cb(), then you'll never get another chunk. -Transform.prototype._transform = function(chunk, encoding, cb) { - throw new Error('not implemented'); -}; - -Transform.prototype._write = function(chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || - rs.needReadable || - rs.length < rs.highWaterMark) - this._read(rs.highWaterMark); - } -}; - -// Doesn't matter what the args are here. -// _transform does all the work. -// That we got here means that the readable side wants more data. -Transform.prototype._read = function(n) { - var ts = this._transformState; - - if (ts.writechunk !== null && ts.writecb && !ts.transforming) { - ts.transforming = true; - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - // mark that we need a transform, so that any data that comes in - // will get processed, now that we've asked for it. - ts.needTransform = true; - } -}; - - -function done(stream, er) { - if (er) - return stream.emit('error', er); - - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided - var ws = stream._writableState; - var rs = stream._readableState; - var ts = stream._transformState; - - if (ws.length) - throw new Error('calling transform done when ws.length != 0'); - - if (ts.transforming) - throw new Error('calling transform done when still transforming'); - - return stream.push(null); -} diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js deleted file mode 100644 index 4bdaa4fa4..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js +++ /dev/null @@ -1,386 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -// A bit simpler than readable streams. -// Implement an async ._write(chunk, cb), and it'll handle all -// the drain event emission and buffering. - -module.exports = Writable; - -/**/ -var Buffer = require('buffer').Buffer; -/**/ - -Writable.WritableState = WritableState; - - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -var Stream = require('stream'); - -util.inherits(Writable, Stream); - -function WriteReq(chunk, encoding, cb) { - this.chunk = chunk; - this.encoding = encoding; - this.callback = cb; -} - -function WritableState(options, stream) { - options = options || {}; - - // the point at which write() starts returning false - // Note: 0 is a valid value, means that we always return false if - // the entire buffer is not flushed immediately on write() - var hwm = options.highWaterMark; - this.highWaterMark = (hwm || hwm === 0) ? hwm : 16 * 1024; - - // object stream flag to indicate whether or not this stream - // contains buffers or objects. - this.objectMode = !!options.objectMode; - - // cast to ints. - this.highWaterMark = ~~this.highWaterMark; - - this.needDrain = false; - // at the start of calling end() - this.ending = false; - // when end() has been called, and returned - this.ended = false; - // when 'finish' is emitted - this.finished = false; - - // should we decode strings into buffers before passing to _write? - // this is here so that some node-core streams can optimize string - // handling at a lower level. - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // not an actual buffer we keep track of, but a measurement - // of how much we're waiting to get pushed to some underlying - // socket or file. - this.length = 0; - - // a flag to see when we're in the middle of a write. - this.writing = false; - - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, becuase any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; - - // a flag to know if we're processing previously buffered items, which - // may call the _write() callback in the same tick, so that we don't - // end up in an overlapped onwrite situation. - this.bufferProcessing = false; - - // the callback that's passed to _write(chunk,cb) - this.onwrite = function(er) { - onwrite(stream, er); - }; - - // the callback that the user supplies to write(chunk,encoding,cb) - this.writecb = null; - - // the amount that is being written when _write is called. - this.writelen = 0; - - this.buffer = []; - - // True if the error was already emitted and should not be thrown again - this.errorEmitted = false; -} - -function Writable(options) { - var Duplex = require('./_stream_duplex'); - - // Writable ctor is applied to Duplexes, though they're not - // instanceof Writable, they're instanceof Readable. - if (!(this instanceof Writable) && !(this instanceof Duplex)) - return new Writable(options); - - this._writableState = new WritableState(options, this); - - // legacy. - this.writable = true; - - Stream.call(this); -} - -// Otherwise people can pipe Writable streams, which is just wrong. -Writable.prototype.pipe = function() { - this.emit('error', new Error('Cannot pipe. Not readable.')); -}; - - -function writeAfterEnd(stream, state, cb) { - var er = new Error('write after end'); - // TODO: defer error events consistently everywhere, not just the cb - stream.emit('error', er); - process.nextTick(function() { - cb(er); - }); -} - -// If we get something that is not a buffer, string, null, or undefined, -// and we're not in objectMode, then that's an error. -// Otherwise stream chunks are all considered to be of length=1, and the -// watermarks determine how many objects to keep in the buffer, rather than -// how many bytes or characters. -function validChunk(stream, state, chunk, cb) { - var valid = true; - if (!Buffer.isBuffer(chunk) && - 'string' !== typeof chunk && - chunk !== null && - chunk !== undefined && - !state.objectMode) { - var er = new TypeError('Invalid non-string/buffer chunk'); - stream.emit('error', er); - process.nextTick(function() { - cb(er); - }); - valid = false; - } - return valid; -} - -Writable.prototype.write = function(chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - - if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (Buffer.isBuffer(chunk)) - encoding = 'buffer'; - else if (!encoding) - encoding = state.defaultEncoding; - - if (typeof cb !== 'function') - cb = function() {}; - - if (state.ended) - writeAfterEnd(this, state, cb); - else if (validChunk(this, state, chunk, cb)) - ret = writeOrBuffer(this, state, chunk, encoding, cb); - - return ret; -}; - -function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && - state.decodeStrings !== false && - typeof chunk === 'string') { - chunk = new Buffer(chunk, encoding); - } - return chunk; -} - -// if we're already writing something, then just put this -// in the queue, and wait our turn. Otherwise, call _write -// If we return false, then we need a drain event, so set that flag. -function writeOrBuffer(stream, state, chunk, encoding, cb) { - chunk = decodeChunk(state, chunk, encoding); - if (Buffer.isBuffer(chunk)) - encoding = 'buffer'; - var len = state.objectMode ? 1 : chunk.length; - - state.length += len; - - var ret = state.length < state.highWaterMark; - // we must ensure that previous needDrain will not be reset to false. - if (!ret) - state.needDrain = true; - - if (state.writing) - state.buffer.push(new WriteReq(chunk, encoding, cb)); - else - doWrite(stream, state, len, chunk, encoding, cb); - - return ret; -} - -function doWrite(stream, state, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - stream._write(chunk, encoding, state.onwrite); - state.sync = false; -} - -function onwriteError(stream, state, sync, er, cb) { - if (sync) - process.nextTick(function() { - cb(er); - }); - else - cb(er); - - stream._writableState.errorEmitted = true; - stream.emit('error', er); -} - -function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; -} - -function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; - - onwriteStateUpdate(state); - - if (er) - onwriteError(stream, state, sync, er, cb); - else { - // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(stream, state); - - if (!finished && !state.bufferProcessing && state.buffer.length) - clearBuffer(stream, state); - - if (sync) { - process.nextTick(function() { - afterWrite(stream, state, finished, cb); - }); - } else { - afterWrite(stream, state, finished, cb); - } - } -} - -function afterWrite(stream, state, finished, cb) { - if (!finished) - onwriteDrain(stream, state); - cb(); - if (finished) - finishMaybe(stream, state); -} - -// Must force callback to be called on nextTick, so that we don't -// emit 'drain' before the write() consumer gets the 'false' return -// value, and has a chance to attach a 'drain' listener. -function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit('drain'); - } -} - - -// if there's something in the buffer waiting, then process it -function clearBuffer(stream, state) { - state.bufferProcessing = true; - - for (var c = 0; c < state.buffer.length; c++) { - var entry = state.buffer[c]; - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; - - doWrite(stream, state, len, chunk, encoding, cb); - - // if we didn't call the onwrite immediately, then - // it means that we need to wait until it does. - // also, that means that the chunk and cb are currently - // being processed, so move the buffer counter past them. - if (state.writing) { - c++; - break; - } - } - - state.bufferProcessing = false; - if (c < state.buffer.length) - state.buffer = state.buffer.slice(c); - else - state.buffer.length = 0; -} - -Writable.prototype._write = function(chunk, encoding, cb) { - cb(new Error('not implemented')); -}; - -Writable.prototype.end = function(chunk, encoding, cb) { - var state = this._writableState; - - if (typeof chunk === 'function') { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (typeof chunk !== 'undefined' && chunk !== null) - this.write(chunk, encoding); - - // ignore unnecessary end() calls. - if (!state.ending && !state.finished) - endWritable(this, state, cb); -}; - - -function needFinish(stream, state) { - return (state.ending && - state.length === 0 && - !state.finished && - !state.writing); -} - -function finishMaybe(stream, state) { - var need = needFinish(stream, state); - if (need) { - state.finished = true; - stream.emit('finish'); - } - return need; -} - -function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - if (cb) { - if (state.finished) - process.nextTick(cb); - else - stream.once('finish', cb); - } - state.ended = true; -} diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/README.md b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/README.md deleted file mode 100644 index 5a76b4149..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# core-util-is - -The `util.is*` functions introduced in Node v0.12. diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/float.patch b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/float.patch deleted file mode 100644 index a06d5c05f..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/float.patch +++ /dev/null @@ -1,604 +0,0 @@ -diff --git a/lib/util.js b/lib/util.js -index a03e874..9074e8e 100644 ---- a/lib/util.js -+++ b/lib/util.js -@@ -19,430 +19,6 @@ - // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - // USE OR OTHER DEALINGS IN THE SOFTWARE. - --var formatRegExp = /%[sdj%]/g; --exports.format = function(f) { -- if (!isString(f)) { -- var objects = []; -- for (var i = 0; i < arguments.length; i++) { -- objects.push(inspect(arguments[i])); -- } -- return objects.join(' '); -- } -- -- var i = 1; -- var args = arguments; -- var len = args.length; -- var str = String(f).replace(formatRegExp, function(x) { -- if (x === '%%') return '%'; -- if (i >= len) return x; -- switch (x) { -- case '%s': return String(args[i++]); -- case '%d': return Number(args[i++]); -- case '%j': -- try { -- return JSON.stringify(args[i++]); -- } catch (_) { -- return '[Circular]'; -- } -- default: -- return x; -- } -- }); -- for (var x = args[i]; i < len; x = args[++i]) { -- if (isNull(x) || !isObject(x)) { -- str += ' ' + x; -- } else { -- str += ' ' + inspect(x); -- } -- } -- return str; --}; -- -- --// Mark that a method should not be used. --// Returns a modified function which warns once by default. --// If --no-deprecation is set, then it is a no-op. --exports.deprecate = function(fn, msg) { -- // Allow for deprecating things in the process of starting up. -- if (isUndefined(global.process)) { -- return function() { -- return exports.deprecate(fn, msg).apply(this, arguments); -- }; -- } -- -- if (process.noDeprecation === true) { -- return fn; -- } -- -- var warned = false; -- function deprecated() { -- if (!warned) { -- if (process.throwDeprecation) { -- throw new Error(msg); -- } else if (process.traceDeprecation) { -- console.trace(msg); -- } else { -- console.error(msg); -- } -- warned = true; -- } -- return fn.apply(this, arguments); -- } -- -- return deprecated; --}; -- -- --var debugs = {}; --var debugEnviron; --exports.debuglog = function(set) { -- if (isUndefined(debugEnviron)) -- debugEnviron = process.env.NODE_DEBUG || ''; -- set = set.toUpperCase(); -- if (!debugs[set]) { -- if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { -- var pid = process.pid; -- debugs[set] = function() { -- var msg = exports.format.apply(exports, arguments); -- console.error('%s %d: %s', set, pid, msg); -- }; -- } else { -- debugs[set] = function() {}; -- } -- } -- return debugs[set]; --}; -- -- --/** -- * Echos the value of a value. Trys to print the value out -- * in the best way possible given the different types. -- * -- * @param {Object} obj The object to print out. -- * @param {Object} opts Optional options object that alters the output. -- */ --/* legacy: obj, showHidden, depth, colors*/ --function inspect(obj, opts) { -- // default options -- var ctx = { -- seen: [], -- stylize: stylizeNoColor -- }; -- // legacy... -- if (arguments.length >= 3) ctx.depth = arguments[2]; -- if (arguments.length >= 4) ctx.colors = arguments[3]; -- if (isBoolean(opts)) { -- // legacy... -- ctx.showHidden = opts; -- } else if (opts) { -- // got an "options" object -- exports._extend(ctx, opts); -- } -- // set default options -- if (isUndefined(ctx.showHidden)) ctx.showHidden = false; -- if (isUndefined(ctx.depth)) ctx.depth = 2; -- if (isUndefined(ctx.colors)) ctx.colors = false; -- if (isUndefined(ctx.customInspect)) ctx.customInspect = true; -- if (ctx.colors) ctx.stylize = stylizeWithColor; -- return formatValue(ctx, obj, ctx.depth); --} --exports.inspect = inspect; -- -- --// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics --inspect.colors = { -- 'bold' : [1, 22], -- 'italic' : [3, 23], -- 'underline' : [4, 24], -- 'inverse' : [7, 27], -- 'white' : [37, 39], -- 'grey' : [90, 39], -- 'black' : [30, 39], -- 'blue' : [34, 39], -- 'cyan' : [36, 39], -- 'green' : [32, 39], -- 'magenta' : [35, 39], -- 'red' : [31, 39], -- 'yellow' : [33, 39] --}; -- --// Don't use 'blue' not visible on cmd.exe --inspect.styles = { -- 'special': 'cyan', -- 'number': 'yellow', -- 'boolean': 'yellow', -- 'undefined': 'grey', -- 'null': 'bold', -- 'string': 'green', -- 'date': 'magenta', -- // "name": intentionally not styling -- 'regexp': 'red' --}; -- -- --function stylizeWithColor(str, styleType) { -- var style = inspect.styles[styleType]; -- -- if (style) { -- return '\u001b[' + inspect.colors[style][0] + 'm' + str + -- '\u001b[' + inspect.colors[style][1] + 'm'; -- } else { -- return str; -- } --} -- -- --function stylizeNoColor(str, styleType) { -- return str; --} -- -- --function arrayToHash(array) { -- var hash = {}; -- -- array.forEach(function(val, idx) { -- hash[val] = true; -- }); -- -- return hash; --} -- -- --function formatValue(ctx, value, recurseTimes) { -- // Provide a hook for user-specified inspect functions. -- // Check that value is an object with an inspect function on it -- if (ctx.customInspect && -- value && -- isFunction(value.inspect) && -- // Filter out the util module, it's inspect function is special -- value.inspect !== exports.inspect && -- // Also filter out any prototype objects using the circular check. -- !(value.constructor && value.constructor.prototype === value)) { -- var ret = value.inspect(recurseTimes, ctx); -- if (!isString(ret)) { -- ret = formatValue(ctx, ret, recurseTimes); -- } -- return ret; -- } -- -- // Primitive types cannot have properties -- var primitive = formatPrimitive(ctx, value); -- if (primitive) { -- return primitive; -- } -- -- // Look up the keys of the object. -- var keys = Object.keys(value); -- var visibleKeys = arrayToHash(keys); -- -- if (ctx.showHidden) { -- keys = Object.getOwnPropertyNames(value); -- } -- -- // Some type of object without properties can be shortcutted. -- if (keys.length === 0) { -- if (isFunction(value)) { -- var name = value.name ? ': ' + value.name : ''; -- return ctx.stylize('[Function' + name + ']', 'special'); -- } -- if (isRegExp(value)) { -- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); -- } -- if (isDate(value)) { -- return ctx.stylize(Date.prototype.toString.call(value), 'date'); -- } -- if (isError(value)) { -- return formatError(value); -- } -- } -- -- var base = '', array = false, braces = ['{', '}']; -- -- // Make Array say that they are Array -- if (isArray(value)) { -- array = true; -- braces = ['[', ']']; -- } -- -- // Make functions say that they are functions -- if (isFunction(value)) { -- var n = value.name ? ': ' + value.name : ''; -- base = ' [Function' + n + ']'; -- } -- -- // Make RegExps say that they are RegExps -- if (isRegExp(value)) { -- base = ' ' + RegExp.prototype.toString.call(value); -- } -- -- // Make dates with properties first say the date -- if (isDate(value)) { -- base = ' ' + Date.prototype.toUTCString.call(value); -- } -- -- // Make error with message first say the error -- if (isError(value)) { -- base = ' ' + formatError(value); -- } -- -- if (keys.length === 0 && (!array || value.length == 0)) { -- return braces[0] + base + braces[1]; -- } -- -- if (recurseTimes < 0) { -- if (isRegExp(value)) { -- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); -- } else { -- return ctx.stylize('[Object]', 'special'); -- } -- } -- -- ctx.seen.push(value); -- -- var output; -- if (array) { -- output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); -- } else { -- output = keys.map(function(key) { -- return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); -- }); -- } -- -- ctx.seen.pop(); -- -- return reduceToSingleString(output, base, braces); --} -- -- --function formatPrimitive(ctx, value) { -- if (isUndefined(value)) -- return ctx.stylize('undefined', 'undefined'); -- if (isString(value)) { -- var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') -- .replace(/'/g, "\\'") -- .replace(/\\"/g, '"') + '\''; -- return ctx.stylize(simple, 'string'); -- } -- if (isNumber(value)) { -- // Format -0 as '-0'. Strict equality won't distinguish 0 from -0, -- // so instead we use the fact that 1 / -0 < 0 whereas 1 / 0 > 0 . -- if (value === 0 && 1 / value < 0) -- return ctx.stylize('-0', 'number'); -- return ctx.stylize('' + value, 'number'); -- } -- if (isBoolean(value)) -- return ctx.stylize('' + value, 'boolean'); -- // For some reason typeof null is "object", so special case here. -- if (isNull(value)) -- return ctx.stylize('null', 'null'); --} -- -- --function formatError(value) { -- return '[' + Error.prototype.toString.call(value) + ']'; --} -- -- --function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { -- var output = []; -- for (var i = 0, l = value.length; i < l; ++i) { -- if (hasOwnProperty(value, String(i))) { -- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, -- String(i), true)); -- } else { -- output.push(''); -- } -- } -- keys.forEach(function(key) { -- if (!key.match(/^\d+$/)) { -- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, -- key, true)); -- } -- }); -- return output; --} -- -- --function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { -- var name, str, desc; -- desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; -- if (desc.get) { -- if (desc.set) { -- str = ctx.stylize('[Getter/Setter]', 'special'); -- } else { -- str = ctx.stylize('[Getter]', 'special'); -- } -- } else { -- if (desc.set) { -- str = ctx.stylize('[Setter]', 'special'); -- } -- } -- if (!hasOwnProperty(visibleKeys, key)) { -- name = '[' + key + ']'; -- } -- if (!str) { -- if (ctx.seen.indexOf(desc.value) < 0) { -- if (isNull(recurseTimes)) { -- str = formatValue(ctx, desc.value, null); -- } else { -- str = formatValue(ctx, desc.value, recurseTimes - 1); -- } -- if (str.indexOf('\n') > -1) { -- if (array) { -- str = str.split('\n').map(function(line) { -- return ' ' + line; -- }).join('\n').substr(2); -- } else { -- str = '\n' + str.split('\n').map(function(line) { -- return ' ' + line; -- }).join('\n'); -- } -- } -- } else { -- str = ctx.stylize('[Circular]', 'special'); -- } -- } -- if (isUndefined(name)) { -- if (array && key.match(/^\d+$/)) { -- return str; -- } -- name = JSON.stringify('' + key); -- if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { -- name = name.substr(1, name.length - 2); -- name = ctx.stylize(name, 'name'); -- } else { -- name = name.replace(/'/g, "\\'") -- .replace(/\\"/g, '"') -- .replace(/(^"|"$)/g, "'"); -- name = ctx.stylize(name, 'string'); -- } -- } -- -- return name + ': ' + str; --} -- -- --function reduceToSingleString(output, base, braces) { -- var numLinesEst = 0; -- var length = output.reduce(function(prev, cur) { -- numLinesEst++; -- if (cur.indexOf('\n') >= 0) numLinesEst++; -- return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; -- }, 0); -- -- if (length > 60) { -- return braces[0] + -- (base === '' ? '' : base + '\n ') + -- ' ' + -- output.join(',\n ') + -- ' ' + -- braces[1]; -- } -- -- return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; --} -- -- - // NOTE: These type checking functions intentionally don't use `instanceof` - // because it is fragile and can be easily faked with `Object.create()`. - function isArray(ar) { -@@ -522,166 +98,10 @@ function isPrimitive(arg) { - exports.isPrimitive = isPrimitive; - - function isBuffer(arg) { -- return arg instanceof Buffer; -+ return Buffer.isBuffer(arg); - } - exports.isBuffer = isBuffer; - - function objectToString(o) { - return Object.prototype.toString.call(o); --} -- -- --function pad(n) { -- return n < 10 ? '0' + n.toString(10) : n.toString(10); --} -- -- --var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', -- 'Oct', 'Nov', 'Dec']; -- --// 26 Feb 16:19:34 --function timestamp() { -- var d = new Date(); -- var time = [pad(d.getHours()), -- pad(d.getMinutes()), -- pad(d.getSeconds())].join(':'); -- return [d.getDate(), months[d.getMonth()], time].join(' '); --} -- -- --// log is just a thin wrapper to console.log that prepends a timestamp --exports.log = function() { -- console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); --}; -- -- --/** -- * Inherit the prototype methods from one constructor into another. -- * -- * The Function.prototype.inherits from lang.js rewritten as a standalone -- * function (not on Function.prototype). NOTE: If this file is to be loaded -- * during bootstrapping this function needs to be rewritten using some native -- * functions as prototype setup using normal JavaScript does not work as -- * expected during bootstrapping (see mirror.js in r114903). -- * -- * @param {function} ctor Constructor function which needs to inherit the -- * prototype. -- * @param {function} superCtor Constructor function to inherit prototype from. -- */ --exports.inherits = function(ctor, superCtor) { -- ctor.super_ = superCtor; -- ctor.prototype = Object.create(superCtor.prototype, { -- constructor: { -- value: ctor, -- enumerable: false, -- writable: true, -- configurable: true -- } -- }); --}; -- --exports._extend = function(origin, add) { -- // Don't do anything if add isn't an object -- if (!add || !isObject(add)) return origin; -- -- var keys = Object.keys(add); -- var i = keys.length; -- while (i--) { -- origin[keys[i]] = add[keys[i]]; -- } -- return origin; --}; -- --function hasOwnProperty(obj, prop) { -- return Object.prototype.hasOwnProperty.call(obj, prop); --} -- -- --// Deprecated old stuff. -- --exports.p = exports.deprecate(function() { -- for (var i = 0, len = arguments.length; i < len; ++i) { -- console.error(exports.inspect(arguments[i])); -- } --}, 'util.p: Use console.error() instead'); -- -- --exports.exec = exports.deprecate(function() { -- return require('child_process').exec.apply(this, arguments); --}, 'util.exec is now called `child_process.exec`.'); -- -- --exports.print = exports.deprecate(function() { -- for (var i = 0, len = arguments.length; i < len; ++i) { -- process.stdout.write(String(arguments[i])); -- } --}, 'util.print: Use console.log instead'); -- -- --exports.puts = exports.deprecate(function() { -- for (var i = 0, len = arguments.length; i < len; ++i) { -- process.stdout.write(arguments[i] + '\n'); -- } --}, 'util.puts: Use console.log instead'); -- -- --exports.debug = exports.deprecate(function(x) { -- process.stderr.write('DEBUG: ' + x + '\n'); --}, 'util.debug: Use console.error instead'); -- -- --exports.error = exports.deprecate(function(x) { -- for (var i = 0, len = arguments.length; i < len; ++i) { -- process.stderr.write(arguments[i] + '\n'); -- } --}, 'util.error: Use console.error instead'); -- -- --exports.pump = exports.deprecate(function(readStream, writeStream, callback) { -- var callbackCalled = false; -- -- function call(a, b, c) { -- if (callback && !callbackCalled) { -- callback(a, b, c); -- callbackCalled = true; -- } -- } -- -- readStream.addListener('data', function(chunk) { -- if (writeStream.write(chunk) === false) readStream.pause(); -- }); -- -- writeStream.addListener('drain', function() { -- readStream.resume(); -- }); -- -- readStream.addListener('end', function() { -- writeStream.end(); -- }); -- -- readStream.addListener('close', function() { -- call(); -- }); -- -- readStream.addListener('error', function(err) { -- writeStream.end(); -- call(err); -- }); -- -- writeStream.addListener('error', function(err) { -- readStream.destroy(); -- call(err); -- }); --}, 'util.pump(): Use readableStream.pipe() instead'); -- -- --var uv; --exports._errnoException = function(err, syscall) { -- if (isUndefined(uv)) uv = process.binding('uv'); -- var errname = uv.errname(err); -- var e = new Error(syscall + ' ' + errname); -- e.code = errname; -- e.errno = errname; -- e.syscall = syscall; -- return e; --}; -+} \ No newline at end of file diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js deleted file mode 100644 index 9074e8ebc..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -// NOTE: These type checking functions intentionally don't use `instanceof` -// because it is fragile and can be easily faked with `Object.create()`. -function isArray(ar) { - return Array.isArray(ar); -} -exports.isArray = isArray; - -function isBoolean(arg) { - return typeof arg === 'boolean'; -} -exports.isBoolean = isBoolean; - -function isNull(arg) { - return arg === null; -} -exports.isNull = isNull; - -function isNullOrUndefined(arg) { - return arg == null; -} -exports.isNullOrUndefined = isNullOrUndefined; - -function isNumber(arg) { - return typeof arg === 'number'; -} -exports.isNumber = isNumber; - -function isString(arg) { - return typeof arg === 'string'; -} -exports.isString = isString; - -function isSymbol(arg) { - return typeof arg === 'symbol'; -} -exports.isSymbol = isSymbol; - -function isUndefined(arg) { - return arg === void 0; -} -exports.isUndefined = isUndefined; - -function isRegExp(re) { - return isObject(re) && objectToString(re) === '[object RegExp]'; -} -exports.isRegExp = isRegExp; - -function isObject(arg) { - return typeof arg === 'object' && arg !== null; -} -exports.isObject = isObject; - -function isDate(d) { - return isObject(d) && objectToString(d) === '[object Date]'; -} -exports.isDate = isDate; - -function isError(e) { - return isObject(e) && - (objectToString(e) === '[object Error]' || e instanceof Error); -} -exports.isError = isError; - -function isFunction(arg) { - return typeof arg === 'function'; -} -exports.isFunction = isFunction; - -function isPrimitive(arg) { - return arg === null || - typeof arg === 'boolean' || - typeof arg === 'number' || - typeof arg === 'string' || - typeof arg === 'symbol' || // ES6 symbol - typeof arg === 'undefined'; -} -exports.isPrimitive = isPrimitive; - -function isBuffer(arg) { - return Buffer.isBuffer(arg); -} -exports.isBuffer = isBuffer; - -function objectToString(o) { - return Object.prototype.toString.call(o); -} \ No newline at end of file diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json deleted file mode 100644 index 2b7593c19..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "core-util-is", - "version": "1.0.1", - "description": "The `util.is*` functions introduced in Node v0.12.", - "main": "lib/util.js", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/core-util-is" - }, - "keywords": [ - "util", - "isBuffer", - "isArray", - "isNumber", - "isString", - "isRegExp", - "isThis", - "isThat", - "polyfill" - ], - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/isaacs/core-util-is/issues" - }, - "readme": "# core-util-is\n\nThe `util.is*` functions introduced in Node v0.12.\n", - "readmeFilename": "README.md", - "homepage": "https://github.com/isaacs/core-util-is", - "_id": "core-util-is@1.0.1", - "dist": { - "shasum": "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538", - "tarball": "http://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz" - }, - "_from": "core-util-is@~1.0.0", - "_npmVersion": "1.3.23", - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "directories": {}, - "_shasum": "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538", - "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz", - "scripts": {} -} diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/util.js b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/util.js deleted file mode 100644 index 007fa1057..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/util.js +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -// NOTE: These type checking functions intentionally don't use `instanceof` -// because it is fragile and can be easily faked with `Object.create()`. -function isArray(ar) { - return Array.isArray(ar); -} -exports.isArray = isArray; - -function isBoolean(arg) { - return typeof arg === 'boolean'; -} -exports.isBoolean = isBoolean; - -function isNull(arg) { - return arg === null; -} -exports.isNull = isNull; - -function isNullOrUndefined(arg) { - return arg == null; -} -exports.isNullOrUndefined = isNullOrUndefined; - -function isNumber(arg) { - return typeof arg === 'number'; -} -exports.isNumber = isNumber; - -function isString(arg) { - return typeof arg === 'string'; -} -exports.isString = isString; - -function isSymbol(arg) { - return typeof arg === 'symbol'; -} -exports.isSymbol = isSymbol; - -function isUndefined(arg) { - return arg === void 0; -} -exports.isUndefined = isUndefined; - -function isRegExp(re) { - return isObject(re) && objectToString(re) === '[object RegExp]'; -} -exports.isRegExp = isRegExp; - -function isObject(arg) { - return typeof arg === 'object' && arg !== null; -} -exports.isObject = isObject; - -function isDate(d) { - return isObject(d) && objectToString(d) === '[object Date]'; -} -exports.isDate = isDate; - -function isError(e) { - return isObject(e) && objectToString(e) === '[object Error]'; -} -exports.isError = isError; - -function isFunction(arg) { - return typeof arg === 'function'; -} -exports.isFunction = isFunction; - -function isPrimitive(arg) { - return arg === null || - typeof arg === 'boolean' || - typeof arg === 'number' || - typeof arg === 'string' || - typeof arg === 'symbol' || // ES6 symbol - typeof arg === 'undefined'; -} -exports.isPrimitive = isPrimitive; - -function isBuffer(arg) { - return arg instanceof Buffer; -} -exports.isBuffer = isBuffer; - -function objectToString(o) { - return Object.prototype.toString.call(o); -} diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/LICENSE b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/LICENSE deleted file mode 100644 index dea3013d6..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/LICENSE +++ /dev/null @@ -1,16 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. - diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/README.md b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/README.md deleted file mode 100644 index b1c566585..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/README.md +++ /dev/null @@ -1,42 +0,0 @@ -Browser-friendly inheritance fully compatible with standard node.js -[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). - -This package exports standard `inherits` from node.js `util` module in -node environment, but also provides alternative browser-friendly -implementation through [browser -field](https://gist.github.com/shtylman/4339901). Alternative -implementation is a literal copy of standard one located in standalone -module to avoid requiring of `util`. It also has a shim for old -browsers with no `Object.create` support. - -While keeping you sure you are using standard `inherits` -implementation in node.js environment, it allows bundlers such as -[browserify](https://github.com/substack/node-browserify) to not -include full `util` package to your client code if all you need is -just `inherits` function. It worth, because browser shim for `util` -package is large and `inherits` is often the single function you need -from it. - -It's recommended to use this package instead of -`require('util').inherits` for any code that has chances to be used -not only in node.js but in browser too. - -## usage - -```js -var inherits = require('inherits'); -// then use exactly as the standard one -``` - -## note on version ~1.0 - -Version ~1.0 had completely different motivation and is not compatible -neither with 2.0 nor with standard node.js `inherits`. - -If you are using version ~1.0 and planning to switch to ~2.0, be -careful: - -* new version uses `super_` instead of `super` for referencing - superclass -* new version overwrites current prototype while old one preserves any - existing fields on it diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/inherits.js b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/inherits.js deleted file mode 100644 index 29f5e24f5..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/inherits.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('util').inherits diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/inherits_browser.js b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/inherits_browser.js deleted file mode 100644 index c1e78a75e..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/inherits_browser.js +++ /dev/null @@ -1,23 +0,0 @@ -if (typeof Object.create === 'function') { - // implementation from standard node.js 'util' module - module.exports = function inherits(ctor, superCtor) { - ctor.super_ = superCtor - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }); - }; -} else { - // old school shim for old browsers - module.exports = function inherits(ctor, superCtor) { - ctor.super_ = superCtor - var TempCtor = function () {} - TempCtor.prototype = superCtor.prototype - ctor.prototype = new TempCtor() - ctor.prototype.constructor = ctor - } -} diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/package.json b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/package.json deleted file mode 100644 index 3d69f4f40..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/package.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "name": "inherits", - "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", - "version": "2.0.1", - "keywords": [ - "inheritance", - "class", - "klass", - "oop", - "object-oriented", - "inherits", - "browser", - "browserify" - ], - "main": "./inherits.js", - "browser": "./inherits_browser.js", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/inherits" - }, - "license": "ISC", - "scripts": { - "test": "node test" - }, - "readme": "Browser-friendly inheritance fully compatible with standard node.js\n[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).\n\nThis package exports standard `inherits` from node.js `util` module in\nnode environment, but also provides alternative browser-friendly\nimplementation through [browser\nfield](https://gist.github.com/shtylman/4339901). Alternative\nimplementation is a literal copy of standard one located in standalone\nmodule to avoid requiring of `util`. It also has a shim for old\nbrowsers with no `Object.create` support.\n\nWhile keeping you sure you are using standard `inherits`\nimplementation in node.js environment, it allows bundlers such as\n[browserify](https://github.com/substack/node-browserify) to not\ninclude full `util` package to your client code if all you need is\njust `inherits` function. It worth, because browser shim for `util`\npackage is large and `inherits` is often the single function you need\nfrom it.\n\nIt's recommended to use this package instead of\n`require('util').inherits` for any code that has chances to be used\nnot only in node.js but in browser too.\n\n## usage\n\n```js\nvar inherits = require('inherits');\n// then use exactly as the standard one\n```\n\n## note on version ~1.0\n\nVersion ~1.0 had completely different motivation and is not compatible\nneither with 2.0 nor with standard node.js `inherits`.\n\nIf you are using version ~1.0 and planning to switch to ~2.0, be\ncareful:\n\n* new version uses `super_` instead of `super` for referencing\n superclass\n* new version overwrites current prototype while old one preserves any\n existing fields on it\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/inherits/issues" - }, - "_id": "inherits@2.0.1", - "dist": { - "shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1", - "tarball": "http://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" - }, - "_from": "inherits@~2.0.1", - "_npmVersion": "1.3.8", - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "directories": {}, - "_shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1", - "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "homepage": "https://github.com/isaacs/inherits" -} diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/test.js b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/test.js deleted file mode 100644 index fc53012d3..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/test.js +++ /dev/null @@ -1,25 +0,0 @@ -var inherits = require('./inherits.js') -var assert = require('assert') - -function test(c) { - assert(c.constructor === Child) - assert(c.constructor.super_ === Parent) - assert(Object.getPrototypeOf(c) === Child.prototype) - assert(Object.getPrototypeOf(Object.getPrototypeOf(c)) === Parent.prototype) - assert(c instanceof Child) - assert(c instanceof Parent) -} - -function Child() { - Parent.call(this) - test(this) -} - -function Parent() {} - -inherits(Child, Parent) - -var c = new Child -test(c) - -console.log('ok') diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/README.md b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/README.md deleted file mode 100644 index 052a62b8d..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/README.md +++ /dev/null @@ -1,54 +0,0 @@ - -# isarray - -`Array#isArray` for older browsers. - -## Usage - -```js -var isArray = require('isarray'); - -console.log(isArray([])); // => true -console.log(isArray({})); // => false -``` - -## Installation - -With [npm](http://npmjs.org) do - -```bash -$ npm install isarray -``` - -Then bundle for the browser with -[browserify](https://github.com/substack/browserify). - -With [component](http://component.io) do - -```bash -$ component install juliangruber/isarray -``` - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -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/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/build/build.js b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/build/build.js deleted file mode 100644 index ec58596ae..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/build/build.js +++ /dev/null @@ -1,209 +0,0 @@ - -/** - * Require the given path. - * - * @param {String} path - * @return {Object} exports - * @api public - */ - -function require(path, parent, orig) { - var resolved = require.resolve(path); - - // lookup failed - if (null == resolved) { - orig = orig || path; - parent = parent || 'root'; - var err = new Error('Failed to require "' + orig + '" from "' + parent + '"'); - err.path = orig; - err.parent = parent; - err.require = true; - throw err; - } - - var module = require.modules[resolved]; - - // perform real require() - // by invoking the module's - // registered function - if (!module.exports) { - module.exports = {}; - module.client = module.component = true; - module.call(this, module.exports, require.relative(resolved), module); - } - - return module.exports; -} - -/** - * Registered modules. - */ - -require.modules = {}; - -/** - * Registered aliases. - */ - -require.aliases = {}; - -/** - * Resolve `path`. - * - * Lookup: - * - * - PATH/index.js - * - PATH.js - * - PATH - * - * @param {String} path - * @return {String} path or null - * @api private - */ - -require.resolve = function(path) { - if (path.charAt(0) === '/') path = path.slice(1); - var index = path + '/index.js'; - - var paths = [ - path, - path + '.js', - path + '.json', - path + '/index.js', - path + '/index.json' - ]; - - for (var i = 0; i < paths.length; i++) { - var path = paths[i]; - if (require.modules.hasOwnProperty(path)) return path; - } - - if (require.aliases.hasOwnProperty(index)) { - return require.aliases[index]; - } -}; - -/** - * Normalize `path` relative to the current path. - * - * @param {String} curr - * @param {String} path - * @return {String} - * @api private - */ - -require.normalize = function(curr, path) { - var segs = []; - - if ('.' != path.charAt(0)) return path; - - curr = curr.split('/'); - path = path.split('/'); - - for (var i = 0; i < path.length; ++i) { - if ('..' == path[i]) { - curr.pop(); - } else if ('.' != path[i] && '' != path[i]) { - segs.push(path[i]); - } - } - - return curr.concat(segs).join('/'); -}; - -/** - * Register module at `path` with callback `definition`. - * - * @param {String} path - * @param {Function} definition - * @api private - */ - -require.register = function(path, definition) { - require.modules[path] = definition; -}; - -/** - * Alias a module definition. - * - * @param {String} from - * @param {String} to - * @api private - */ - -require.alias = function(from, to) { - if (!require.modules.hasOwnProperty(from)) { - throw new Error('Failed to alias "' + from + '", it does not exist'); - } - require.aliases[to] = from; -}; - -/** - * Return a require function relative to the `parent` path. - * - * @param {String} parent - * @return {Function} - * @api private - */ - -require.relative = function(parent) { - var p = require.normalize(parent, '..'); - - /** - * lastIndexOf helper. - */ - - function lastIndexOf(arr, obj) { - var i = arr.length; - while (i--) { - if (arr[i] === obj) return i; - } - return -1; - } - - /** - * The relative require() itself. - */ - - function localRequire(path) { - var resolved = localRequire.resolve(path); - return require(resolved, parent, path); - } - - /** - * Resolve relative to the parent. - */ - - localRequire.resolve = function(path) { - var c = path.charAt(0); - if ('/' == c) return path.slice(1); - if ('.' == c) return require.normalize(p, path); - - // resolve deps by returning - // the dep in the nearest "deps" - // directory - var segs = parent.split('/'); - var i = lastIndexOf(segs, 'deps') + 1; - if (!i) i = 0; - path = segs.slice(0, i + 1).join('/') + '/deps/' + path; - return path; - }; - - /** - * Check if module is defined at `path`. - */ - - localRequire.exists = function(path) { - return require.modules.hasOwnProperty(localRequire.resolve(path)); - }; - - return localRequire; -}; -require.register("isarray/index.js", function(exports, require, module){ -module.exports = Array.isArray || function (arr) { - return Object.prototype.toString.call(arr) == '[object Array]'; -}; - -}); -require.alias("isarray/index.js", "isarray/index.js"); - diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/component.json b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/component.json deleted file mode 100644 index 9e31b6838..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/component.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name" : "isarray", - "description" : "Array#isArray for older browsers", - "version" : "0.0.1", - "repository" : "juliangruber/isarray", - "homepage": "https://github.com/juliangruber/isarray", - "main" : "index.js", - "scripts" : [ - "index.js" - ], - "dependencies" : {}, - "keywords": ["browser","isarray","array"], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "license": "MIT" -} diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/index.js b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/index.js deleted file mode 100644 index 5f5ad45d4..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/index.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = Array.isArray || function (arr) { - return Object.prototype.toString.call(arr) == '[object Array]'; -}; diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json deleted file mode 100644 index 02be6fe9c..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "isarray", - "description": "Array#isArray for older browsers", - "version": "0.0.1", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/isarray.git" - }, - "homepage": "https://github.com/juliangruber/isarray", - "main": "index.js", - "scripts": { - "test": "tap test/*.js" - }, - "dependencies": {}, - "devDependencies": { - "tap": "*" - }, - "keywords": [ - "browser", - "isarray", - "array" - ], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "license": "MIT", - "readme": "\n# isarray\n\n`Array#isArray` for older browsers.\n\n## Usage\n\n```js\nvar isArray = require('isarray');\n\nconsole.log(isArray([])); // => true\nconsole.log(isArray({})); // => false\n```\n\n## Installation\n\nWith [npm](http://npmjs.org) do\n\n```bash\n$ npm install isarray\n```\n\nThen bundle for the browser with\n[browserify](https://github.com/substack/browserify).\n\nWith [component](http://component.io) do\n\n```bash\n$ component install juliangruber/isarray\n```\n\n## License\n\n(MIT)\n\nCopyright (c) 2013 Julian Gruber <julian@juliangruber.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/juliangruber/isarray/issues" - }, - "_id": "isarray@0.0.1", - "_from": "isarray@0.0.1" -} diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/.npmignore b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/.npmignore deleted file mode 100644 index 206320cc1..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -build -test diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/LICENSE b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/LICENSE deleted file mode 100644 index 6de584a48..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright Joyent, Inc. and other Node contributors. - -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/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/README.md b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/README.md deleted file mode 100644 index 4d2aa0015..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/README.md +++ /dev/null @@ -1,7 +0,0 @@ -**string_decoder.js** (`require('string_decoder')`) from Node.js core - -Copyright Joyent, Inc. and other Node contributors. See LICENCE file for details. - -Version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. **Prefer the stable version over the unstable.** - -The *build/* directory contains a build script that will scrape the source from the [joyent/node](https://github.com/joyent/node) repo given a specific Node version. \ No newline at end of file diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/index.js b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/index.js deleted file mode 100644 index b00e54fb7..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/index.js +++ /dev/null @@ -1,221 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -var Buffer = require('buffer').Buffer; - -var isBufferEncoding = Buffer.isEncoding - || function(encoding) { - switch (encoding && encoding.toLowerCase()) { - case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true; - default: return false; - } - } - - -function assertEncoding(encoding) { - if (encoding && !isBufferEncoding(encoding)) { - throw new Error('Unknown encoding: ' + encoding); - } -} - -// StringDecoder provides an interface for efficiently splitting a series of -// buffers into a series of JS strings without breaking apart multi-byte -// characters. CESU-8 is handled as part of the UTF-8 encoding. -// -// @TODO Handling all encodings inside a single object makes it very difficult -// to reason about this code, so it should be split up in the future. -// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code -// points as used by CESU-8. -var StringDecoder = exports.StringDecoder = function(encoding) { - this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, ''); - assertEncoding(encoding); - switch (this.encoding) { - case 'utf8': - // CESU-8 represents each of Surrogate Pair by 3-bytes - this.surrogateSize = 3; - break; - case 'ucs2': - case 'utf16le': - // UTF-16 represents each of Surrogate Pair by 2-bytes - this.surrogateSize = 2; - this.detectIncompleteChar = utf16DetectIncompleteChar; - break; - case 'base64': - // Base-64 stores 3 bytes in 4 chars, and pads the remainder. - this.surrogateSize = 3; - this.detectIncompleteChar = base64DetectIncompleteChar; - break; - default: - this.write = passThroughWrite; - return; - } - - // Enough space to store all bytes of a single character. UTF-8 needs 4 - // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate). - this.charBuffer = new Buffer(6); - // Number of bytes received for the current incomplete multi-byte character. - this.charReceived = 0; - // Number of bytes expected for the current incomplete multi-byte character. - this.charLength = 0; -}; - - -// write decodes the given buffer and returns it as JS string that is -// guaranteed to not contain any partial multi-byte characters. Any partial -// character found at the end of the buffer is buffered up, and will be -// returned when calling write again with the remaining bytes. -// -// Note: Converting a Buffer containing an orphan surrogate to a String -// currently works, but converting a String to a Buffer (via `new Buffer`, or -// Buffer#write) will replace incomplete surrogates with the unicode -// replacement character. See https://codereview.chromium.org/121173009/ . -StringDecoder.prototype.write = function(buffer) { - var charStr = ''; - // if our last write ended with an incomplete multibyte character - while (this.charLength) { - // determine how many remaining bytes this buffer has to offer for this char - var available = (buffer.length >= this.charLength - this.charReceived) ? - this.charLength - this.charReceived : - buffer.length; - - // add the new bytes to the char buffer - buffer.copy(this.charBuffer, this.charReceived, 0, available); - this.charReceived += available; - - if (this.charReceived < this.charLength) { - // still not enough chars in this buffer? wait for more ... - return ''; - } - - // remove bytes belonging to the current character from the buffer - buffer = buffer.slice(available, buffer.length); - - // get the character that was split - charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding); - - // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character - var charCode = charStr.charCodeAt(charStr.length - 1); - if (charCode >= 0xD800 && charCode <= 0xDBFF) { - this.charLength += this.surrogateSize; - charStr = ''; - continue; - } - this.charReceived = this.charLength = 0; - - // if there are no more bytes in this buffer, just emit our char - if (buffer.length === 0) { - return charStr; - } - break; - } - - // determine and set charLength / charReceived - this.detectIncompleteChar(buffer); - - var end = buffer.length; - if (this.charLength) { - // buffer the incomplete character bytes we got - buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end); - end -= this.charReceived; - } - - charStr += buffer.toString(this.encoding, 0, end); - - var end = charStr.length - 1; - var charCode = charStr.charCodeAt(end); - // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character - if (charCode >= 0xD800 && charCode <= 0xDBFF) { - var size = this.surrogateSize; - this.charLength += size; - this.charReceived += size; - this.charBuffer.copy(this.charBuffer, size, 0, size); - buffer.copy(this.charBuffer, 0, 0, size); - return charStr.substring(0, end); - } - - // or just emit the charStr - return charStr; -}; - -// detectIncompleteChar determines if there is an incomplete UTF-8 character at -// the end of the given buffer. If so, it sets this.charLength to the byte -// length that character, and sets this.charReceived to the number of bytes -// that are available for this character. -StringDecoder.prototype.detectIncompleteChar = function(buffer) { - // determine how many bytes we have to check at the end of this buffer - var i = (buffer.length >= 3) ? 3 : buffer.length; - - // Figure out if one of the last i bytes of our buffer announces an - // incomplete char. - for (; i > 0; i--) { - var c = buffer[buffer.length - i]; - - // See http://en.wikipedia.org/wiki/UTF-8#Description - - // 110XXXXX - if (i == 1 && c >> 5 == 0x06) { - this.charLength = 2; - break; - } - - // 1110XXXX - if (i <= 2 && c >> 4 == 0x0E) { - this.charLength = 3; - break; - } - - // 11110XXX - if (i <= 3 && c >> 3 == 0x1E) { - this.charLength = 4; - break; - } - } - this.charReceived = i; -}; - -StringDecoder.prototype.end = function(buffer) { - var res = ''; - if (buffer && buffer.length) - res = this.write(buffer); - - if (this.charReceived) { - var cr = this.charReceived; - var buf = this.charBuffer; - var enc = this.encoding; - res += buf.slice(0, cr).toString(enc); - } - - return res; -}; - -function passThroughWrite(buffer) { - return buffer.toString(this.encoding); -} - -function utf16DetectIncompleteChar(buffer) { - this.charReceived = buffer.length % 2; - this.charLength = this.charReceived ? 2 : 0; -} - -function base64DetectIncompleteChar(buffer) { - this.charReceived = buffer.length % 3; - this.charLength = this.charReceived ? 3 : 0; -} diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json deleted file mode 100644 index a8c586bfb..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "string_decoder", - "version": "0.10.31", - "description": "The string_decoder module from Node core", - "main": "index.js", - "dependencies": {}, - "devDependencies": { - "tap": "~0.4.8" - }, - "scripts": { - "test": "tap test/simple/*.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/rvagg/string_decoder.git" - }, - "homepage": "https://github.com/rvagg/string_decoder", - "keywords": [ - "string", - "decoder", - "browser", - "browserify" - ], - "license": "MIT", - "gitHead": "d46d4fd87cf1d06e031c23f1ba170ca7d4ade9a0", - "bugs": { - "url": "https://github.com/rvagg/string_decoder/issues" - }, - "_id": "string_decoder@0.10.31", - "_shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", - "_from": "string_decoder@~0.10.x", - "_npmVersion": "1.4.23", - "_npmUser": { - "name": "rvagg", - "email": "rod@vagg.org" - }, - "maintainers": [ - { - "name": "substack", - "email": "mail@substack.net" - }, - { - "name": "rvagg", - "email": "rod@vagg.org" - } - ], - "dist": { - "shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", - "tarball": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json deleted file mode 100644 index d9251caa0..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "name": "readable-stream", - "version": "1.0.33", - "description": "Streams2, a user-land copy of the stream library from Node.js v0.10.x", - "main": "readable.js", - "dependencies": { - "core-util-is": "~1.0.0", - "isarray": "0.0.1", - "string_decoder": "~0.10.x", - "inherits": "~2.0.1" - }, - "devDependencies": { - "tap": "~0.2.6" - }, - "scripts": { - "test": "tap test/simple/*.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/readable-stream" - }, - "keywords": [ - "readable", - "stream", - "pipe" - ], - "browser": { - "util": false - }, - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "license": "MIT", - "gitHead": "0bf97a117c5646556548966409ebc57a6dda2638", - "bugs": { - "url": "https://github.com/isaacs/readable-stream/issues" - }, - "homepage": "https://github.com/isaacs/readable-stream", - "_id": "readable-stream@1.0.33", - "_shasum": "3a360dd66c1b1d7fd4705389860eda1d0f61126c", - "_from": "readable-stream@~1.0.26", - "_npmVersion": "1.4.28", - "_npmUser": { - "name": "rvagg", - "email": "rod@vagg.org" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - }, - { - "name": "tootallnate", - "email": "nathan@tootallnate.net" - }, - { - "name": "rvagg", - "email": "rod@vagg.org" - } - ], - "dist": { - "shasum": "3a360dd66c1b1d7fd4705389860eda1d0f61126c", - "tarball": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/passthrough.js b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/passthrough.js deleted file mode 100644 index 27e8d8a55..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/passthrough.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_passthrough.js") diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/readable.js b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/readable.js deleted file mode 100644 index 8b5337b5c..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/readable.js +++ /dev/null @@ -1,8 +0,0 @@ -var Stream = require('stream'); // hack to fix a circular dependency issue when used with browserify -exports = module.exports = require('./lib/_stream_readable.js'); -exports.Stream = Stream; -exports.Readable = exports; -exports.Writable = require('./lib/_stream_writable.js'); -exports.Duplex = require('./lib/_stream_duplex.js'); -exports.Transform = require('./lib/_stream_transform.js'); -exports.PassThrough = require('./lib/_stream_passthrough.js'); diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/transform.js b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/transform.js deleted file mode 100644 index 5d482f078..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/transform.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_transform.js") diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/writable.js b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/writable.js deleted file mode 100644 index e1e9efdf3..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/node_modules/readable-stream/writable.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_writable.js") diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/package.json b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/package.json deleted file mode 100644 index 13ca9ef58..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "name": "bl", - "version": "0.9.4", - "description": "Buffer List: collect buffers and access with a standard readable Buffer interface, streamable too!", - "main": "bl.js", - "scripts": { - "test": "node test/test.js | faucet", - "test-local": "brtapsauce-local test/basic-test.js" - }, - "repository": { - "type": "git", - "url": "https://github.com/rvagg/bl.git" - }, - "homepage": "https://github.com/rvagg/bl", - "authors": [ - "Rod Vagg (https://github.com/rvagg)", - "Matteo Collina (https://github.com/mcollina)", - "Jarett Cruger (https://github.com/jcrugzz)" - ], - "keywords": [ - "buffer", - "buffers", - "stream", - "awesomesauce" - ], - "license": "MIT", - "dependencies": { - "readable-stream": "~1.0.26" - }, - "devDependencies": { - "tape": "~2.12.3", - "hash_file": "~0.1.1", - "faucet": "~0.0.1", - "brtapsauce": "~0.3.0" - }, - "gitHead": "e7f90703c5f90ca26f60455ea6ad0b6be4a9feee", - "bugs": { - "url": "https://github.com/rvagg/bl/issues" - }, - "_id": "bl@0.9.4", - "_shasum": "4702ddf72fbe0ecd82787c00c113aea1935ad0e7", - "_from": "bl@~0.9.0", - "_npmVersion": "2.1.18", - "_nodeVersion": "1.0.3", - "_npmUser": { - "name": "rvagg", - "email": "rod@vagg.org" - }, - "maintainers": [ - { - "name": "rvagg", - "email": "rod@vagg.org" - } - ], - "dist": { - "shasum": "4702ddf72fbe0ecd82787c00c113aea1935ad0e7", - "tarball": "http://registry.npmjs.org/bl/-/bl-0.9.4.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/bl/-/bl-0.9.4.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/test/basic-test.js b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/test/basic-test.js deleted file mode 100644 index 75116a30f..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/test/basic-test.js +++ /dev/null @@ -1,541 +0,0 @@ -var tape = require('tape') - , crypto = require('crypto') - , fs = require('fs') - , hash = require('hash_file') - , BufferList = require('../') - - , encodings = - ('hex utf8 utf-8 ascii binary base64' - + (process.browser ? '' : ' ucs2 ucs-2 utf16le utf-16le')).split(' ') - -tape('single bytes from single buffer', function (t) { - var bl = new BufferList() - bl.append(new Buffer('abcd')) - - t.equal(bl.length, 4) - - t.equal(bl.get(0), 97) - t.equal(bl.get(1), 98) - t.equal(bl.get(2), 99) - t.equal(bl.get(3), 100) - - t.end() -}) - -tape('single bytes from multiple buffers', function (t) { - var bl = new BufferList() - bl.append(new Buffer('abcd')) - bl.append(new Buffer('efg')) - bl.append(new Buffer('hi')) - bl.append(new Buffer('j')) - - t.equal(bl.length, 10) - - t.equal(bl.get(0), 97) - t.equal(bl.get(1), 98) - t.equal(bl.get(2), 99) - t.equal(bl.get(3), 100) - t.equal(bl.get(4), 101) - t.equal(bl.get(5), 102) - t.equal(bl.get(6), 103) - t.equal(bl.get(7), 104) - t.equal(bl.get(8), 105) - t.equal(bl.get(9), 106) - t.end() -}) - -tape('multi bytes from single buffer', function (t) { - var bl = new BufferList() - bl.append(new Buffer('abcd')) - - t.equal(bl.length, 4) - - t.equal(bl.slice(0, 4).toString('ascii'), 'abcd') - t.equal(bl.slice(0, 3).toString('ascii'), 'abc') - t.equal(bl.slice(1, 4).toString('ascii'), 'bcd') - - t.end() -}) - -tape('multiple bytes from multiple buffers', function (t) { - var bl = new BufferList() - - bl.append(new Buffer('abcd')) - bl.append(new Buffer('efg')) - bl.append(new Buffer('hi')) - bl.append(new Buffer('j')) - - t.equal(bl.length, 10) - - t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij') - t.equal(bl.slice(3, 10).toString('ascii'), 'defghij') - t.equal(bl.slice(3, 6).toString('ascii'), 'def') - t.equal(bl.slice(3, 8).toString('ascii'), 'defgh') - t.equal(bl.slice(5, 10).toString('ascii'), 'fghij') - - t.end() -}) - -tape('multiple bytes from multiple buffer lists', function (t) { - var bl = new BufferList() - - bl.append(new BufferList([new Buffer('abcd'), new Buffer('efg')])) - bl.append(new BufferList([new Buffer('hi'), new Buffer('j')])) - - t.equal(bl.length, 10) - - t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij') - t.equal(bl.slice(3, 10).toString('ascii'), 'defghij') - t.equal(bl.slice(3, 6).toString('ascii'), 'def') - t.equal(bl.slice(3, 8).toString('ascii'), 'defgh') - t.equal(bl.slice(5, 10).toString('ascii'), 'fghij') - - t.end() -}) - -tape('consuming from multiple buffers', function (t) { - var bl = new BufferList() - - bl.append(new Buffer('abcd')) - bl.append(new Buffer('efg')) - bl.append(new Buffer('hi')) - bl.append(new Buffer('j')) - - t.equal(bl.length, 10) - - t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij') - - bl.consume(3) - t.equal(bl.length, 7) - t.equal(bl.slice(0, 7).toString('ascii'), 'defghij') - - bl.consume(2) - t.equal(bl.length, 5) - t.equal(bl.slice(0, 5).toString('ascii'), 'fghij') - - bl.consume(1) - t.equal(bl.length, 4) - t.equal(bl.slice(0, 4).toString('ascii'), 'ghij') - - bl.consume(1) - t.equal(bl.length, 3) - t.equal(bl.slice(0, 3).toString('ascii'), 'hij') - - bl.consume(2) - t.equal(bl.length, 1) - t.equal(bl.slice(0, 1).toString('ascii'), 'j') - - t.end() -}) - -tape('test readUInt8 / readInt8', function (t) { - var buf1 = new Buffer(1) - , buf2 = new Buffer(3) - , buf3 = new Buffer(3) - , bl = new BufferList() - - buf2[1] = 0x3 - buf2[2] = 0x4 - buf3[0] = 0x23 - buf3[1] = 0x42 - - bl.append(buf1) - bl.append(buf2) - bl.append(buf3) - - t.equal(bl.readUInt8(2), 0x3) - t.equal(bl.readInt8(2), 0x3) - t.equal(bl.readUInt8(3), 0x4) - t.equal(bl.readInt8(3), 0x4) - t.equal(bl.readUInt8(4), 0x23) - t.equal(bl.readInt8(4), 0x23) - t.equal(bl.readUInt8(5), 0x42) - t.equal(bl.readInt8(5), 0x42) - t.end() -}) - -tape('test readUInt16LE / readUInt16BE / readInt16LE / readInt16BE', function (t) { - var buf1 = new Buffer(1) - , buf2 = new Buffer(3) - , buf3 = new Buffer(3) - , bl = new BufferList() - - buf2[1] = 0x3 - buf2[2] = 0x4 - buf3[0] = 0x23 - buf3[1] = 0x42 - - bl.append(buf1) - bl.append(buf2) - bl.append(buf3) - - t.equal(bl.readUInt16BE(2), 0x0304) - t.equal(bl.readUInt16LE(2), 0x0403) - t.equal(bl.readInt16BE(2), 0x0304) - t.equal(bl.readInt16LE(2), 0x0403) - t.equal(bl.readUInt16BE(3), 0x0423) - t.equal(bl.readUInt16LE(3), 0x2304) - t.equal(bl.readInt16BE(3), 0x0423) - t.equal(bl.readInt16LE(3), 0x2304) - t.equal(bl.readUInt16BE(4), 0x2342) - t.equal(bl.readUInt16LE(4), 0x4223) - t.equal(bl.readInt16BE(4), 0x2342) - t.equal(bl.readInt16LE(4), 0x4223) - t.end() -}) - -tape('test readUInt32LE / readUInt32BE / readInt32LE / readInt32BE', function (t) { - var buf1 = new Buffer(1) - , buf2 = new Buffer(3) - , buf3 = new Buffer(3) - , bl = new BufferList() - - buf2[1] = 0x3 - buf2[2] = 0x4 - buf3[0] = 0x23 - buf3[1] = 0x42 - - bl.append(buf1) - bl.append(buf2) - bl.append(buf3) - - t.equal(bl.readUInt32BE(2), 0x03042342) - t.equal(bl.readUInt32LE(2), 0x42230403) - t.equal(bl.readInt32BE(2), 0x03042342) - t.equal(bl.readInt32LE(2), 0x42230403) - t.end() -}) - -tape('test readFloatLE / readFloatBE', function (t) { - var buf1 = new Buffer(1) - , buf2 = new Buffer(3) - , buf3 = new Buffer(3) - , bl = new BufferList() - - buf2[1] = 0x00 - buf2[2] = 0x00 - buf3[0] = 0x80 - buf3[1] = 0x3f - - bl.append(buf1) - bl.append(buf2) - bl.append(buf3) - - t.equal(bl.readFloatLE(2), 0x01) - t.end() -}) - -tape('test readDoubleLE / readDoubleBE', function (t) { - var buf1 = new Buffer(1) - , buf2 = new Buffer(3) - , buf3 = new Buffer(10) - , bl = new BufferList() - - buf2[1] = 0x55 - buf2[2] = 0x55 - buf3[0] = 0x55 - buf3[1] = 0x55 - buf3[2] = 0x55 - buf3[3] = 0x55 - buf3[4] = 0xd5 - buf3[5] = 0x3f - - bl.append(buf1) - bl.append(buf2) - bl.append(buf3) - - t.equal(bl.readDoubleLE(2), 0.3333333333333333) - t.end() -}) - -tape('test toString', function (t) { - var bl = new BufferList() - - bl.append(new Buffer('abcd')) - bl.append(new Buffer('efg')) - bl.append(new Buffer('hi')) - bl.append(new Buffer('j')) - - t.equal(bl.toString('ascii', 0, 10), 'abcdefghij') - t.equal(bl.toString('ascii', 3, 10), 'defghij') - t.equal(bl.toString('ascii', 3, 6), 'def') - t.equal(bl.toString('ascii', 3, 8), 'defgh') - t.equal(bl.toString('ascii', 5, 10), 'fghij') - - t.end() -}) - -tape('test toString encoding', function (t) { - var bl = new BufferList() - , b = new Buffer('abcdefghij\xff\x00') - - bl.append(new Buffer('abcd')) - bl.append(new Buffer('efg')) - bl.append(new Buffer('hi')) - bl.append(new Buffer('j')) - bl.append(new Buffer('\xff\x00')) - - encodings.forEach(function (enc) { - t.equal(bl.toString(enc), b.toString(enc), enc) - }) - - t.end() -}) - -!process.browser && tape('test stream', function (t) { - var random = crypto.randomBytes(65534) - , rndhash = hash(random, 'md5') - , md5sum = crypto.createHash('md5') - , bl = new BufferList(function (err, buf) { - t.ok(Buffer.isBuffer(buf)) - t.ok(err === null) - t.equal(rndhash, hash(bl.slice(), 'md5')) - t.equal(rndhash, hash(buf, 'md5')) - - bl.pipe(fs.createWriteStream('/tmp/bl_test_rnd_out.dat')) - .on('close', function () { - var s = fs.createReadStream('/tmp/bl_test_rnd_out.dat') - s.on('data', md5sum.update.bind(md5sum)) - s.on('end', function() { - t.equal(rndhash, md5sum.digest('hex'), 'woohoo! correct hash!') - t.end() - }) - }) - - }) - - fs.writeFileSync('/tmp/bl_test_rnd.dat', random) - fs.createReadStream('/tmp/bl_test_rnd.dat').pipe(bl) -}) - -tape('instantiation with Buffer', function (t) { - var buf = crypto.randomBytes(1024) - , buf2 = crypto.randomBytes(1024) - , b = BufferList(buf) - - t.equal(buf.toString('hex'), b.slice().toString('hex'), 'same buffer') - b = BufferList([ buf, buf2 ]) - t.equal(b.slice().toString('hex'), Buffer.concat([ buf, buf2 ]).toString('hex'), 'same buffer') - t.end() -}) - -tape('test String appendage', function (t) { - var bl = new BufferList() - , b = new Buffer('abcdefghij\xff\x00') - - bl.append('abcd') - bl.append('efg') - bl.append('hi') - bl.append('j') - bl.append('\xff\x00') - - encodings.forEach(function (enc) { - t.equal(bl.toString(enc), b.toString(enc)) - }) - - t.end() -}) - -tape('write nothing, should get empty buffer', function (t) { - t.plan(3) - BufferList(function (err, data) { - t.notOk(err, 'no error') - t.ok(Buffer.isBuffer(data), 'got a buffer') - t.equal(0, data.length, 'got a zero-length buffer') - t.end() - }).end() -}) - -tape('unicode string', function (t) { - t.plan(2) - var inp1 = '\u2600' - , inp2 = '\u2603' - , exp = inp1 + ' and ' + inp2 - , bl = BufferList() - bl.write(inp1) - bl.write(' and ') - bl.write(inp2) - t.equal(exp, bl.toString()) - t.equal(new Buffer(exp).toString('hex'), bl.toString('hex')) -}) - -tape('should emit finish', function (t) { - var source = BufferList() - , dest = BufferList() - - source.write('hello') - source.pipe(dest) - - dest.on('finish', function () { - t.equal(dest.toString('utf8'), 'hello') - t.end() - }) -}) - -tape('basic copy', function (t) { - var buf = crypto.randomBytes(1024) - , buf2 = new Buffer(1024) - , b = BufferList(buf) - - b.copy(buf2) - t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer') - t.end() -}) - -tape('copy after many appends', function (t) { - var buf = crypto.randomBytes(512) - , buf2 = new Buffer(1024) - , b = BufferList(buf) - - b.append(buf) - b.copy(buf2) - t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer') - t.end() -}) - -tape('copy at a precise position', function (t) { - var buf = crypto.randomBytes(1004) - , buf2 = new Buffer(1024) - , b = BufferList(buf) - - b.copy(buf2, 20) - t.equal(b.slice().toString('hex'), buf2.slice(20).toString('hex'), 'same buffer') - t.end() -}) - -tape('copy starting from a precise location', function (t) { - var buf = crypto.randomBytes(10) - , buf2 = new Buffer(5) - , b = BufferList(buf) - - b.copy(buf2, 0, 5) - t.equal(b.slice(5).toString('hex'), buf2.toString('hex'), 'same buffer') - t.end() -}) - -tape('copy in an interval', function (t) { - var rnd = crypto.randomBytes(10) - , b = BufferList(rnd) // put the random bytes there - , actual = new Buffer(3) - , expected = new Buffer(3) - - rnd.copy(expected, 0, 5, 8) - b.copy(actual, 0, 5, 8) - - t.equal(actual.toString('hex'), expected.toString('hex'), 'same buffer') - t.end() -}) - -tape('copy an interval between two buffers', function (t) { - var buf = crypto.randomBytes(10) - , buf2 = new Buffer(10) - , b = BufferList(buf) - - b.append(buf) - b.copy(buf2, 0, 5, 15) - - t.equal(b.slice(5, 15).toString('hex'), buf2.toString('hex'), 'same buffer') - t.end() -}) - -tape('duplicate', function (t) { - t.plan(2) - - var bl = new BufferList('abcdefghij\xff\x00') - , dup = bl.duplicate() - - t.equal(bl.prototype, dup.prototype) - t.equal(bl.toString('hex'), dup.toString('hex')) -}) - -tape('destroy no pipe', function (t) { - t.plan(2) - - var bl = new BufferList('alsdkfja;lsdkfja;lsdk') - bl.destroy() - - t.equal(bl._bufs.length, 0) - t.equal(bl.length, 0) -}) - -!process.browser && tape('destroy with pipe before read end', function (t) { - t.plan(2) - - var bl = new BufferList() - fs.createReadStream(__dirname + '/sauce.js') - .pipe(bl) - - bl.destroy() - - t.equal(bl._bufs.length, 0) - t.equal(bl.length, 0) - -}) - -!process.browser && tape('destroy with pipe before read end with race', function (t) { - t.plan(2) - - var bl = new BufferList() - fs.createReadStream(__dirname + '/sauce.js') - .pipe(bl) - - setTimeout(function () { - bl.destroy() - setTimeout(function () { - t.equal(bl._bufs.length, 0) - t.equal(bl.length, 0) - }, 500) - }, 500) -}) - -!process.browser && tape('destroy with pipe after read end', function (t) { - t.plan(2) - - var bl = new BufferList() - fs.createReadStream(__dirname + '/sauce.js') - .on('end', onEnd) - .pipe(bl) - - function onEnd () { - bl.destroy() - - t.equal(bl._bufs.length, 0) - t.equal(bl.length, 0) - } -}) - -!process.browser && tape('destroy with pipe while writing to a destination', function (t) { - t.plan(4) - - var bl = new BufferList() - , ds = new BufferList() - - fs.createReadStream(__dirname + '/sauce.js') - .on('end', onEnd) - .pipe(bl) - - function onEnd () { - bl.pipe(ds) - - setTimeout(function () { - bl.destroy() - - t.equals(bl._bufs.length, 0) - t.equals(bl.length, 0) - - ds.destroy() - - t.equals(bl._bufs.length, 0) - t.equals(bl.length, 0) - - }, 100) - } -}) - -!process.browser && tape('handle error', function (t) { - t.plan(2) - fs.createReadStream('/does/not/exist').pipe(BufferList(function (err, data) { - t.ok(err instanceof Error, 'has error') - t.notOk(data, 'no data') - })) -}) diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/test/sauce.js b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/test/sauce.js deleted file mode 100644 index a6d28625f..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/test/sauce.js +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env node - -const user = process.env.SAUCE_USER - , key = process.env.SAUCE_KEY - , path = require('path') - , brtapsauce = require('brtapsauce') - , testFile = path.join(__dirname, 'basic-test.js') - - , capabilities = [ - { browserName: 'chrome' , platform: 'Windows XP', version: '' } - , { browserName: 'firefox' , platform: 'Windows 8' , version: '' } - , { browserName: 'firefox' , platform: 'Windows XP', version: '4' } - , { browserName: 'internet explorer' , platform: 'Windows 8' , version: '10' } - , { browserName: 'internet explorer' , platform: 'Windows 7' , version: '9' } - , { browserName: 'internet explorer' , platform: 'Windows 7' , version: '8' } - , { browserName: 'internet explorer' , platform: 'Windows XP', version: '7' } - , { browserName: 'internet explorer' , platform: 'Windows XP', version: '6' } - , { browserName: 'safari' , platform: 'Windows 7' , version: '5' } - , { browserName: 'safari' , platform: 'OS X 10.8' , version: '6' } - , { browserName: 'opera' , platform: 'Windows 7' , version: '' } - , { browserName: 'opera' , platform: 'Windows 7' , version: '11' } - , { browserName: 'ipad' , platform: 'OS X 10.8' , version: '6' } - , { browserName: 'android' , platform: 'Linux' , version: '4.0', 'device-type': 'tablet' } - ] - -if (!user) - throw new Error('Must set a SAUCE_USER env var') -if (!key) - throw new Error('Must set a SAUCE_KEY env var') - -brtapsauce({ - name : 'Traversty' - , user : user - , key : key - , brsrc : testFile - , capabilities : capabilities - , options : { timeout: 60 * 6 } -}) \ No newline at end of file diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/test/test.js b/update_nation/node_modules/nano/node_modules/request/node_modules/bl/test/test.js deleted file mode 100644 index aa9b48771..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/bl/test/test.js +++ /dev/null @@ -1,9 +0,0 @@ -require('./basic-test') - -if (!process.env.SAUCE_KEY || !process.env.SAUCE_USER) - return console.log('SAUCE_KEY and/or SAUCE_USER not set, not running sauce tests') - -if (!/v0\.10/.test(process.version)) - return console.log('Not Node v0.10.x, not running sauce tests') - -require('./sauce.js') \ No newline at end of file diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/caseless/README.md b/update_nation/node_modules/nano/node_modules/request/node_modules/caseless/README.md deleted file mode 100644 index 719584c85..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/caseless/README.md +++ /dev/null @@ -1,45 +0,0 @@ -## Caseless -- wrap an object to set and get property with caseless semantics but also preserve caseing. - -This library is incredibly useful when working with HTTP headers. It allows you to get/set/check for headers in a caseless manor while also preserving the caseing of headers the first time they are set. - -## Usage - -```javascript -var headers = {} - , c = caseless(headers) - ; -c.set('a-Header', 'asdf') -c.get('a-header') === 'asdf' -``` - -## has(key) - -Has takes a name and if it finds a matching header will return that header name with the preserved caseing it was set with. - -```javascript -c.has('a-header') === 'a-Header' -``` - -## set(key, value[, clobber=true]) - -Set is fairly straight forward except that if the header exists and clobber is disabled it will add `','+value` to the existing header. - -```javascript -c.set('a-Header', 'fdas') -c.set('a-HEADER', 'more', false) -c.get('a-header') === 'fdsa,more' -``` - -## swap(key) - -Swaps the casing of a header with the new one that is passed in. - -```javascript -var headers = {} - , c = caseless(headers) - ; -c.set('a-Header', 'fdas') -c.swap('a-HEADER') -c.has('a-header') === 'a-HEADER' -headers === {'a-HEADER': 'fdas'} -``` diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/caseless/index.js b/update_nation/node_modules/nano/node_modules/request/node_modules/caseless/index.js deleted file mode 100644 index 231a997e0..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/caseless/index.js +++ /dev/null @@ -1,65 +0,0 @@ -function Caseless (dict) { - this.dict = dict -} -Caseless.prototype.set = function (name, value, clobber) { - if (typeof name === 'object') { - for (var i in name) { - this.set(i, name[i], value) - } - } else { - if (typeof clobber === 'undefined') clobber = true - var has = this.has(name) - - if (!clobber && has) this.dict[has] = this.dict[has] + ',' + value - else this.dict[has || name] = value - return has - } -} -Caseless.prototype.has = function (name) { - var keys = Object.keys(this.dict) - , name = name.toLowerCase() - ; - for (var i=0;i 0 && !req.useChunkedEncodingByDefault) { - var idleSocket = this.freeSockets[name].pop() - idleSocket.removeListener('error', idleSocket._onIdleError) - delete idleSocket._onIdleError - req._reusedSocket = true - req.onSocket(idleSocket) - } else { - this.addRequestNoreuse(req, host, port) - } -} - -ForeverAgent.prototype.removeSocket = function(s, name, host, port) { - if (this.sockets[name]) { - var index = this.sockets[name].indexOf(s) - if (index !== -1) { - this.sockets[name].splice(index, 1) - } - } else if (this.sockets[name] && this.sockets[name].length === 0) { - // don't leak - delete this.sockets[name] - delete this.requests[name] - } - - if (this.freeSockets[name]) { - var index = this.freeSockets[name].indexOf(s) - if (index !== -1) { - this.freeSockets[name].splice(index, 1) - if (this.freeSockets[name].length === 0) { - delete this.freeSockets[name] - } - } - } - - if (this.requests[name] && this.requests[name].length) { - // If we have pending requests and a socket gets closed a new one - // needs to be created to take over in the pool for the one that closed. - this.createSocket(name, host, port).emit('free') - } -} - -function ForeverAgentSSL (options) { - ForeverAgent.call(this, options) -} -util.inherits(ForeverAgentSSL, ForeverAgent) - -ForeverAgentSSL.prototype.createConnection = createConnectionSSL -ForeverAgentSSL.prototype.addRequestNoreuse = AgentSSL.prototype.addRequest - -function createConnectionSSL (port, host, options) { - if (typeof port === 'object') { - options = port; - } else if (typeof host === 'object') { - options = host; - } else if (typeof options === 'object') { - options = options; - } else { - options = {}; - } - - if (typeof port === 'number') { - options.port = port; - } - - if (typeof host === 'string') { - options.host = host; - } - - return tls.connect(options); -} diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/forever-agent/package.json b/update_nation/node_modules/nano/node_modules/request/node_modules/forever-agent/package.json deleted file mode 100644 index 110a36fe4..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/forever-agent/package.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "author": { - "name": "Mikeal Rogers", - "email": "mikeal.rogers@gmail.com", - "url": "http://www.futurealoof.com" - }, - "name": "forever-agent", - "description": "HTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.", - "version": "0.5.2", - "repository": { - "url": "https://github.com/mikeal/forever-agent" - }, - "main": "index.js", - "dependencies": {}, - "devDependencies": {}, - "optionalDependencies": {}, - "engines": { - "node": "*" - }, - "bugs": { - "url": "https://github.com/mikeal/forever-agent/issues" - }, - "homepage": "https://github.com/mikeal/forever-agent", - "_id": "forever-agent@0.5.2", - "dist": { - "shasum": "6d0e09c4921f94a27f63d3b49c5feff1ea4c5130", - "tarball": "http://registry.npmjs.org/forever-agent/-/forever-agent-0.5.2.tgz" - }, - "_from": "forever-agent@~0.5.0", - "_npmVersion": "1.3.21", - "_npmUser": { - "name": "mikeal", - "email": "mikeal.rogers@gmail.com" - }, - "maintainers": [ - { - "name": "mikeal", - "email": "mikeal.rogers@gmail.com" - } - ], - "directories": {}, - "_shasum": "6d0e09c4921f94a27f63d3b49c5feff1ea4c5130", - "_resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.5.2.tgz", - "readme": "ERROR: No README data found!", - "scripts": {} -} diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/form-data/License b/update_nation/node_modules/nano/node_modules/request/node_modules/form-data/License deleted file mode 100644 index c7ff12a2f..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/form-data/License +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2012 Felix Geisendörfer (felix@debuggable.com) and contributors - - 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/update_nation/node_modules/nano/node_modules/request/node_modules/form-data/Readme.md b/update_nation/node_modules/nano/node_modules/request/node_modules/form-data/Readme.md deleted file mode 100644 index c8a1a55db..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/form-data/Readme.md +++ /dev/null @@ -1,175 +0,0 @@ -# Form-Data [![Build Status](https://travis-ci.org/felixge/node-form-data.png?branch=master)](https://travis-ci.org/felixge/node-form-data) [![Dependency Status](https://gemnasium.com/felixge/node-form-data.png)](https://gemnasium.com/felixge/node-form-data) - -A module to create readable ```"multipart/form-data"``` streams. Can be used to submit forms and file uploads to other web applications. - -The API of this module is inspired by the [XMLHttpRequest-2 FormData Interface][xhr2-fd]. - -[xhr2-fd]: http://dev.w3.org/2006/webapi/XMLHttpRequest-2/Overview.html#the-formdata-interface -[streams2-thing]: http://nodejs.org/api/stream.html#stream_compatibility_with_older_node_versions - -## Install - -``` -npm install form-data -``` - -## Usage - -In this example we are constructing a form with 3 fields that contain a string, -a buffer and a file stream. - -``` javascript -var FormData = require('form-data'); -var fs = require('fs'); - -var form = new FormData(); -form.append('my_field', 'my value'); -form.append('my_buffer', new Buffer(10)); -form.append('my_file', fs.createReadStream('/foo/bar.jpg')); -``` - -Also you can use http-response stream: - -``` javascript -var FormData = require('form-data'); -var http = require('http'); - -var form = new FormData(); - -http.request('http://nodejs.org/images/logo.png', function(response) { - form.append('my_field', 'my value'); - form.append('my_buffer', new Buffer(10)); - form.append('my_logo', response); -}); -``` - -Or @mikeal's request stream: - -``` javascript -var FormData = require('form-data'); -var request = require('request'); - -var form = new FormData(); - -form.append('my_field', 'my value'); -form.append('my_buffer', new Buffer(10)); -form.append('my_logo', request('http://nodejs.org/images/logo.png')); -``` - -In order to submit this form to a web application, call ```submit(url, [callback])``` method: - -``` javascript -form.submit('http://example.org/', function(err, res) { - // res – response object (http.IncomingMessage) // - res.resume(); // for node-0.10.x -}); - -``` - -For more advanced request manipulations ```submit()``` method returns ```http.ClientRequest``` object, or you can choose from one of the alternative submission methods. - -### Alternative submission methods - -You can use node's http client interface: - -``` javascript -var http = require('http'); - -var request = http.request({ - method: 'post', - host: 'example.org', - path: '/upload', - headers: form.getHeaders() -}); - -form.pipe(request); - -request.on('response', function(res) { - console.log(res.statusCode); -}); -``` - -Or if you would prefer the `'Content-Length'` header to be set for you: - -``` javascript -form.submit('example.org/upload', function(err, res) { - console.log(res.statusCode); -}); -``` - -To use custom headers and pre-known length in parts: - -``` javascript -var CRLF = '\r\n'; -var form = new FormData(); - -var options = { - header: CRLF + '--' + form.getBoundary() + CRLF + 'X-Custom-Header: 123' + CRLF + CRLF, - knownLength: 1 -}; - -form.append('my_buffer', buffer, options); - -form.submit('http://example.com/', function(err, res) { - if (err) throw err; - console.log('Done'); -}); -``` - -Form-Data can recognize and fetch all the required information from common types of streams (```fs.readStream```, ```http.response``` and ```mikeal's request```), for some other types of streams you'd need to provide "file"-related information manually: - -``` javascript -someModule.stream(function(err, stdout, stderr) { - if (err) throw err; - - var form = new FormData(); - - form.append('file', stdout, { - filename: 'unicycle.jpg', - contentType: 'image/jpg', - knownLength: 19806 - }); - - form.submit('http://example.com/', function(err, res) { - if (err) throw err; - console.log('Done'); - }); -}); -``` - -For edge cases, like POST request to URL with query string or to pass HTTP auth credentials, object can be passed to `form.submit()` as first parameter: - -``` javascript -form.submit({ - host: 'example.com', - path: '/probably.php?extra=params', - auth: 'username:password' -}, function(err, res) { - console.log(res.statusCode); -}); -``` - -In case you need to also send custom HTTP headers with the POST request, you can use the `headers` key in first parameter of `form.submit()`: - -``` javascript -form.submit({ - host: 'example.com', - path: '/surelynot.php', - headers: {'x-test-header': 'test-header-value'} -}, function(err, res) { - console.log(res.statusCode); -}); -``` - -## Notes - -- ```getLengthSync()``` method DOESN'T calculate length for streams, use ```knownLength``` options as workaround. -- If it feels like FormData hangs after submit and you're on ```node-0.10```, please check [Compatibility with Older Node Versions][streams2-thing] - -## TODO - -- Add new streams (0.10) support and try really hard not to break it for 0.8.x. - -## License - -Form-Data is licensed under the MIT license. diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/form-data/lib/form_data.js b/update_nation/node_modules/nano/node_modules/request/node_modules/form-data/lib/form_data.js deleted file mode 100644 index b8bd15848..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/form-data/lib/form_data.js +++ /dev/null @@ -1,351 +0,0 @@ -var CombinedStream = require('combined-stream'); -var util = require('util'); -var path = require('path'); -var http = require('http'); -var https = require('https'); -var parseUrl = require('url').parse; -var fs = require('fs'); -var mime = require('mime'); -var async = require('async'); - -module.exports = FormData; -function FormData() { - this._overheadLength = 0; - this._valueLength = 0; - this._lengthRetrievers = []; - - CombinedStream.call(this); -} -util.inherits(FormData, CombinedStream); - -FormData.LINE_BREAK = '\r\n'; - -FormData.prototype.append = function(field, value, options) { - options = options || {}; - - var append = CombinedStream.prototype.append.bind(this); - - // all that streamy business can't handle numbers - if (typeof value == 'number') value = ''+value; - - // https://github.com/felixge/node-form-data/issues/38 - if (util.isArray(value)) { - // Please convert your array into string - // the way web server expects it - this._error(new Error('Arrays are not supported.')); - return; - } - - var header = this._multiPartHeader(field, value, options); - var footer = this._multiPartFooter(field, value, options); - - append(header); - append(value); - append(footer); - - // pass along options.knownLength - this._trackLength(header, value, options); -}; - -FormData.prototype._trackLength = function(header, value, options) { - var valueLength = 0; - - // used w/ getLengthSync(), when length is known. - // e.g. for streaming directly from a remote server, - // w/ a known file a size, and not wanting to wait for - // incoming file to finish to get its size. - if (options.knownLength != null) { - valueLength += +options.knownLength; - } else if (Buffer.isBuffer(value)) { - valueLength = value.length; - } else if (typeof value === 'string') { - valueLength = Buffer.byteLength(value); - } - - this._valueLength += valueLength; - - // @check why add CRLF? does this account for custom/multiple CRLFs? - this._overheadLength += - Buffer.byteLength(header) + - + FormData.LINE_BREAK.length; - - // empty or either doesn't have path or not an http response - if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) )) { - return; - } - - // no need to bother with the length - if (!options.knownLength) - this._lengthRetrievers.push(function(next) { - - if (value.hasOwnProperty('fd')) { - - // take read range into a account - // `end` = Infinity –> read file till the end - // - // TODO: Looks like there is bug in Node fs.createReadStream - // it doesn't respect `end` options without `start` options - // Fix it when node fixes it. - // https://github.com/joyent/node/issues/7819 - if (value.end != undefined && value.end != Infinity && value.start != undefined) { - - // when end specified - // no need to calculate range - // inclusive, starts with 0 - next(null, value.end+1 - (value.start ? value.start : 0)); - - // not that fast snoopy - } else { - // still need to fetch file size from fs - fs.stat(value.path, function(err, stat) { - - var fileSize; - - if (err) { - next(err); - return; - } - - // update final size based on the range options - fileSize = stat.size - (value.start ? value.start : 0); - next(null, fileSize); - }); - } - - // or http response - } else if (value.hasOwnProperty('httpVersion')) { - next(null, +value.headers['content-length']); - - // or request stream http://github.com/mikeal/request - } else if (value.hasOwnProperty('httpModule')) { - // wait till response come back - value.on('response', function(response) { - value.pause(); - next(null, +response.headers['content-length']); - }); - value.resume(); - - // something else - } else { - next('Unknown stream'); - } - }); -}; - -FormData.prototype._multiPartHeader = function(field, value, options) { - var boundary = this.getBoundary(); - var header = ''; - - // custom header specified (as string)? - // it becomes responsible for boundary - // (e.g. to handle extra CRLFs on .NET servers) - if (options.header != null) { - header = options.header; - } else { - header += '--' + boundary + FormData.LINE_BREAK + - 'Content-Disposition: form-data; name="' + field + '"'; - - // fs- and request- streams have path property - // or use custom filename and/or contentType - // TODO: Use request's response mime-type - if (options.filename || value.path) { - header += - '; filename="' + path.basename(options.filename || value.path) + '"' + FormData.LINE_BREAK + - 'Content-Type: ' + (options.contentType || mime.lookup(options.filename || value.path)); - - // http response has not - } else if (value.readable && value.hasOwnProperty('httpVersion')) { - header += - '; filename="' + path.basename(value.client._httpMessage.path) + '"' + FormData.LINE_BREAK + - 'Content-Type: ' + value.headers['content-type']; - } - - header += FormData.LINE_BREAK + FormData.LINE_BREAK; - } - - return header; -}; - -FormData.prototype._multiPartFooter = function(field, value, options) { - return function(next) { - var footer = FormData.LINE_BREAK; - - var lastPart = (this._streams.length === 0); - if (lastPart) { - footer += this._lastBoundary(); - } - - next(footer); - }.bind(this); -}; - -FormData.prototype._lastBoundary = function() { - return '--' + this.getBoundary() + '--'; -}; - -FormData.prototype.getHeaders = function(userHeaders) { - var formHeaders = { - 'content-type': 'multipart/form-data; boundary=' + this.getBoundary() - }; - - for (var header in userHeaders) { - formHeaders[header.toLowerCase()] = userHeaders[header]; - } - - return formHeaders; -} - -FormData.prototype.getCustomHeaders = function(contentType) { - contentType = contentType ? contentType : 'multipart/form-data'; - - var formHeaders = { - 'content-type': contentType + '; boundary=' + this.getBoundary(), - 'content-length': this.getLengthSync() - }; - - return formHeaders; -} - -FormData.prototype.getBoundary = function() { - if (!this._boundary) { - this._generateBoundary(); - } - - return this._boundary; -}; - -FormData.prototype._generateBoundary = function() { - // This generates a 50 character boundary similar to those used by Firefox. - // They are optimized for boyer-moore parsing. - var boundary = '--------------------------'; - for (var i = 0; i < 24; i++) { - boundary += Math.floor(Math.random() * 10).toString(16); - } - - this._boundary = boundary; -}; - -// Note: getLengthSync DOESN'T calculate streams length -// As workaround one can calculate file size manually -// and add it as knownLength option -FormData.prototype.getLengthSync = function(debug) { - var knownLength = this._overheadLength + this._valueLength; - - // Don't get confused, there are 3 "internal" streams for each keyval pair - // so it basically checks if there is any value added to the form - if (this._streams.length) { - knownLength += this._lastBoundary().length; - } - - // https://github.com/felixge/node-form-data/issues/40 - if (this._lengthRetrievers.length) { - // Some async length retrivers are present - // therefore synchronous length calculation is false. - // Please use getLength(callback) to get proper length - this._error(new Error('Cannot calculate proper length in synchronous way.')); - } - - return knownLength; -}; - -FormData.prototype.getLength = function(cb) { - var knownLength = this._overheadLength + this._valueLength; - - if (this._streams.length) { - knownLength += this._lastBoundary().length; - } - - if (!this._lengthRetrievers.length) { - process.nextTick(cb.bind(this, null, knownLength)); - return; - } - - async.parallel(this._lengthRetrievers, function(err, values) { - if (err) { - cb(err); - return; - } - - values.forEach(function(length) { - knownLength += length; - }); - - cb(null, knownLength); - }); -}; - -FormData.prototype.submit = function(params, cb) { - - var request - , options - , defaults = { - method : 'post' - }; - - // parse provided url if it's string - // or treat it as options object - if (typeof params == 'string') { - params = parseUrl(params); - - options = populate({ - port: params.port, - path: params.pathname, - host: params.hostname - }, defaults); - } - else // use custom params - { - options = populate(params, defaults); - // if no port provided use default one - if (!options.port) { - options.port = options.protocol == 'https:' ? 443 : 80; - } - } - - // put that good code in getHeaders to some use - options.headers = this.getHeaders(params.headers); - - // https if specified, fallback to http in any other case - if (params.protocol == 'https:') { - request = https.request(options); - } else { - request = http.request(options); - } - - // get content length and fire away - this.getLength(function(err, length) { - - // TODO: Add chunked encoding when no length (if err) - - // add content length - request.setHeader('Content-Length', length); - - this.pipe(request); - if (cb) { - request.on('error', cb); - request.on('response', cb.bind(this, null)); - } - }.bind(this)); - - return request; -}; - -FormData.prototype._error = function(err) { - if (this.error) return; - - this.error = err; - this.pause(); - this.emit('error', err); -}; - -/* - * Santa's little helpers - */ - -// populates missing values -function populate(dst, src) { - for (var prop in src) { - if (!dst[prop]) dst[prop] = src[prop]; - } - return dst; -} diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/form-data/node_modules/async/.travis.yml b/update_nation/node_modules/nano/node_modules/request/node_modules/form-data/node_modules/async/.travis.yml deleted file mode 100644 index 6e5919de3..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/form-data/node_modules/async/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - "0.10" diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/form-data/node_modules/async/LICENSE b/update_nation/node_modules/nano/node_modules/request/node_modules/form-data/node_modules/async/LICENSE deleted file mode 100644 index 8f2969858..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/form-data/node_modules/async/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2010-2014 Caolan McMahon - -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/update_nation/node_modules/nano/node_modules/request/node_modules/form-data/node_modules/async/README.md b/update_nation/node_modules/nano/node_modules/request/node_modules/form-data/node_modules/async/README.md deleted file mode 100644 index 0bea5311a..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/form-data/node_modules/async/README.md +++ /dev/null @@ -1,1646 +0,0 @@ -# Async.js - -[![Build Status via Travis CI](https://travis-ci.org/caolan/async.svg?branch=master)](https://travis-ci.org/caolan/async) - - -Async is a utility module which provides straight-forward, powerful functions -for working with asynchronous JavaScript. Although originally designed for -use with [Node.js](http://nodejs.org), it can also be used directly in the -browser. Also supports [component](https://github.com/component/component). - -Async provides around 20 functions that include the usual 'functional' -suspects (`map`, `reduce`, `filter`, `each`…) as well as some common patterns -for asynchronous control flow (`parallel`, `series`, `waterfall`…). All these -functions assume you follow the Node.js convention of providing a single -callback as the last argument of your `async` function. - - -## Quick Examples - -```javascript -async.map(['file1','file2','file3'], fs.stat, function(err, results){ - // results is now an array of stats for each file -}); - -async.filter(['file1','file2','file3'], fs.exists, function(results){ - // results now equals an array of the existing files -}); - -async.parallel([ - function(){ ... }, - function(){ ... } -], callback); - -async.series([ - function(){ ... }, - function(){ ... } -]); -``` - -There are many more functions available so take a look at the docs below for a -full list. This module aims to be comprehensive, so if you feel anything is -missing please create a GitHub issue for it. - -## Common Pitfalls - -### Binding a context to an iterator - -This section is really about `bind`, not about `async`. If you are wondering how to -make `async` execute your iterators in a given context, or are confused as to why -a method of another library isn't working as an iterator, study this example: - -```js -// Here is a simple object with an (unnecessarily roundabout) squaring method -var AsyncSquaringLibrary = { - squareExponent: 2, - square: function(number, callback){ - var result = Math.pow(number, this.squareExponent); - setTimeout(function(){ - callback(null, result); - }, 200); - } -}; - -async.map([1, 2, 3], AsyncSquaringLibrary.square, function(err, result){ - // result is [NaN, NaN, NaN] - // This fails because the `this.squareExponent` expression in the square - // function is not evaluated in the context of AsyncSquaringLibrary, and is - // therefore undefined. -}); - -async.map([1, 2, 3], AsyncSquaringLibrary.square.bind(AsyncSquaringLibrary), function(err, result){ - // result is [1, 4, 9] - // With the help of bind we can attach a context to the iterator before - // passing it to async. Now the square function will be executed in its - // 'home' AsyncSquaringLibrary context and the value of `this.squareExponent` - // will be as expected. -}); -``` - -## Download - -The source is available for download from -[GitHub](http://github.com/caolan/async). -Alternatively, you can install using Node Package Manager (`npm`): - - npm install async - -__Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async.js) - 29.6kb Uncompressed - -## In the Browser - -So far it's been tested in IE6, IE7, IE8, FF3.6 and Chrome 5. - -Usage: - -```html - - -``` - -## Documentation - -### Collections - -* [`each`](#each) -* [`eachSeries`](#eachSeries) -* [`eachLimit`](#eachLimit) -* [`map`](#map) -* [`mapSeries`](#mapSeries) -* [`mapLimit`](#mapLimit) -* [`filter`](#filter) -* [`filterSeries`](#filterSeries) -* [`reject`](#reject) -* [`rejectSeries`](#rejectSeries) -* [`reduce`](#reduce) -* [`reduceRight`](#reduceRight) -* [`detect`](#detect) -* [`detectSeries`](#detectSeries) -* [`sortBy`](#sortBy) -* [`some`](#some) -* [`every`](#every) -* [`concat`](#concat) -* [`concatSeries`](#concatSeries) - -### Control Flow - -* [`series`](#seriestasks-callback) -* [`parallel`](#parallel) -* [`parallelLimit`](#parallellimittasks-limit-callback) -* [`whilst`](#whilst) -* [`doWhilst`](#doWhilst) -* [`until`](#until) -* [`doUntil`](#doUntil) -* [`forever`](#forever) -* [`waterfall`](#waterfall) -* [`compose`](#compose) -* [`seq`](#seq) -* [`applyEach`](#applyEach) -* [`applyEachSeries`](#applyEachSeries) -* [`queue`](#queue) -* [`priorityQueue`](#priorityQueue) -* [`cargo`](#cargo) -* [`auto`](#auto) -* [`retry`](#retry) -* [`iterator`](#iterator) -* [`apply`](#apply) -* [`nextTick`](#nextTick) -* [`times`](#times) -* [`timesSeries`](#timesSeries) - -### Utils - -* [`memoize`](#memoize) -* [`unmemoize`](#unmemoize) -* [`log`](#log) -* [`dir`](#dir) -* [`noConflict`](#noConflict) - - -## Collections - - - -### each(arr, iterator, callback) - -Applies the function `iterator` to each item in `arr`, in parallel. -The `iterator` is called with an item from the list, and a callback for when it -has finished. If the `iterator` passes an error to its `callback`, the main -`callback` (for the `each` function) is immediately called with the error. - -Note, that since this function applies `iterator` to each item in parallel, -there is no guarantee that the iterator functions will complete in order. - -__Arguments__ - -* `arr` - An array to iterate over. -* `iterator(item, callback)` - A function to apply to each item in `arr`. - The iterator is passed a `callback(err)` which must be called once it has - completed. If no error has occured, the `callback` should be run without - arguments or with an explicit `null` argument. -* `callback(err)` - A callback which is called when all `iterator` functions - have finished, or an error occurs. - -__Examples__ - - -```js -// assuming openFiles is an array of file names and saveFile is a function -// to save the modified contents of that file: - -async.each(openFiles, saveFile, function(err){ - // if any of the saves produced an error, err would equal that error -}); -``` - -```js -// assuming openFiles is an array of file names - -async.each(openFiles, function( file, callback) { - - // Perform operation on file here. - console.log('Processing file ' + file); - - if( file.length > 32 ) { - console.log('This file name is too long'); - callback('File name too long'); - } else { - // Do work to process file here - console.log('File processed'); - callback(); - } -}, function(err){ - // if any of the file processing produced an error, err would equal that error - if( err ) { - // One of the iterations produced an error. - // All processing will now stop. - console.log('A file failed to process'); - } else { - console.log('All files have been processed successfully'); - } -}); -``` - ---------------------------------------- - - - -### eachSeries(arr, iterator, callback) - -The same as [`each`](#each), only `iterator` is applied to each item in `arr` in -series. The next `iterator` is only called once the current one has completed. -This means the `iterator` functions will complete in order. - - ---------------------------------------- - - - -### eachLimit(arr, limit, iterator, callback) - -The same as [`each`](#each), only no more than `limit` `iterator`s will be simultaneously -running at any time. - -Note that the items in `arr` are not processed in batches, so there is no guarantee that -the first `limit` `iterator` functions will complete before any others are started. - -__Arguments__ - -* `arr` - An array to iterate over. -* `limit` - The maximum number of `iterator`s to run at any time. -* `iterator(item, callback)` - A function to apply to each item in `arr`. - The iterator is passed a `callback(err)` which must be called once it has - completed. If no error has occured, the callback should be run without - arguments or with an explicit `null` argument. -* `callback(err)` - A callback which is called when all `iterator` functions - have finished, or an error occurs. - -__Example__ - -```js -// Assume documents is an array of JSON objects and requestApi is a -// function that interacts with a rate-limited REST api. - -async.eachLimit(documents, 20, requestApi, function(err){ - // if any of the saves produced an error, err would equal that error -}); -``` - ---------------------------------------- - - -### map(arr, iterator, callback) - -Produces a new array of values by mapping each value in `arr` through -the `iterator` function. The `iterator` is called with an item from `arr` and a -callback for when it has finished processing. Each of these callback takes 2 arguments: -an `error`, and the transformed item from `arr`. If `iterator` passes an error to this -callback, the main `callback` (for the `map` function) is immediately called with the error. - -Note, that since this function applies the `iterator` to each item in parallel, -there is no guarantee that the `iterator` functions will complete in order. -However, the results array will be in the same order as the original `arr`. - -__Arguments__ - -* `arr` - An array to iterate over. -* `iterator(item, callback)` - A function to apply to each item in `arr`. - The iterator is passed a `callback(err, transformed)` which must be called once - it has completed with an error (which can be `null`) and a transformed item. -* `callback(err, results)` - A callback which is called when all `iterator` - functions have finished, or an error occurs. Results is an array of the - transformed items from the `arr`. - -__Example__ - -```js -async.map(['file1','file2','file3'], fs.stat, function(err, results){ - // results is now an array of stats for each file -}); -``` - ---------------------------------------- - - -### mapSeries(arr, iterator, callback) - -The same as [`map`](#map), only the `iterator` is applied to each item in `arr` in -series. The next `iterator` is only called once the current one has completed. -The results array will be in the same order as the original. - - ---------------------------------------- - - -### mapLimit(arr, limit, iterator, callback) - -The same as [`map`](#map), only no more than `limit` `iterator`s will be simultaneously -running at any time. - -Note that the items are not processed in batches, so there is no guarantee that -the first `limit` `iterator` functions will complete before any others are started. - -__Arguments__ - -* `arr` - An array to iterate over. -* `limit` - The maximum number of `iterator`s to run at any time. -* `iterator(item, callback)` - A function to apply to each item in `arr`. - The iterator is passed a `callback(err, transformed)` which must be called once - it has completed with an error (which can be `null`) and a transformed item. -* `callback(err, results)` - A callback which is called when all `iterator` - calls have finished, or an error occurs. The result is an array of the - transformed items from the original `arr`. - -__Example__ - -```js -async.mapLimit(['file1','file2','file3'], 1, fs.stat, function(err, results){ - // results is now an array of stats for each file -}); -``` - ---------------------------------------- - - - -### filter(arr, iterator, callback) - -__Alias:__ `select` - -Returns a new array of all the values in `arr` which pass an async truth test. -_The callback for each `iterator` call only accepts a single argument of `true` or -`false`; it does not accept an error argument first!_ This is in-line with the -way node libraries work with truth tests like `fs.exists`. This operation is -performed in parallel, but the results array will be in the same order as the -original. - -__Arguments__ - -* `arr` - An array to iterate over. -* `iterator(item, callback)` - A truth test to apply to each item in `arr`. - The `iterator` is passed a `callback(truthValue)`, which must be called with a - boolean argument once it has completed. -* `callback(results)` - A callback which is called after all the `iterator` - functions have finished. - -__Example__ - -```js -async.filter(['file1','file2','file3'], fs.exists, function(results){ - // results now equals an array of the existing files -}); -``` - ---------------------------------------- - - - -### filterSeries(arr, iterator, callback) - -__Alias:__ `selectSeries` - -The same as [`filter`](#filter) only the `iterator` is applied to each item in `arr` in -series. The next `iterator` is only called once the current one has completed. -The results array will be in the same order as the original. - ---------------------------------------- - - -### reject(arr, iterator, callback) - -The opposite of [`filter`](#filter). Removes values that pass an `async` truth test. - ---------------------------------------- - - -### rejectSeries(arr, iterator, callback) - -The same as [`reject`](#reject), only the `iterator` is applied to each item in `arr` -in series. - - ---------------------------------------- - - -### reduce(arr, memo, iterator, callback) - -__Aliases:__ `inject`, `foldl` - -Reduces `arr` into a single value using an async `iterator` to return -each successive step. `memo` is the initial state of the reduction. -This function only operates in series. - -For performance reasons, it may make sense to split a call to this function into -a parallel map, and then use the normal `Array.prototype.reduce` on the results. -This function is for situations where each step in the reduction needs to be async; -if you can get the data before reducing it, then it's probably a good idea to do so. - -__Arguments__ - -* `arr` - An array to iterate over. -* `memo` - The initial state of the reduction. -* `iterator(memo, item, callback)` - A function applied to each item in the - array to produce the next step in the reduction. The `iterator` is passed a - `callback(err, reduction)` which accepts an optional error as its first - argument, and the state of the reduction as the second. If an error is - passed to the callback, the reduction is stopped and the main `callback` is - immediately called with the error. -* `callback(err, result)` - A callback which is called after all the `iterator` - functions have finished. Result is the reduced value. - -__Example__ - -```js -async.reduce([1,2,3], 0, function(memo, item, callback){ - // pointless async: - process.nextTick(function(){ - callback(null, memo + item) - }); -}, function(err, result){ - // result is now equal to the last value of memo, which is 6 -}); -``` - ---------------------------------------- - - -### reduceRight(arr, memo, iterator, callback) - -__Alias:__ `foldr` - -Same as [`reduce`](#reduce), only operates on `arr` in reverse order. - - ---------------------------------------- - - -### detect(arr, iterator, callback) - -Returns the first value in `arr` that passes an async truth test. The -`iterator` is applied in parallel, meaning the first iterator to return `true` will -fire the detect `callback` with that result. That means the result might not be -the first item in the original `arr` (in terms of order) that passes the test. - -If order within the original `arr` is important, then look at [`detectSeries`](#detectSeries). - -__Arguments__ - -* `arr` - An array to iterate over. -* `iterator(item, callback)` - A truth test to apply to each item in `arr`. - The iterator is passed a `callback(truthValue)` which must be called with a - boolean argument once it has completed. -* `callback(result)` - A callback which is called as soon as any iterator returns - `true`, or after all the `iterator` functions have finished. Result will be - the first item in the array that passes the truth test (iterator) or the - value `undefined` if none passed. - -__Example__ - -```js -async.detect(['file1','file2','file3'], fs.exists, function(result){ - // result now equals the first file in the list that exists -}); -``` - ---------------------------------------- - - -### detectSeries(arr, iterator, callback) - -The same as [`detect`](#detect), only the `iterator` is applied to each item in `arr` -in series. This means the result is always the first in the original `arr` (in -terms of array order) that passes the truth test. - - ---------------------------------------- - - -### sortBy(arr, iterator, callback) - -Sorts a list by the results of running each `arr` value through an async `iterator`. - -__Arguments__ - -* `arr` - An array to iterate over. -* `iterator(item, callback)` - A function to apply to each item in `arr`. - The iterator is passed a `callback(err, sortValue)` which must be called once it - has completed with an error (which can be `null`) and a value to use as the sort - criteria. -* `callback(err, results)` - A callback which is called after all the `iterator` - functions have finished, or an error occurs. Results is the items from - the original `arr` sorted by the values returned by the `iterator` calls. - -__Example__ - -```js -async.sortBy(['file1','file2','file3'], function(file, callback){ - fs.stat(file, function(err, stats){ - callback(err, stats.mtime); - }); -}, function(err, results){ - // results is now the original array of files sorted by - // modified date -}); -``` - -__Sort Order__ - -By modifying the callback parameter the sorting order can be influenced: - -```js -//ascending order -async.sortBy([1,9,3,5], function(x, callback){ - callback(err, x); -}, function(err,result){ - //result callback -} ); - -//descending order -async.sortBy([1,9,3,5], function(x, callback){ - callback(err, x*-1); //<- x*-1 instead of x, turns the order around -}, function(err,result){ - //result callback -} ); -``` - ---------------------------------------- - - -### some(arr, iterator, callback) - -__Alias:__ `any` - -Returns `true` if at least one element in the `arr` satisfies an async test. -_The callback for each iterator call only accepts a single argument of `true` or -`false`; it does not accept an error argument first!_ This is in-line with the -way node libraries work with truth tests like `fs.exists`. Once any iterator -call returns `true`, the main `callback` is immediately called. - -__Arguments__ - -* `arr` - An array to iterate over. -* `iterator(item, callback)` - A truth test to apply to each item in the array - in parallel. The iterator is passed a callback(truthValue) which must be - called with a boolean argument once it has completed. -* `callback(result)` - A callback which is called as soon as any iterator returns - `true`, or after all the iterator functions have finished. Result will be - either `true` or `false` depending on the values of the async tests. - -__Example__ - -```js -async.some(['file1','file2','file3'], fs.exists, function(result){ - // if result is true then at least one of the files exists -}); -``` - ---------------------------------------- - - -### every(arr, iterator, callback) - -__Alias:__ `all` - -Returns `true` if every element in `arr` satisfies an async test. -_The callback for each `iterator` call only accepts a single argument of `true` or -`false`; it does not accept an error argument first!_ This is in-line with the -way node libraries work with truth tests like `fs.exists`. - -__Arguments__ - -* `arr` - An array to iterate over. -* `iterator(item, callback)` - A truth test to apply to each item in the array - in parallel. The iterator is passed a callback(truthValue) which must be - called with a boolean argument once it has completed. -* `callback(result)` - A callback which is called after all the `iterator` - functions have finished. Result will be either `true` or `false` depending on - the values of the async tests. - -__Example__ - -```js -async.every(['file1','file2','file3'], fs.exists, function(result){ - // if result is true then every file exists -}); -``` - ---------------------------------------- - - -### concat(arr, iterator, callback) - -Applies `iterator` to each item in `arr`, concatenating the results. Returns the -concatenated list. The `iterator`s are called in parallel, and the results are -concatenated as they return. There is no guarantee that the results array will -be returned in the original order of `arr` passed to the `iterator` function. - -__Arguments__ - -* `arr` - An array to iterate over. -* `iterator(item, callback)` - A function to apply to each item in `arr`. - The iterator is passed a `callback(err, results)` which must be called once it - has completed with an error (which can be `null`) and an array of results. -* `callback(err, results)` - A callback which is called after all the `iterator` - functions have finished, or an error occurs. Results is an array containing - the concatenated results of the `iterator` function. - -__Example__ - -```js -async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){ - // files is now a list of filenames that exist in the 3 directories -}); -``` - ---------------------------------------- - - -### concatSeries(arr, iterator, callback) - -Same as [`concat`](#concat), but executes in series instead of parallel. - - -## Control Flow - - -### series(tasks, [callback]) - -Run the functions in the `tasks` array in series, each one running once the previous -function has completed. If any functions in the series pass an error to its -callback, no more functions are run, and `callback` is immediately called with the value of the error. -Otherwise, `callback` receives an array of results when `tasks` have completed. - -It is also possible to use an object instead of an array. Each property will be -run as a function, and the results will be passed to the final `callback` as an object -instead of an array. This can be a more readable way of handling results from -[`series`](#series). - -**Note** that while many implementations preserve the order of object properties, the -[ECMAScript Language Specifcation](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6) -explicitly states that - -> The mechanics and order of enumerating the properties is not specified. - -So if you rely on the order in which your series of functions are executed, and want -this to work on all platforms, consider using an array. - -__Arguments__ - -* `tasks` - An array or object containing functions to run, each function is passed - a `callback(err, result)` it must call on completion with an error `err` (which can - be `null`) and an optional `result` value. -* `callback(err, results)` - An optional callback to run once all the functions - have completed. This function gets a results array (or object) containing all - the result arguments passed to the `task` callbacks. - -__Example__ - -```js -async.series([ - function(callback){ - // do some stuff ... - callback(null, 'one'); - }, - function(callback){ - // do some more stuff ... - callback(null, 'two'); - } -], -// optional callback -function(err, results){ - // results is now equal to ['one', 'two'] -}); - - -// an example using an object instead of an array -async.series({ - one: function(callback){ - setTimeout(function(){ - callback(null, 1); - }, 200); - }, - two: function(callback){ - setTimeout(function(){ - callback(null, 2); - }, 100); - } -}, -function(err, results) { - // results is now equal to: {one: 1, two: 2} -}); -``` - ---------------------------------------- - - -### parallel(tasks, [callback]) - -Run the `tasks` array of functions in parallel, without waiting until the previous -function has completed. If any of the functions pass an error to its -callback, the main `callback` is immediately called with the value of the error. -Once the `tasks` have completed, the results are passed to the final `callback` as an -array. - -It is also possible to use an object instead of an array. Each property will be -run as a function and the results will be passed to the final `callback` as an object -instead of an array. This can be a more readable way of handling results from -[`parallel`](#parallel). - - -__Arguments__ - -* `tasks` - An array or object containing functions to run. Each function is passed - a `callback(err, result)` which it must call on completion with an error `err` - (which can be `null`) and an optional `result` value. -* `callback(err, results)` - An optional callback to run once all the functions - have completed. This function gets a results array (or object) containing all - the result arguments passed to the task callbacks. - -__Example__ - -```js -async.parallel([ - function(callback){ - setTimeout(function(){ - callback(null, 'one'); - }, 200); - }, - function(callback){ - setTimeout(function(){ - callback(null, 'two'); - }, 100); - } -], -// optional callback -function(err, results){ - // the results array will equal ['one','two'] even though - // the second function had a shorter timeout. -}); - - -// an example using an object instead of an array -async.parallel({ - one: function(callback){ - setTimeout(function(){ - callback(null, 1); - }, 200); - }, - two: function(callback){ - setTimeout(function(){ - callback(null, 2); - }, 100); - } -}, -function(err, results) { - // results is now equals to: {one: 1, two: 2} -}); -``` - ---------------------------------------- - - -### parallelLimit(tasks, limit, [callback]) - -The same as [`parallel`](#parallel), only `tasks` are executed in parallel -with a maximum of `limit` tasks executing at any time. - -Note that the `tasks` are not executed in batches, so there is no guarantee that -the first `limit` tasks will complete before any others are started. - -__Arguments__ - -* `tasks` - An array or object containing functions to run, each function is passed - a `callback(err, result)` it must call on completion with an error `err` (which can - be `null`) and an optional `result` value. -* `limit` - The maximum number of `tasks` to run at any time. -* `callback(err, results)` - An optional callback to run once all the functions - have completed. This function gets a results array (or object) containing all - the result arguments passed to the `task` callbacks. - ---------------------------------------- - - -### whilst(test, fn, callback) - -Repeatedly call `fn`, while `test` returns `true`. Calls `callback` when stopped, -or an error occurs. - -__Arguments__ - -* `test()` - synchronous truth test to perform before each execution of `fn`. -* `fn(callback)` - A function which is called each time `test` passes. The function is - passed a `callback(err)`, which must be called once it has completed with an - optional `err` argument. -* `callback(err)` - A callback which is called after the test fails and repeated - execution of `fn` has stopped. - -__Example__ - -```js -var count = 0; - -async.whilst( - function () { return count < 5; }, - function (callback) { - count++; - setTimeout(callback, 1000); - }, - function (err) { - // 5 seconds have passed - } -); -``` - ---------------------------------------- - - -### doWhilst(fn, test, callback) - -The post-check version of [`whilst`](#whilst). To reflect the difference in -the order of operations, the arguments `test` and `fn` are switched. - -`doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript. - ---------------------------------------- - - -### until(test, fn, callback) - -Repeatedly call `fn` until `test` returns `true`. Calls `callback` when stopped, -or an error occurs. - -The inverse of [`whilst`](#whilst). - ---------------------------------------- - - -### doUntil(fn, test, callback) - -Like [`doWhilst`](#doWhilst), except the `test` is inverted. Note the argument ordering differs from `until`. - ---------------------------------------- - - -### forever(fn, errback) - -Calls the asynchronous function `fn` with a callback parameter that allows it to -call itself again, in series, indefinitely. - -If an error is passed to the callback then `errback` is called with the -error, and execution stops, otherwise it will never be called. - -```js -async.forever( - function(next) { - // next is suitable for passing to things that need a callback(err [, whatever]); - // it will result in this function being called again. - }, - function(err) { - // if next is called with a value in its first parameter, it will appear - // in here as 'err', and execution will stop. - } -); -``` - ---------------------------------------- - - -### waterfall(tasks, [callback]) - -Runs the `tasks` array of functions in series, each passing their results to the next in -the array. However, if any of the `tasks` pass an error to their own callback, the -next function is not executed, and the main `callback` is immediately called with -the error. - -__Arguments__ - -* `tasks` - An array of functions to run, each function is passed a - `callback(err, result1, result2, ...)` it must call on completion. The first - argument is an error (which can be `null`) and any further arguments will be - passed as arguments in order to the next task. -* `callback(err, [results])` - An optional callback to run once all the functions - have completed. This will be passed the results of the last task's callback. - - - -__Example__ - -```js -async.waterfall([ - function(callback){ - callback(null, 'one', 'two'); - }, - function(arg1, arg2, callback){ - // arg1 now equals 'one' and arg2 now equals 'two' - callback(null, 'three'); - }, - function(arg1, callback){ - // arg1 now equals 'three' - callback(null, 'done'); - } -], function (err, result) { - // result now equals 'done' -}); -``` - ---------------------------------------- - -### compose(fn1, fn2...) - -Creates a function which is a composition of the passed asynchronous -functions. Each function consumes the return value of the function that -follows. Composing functions `f()`, `g()`, and `h()` would produce the result of -`f(g(h()))`, only this version uses callbacks to obtain the return values. - -Each function is executed with the `this` binding of the composed function. - -__Arguments__ - -* `functions...` - the asynchronous functions to compose - - -__Example__ - -```js -function add1(n, callback) { - setTimeout(function () { - callback(null, n + 1); - }, 10); -} - -function mul3(n, callback) { - setTimeout(function () { - callback(null, n * 3); - }, 10); -} - -var add1mul3 = async.compose(mul3, add1); - -add1mul3(4, function (err, result) { - // result now equals 15 -}); -``` - ---------------------------------------- - -### seq(fn1, fn2...) - -Version of the compose function that is more natural to read. -Each following function consumes the return value of the latter function. - -Each function is executed with the `this` binding of the composed function. - -__Arguments__ - -* functions... - the asynchronous functions to compose - - -__Example__ - -```js -// Requires lodash (or underscore), express3 and dresende's orm2. -// Part of an app, that fetches cats of the logged user. -// This example uses `seq` function to avoid overnesting and error -// handling clutter. -app.get('/cats', function(request, response) { - function handleError(err, data, callback) { - if (err) { - console.error(err); - response.json({ status: 'error', message: err.message }); - } - else { - callback(data); - } - } - var User = request.models.User; - async.seq( - _.bind(User.get, User), // 'User.get' has signature (id, callback(err, data)) - handleError, - function(user, fn) { - user.getCats(fn); // 'getCats' has signature (callback(err, data)) - }, - handleError, - function(cats) { - response.json({ status: 'ok', message: 'Cats found', data: cats }); - } - )(req.session.user_id); - } -}); -``` - ---------------------------------------- - -### applyEach(fns, args..., callback) - -Applies the provided arguments to each function in the array, calling -`callback` after all functions have completed. If you only provide the first -argument, then it will return a function which lets you pass in the -arguments as if it were a single function call. - -__Arguments__ - -* `fns` - the asynchronous functions to all call with the same arguments -* `args...` - any number of separate arguments to pass to the function -* `callback` - the final argument should be the callback, called when all - functions have completed processing - - -__Example__ - -```js -async.applyEach([enableSearch, updateSchema], 'bucket', callback); - -// partial application example: -async.each( - buckets, - async.applyEach([enableSearch, updateSchema]), - callback -); -``` - ---------------------------------------- - - -### applyEachSeries(arr, iterator, callback) - -The same as [`applyEach`](#applyEach) only the functions are applied in series. - ---------------------------------------- - - -### queue(worker, concurrency) - -Creates a `queue` object with the specified `concurrency`. Tasks added to the -`queue` are processed in parallel (up to the `concurrency` limit). If all -`worker`s are in progress, the task is queued until one becomes available. -Once a `worker` completes a `task`, that `task`'s callback is called. - -__Arguments__ - -* `worker(task, callback)` - An asynchronous function for processing a queued - task, which must call its `callback(err)` argument when finished, with an - optional `error` as an argument. -* `concurrency` - An `integer` for determining how many `worker` functions should be - run in parallel. - -__Queue objects__ - -The `queue` object returned by this function has the following properties and -methods: - -* `length()` - a function returning the number of items waiting to be processed. -* `started` - a function returning whether or not any items have been pushed and processed by the queue -* `running()` - a function returning the number of items currently being processed. -* `idle()` - a function returning false if there are items waiting or being processed, or true if not. -* `concurrency` - an integer for determining how many `worker` functions should be - run in parallel. This property can be changed after a `queue` is created to - alter the concurrency on-the-fly. -* `push(task, [callback])` - add a new task to the `queue`. Calls `callback` once - the `worker` has finished processing the task. Instead of a single task, a `tasks` array - can be submitted. The respective callback is used for every task in the list. -* `unshift(task, [callback])` - add a new task to the front of the `queue`. -* `saturated` - a callback that is called when the `queue` length hits the `concurrency` limit, - and further tasks will be queued. -* `empty` - a callback that is called when the last item from the `queue` is given to a `worker`. -* `drain` - a callback that is called when the last item from the `queue` has returned from the `worker`. -* `paused` - a boolean for determining whether the queue is in a paused state -* `pause()` - a function that pauses the processing of tasks until `resume()` is called. -* `resume()` - a function that resumes the processing of queued tasks when the queue is paused. -* `kill()` - a function that empties remaining tasks from the queue forcing it to go idle. - -__Example__ - -```js -// create a queue object with concurrency 2 - -var q = async.queue(function (task, callback) { - console.log('hello ' + task.name); - callback(); -}, 2); - - -// assign a callback -q.drain = function() { - console.log('all items have been processed'); -} - -// add some items to the queue - -q.push({name: 'foo'}, function (err) { - console.log('finished processing foo'); -}); -q.push({name: 'bar'}, function (err) { - console.log('finished processing bar'); -}); - -// add some items to the queue (batch-wise) - -q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) { - console.log('finished processing bar'); -}); - -// add some items to the front of the queue - -q.unshift({name: 'bar'}, function (err) { - console.log('finished processing bar'); -}); -``` - - ---------------------------------------- - - -### priorityQueue(worker, concurrency) - -The same as [`queue`](#queue) only tasks are assigned a priority and completed in ascending priority order. There are two differences between `queue` and `priorityQueue` objects: - -* `push(task, priority, [callback])` - `priority` should be a number. If an array of - `tasks` is given, all tasks will be assigned the same priority. -* The `unshift` method was removed. - ---------------------------------------- - - -### cargo(worker, [payload]) - -Creates a `cargo` object with the specified payload. Tasks added to the -cargo will be processed altogether (up to the `payload` limit). If the -`worker` is in progress, the task is queued until it becomes available. Once -the `worker` has completed some tasks, each callback of those tasks is called. -Check out [this animation](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) for how `cargo` and `queue` work. - -While [queue](#queue) passes only one task to one of a group of workers -at a time, cargo passes an array of tasks to a single worker, repeating -when the worker is finished. - -__Arguments__ - -* `worker(tasks, callback)` - An asynchronous function for processing an array of - queued tasks, which must call its `callback(err)` argument when finished, with - an optional `err` argument. -* `payload` - An optional `integer` for determining how many tasks should be - processed per round; if omitted, the default is unlimited. - -__Cargo objects__ - -The `cargo` object returned by this function has the following properties and -methods: - -* `length()` - A function returning the number of items waiting to be processed. -* `payload` - An `integer` for determining how many tasks should be - process per round. This property can be changed after a `cargo` is created to - alter the payload on-the-fly. -* `push(task, [callback])` - Adds `task` to the `queue`. The callback is called - once the `worker` has finished processing the task. Instead of a single task, an array of `tasks` - can be submitted. The respective callback is used for every task in the list. -* `saturated` - A callback that is called when the `queue.length()` hits the concurrency and further tasks will be queued. -* `empty` - A callback that is called when the last item from the `queue` is given to a `worker`. -* `drain` - A callback that is called when the last item from the `queue` has returned from the `worker`. - -__Example__ - -```js -// create a cargo object with payload 2 - -var cargo = async.cargo(function (tasks, callback) { - for(var i=0; i -### auto(tasks, [callback]) - -Determines the best order for running the functions in `tasks`, based on their -requirements. Each function can optionally depend on other functions being completed -first, and each function is run as soon as its requirements are satisfied. - -If any of the functions pass an error to their callback, it will not -complete (so any other functions depending on it will not run), and the main -`callback` is immediately called with the error. Functions also receive an -object containing the results of functions which have completed so far. - -Note, all functions are called with a `results` object as a second argument, -so it is unsafe to pass functions in the `tasks` object which cannot handle the -extra argument. - -For example, this snippet of code: - -```js -async.auto({ - readData: async.apply(fs.readFile, 'data.txt', 'utf-8') -}, callback); -``` - -will have the effect of calling `readFile` with the results object as the last -argument, which will fail: - -```js -fs.readFile('data.txt', 'utf-8', cb, {}); -``` - -Instead, wrap the call to `readFile` in a function which does not forward the -`results` object: - -```js -async.auto({ - readData: function(cb, results){ - fs.readFile('data.txt', 'utf-8', cb); - } -}, callback); -``` - -__Arguments__ - -* `tasks` - An object. Each of its properties is either a function or an array of - requirements, with the function itself the last item in the array. The object's key - of a property serves as the name of the task defined by that property, - i.e. can be used when specifying requirements for other tasks. - The function receives two arguments: (1) a `callback(err, result)` which must be - called when finished, passing an `error` (which can be `null`) and the result of - the function's execution, and (2) a `results` object, containing the results of - the previously executed functions. -* `callback(err, results)` - An optional callback which is called when all the - tasks have been completed. It receives the `err` argument if any `tasks` - pass an error to their callback. Results are always returned; however, if - an error occurs, no further `tasks` will be performed, and the results - object will only contain partial results. - - -__Example__ - -```js -async.auto({ - get_data: function(callback){ - console.log('in get_data'); - // async code to get some data - callback(null, 'data', 'converted to array'); - }, - make_folder: function(callback){ - console.log('in make_folder'); - // async code to create a directory to store a file in - // this is run at the same time as getting the data - callback(null, 'folder'); - }, - write_file: ['get_data', 'make_folder', function(callback, results){ - console.log('in write_file', JSON.stringify(results)); - // once there is some data and the directory exists, - // write the data to a file in the directory - callback(null, 'filename'); - }], - email_link: ['write_file', function(callback, results){ - console.log('in email_link', JSON.stringify(results)); - // once the file is written let's email a link to it... - // results.write_file contains the filename returned by write_file. - callback(null, {'file':results.write_file, 'email':'user@example.com'}); - }] -}, function(err, results) { - console.log('err = ', err); - console.log('results = ', results); -}); -``` - -This is a fairly trivial example, but to do this using the basic parallel and -series functions would look like this: - -```js -async.parallel([ - function(callback){ - console.log('in get_data'); - // async code to get some data - callback(null, 'data', 'converted to array'); - }, - function(callback){ - console.log('in make_folder'); - // async code to create a directory to store a file in - // this is run at the same time as getting the data - callback(null, 'folder'); - } -], -function(err, results){ - async.series([ - function(callback){ - console.log('in write_file', JSON.stringify(results)); - // once there is some data and the directory exists, - // write the data to a file in the directory - results.push('filename'); - callback(null); - }, - function(callback){ - console.log('in email_link', JSON.stringify(results)); - // once the file is written let's email a link to it... - callback(null, {'file':results.pop(), 'email':'user@example.com'}); - } - ]); -}); -``` - -For a complicated series of `async` tasks, using the [`auto`](#auto) function makes adding -new tasks much easier (and the code more readable). - - ---------------------------------------- - - -### retry([times = 5], task, [callback]) - -Attempts to get a successful response from `task` no more than `times` times before -returning an error. If the task is successful, the `callback` will be passed the result -of the successfull task. If all attemps fail, the callback will be passed the error and -result (if any) of the final attempt. - -__Arguments__ - -* `times` - An integer indicating how many times to attempt the `task` before giving up. Defaults to 5. -* `task(callback, results)` - A function which receives two arguments: (1) a `callback(err, result)` - which must be called when finished, passing `err` (which can be `null`) and the `result` of - the function's execution, and (2) a `results` object, containing the results of - the previously executed functions (if nested inside another control flow). -* `callback(err, results)` - An optional callback which is called when the - task has succeeded, or after the final failed attempt. It receives the `err` and `result` arguments of the last attempt at completing the `task`. - -The [`retry`](#retry) function can be used as a stand-alone control flow by passing a -callback, as shown below: - -```js -async.retry(3, apiMethod, function(err, result) { - // do something with the result -}); -``` - -It can also be embeded within other control flow functions to retry individual methods -that are not as reliable, like this: - -```js -async.auto({ - users: api.getUsers.bind(api), - payments: async.retry(3, api.getPayments.bind(api)) -}, function(err, results) { - // do something with the results -}); -``` - - ---------------------------------------- - - -### iterator(tasks) - -Creates an iterator function which calls the next function in the `tasks` array, -returning a continuation to call the next one after that. It's also possible to -“peek” at the next iterator with `iterator.next()`. - -This function is used internally by the `async` module, but can be useful when -you want to manually control the flow of functions in series. - -__Arguments__ - -* `tasks` - An array of functions to run. - -__Example__ - -```js -var iterator = async.iterator([ - function(){ sys.p('one'); }, - function(){ sys.p('two'); }, - function(){ sys.p('three'); } -]); - -node> var iterator2 = iterator(); -'one' -node> var iterator3 = iterator2(); -'two' -node> iterator3(); -'three' -node> var nextfn = iterator2.next(); -node> nextfn(); -'three' -``` - ---------------------------------------- - - -### apply(function, arguments..) - -Creates a continuation function with some arguments already applied. - -Useful as a shorthand when combined with other control flow functions. Any arguments -passed to the returned function are added to the arguments originally passed -to apply. - -__Arguments__ - -* `function` - The function you want to eventually apply all arguments to. -* `arguments...` - Any number of arguments to automatically apply when the - continuation is called. - -__Example__ - -```js -// using apply - -async.parallel([ - async.apply(fs.writeFile, 'testfile1', 'test1'), - async.apply(fs.writeFile, 'testfile2', 'test2'), -]); - - -// the same process without using apply - -async.parallel([ - function(callback){ - fs.writeFile('testfile1', 'test1', callback); - }, - function(callback){ - fs.writeFile('testfile2', 'test2', callback); - } -]); -``` - -It's possible to pass any number of additional arguments when calling the -continuation: - -```js -node> var fn = async.apply(sys.puts, 'one'); -node> fn('two', 'three'); -one -two -three -``` - ---------------------------------------- - - -### nextTick(callback) - -Calls `callback` on a later loop around the event loop. In Node.js this just -calls `process.nextTick`; in the browser it falls back to `setImmediate(callback)` -if available, otherwise `setTimeout(callback, 0)`, which means other higher priority -events may precede the execution of `callback`. - -This is used internally for browser-compatibility purposes. - -__Arguments__ - -* `callback` - The function to call on a later loop around the event loop. - -__Example__ - -```js -var call_order = []; -async.nextTick(function(){ - call_order.push('two'); - // call_order now equals ['one','two'] -}); -call_order.push('one') -``` - - -### times(n, callback) - -Calls the `callback` function `n` times, and accumulates results in the same manner -you would use with [`map`](#map). - -__Arguments__ - -* `n` - The number of times to run the function. -* `callback` - The function to call `n` times. - -__Example__ - -```js -// Pretend this is some complicated async factory -var createUser = function(id, callback) { - callback(null, { - id: 'user' + id - }) -} -// generate 5 users -async.times(5, function(n, next){ - createUser(n, function(err, user) { - next(err, user) - }) -}, function(err, users) { - // we should now have 5 users -}); -``` - - -### timesSeries(n, callback) - -The same as [`times`](#times), only the iterator is applied to each item in `arr` in -series. The next `iterator` is only called once the current one has completed. -The results array will be in the same order as the original. - - -## Utils - - -### memoize(fn, [hasher]) - -Caches the results of an `async` function. When creating a hash to store function -results against, the callback is omitted from the hash and an optional hash -function can be used. - -The cache of results is exposed as the `memo` property of the function returned -by `memoize`. - -__Arguments__ - -* `fn` - The function to proxy and cache results from. -* `hasher` - Tn optional function for generating a custom hash for storing - results. It has all the arguments applied to it apart from the callback, and - must be synchronous. - -__Example__ - -```js -var slow_fn = function (name, callback) { - // do something - callback(null, result); -}; -var fn = async.memoize(slow_fn); - -// fn can now be used as if it were slow_fn -fn('some name', function () { - // callback -}); -``` - - -### unmemoize(fn) - -Undoes a [`memoize`](#memoize)d function, reverting it to the original, unmemoized -form. Handy for testing. - -__Arguments__ - -* `fn` - the memoized function - - -### log(function, arguments) - -Logs the result of an `async` function to the `console`. Only works in Node.js or -in browsers that support `console.log` and `console.error` (such as FF and Chrome). -If multiple arguments are returned from the async function, `console.log` is -called on each argument in order. - -__Arguments__ - -* `function` - The function you want to eventually apply all arguments to. -* `arguments...` - Any number of arguments to apply to the function. - -__Example__ - -```js -var hello = function(name, callback){ - setTimeout(function(){ - callback(null, 'hello ' + name); - }, 1000); -}; -``` -```js -node> async.log(hello, 'world'); -'hello world' -``` - ---------------------------------------- - - -### dir(function, arguments) - -Logs the result of an `async` function to the `console` using `console.dir` to -display the properties of the resulting object. Only works in Node.js or -in browsers that support `console.dir` and `console.error` (such as FF and Chrome). -If multiple arguments are returned from the async function, `console.dir` is -called on each argument in order. - -__Arguments__ - -* `function` - The function you want to eventually apply all arguments to. -* `arguments...` - Any number of arguments to apply to the function. - -__Example__ - -```js -var hello = function(name, callback){ - setTimeout(function(){ - callback(null, {hello: name}); - }, 1000); -}; -``` -```js -node> async.dir(hello, 'world'); -{hello: 'world'} -``` - ---------------------------------------- - - -### noConflict() - -Changes the value of `async` back to its original value, returning a reference to the -`async` object. diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/form-data/node_modules/async/component.json b/update_nation/node_modules/nano/node_modules/request/node_modules/form-data/node_modules/async/component.json deleted file mode 100644 index bbb011548..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/form-data/node_modules/async/component.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "async", - "repo": "caolan/async", - "description": "Higher-order functions and common patterns for asynchronous code", - "version": "0.1.23", - "keywords": [], - "dependencies": {}, - "development": {}, - "main": "lib/async.js", - "scripts": [ "lib/async.js" ] -} diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js b/update_nation/node_modules/nano/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js deleted file mode 100644 index 01e8afcc4..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js +++ /dev/null @@ -1,1123 +0,0 @@ -/*! - * async - * https://github.com/caolan/async - * - * Copyright 2010-2014 Caolan McMahon - * Released under the MIT license - */ -/*jshint onevar: false, indent:4 */ -/*global setImmediate: false, setTimeout: false, console: false */ -(function () { - - var async = {}; - - // global on the server, window in the browser - var root, previous_async; - - root = this; - if (root != null) { - previous_async = root.async; - } - - async.noConflict = function () { - root.async = previous_async; - return async; - }; - - function only_once(fn) { - var called = false; - return function() { - if (called) throw new Error("Callback was already called."); - called = true; - fn.apply(root, arguments); - } - } - - //// cross-browser compatiblity functions //// - - var _toString = Object.prototype.toString; - - var _isArray = Array.isArray || function (obj) { - return _toString.call(obj) === '[object Array]'; - }; - - var _each = function (arr, iterator) { - if (arr.forEach) { - return arr.forEach(iterator); - } - for (var i = 0; i < arr.length; i += 1) { - iterator(arr[i], i, arr); - } - }; - - var _map = function (arr, iterator) { - if (arr.map) { - return arr.map(iterator); - } - var results = []; - _each(arr, function (x, i, a) { - results.push(iterator(x, i, a)); - }); - return results; - }; - - var _reduce = function (arr, iterator, memo) { - if (arr.reduce) { - return arr.reduce(iterator, memo); - } - _each(arr, function (x, i, a) { - memo = iterator(memo, x, i, a); - }); - return memo; - }; - - var _keys = function (obj) { - if (Object.keys) { - return Object.keys(obj); - } - var keys = []; - for (var k in obj) { - if (obj.hasOwnProperty(k)) { - keys.push(k); - } - } - return keys; - }; - - //// exported async module functions //// - - //// nextTick implementation with browser-compatible fallback //// - if (typeof process === 'undefined' || !(process.nextTick)) { - if (typeof setImmediate === 'function') { - async.nextTick = function (fn) { - // not a direct alias for IE10 compatibility - setImmediate(fn); - }; - async.setImmediate = async.nextTick; - } - else { - async.nextTick = function (fn) { - setTimeout(fn, 0); - }; - async.setImmediate = async.nextTick; - } - } - else { - async.nextTick = process.nextTick; - if (typeof setImmediate !== 'undefined') { - async.setImmediate = function (fn) { - // not a direct alias for IE10 compatibility - setImmediate(fn); - }; - } - else { - async.setImmediate = async.nextTick; - } - } - - async.each = function (arr, iterator, callback) { - callback = callback || function () {}; - if (!arr.length) { - return callback(); - } - var completed = 0; - _each(arr, function (x) { - iterator(x, only_once(done) ); - }); - function done(err) { - if (err) { - callback(err); - callback = function () {}; - } - else { - completed += 1; - if (completed >= arr.length) { - callback(); - } - } - } - }; - async.forEach = async.each; - - async.eachSeries = function (arr, iterator, callback) { - callback = callback || function () {}; - if (!arr.length) { - return callback(); - } - var completed = 0; - var iterate = function () { - iterator(arr[completed], function (err) { - if (err) { - callback(err); - callback = function () {}; - } - else { - completed += 1; - if (completed >= arr.length) { - callback(); - } - else { - iterate(); - } - } - }); - }; - iterate(); - }; - async.forEachSeries = async.eachSeries; - - async.eachLimit = function (arr, limit, iterator, callback) { - var fn = _eachLimit(limit); - fn.apply(null, [arr, iterator, callback]); - }; - async.forEachLimit = async.eachLimit; - - var _eachLimit = function (limit) { - - return function (arr, iterator, callback) { - callback = callback || function () {}; - if (!arr.length || limit <= 0) { - return callback(); - } - var completed = 0; - var started = 0; - var running = 0; - - (function replenish () { - if (completed >= arr.length) { - return callback(); - } - - while (running < limit && started < arr.length) { - started += 1; - running += 1; - iterator(arr[started - 1], function (err) { - if (err) { - callback(err); - callback = function () {}; - } - else { - completed += 1; - running -= 1; - if (completed >= arr.length) { - callback(); - } - else { - replenish(); - } - } - }); - } - })(); - }; - }; - - - var doParallel = function (fn) { - return function () { - var args = Array.prototype.slice.call(arguments); - return fn.apply(null, [async.each].concat(args)); - }; - }; - var doParallelLimit = function(limit, fn) { - return function () { - var args = Array.prototype.slice.call(arguments); - return fn.apply(null, [_eachLimit(limit)].concat(args)); - }; - }; - var doSeries = function (fn) { - return function () { - var args = Array.prototype.slice.call(arguments); - return fn.apply(null, [async.eachSeries].concat(args)); - }; - }; - - - var _asyncMap = function (eachfn, arr, iterator, callback) { - arr = _map(arr, function (x, i) { - return {index: i, value: x}; - }); - if (!callback) { - eachfn(arr, function (x, callback) { - iterator(x.value, function (err) { - callback(err); - }); - }); - } else { - var results = []; - eachfn(arr, function (x, callback) { - iterator(x.value, function (err, v) { - results[x.index] = v; - callback(err); - }); - }, function (err) { - callback(err, results); - }); - } - }; - async.map = doParallel(_asyncMap); - async.mapSeries = doSeries(_asyncMap); - async.mapLimit = function (arr, limit, iterator, callback) { - return _mapLimit(limit)(arr, iterator, callback); - }; - - var _mapLimit = function(limit) { - return doParallelLimit(limit, _asyncMap); - }; - - // reduce only has a series version, as doing reduce in parallel won't - // work in many situations. - async.reduce = function (arr, memo, iterator, callback) { - async.eachSeries(arr, function (x, callback) { - iterator(memo, x, function (err, v) { - memo = v; - callback(err); - }); - }, function (err) { - callback(err, memo); - }); - }; - // inject alias - async.inject = async.reduce; - // foldl alias - async.foldl = async.reduce; - - async.reduceRight = function (arr, memo, iterator, callback) { - var reversed = _map(arr, function (x) { - return x; - }).reverse(); - async.reduce(reversed, memo, iterator, callback); - }; - // foldr alias - async.foldr = async.reduceRight; - - var _filter = function (eachfn, arr, iterator, callback) { - var results = []; - arr = _map(arr, function (x, i) { - return {index: i, value: x}; - }); - eachfn(arr, function (x, callback) { - iterator(x.value, function (v) { - if (v) { - results.push(x); - } - callback(); - }); - }, function (err) { - callback(_map(results.sort(function (a, b) { - return a.index - b.index; - }), function (x) { - return x.value; - })); - }); - }; - async.filter = doParallel(_filter); - async.filterSeries = doSeries(_filter); - // select alias - async.select = async.filter; - async.selectSeries = async.filterSeries; - - var _reject = function (eachfn, arr, iterator, callback) { - var results = []; - arr = _map(arr, function (x, i) { - return {index: i, value: x}; - }); - eachfn(arr, function (x, callback) { - iterator(x.value, function (v) { - if (!v) { - results.push(x); - } - callback(); - }); - }, function (err) { - callback(_map(results.sort(function (a, b) { - return a.index - b.index; - }), function (x) { - return x.value; - })); - }); - }; - async.reject = doParallel(_reject); - async.rejectSeries = doSeries(_reject); - - var _detect = function (eachfn, arr, iterator, main_callback) { - eachfn(arr, function (x, callback) { - iterator(x, function (result) { - if (result) { - main_callback(x); - main_callback = function () {}; - } - else { - callback(); - } - }); - }, function (err) { - main_callback(); - }); - }; - async.detect = doParallel(_detect); - async.detectSeries = doSeries(_detect); - - async.some = function (arr, iterator, main_callback) { - async.each(arr, function (x, callback) { - iterator(x, function (v) { - if (v) { - main_callback(true); - main_callback = function () {}; - } - callback(); - }); - }, function (err) { - main_callback(false); - }); - }; - // any alias - async.any = async.some; - - async.every = function (arr, iterator, main_callback) { - async.each(arr, function (x, callback) { - iterator(x, function (v) { - if (!v) { - main_callback(false); - main_callback = function () {}; - } - callback(); - }); - }, function (err) { - main_callback(true); - }); - }; - // all alias - async.all = async.every; - - async.sortBy = function (arr, iterator, callback) { - async.map(arr, function (x, callback) { - iterator(x, function (err, criteria) { - if (err) { - callback(err); - } - else { - callback(null, {value: x, criteria: criteria}); - } - }); - }, function (err, results) { - if (err) { - return callback(err); - } - else { - var fn = function (left, right) { - var a = left.criteria, b = right.criteria; - return a < b ? -1 : a > b ? 1 : 0; - }; - callback(null, _map(results.sort(fn), function (x) { - return x.value; - })); - } - }); - }; - - async.auto = function (tasks, callback) { - callback = callback || function () {}; - var keys = _keys(tasks); - var remainingTasks = keys.length - if (!remainingTasks) { - return callback(); - } - - var results = {}; - - var listeners = []; - var addListener = function (fn) { - listeners.unshift(fn); - }; - var removeListener = function (fn) { - for (var i = 0; i < listeners.length; i += 1) { - if (listeners[i] === fn) { - listeners.splice(i, 1); - return; - } - } - }; - var taskComplete = function () { - remainingTasks-- - _each(listeners.slice(0), function (fn) { - fn(); - }); - }; - - addListener(function () { - if (!remainingTasks) { - var theCallback = callback; - // prevent final callback from calling itself if it errors - callback = function () {}; - - theCallback(null, results); - } - }); - - _each(keys, function (k) { - var task = _isArray(tasks[k]) ? tasks[k]: [tasks[k]]; - var taskCallback = function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - if (err) { - var safeResults = {}; - _each(_keys(results), function(rkey) { - safeResults[rkey] = results[rkey]; - }); - safeResults[k] = args; - callback(err, safeResults); - // stop subsequent errors hitting callback multiple times - callback = function () {}; - } - else { - results[k] = args; - async.setImmediate(taskComplete); - } - }; - var requires = task.slice(0, Math.abs(task.length - 1)) || []; - var ready = function () { - return _reduce(requires, function (a, x) { - return (a && results.hasOwnProperty(x)); - }, true) && !results.hasOwnProperty(k); - }; - if (ready()) { - task[task.length - 1](taskCallback, results); - } - else { - var listener = function () { - if (ready()) { - removeListener(listener); - task[task.length - 1](taskCallback, results); - } - }; - addListener(listener); - } - }); - }; - - async.retry = function(times, task, callback) { - var DEFAULT_TIMES = 5; - var attempts = []; - // Use defaults if times not passed - if (typeof times === 'function') { - callback = task; - task = times; - times = DEFAULT_TIMES; - } - // Make sure times is a number - times = parseInt(times, 10) || DEFAULT_TIMES; - var wrappedTask = function(wrappedCallback, wrappedResults) { - var retryAttempt = function(task, finalAttempt) { - return function(seriesCallback) { - task(function(err, result){ - seriesCallback(!err || finalAttempt, {err: err, result: result}); - }, wrappedResults); - }; - }; - while (times) { - attempts.push(retryAttempt(task, !(times-=1))); - } - async.series(attempts, function(done, data){ - data = data[data.length - 1]; - (wrappedCallback || callback)(data.err, data.result); - }); - } - // If a callback is passed, run this as a controll flow - return callback ? wrappedTask() : wrappedTask - }; - - async.waterfall = function (tasks, callback) { - callback = callback || function () {}; - if (!_isArray(tasks)) { - var err = new Error('First argument to waterfall must be an array of functions'); - return callback(err); - } - if (!tasks.length) { - return callback(); - } - var wrapIterator = function (iterator) { - return function (err) { - if (err) { - callback.apply(null, arguments); - callback = function () {}; - } - else { - var args = Array.prototype.slice.call(arguments, 1); - var next = iterator.next(); - if (next) { - args.push(wrapIterator(next)); - } - else { - args.push(callback); - } - async.setImmediate(function () { - iterator.apply(null, args); - }); - } - }; - }; - wrapIterator(async.iterator(tasks))(); - }; - - var _parallel = function(eachfn, tasks, callback) { - callback = callback || function () {}; - if (_isArray(tasks)) { - eachfn.map(tasks, function (fn, callback) { - if (fn) { - fn(function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - callback.call(null, err, args); - }); - } - }, callback); - } - else { - var results = {}; - eachfn.each(_keys(tasks), function (k, callback) { - tasks[k](function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - results[k] = args; - callback(err); - }); - }, function (err) { - callback(err, results); - }); - } - }; - - async.parallel = function (tasks, callback) { - _parallel({ map: async.map, each: async.each }, tasks, callback); - }; - - async.parallelLimit = function(tasks, limit, callback) { - _parallel({ map: _mapLimit(limit), each: _eachLimit(limit) }, tasks, callback); - }; - - async.series = function (tasks, callback) { - callback = callback || function () {}; - if (_isArray(tasks)) { - async.mapSeries(tasks, function (fn, callback) { - if (fn) { - fn(function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - callback.call(null, err, args); - }); - } - }, callback); - } - else { - var results = {}; - async.eachSeries(_keys(tasks), function (k, callback) { - tasks[k](function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - results[k] = args; - callback(err); - }); - }, function (err) { - callback(err, results); - }); - } - }; - - async.iterator = function (tasks) { - var makeCallback = function (index) { - var fn = function () { - if (tasks.length) { - tasks[index].apply(null, arguments); - } - return fn.next(); - }; - fn.next = function () { - return (index < tasks.length - 1) ? makeCallback(index + 1): null; - }; - return fn; - }; - return makeCallback(0); - }; - - async.apply = function (fn) { - var args = Array.prototype.slice.call(arguments, 1); - return function () { - return fn.apply( - null, args.concat(Array.prototype.slice.call(arguments)) - ); - }; - }; - - var _concat = function (eachfn, arr, fn, callback) { - var r = []; - eachfn(arr, function (x, cb) { - fn(x, function (err, y) { - r = r.concat(y || []); - cb(err); - }); - }, function (err) { - callback(err, r); - }); - }; - async.concat = doParallel(_concat); - async.concatSeries = doSeries(_concat); - - async.whilst = function (test, iterator, callback) { - if (test()) { - iterator(function (err) { - if (err) { - return callback(err); - } - async.whilst(test, iterator, callback); - }); - } - else { - callback(); - } - }; - - async.doWhilst = function (iterator, test, callback) { - iterator(function (err) { - if (err) { - return callback(err); - } - var args = Array.prototype.slice.call(arguments, 1); - if (test.apply(null, args)) { - async.doWhilst(iterator, test, callback); - } - else { - callback(); - } - }); - }; - - async.until = function (test, iterator, callback) { - if (!test()) { - iterator(function (err) { - if (err) { - return callback(err); - } - async.until(test, iterator, callback); - }); - } - else { - callback(); - } - }; - - async.doUntil = function (iterator, test, callback) { - iterator(function (err) { - if (err) { - return callback(err); - } - var args = Array.prototype.slice.call(arguments, 1); - if (!test.apply(null, args)) { - async.doUntil(iterator, test, callback); - } - else { - callback(); - } - }); - }; - - async.queue = function (worker, concurrency) { - if (concurrency === undefined) { - concurrency = 1; - } - function _insert(q, data, pos, callback) { - if (!q.started){ - q.started = true; - } - if (!_isArray(data)) { - data = [data]; - } - if(data.length == 0) { - // call drain immediately if there are no tasks - return async.setImmediate(function() { - if (q.drain) { - q.drain(); - } - }); - } - _each(data, function(task) { - var item = { - data: task, - callback: typeof callback === 'function' ? callback : null - }; - - if (pos) { - q.tasks.unshift(item); - } else { - q.tasks.push(item); - } - - if (q.saturated && q.tasks.length === q.concurrency) { - q.saturated(); - } - async.setImmediate(q.process); - }); - } - - var workers = 0; - var q = { - tasks: [], - concurrency: concurrency, - saturated: null, - empty: null, - drain: null, - started: false, - paused: false, - push: function (data, callback) { - _insert(q, data, false, callback); - }, - kill: function () { - q.drain = null; - q.tasks = []; - }, - unshift: function (data, callback) { - _insert(q, data, true, callback); - }, - process: function () { - if (!q.paused && workers < q.concurrency && q.tasks.length) { - var task = q.tasks.shift(); - if (q.empty && q.tasks.length === 0) { - q.empty(); - } - workers += 1; - var next = function () { - workers -= 1; - if (task.callback) { - task.callback.apply(task, arguments); - } - if (q.drain && q.tasks.length + workers === 0) { - q.drain(); - } - q.process(); - }; - var cb = only_once(next); - worker(task.data, cb); - } - }, - length: function () { - return q.tasks.length; - }, - running: function () { - return workers; - }, - idle: function() { - return q.tasks.length + workers === 0; - }, - pause: function () { - if (q.paused === true) { return; } - q.paused = true; - q.process(); - }, - resume: function () { - if (q.paused === false) { return; } - q.paused = false; - q.process(); - } - }; - return q; - }; - - async.priorityQueue = function (worker, concurrency) { - - function _compareTasks(a, b){ - return a.priority - b.priority; - }; - - function _binarySearch(sequence, item, compare) { - var beg = -1, - end = sequence.length - 1; - while (beg < end) { - var mid = beg + ((end - beg + 1) >>> 1); - if (compare(item, sequence[mid]) >= 0) { - beg = mid; - } else { - end = mid - 1; - } - } - return beg; - } - - function _insert(q, data, priority, callback) { - if (!q.started){ - q.started = true; - } - if (!_isArray(data)) { - data = [data]; - } - if(data.length == 0) { - // call drain immediately if there are no tasks - return async.setImmediate(function() { - if (q.drain) { - q.drain(); - } - }); - } - _each(data, function(task) { - var item = { - data: task, - priority: priority, - callback: typeof callback === 'function' ? callback : null - }; - - q.tasks.splice(_binarySearch(q.tasks, item, _compareTasks) + 1, 0, item); - - if (q.saturated && q.tasks.length === q.concurrency) { - q.saturated(); - } - async.setImmediate(q.process); - }); - } - - // Start with a normal queue - var q = async.queue(worker, concurrency); - - // Override push to accept second parameter representing priority - q.push = function (data, priority, callback) { - _insert(q, data, priority, callback); - }; - - // Remove unshift function - delete q.unshift; - - return q; - }; - - async.cargo = function (worker, payload) { - var working = false, - tasks = []; - - var cargo = { - tasks: tasks, - payload: payload, - saturated: null, - empty: null, - drain: null, - drained: true, - push: function (data, callback) { - if (!_isArray(data)) { - data = [data]; - } - _each(data, function(task) { - tasks.push({ - data: task, - callback: typeof callback === 'function' ? callback : null - }); - cargo.drained = false; - if (cargo.saturated && tasks.length === payload) { - cargo.saturated(); - } - }); - async.setImmediate(cargo.process); - }, - process: function process() { - if (working) return; - if (tasks.length === 0) { - if(cargo.drain && !cargo.drained) cargo.drain(); - cargo.drained = true; - return; - } - - var ts = typeof payload === 'number' - ? tasks.splice(0, payload) - : tasks.splice(0, tasks.length); - - var ds = _map(ts, function (task) { - return task.data; - }); - - if(cargo.empty) cargo.empty(); - working = true; - worker(ds, function () { - working = false; - - var args = arguments; - _each(ts, function (data) { - if (data.callback) { - data.callback.apply(null, args); - } - }); - - process(); - }); - }, - length: function () { - return tasks.length; - }, - running: function () { - return working; - } - }; - return cargo; - }; - - var _console_fn = function (name) { - return function (fn) { - var args = Array.prototype.slice.call(arguments, 1); - fn.apply(null, args.concat([function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (typeof console !== 'undefined') { - if (err) { - if (console.error) { - console.error(err); - } - } - else if (console[name]) { - _each(args, function (x) { - console[name](x); - }); - } - } - }])); - }; - }; - async.log = _console_fn('log'); - async.dir = _console_fn('dir'); - /*async.info = _console_fn('info'); - async.warn = _console_fn('warn'); - async.error = _console_fn('error');*/ - - async.memoize = function (fn, hasher) { - var memo = {}; - var queues = {}; - hasher = hasher || function (x) { - return x; - }; - var memoized = function () { - var args = Array.prototype.slice.call(arguments); - var callback = args.pop(); - var key = hasher.apply(null, args); - if (key in memo) { - async.nextTick(function () { - callback.apply(null, memo[key]); - }); - } - else if (key in queues) { - queues[key].push(callback); - } - else { - queues[key] = [callback]; - fn.apply(null, args.concat([function () { - memo[key] = arguments; - var q = queues[key]; - delete queues[key]; - for (var i = 0, l = q.length; i < l; i++) { - q[i].apply(null, arguments); - } - }])); - } - }; - memoized.memo = memo; - memoized.unmemoized = fn; - return memoized; - }; - - async.unmemoize = function (fn) { - return function () { - return (fn.unmemoized || fn).apply(null, arguments); - }; - }; - - async.times = function (count, iterator, callback) { - var counter = []; - for (var i = 0; i < count; i++) { - counter.push(i); - } - return async.map(counter, iterator, callback); - }; - - async.timesSeries = function (count, iterator, callback) { - var counter = []; - for (var i = 0; i < count; i++) { - counter.push(i); - } - return async.mapSeries(counter, iterator, callback); - }; - - async.seq = function (/* functions... */) { - var fns = arguments; - return function () { - var that = this; - var args = Array.prototype.slice.call(arguments); - var callback = args.pop(); - async.reduce(fns, args, function (newargs, fn, cb) { - fn.apply(that, newargs.concat([function () { - var err = arguments[0]; - var nextargs = Array.prototype.slice.call(arguments, 1); - cb(err, nextargs); - }])) - }, - function (err, results) { - callback.apply(that, [err].concat(results)); - }); - }; - }; - - async.compose = function (/* functions... */) { - return async.seq.apply(null, Array.prototype.reverse.call(arguments)); - }; - - var _applyEach = function (eachfn, fns /*args...*/) { - var go = function () { - var that = this; - var args = Array.prototype.slice.call(arguments); - var callback = args.pop(); - return eachfn(fns, function (fn, cb) { - fn.apply(that, args.concat([cb])); - }, - callback); - }; - if (arguments.length > 2) { - var args = Array.prototype.slice.call(arguments, 2); - return go.apply(this, args); - } - else { - return go; - } - }; - async.applyEach = doParallel(_applyEach); - async.applyEachSeries = doSeries(_applyEach); - - async.forever = function (fn, callback) { - function next(err) { - if (err) { - if (callback) { - return callback(err); - } - throw err; - } - fn(next); - } - next(); - }; - - // Node.js - if (typeof module !== 'undefined' && module.exports) { - module.exports = async; - } - // AMD / RequireJS - else if (typeof define !== 'undefined' && define.amd) { - define([], function () { - return async; - }); - } - // included directly via ')); - expect(boom.response.payload.message).to.not.contain(''); - expect(encoded).to.equal('\\x3cscript\\x3ealert\\x281\\x29\\x3c\\x2fscript\\x3e'); - done(); - }); - - it('encodes \' characters', function (done) { - - var encoded = Hoek.escapeJavaScript('something(\'param\')'); - expect(encoded).to.equal('something\\x28\\x27param\\x27\\x29'); - done(); - }); - - it('encodes large unicode characters with the correct padding', function (done) { - - var encoded = Hoek.escapeJavaScript(String.fromCharCode(500) + String.fromCharCode(1000)); - expect(encoded).to.equal('\\u0500\\u1000'); - done(); - }); - - it('doesn\'t throw an exception when passed null', function (done) { - - var encoded = Hoek.escapeJavaScript(null); - expect(encoded).to.equal(''); - done(); - }); - }); - - describe('#escapeHtml', function () { - - it('encodes / characters', function (done) { - - var encoded = Hoek.escapeHtml(''); - expect(encoded).to.equal('<script>alert(1)</script>'); - done(); - }); - - it('encodes < and > as named characters', function (done) { - - var encoded = Hoek.escapeHtml(' -``` - -Or in node.js: - -``` -npm install node-uuid -``` - -```javascript -var uuid = require('node-uuid'); -``` - -Then create some ids ... - -```javascript -// Generate a v1 (time-based) id -uuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a' - -// Generate a v4 (random) id -uuid.v4(); // -> '110ec58a-a0f2-4ac4-8393-c866d813b8d1' -``` - -## API - -### uuid.v1([`options` [, `buffer` [, `offset`]]]) - -Generate and return a RFC4122 v1 (timestamp-based) UUID. - -* `options` - (Object) Optional uuid state to apply. Properties may include: - - * `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID. See note 1. - * `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used. - * `msecs` - (Number | Date) Time in milliseconds since unix Epoch. Default: The current time is used. - * `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2. - -* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. -* `offset` - (Number) Starting index in `buffer` at which to begin writing. - -Returns `buffer`, if specified, otherwise the string form of the UUID - -Notes: - -1. The randomly generated node id is only guaranteed to stay constant for the lifetime of the current JS runtime. (Future versions of this module may use persistent storage mechanisms to extend this guarantee.) - -Example: Generate string UUID with fully-specified options - -```javascript -uuid.v1({ - node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab], - clockseq: 0x1234, - msecs: new Date('2011-11-01').getTime(), - nsecs: 5678 -}); // -> "710b962e-041c-11e1-9234-0123456789ab" -``` - -Example: In-place generation of two binary IDs - -```javascript -// Generate two ids in an array -var arr = new Array(32); // -> [] -uuid.v1(null, arr, 0); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15] -uuid.v1(null, arr, 16); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15 02 a3 1c b0 14 32 11 e1 85 58 0b 48 8e 4f c1 15] - -// Optionally use uuid.unparse() to get stringify the ids -uuid.unparse(buffer); // -> '02a2ce90-1432-11e1-8558-0b488e4fc115' -uuid.unparse(buffer, 16) // -> '02a31cb0-1432-11e1-8558-0b488e4fc115' -``` - -### uuid.v4([`options` [, `buffer` [, `offset`]]]) - -Generate and return a RFC4122 v4 UUID. - -* `options` - (Object) Optional uuid state to apply. Properties may include: - - * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values - * `rng` - (Function) Random # generator to use. Set to one of the built-in generators - `uuid.mathRNG` (all platforms), `uuid.nodeRNG` (node.js only), `uuid.whatwgRNG` (WebKit only) - or a custom function that returns an array[16] of byte values. - -* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. -* `offset` - (Number) Starting index in `buffer` at which to begin writing. - -Returns `buffer`, if specified, otherwise the string form of the UUID - -Example: Generate string UUID with fully-specified options - -```javascript -uuid.v4({ - random: [ - 0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea, - 0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36 - ] -}); -// -> "109156be-c4fb-41ea-b1b4-efe1671c5836" -``` - -Example: Generate two IDs in a single buffer - -```javascript -var buffer = new Array(32); // (or 'new Buffer' in node.js) -uuid.v4(null, buffer, 0); -uuid.v4(null, buffer, 16); -``` - -### uuid.parse(id[, buffer[, offset]]) -### uuid.unparse(buffer[, offset]) - -Parse and unparse UUIDs - - * `id` - (String) UUID(-like) string - * `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. Default: A new Array or Buffer is used - * `offset` - (Number) Starting index in `buffer` at which to begin writing. Default: 0 - -Example parsing and unparsing a UUID string - -```javascript -var bytes = uuid.parse('797ff043-11eb-11e1-80d6-510998755d10'); // -> -var string = uuid.unparse(bytes); // -> '797ff043-11eb-11e1-80d6-510998755d10' -``` - -### uuid.noConflict() - -(Browsers only) Set `uuid` property back to it's previous value. - -Returns the node-uuid object. - -Example: - -```javascript -var myUuid = uuid.noConflict(); -myUuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a' -``` - -## Deprecated APIs - -Support for the following v1.2 APIs is available in v1.3, but is deprecated and will be removed in the next major version. - -### uuid([format [, buffer [, offset]]]) - -uuid() has become uuid.v4(), and the `format` argument is now implicit in the `buffer` argument. (i.e. if you specify a buffer, the format is assumed to be binary). - -### uuid.BufferClass - -The class of container created when generating binary uuid data if no buffer argument is specified. This is expected to go away, with no replacement API. - -## Command Line Interface - -To use the executable, it's probably best to install this library globally. - -`npm install -g node-uuid` - -Usage: - -``` -USAGE: uuid [version] [options] - - -options: - ---help Display this message and exit -``` - -`version` must be an RFC4122 version that is supported by this library, which is currently version 1 and version 4 (denoted by "v1" and "v4", respectively). `version` defaults to version 4 when not supplied. - -### Examples - -``` -> uuid -3a91f950-dec8-4688-ba14-5b7bbfc7a563 -``` - -``` -> uuid v1 -9d0b43e0-7696-11e3-964b-250efa37a98e -``` - -``` -> uuid v4 -6790ac7c-24ac-4f98-8464-42f6d98a53ae -``` - -## Testing - -In node.js - -``` -npm test -``` - -In Browser - -``` -open test/test.html -``` - -### Benchmarking - -Requires node.js - -``` -npm install uuid uuid-js -node benchmark/benchmark.js -``` - -For a more complete discussion of node-uuid performance, please see the `benchmark/README.md` file, and the [benchmark wiki](https://github.com/broofa/node-uuid/wiki/Benchmark) - -For browser performance [checkout the JSPerf tests](http://jsperf.com/node-uuid-performance). - -## Release notes - -### 1.4.0 - -* Improved module context detection -* Removed public RNG functions - -### 1.3.2 - -* Improve tests and handling of v1() options (Issue #24) -* Expose RNG option to allow for perf testing with different generators - -### 1.3.0 - -* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)! -* Support for node.js crypto API -* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/benchmark/README.md b/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/benchmark/README.md deleted file mode 100644 index aaeb2ea01..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/benchmark/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# node-uuid Benchmarks - -### Results - -To see the results of our benchmarks visit https://github.com/broofa/node-uuid/wiki/Benchmark - -### Run them yourself - -node-uuid comes with some benchmarks to measure performance of generating UUIDs. These can be run using node.js. node-uuid is being benchmarked against some other uuid modules, that are available through npm namely `uuid` and `uuid-js`. - -To prepare and run the benchmark issue; - -``` -npm install uuid uuid-js -node benchmark/benchmark.js -``` - -You'll see an output like this one: - -``` -# v4 -nodeuuid.v4(): 854700 uuids/second -nodeuuid.v4('binary'): 788643 uuids/second -nodeuuid.v4('binary', buffer): 1336898 uuids/second -uuid(): 479386 uuids/second -uuid('binary'): 582072 uuids/second -uuidjs.create(4): 312304 uuids/second - -# v1 -nodeuuid.v1(): 938086 uuids/second -nodeuuid.v1('binary'): 683060 uuids/second -nodeuuid.v1('binary', buffer): 1644736 uuids/second -uuidjs.create(1): 190621 uuids/second -``` - -* The `uuid()` entries are for Nikhil Marathe's [uuid module](https://bitbucket.org/nikhilm/uuidjs) which is a wrapper around the native libuuid library. -* The `uuidjs()` entries are for Patrick Negri's [uuid-js module](https://github.com/pnegri/uuid-js) which is a pure javascript implementation based on [UUID.js](https://github.com/LiosK/UUID.js) by LiosK. - -If you want to get more reliable results you can run the benchmark multiple times and write the output into a log file: - -``` -for i in {0..9}; do node benchmark/benchmark.js >> benchmark/bench_0.4.12.log; done; -``` - -If you're interested in how performance varies between different node versions, you can issue the above command multiple times. - -You can then use the shell script `bench.sh` provided in this directory to calculate the averages over all benchmark runs and draw a nice plot: - -``` -(cd benchmark/ && ./bench.sh) -``` - -This assumes you have [gnuplot](http://www.gnuplot.info/) and [ImageMagick](http://www.imagemagick.org/) installed. You'll find a nice `bench.png` graph in the `benchmark/` directory then. diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu b/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu deleted file mode 100644 index a342fbbe0..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu +++ /dev/null @@ -1,174 +0,0 @@ -#!/opt/local/bin/gnuplot -persist -# -# -# G N U P L O T -# Version 4.4 patchlevel 3 -# last modified March 2011 -# System: Darwin 10.8.0 -# -# Copyright (C) 1986-1993, 1998, 2004, 2007-2010 -# Thomas Williams, Colin Kelley and many others -# -# gnuplot home: http://www.gnuplot.info -# faq, bugs, etc: type "help seeking-assistance" -# immediate help: type "help" -# plot window: hit 'h' -set terminal postscript eps noenhanced defaultplex \ - leveldefault color colortext \ - solid linewidth 1.2 butt noclip \ - palfuncparam 2000,0.003 \ - "Helvetica" 14 -set output 'bench.eps' -unset clip points -set clip one -unset clip two -set bar 1.000000 front -set border 31 front linetype -1 linewidth 1.000 -set xdata -set ydata -set zdata -set x2data -set y2data -set timefmt x "%d/%m/%y,%H:%M" -set timefmt y "%d/%m/%y,%H:%M" -set timefmt z "%d/%m/%y,%H:%M" -set timefmt x2 "%d/%m/%y,%H:%M" -set timefmt y2 "%d/%m/%y,%H:%M" -set timefmt cb "%d/%m/%y,%H:%M" -set boxwidth -set style fill empty border -set style rectangle back fc lt -3 fillstyle solid 1.00 border lt -1 -set style circle radius graph 0.02, first 0, 0 -set dummy x,y -set format x "% g" -set format y "% g" -set format x2 "% g" -set format y2 "% g" -set format z "% g" -set format cb "% g" -set angles radians -unset grid -set key title "" -set key outside left top horizontal Right noreverse enhanced autotitles columnhead nobox -set key noinvert samplen 4 spacing 1 width 0 height 0 -set key maxcolumns 2 maxrows 0 -unset label -unset arrow -set style increment default -unset style line -set style line 1 linetype 1 linewidth 2.000 pointtype 1 pointsize default pointinterval 0 -unset style arrow -set style histogram clustered gap 2 title offset character 0, 0, 0 -unset logscale -set offsets graph 0.05, 0.15, 0, 0 -set pointsize 1.5 -set pointintervalbox 1 -set encoding default -unset polar -unset parametric -unset decimalsign -set view 60, 30, 1, 1 -set samples 100, 100 -set isosamples 10, 10 -set surface -unset contour -set clabel '%8.3g' -set mapping cartesian -set datafile separator whitespace -unset hidden3d -set cntrparam order 4 -set cntrparam linear -set cntrparam levels auto 5 -set cntrparam points 5 -set size ratio 0 1,1 -set origin 0,0 -set style data points -set style function lines -set xzeroaxis linetype -2 linewidth 1.000 -set yzeroaxis linetype -2 linewidth 1.000 -set zzeroaxis linetype -2 linewidth 1.000 -set x2zeroaxis linetype -2 linewidth 1.000 -set y2zeroaxis linetype -2 linewidth 1.000 -set ticslevel 0.5 -set mxtics default -set mytics default -set mztics default -set mx2tics default -set my2tics default -set mcbtics default -set xtics border in scale 1,0.5 mirror norotate offset character 0, 0, 0 -set xtics norangelimit -set xtics () -set ytics border in scale 1,0.5 mirror norotate offset character 0, 0, 0 -set ytics autofreq norangelimit -set ztics border in scale 1,0.5 nomirror norotate offset character 0, 0, 0 -set ztics autofreq norangelimit -set nox2tics -set noy2tics -set cbtics border in scale 1,0.5 mirror norotate offset character 0, 0, 0 -set cbtics autofreq norangelimit -set title "" -set title offset character 0, 0, 0 font "" norotate -set timestamp bottom -set timestamp "" -set timestamp offset character 0, 0, 0 font "" norotate -set rrange [ * : * ] noreverse nowriteback # (currently [8.98847e+307:-8.98847e+307] ) -set autoscale rfixmin -set autoscale rfixmax -set trange [ * : * ] noreverse nowriteback # (currently [-5.00000:5.00000] ) -set autoscale tfixmin -set autoscale tfixmax -set urange [ * : * ] noreverse nowriteback # (currently [-10.0000:10.0000] ) -set autoscale ufixmin -set autoscale ufixmax -set vrange [ * : * ] noreverse nowriteback # (currently [-10.0000:10.0000] ) -set autoscale vfixmin -set autoscale vfixmax -set xlabel "" -set xlabel offset character 0, 0, 0 font "" textcolor lt -1 norotate -set x2label "" -set x2label offset character 0, 0, 0 font "" textcolor lt -1 norotate -set xrange [ * : * ] noreverse nowriteback # (currently [-0.150000:3.15000] ) -set autoscale xfixmin -set autoscale xfixmax -set x2range [ * : * ] noreverse nowriteback # (currently [0.00000:3.00000] ) -set autoscale x2fixmin -set autoscale x2fixmax -set ylabel "" -set ylabel offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270 -set y2label "" -set y2label offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270 -set yrange [ 0.00000 : 1.90000e+06 ] noreverse nowriteback # (currently [:] ) -set autoscale yfixmin -set autoscale yfixmax -set y2range [ * : * ] noreverse nowriteback # (currently [0.00000:1.90000e+06] ) -set autoscale y2fixmin -set autoscale y2fixmax -set zlabel "" -set zlabel offset character 0, 0, 0 font "" textcolor lt -1 norotate -set zrange [ * : * ] noreverse nowriteback # (currently [-10.0000:10.0000] ) -set autoscale zfixmin -set autoscale zfixmax -set cblabel "" -set cblabel offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270 -set cbrange [ * : * ] noreverse nowriteback # (currently [8.98847e+307:-8.98847e+307] ) -set autoscale cbfixmin -set autoscale cbfixmax -set zero 1e-08 -set lmargin -1 -set bmargin -1 -set rmargin -1 -set tmargin -1 -set pm3d explicit at s -set pm3d scansautomatic -set pm3d interpolate 1,1 flush begin noftriangles nohidden3d corners2color mean -set palette positive nops_allcF maxcolors 0 gamma 1.5 color model RGB -set palette rgbformulae 7, 5, 15 -set colorbox default -set colorbox vertical origin screen 0.9, 0.2, 0 size screen 0.05, 0.6, 0 front bdefault -set loadpath -set fontpath -set fit noerrorvariables -GNUTERM = "aqua" -plot 'bench_results.txt' using 2:xticlabel(1) w lp lw 2, '' using 3:xticlabel(1) w lp lw 2, '' using 4:xticlabel(1) w lp lw 2, '' using 5:xticlabel(1) w lp lw 2, '' using 6:xticlabel(1) w lp lw 2, '' using 7:xticlabel(1) w lp lw 2, '' using 8:xticlabel(1) w lp lw 2, '' using 9:xticlabel(1) w lp lw 2 -# EOF diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/benchmark/bench.sh b/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/benchmark/bench.sh deleted file mode 100644 index d870a0cb0..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/benchmark/bench.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -# for a given node version run: -# for i in {0..9}; do node benchmark.js >> bench_0.6.2.log; done; - -PATTERNS=('nodeuuid.v1()' "nodeuuid.v1('binary'," 'nodeuuid.v4()' "nodeuuid.v4('binary'," "uuid()" "uuid('binary')" 'uuidjs.create(1)' 'uuidjs.create(4)' '140byte') -FILES=(node_uuid_v1_string node_uuid_v1_buf node_uuid_v4_string node_uuid_v4_buf libuuid_v4_string libuuid_v4_binary uuidjs_v1_string uuidjs_v4_string 140byte_es) -INDICES=(2 3 2 3 2 2 2 2 2) -VERSIONS=$( ls bench_*.log | sed -e 's/^bench_\([0-9\.]*\)\.log/\1/' | tr "\\n" " " ) -TMPJOIN="tmp_join" -OUTPUT="bench_results.txt" - -for I in ${!FILES[*]}; do - F=${FILES[$I]} - P=${PATTERNS[$I]} - INDEX=${INDICES[$I]} - echo "version $F" > $F - for V in $VERSIONS; do - (VAL=$( grep "$P" bench_$V.log | LC_ALL=en_US awk '{ sum += $'$INDEX' } END { print sum/NR }' ); echo $V $VAL) >> $F - done - if [ $I == 0 ]; then - cat $F > $TMPJOIN - else - join $TMPJOIN $F > $OUTPUT - cp $OUTPUT $TMPJOIN - fi - rm $F -done - -rm $TMPJOIN - -gnuplot bench.gnu -convert -density 200 -resize 800x560 -flatten bench.eps bench.png -rm bench.eps diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c b/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c deleted file mode 100644 index dbfc75f6d..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c +++ /dev/null @@ -1,34 +0,0 @@ -/* -Test performance of native C UUID generation - -To Compile: cc -luuid benchmark-native.c -o benchmark-native -*/ - -#include -#include -#include -#include - -int main() { - uuid_t myid; - char buf[36+1]; - int i; - struct timeval t; - double start, finish; - - gettimeofday(&t, NULL); - start = t.tv_sec + t.tv_usec/1e6; - - int n = 2e5; - for (i = 0; i < n; i++) { - uuid_generate(myid); - uuid_unparse(myid, buf); - } - - gettimeofday(&t, NULL); - finish = t.tv_sec + t.tv_usec/1e6; - double dur = finish - start; - - printf("%d uuids/sec", (int)(n/dur)); - return 0; -} diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js b/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js deleted file mode 100644 index 40e6efbe7..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js +++ /dev/null @@ -1,84 +0,0 @@ -try { - var nodeuuid = require('../uuid'); -} catch (e) { - console.error('node-uuid require failed - skipping tests'); -} - -try { - var uuid = require('uuid'); -} catch (e) { - console.error('uuid require failed - skipping tests'); -} - -try { - var uuidjs = require('uuid-js'); -} catch (e) { - console.error('uuid-js require failed - skipping tests'); -} - -var N = 5e5; - -function rate(msg, t) { - console.log(msg + ': ' + - (N / (Date.now() - t) * 1e3 | 0) + - ' uuids/second'); -} - -console.log('# v4'); - -// node-uuid - string form -if (nodeuuid) { - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4(); - rate('nodeuuid.v4() - using node.js crypto RNG', t); - - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4({rng: nodeuuid.mathRNG}); - rate('nodeuuid.v4() - using Math.random() RNG', t); - - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4('binary'); - rate('nodeuuid.v4(\'binary\')', t); - - var buffer = new nodeuuid.BufferClass(16); - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4('binary', buffer); - rate('nodeuuid.v4(\'binary\', buffer)', t); -} - -// libuuid - string form -if (uuid) { - for (var i = 0, t = Date.now(); i < N; i++) uuid(); - rate('uuid()', t); - - for (var i = 0, t = Date.now(); i < N; i++) uuid('binary'); - rate('uuid(\'binary\')', t); -} - -// uuid-js - string form -if (uuidjs) { - for (var i = 0, t = Date.now(); i < N; i++) uuidjs.create(4); - rate('uuidjs.create(4)', t); -} - -// 140byte.es -for (var i = 0, t = Date.now(); i < N; i++) 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,function(s,r){r=Math.random()*16|0;return (s=='x'?r:r&0x3|0x8).toString(16)}); -rate('140byte.es_v4', t); - -console.log(''); -console.log('# v1'); - -// node-uuid - v1 string form -if (nodeuuid) { - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v1(); - rate('nodeuuid.v1()', t); - - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v1('binary'); - rate('nodeuuid.v1(\'binary\')', t); - - var buffer = new nodeuuid.BufferClass(16); - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v1('binary', buffer); - rate('nodeuuid.v1(\'binary\', buffer)', t); -} - -// uuid-js - v1 string form -if (uuidjs) { - for (var i = 0, t = Date.now(); i < N; i++) uuidjs.create(1); - rate('uuidjs.create(1)', t); -} diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/bin/uuid b/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/bin/uuid deleted file mode 100644 index f732e9918..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/bin/uuid +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env node - -var path = require('path'); -var uuid = require(path.join(__dirname, '..')); - -var arg = process.argv[2]; - -if ('--help' === arg) { - console.log('\n USAGE: uuid [version] [options]\n\n'); - console.log(' options:\n'); - console.log(' --help Display this message and exit\n'); - process.exit(0); -} - -if (null == arg) { - console.log(uuid()); - process.exit(0); -} - -if ('v1' !== arg && 'v4' !== arg) { - console.error('Version must be RFC4122 version 1 or version 4, denoted as "v1" or "v4"'); - process.exit(1); -} - -console.log(uuid[arg]()); -process.exit(0); diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/bower.json b/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/bower.json deleted file mode 100644 index 1656dc819..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/bower.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "node-uuid", - "version": "1.4.3", - "homepage": "https://github.com/broofa/node-uuid", - "authors": [ - "Robert Kieffer " - ], - "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.", - "main": "uuid.js", - "keywords": [ - "uuid", - "gid", - "rfc4122" - ], - "license": "MIT", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ] -} diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/component.json b/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/component.json deleted file mode 100644 index 149f84b22..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/component.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "node-uuid", - "repo": "broofa/node-uuid", - "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.", - "version": "1.4.3", - "author": "Robert Kieffer ", - "contributors": [ - {"name": "Christoph Tavan ", "github": "https://github.com/ctavan"} - ], - "keywords": ["uuid", "guid", "rfc4122"], - "dependencies": {}, - "development": {}, - "main": "uuid.js", - "scripts": [ - "uuid.js" - ], - "license": "MIT" -} diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/package.json b/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/package.json deleted file mode 100644 index a35d25377..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "name": "node-uuid", - "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.", - "url": "http://github.com/broofa/node-uuid", - "keywords": [ - "uuid", - "guid", - "rfc4122" - ], - "author": { - "name": "Robert Kieffer", - "email": "robert@broofa.com" - }, - "contributors": [ - { - "name": "Christoph Tavan", - "email": "dev@tavan.de" - } - ], - "bin": { - "uuid": "./bin/uuid" - }, - "scripts": { - "test": "node test/test.js" - }, - "lib": ".", - "main": "./uuid.js", - "repository": { - "type": "git", - "url": "https://github.com/broofa/node-uuid.git" - }, - "version": "1.4.3", - "licenses": [ - { - "type": "MIT", - "url": "https://raw.github.com/broofa/node-uuid/master/LICENSE.md" - } - ], - "gitHead": "886463c660a095dfebfa69603921a8d156fdb12c", - "bugs": { - "url": "https://github.com/broofa/node-uuid/issues" - }, - "homepage": "https://github.com/broofa/node-uuid", - "_id": "node-uuid@1.4.3", - "_shasum": "319bb7a56e7cb63f00b5c0cd7851cd4b4ddf1df9", - "_from": "node-uuid@~1.4.0", - "_npmVersion": "1.4.28", - "_npmUser": { - "name": "broofa", - "email": "robert@broofa.com" - }, - "maintainers": [ - { - "name": "broofa", - "email": "robert@broofa.com" - } - ], - "dist": { - "shasum": "319bb7a56e7cb63f00b5c0cd7851cd4b4ddf1df9", - "tarball": "http://registry.npmjs.org/node-uuid/-/node-uuid-1.4.3.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.3.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/test/compare_v1.js b/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/test/compare_v1.js deleted file mode 100644 index 05af82215..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/test/compare_v1.js +++ /dev/null @@ -1,63 +0,0 @@ -var assert = require('assert'), - nodeuuid = require('../uuid'), - uuidjs = require('uuid-js'), - libuuid = require('uuid').generate, - util = require('util'), - exec = require('child_process').exec, - os = require('os'); - -// On Mac Os X / macports there's only the ossp-uuid package that provides uuid -// On Linux there's uuid-runtime which provides uuidgen -var uuidCmd = os.type() === 'Darwin' ? 'uuid -1' : 'uuidgen -t'; - -function compare(ids) { - console.log(ids); - for (var i = 0; i < ids.length; i++) { - var id = ids[i].split('-'); - id = [id[2], id[1], id[0]].join(''); - ids[i] = id; - } - var sorted = ([].concat(ids)).sort(); - - if (sorted.toString() !== ids.toString()) { - console.log('Warning: sorted !== ids'); - } else { - console.log('everything in order!'); - } -} - -// Test time order of v1 uuids -var ids = []; -while (ids.length < 10e3) ids.push(nodeuuid.v1()); - -var max = 10; -console.log('node-uuid:'); -ids = []; -for (var i = 0; i < max; i++) ids.push(nodeuuid.v1()); -compare(ids); - -console.log(''); -console.log('uuidjs:'); -ids = []; -for (var i = 0; i < max; i++) ids.push(uuidjs.create(1).toString()); -compare(ids); - -console.log(''); -console.log('libuuid:'); -ids = []; -var count = 0; -var last = function() { - compare(ids); -} -var cb = function(err, stdout, stderr) { - ids.push(stdout.substring(0, stdout.length-1)); - count++; - if (count < max) { - return next(); - } - last(); -}; -var next = function() { - exec(uuidCmd, cb); -}; -next(); diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/test/test.html b/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/test/test.html deleted file mode 100644 index d80326ec5..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/test/test.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/test/test.js b/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/test/test.js deleted file mode 100644 index 246922561..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/test/test.js +++ /dev/null @@ -1,228 +0,0 @@ -if (!this.uuid) { - // node.js - uuid = require('../uuid'); -} - -// -// x-platform log/assert shims -// - -function _log(msg, type) { - type = type || 'log'; - - if (typeof(document) != 'undefined') { - document.write('
' + msg.replace(/\n/g, '
') + '
'); - } - if (typeof(console) != 'undefined') { - var color = { - log: '\033[39m', - warn: '\033[33m', - error: '\033[31m' - }; - console[type](color[type] + msg + color.log); - } -} - -function log(msg) {_log(msg, 'log');} -function warn(msg) {_log(msg, 'warn');} -function error(msg) {_log(msg, 'error');} - -function assert(res, msg) { - if (!res) { - error('FAIL: ' + msg); - } else { - log('Pass: ' + msg); - } -} - -// -// Unit tests -// - -// Verify ordering of v1 ids created with explicit times -var TIME = 1321644961388; // 2011-11-18 11:36:01.388-08:00 - -function compare(name, ids) { - ids = ids.map(function(id) { - return id.split('-').reverse().join('-'); - }).sort(); - var sorted = ([].concat(ids)).sort(); - - assert(sorted.toString() == ids.toString(), name + ' have expected order'); -} - -// Verify ordering of v1 ids created using default behavior -compare('uuids with current time', [ - uuid.v1(), - uuid.v1(), - uuid.v1(), - uuid.v1(), - uuid.v1() -]); - -// Verify ordering of v1 ids created with explicit times -compare('uuids with time option', [ - uuid.v1({msecs: TIME - 10*3600*1000}), - uuid.v1({msecs: TIME - 1}), - uuid.v1({msecs: TIME}), - uuid.v1({msecs: TIME + 1}), - uuid.v1({msecs: TIME + 28*24*3600*1000}) -]); - -assert( - uuid.v1({msecs: TIME}) != uuid.v1({msecs: TIME}), - 'IDs created at same msec are different' -); - -// Verify throw if too many ids created -var thrown = false; -try { - uuid.v1({msecs: TIME, nsecs: 10000}); -} catch (e) { - thrown = true; -} -assert(thrown, 'Exception thrown when > 10K ids created in 1 ms'); - -// Verify clock regression bumps clockseq -var uidt = uuid.v1({msecs: TIME}); -var uidtb = uuid.v1({msecs: TIME - 1}); -assert( - parseInt(uidtb.split('-')[3], 16) - parseInt(uidt.split('-')[3], 16) === 1, - 'Clock regression by msec increments the clockseq' -); - -// Verify clock regression bumps clockseq -var uidtn = uuid.v1({msecs: TIME, nsecs: 10}); -var uidtnb = uuid.v1({msecs: TIME, nsecs: 9}); -assert( - parseInt(uidtnb.split('-')[3], 16) - parseInt(uidtn.split('-')[3], 16) === 1, - 'Clock regression by nsec increments the clockseq' -); - -// Verify explicit options produce expected id -var id = uuid.v1({ - msecs: 1321651533573, - nsecs: 5432, - clockseq: 0x385c, - node: [ 0x61, 0xcd, 0x3c, 0xbb, 0x32, 0x10 ] -}); -assert(id == 'd9428888-122b-11e1-b85c-61cd3cbb3210', 'Explicit options produce expected id'); - -// Verify adjacent ids across a msec boundary are 1 time unit apart -var u0 = uuid.v1({msecs: TIME, nsecs: 9999}); -var u1 = uuid.v1({msecs: TIME + 1, nsecs: 0}); - -var before = u0.split('-')[0], after = u1.split('-')[0]; -var dt = parseInt(after, 16) - parseInt(before, 16); -assert(dt === 1, 'Ids spanning 1ms boundary are 100ns apart'); - -// -// Test parse/unparse -// - -id = '00112233445566778899aabbccddeeff'; -assert(uuid.unparse(uuid.parse(id.substr(0,10))) == - '00112233-4400-0000-0000-000000000000', 'Short parse'); -assert(uuid.unparse(uuid.parse('(this is the uuid -> ' + id + id)) == - '00112233-4455-6677-8899-aabbccddeeff', 'Dirty parse'); - -// -// Perf tests -// - -var generators = { - v1: uuid.v1, - v4: uuid.v4 -}; - -var UUID_FORMAT = { - v1: /[0-9a-f]{8}-[0-9a-f]{4}-1[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/i, - v4: /[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/i -}; - -var N = 1e4; - -// Get %'age an actual value differs from the ideal value -function divergence(actual, ideal) { - return Math.round(100*100*(actual - ideal)/ideal)/100; -} - -function rate(msg, t) { - log(msg + ': ' + (N / (Date.now() - t) * 1e3 | 0) + ' uuids\/second'); -} - -for (var version in generators) { - var counts = {}, max = 0; - var generator = generators[version]; - var format = UUID_FORMAT[version]; - - log('\nSanity check ' + N + ' ' + version + ' uuids'); - for (var i = 0, ok = 0; i < N; i++) { - id = generator(); - if (!format.test(id)) { - throw Error(id + ' is not a valid UUID string'); - } - - if (id != uuid.unparse(uuid.parse(id))) { - assert(fail, id + ' is not a valid id'); - } - - // Count digits for our randomness check - if (version == 'v4') { - var digits = id.replace(/-/g, '').split(''); - for (var j = digits.length-1; j >= 0; j--) { - var c = digits[j]; - max = Math.max(max, counts[c] = (counts[c] || 0) + 1); - } - } - } - - // Check randomness for v4 UUIDs - if (version == 'v4') { - // Limit that we get worried about randomness. (Purely empirical choice, this!) - var limit = 2*100*Math.sqrt(1/N); - - log('\nChecking v4 randomness. Distribution of Hex Digits (% deviation from ideal)'); - - for (var i = 0; i < 16; i++) { - var c = i.toString(16); - var bar = '', n = counts[c], p = Math.round(n/max*100|0); - - // 1-3,5-8, and D-F: 1:16 odds over 30 digits - var ideal = N*30/16; - if (i == 4) { - // 4: 1:1 odds on 1 digit, plus 1:16 odds on 30 digits - ideal = N*(1 + 30/16); - } else if (i >= 8 && i <= 11) { - // 8-B: 1:4 odds on 1 digit, plus 1:16 odds on 30 digits - ideal = N*(1/4 + 30/16); - } else { - // Otherwise: 1:16 odds on 30 digits - ideal = N*30/16; - } - var d = divergence(n, ideal); - - // Draw bar using UTF squares (just for grins) - var s = n/max*50 | 0; - while (s--) bar += '='; - - assert(Math.abs(d) < limit, c + ' |' + bar + '| ' + counts[c] + ' (' + d + '% < ' + limit + '%)'); - } - } -} - -// Perf tests -for (var version in generators) { - log('\nPerformance testing ' + version + ' UUIDs'); - var generator = generators[version]; - var buf = new uuid.BufferClass(16); - - for (var i = 0, t = Date.now(); i < N; i++) generator(); - rate('uuid.' + version + '()', t); - - for (var i = 0, t = Date.now(); i < N; i++) generator('binary'); - rate('uuid.' + version + '(\'binary\')', t); - - for (var i = 0, t = Date.now(); i < N; i++) generator('binary', buf); - rate('uuid.' + version + '(\'binary\', buffer)', t); -} diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/uuid.js b/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/uuid.js deleted file mode 100644 index 0a6176979..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/node-uuid/uuid.js +++ /dev/null @@ -1,247 +0,0 @@ -// uuid.js -// -// Copyright (c) 2010-2012 Robert Kieffer -// MIT License - http://opensource.org/licenses/mit-license.php - -(function() { - var _global = this; - - // Unique ID creation requires a high quality random # generator. We feature - // detect to determine the best RNG source, normalizing to a function that - // returns 128-bits of randomness, since that's what's usually required - var _rng; - - // Node.js crypto-based RNG - http://nodejs.org/docs/v0.6.2/api/crypto.html - // - // Moderately fast, high quality - if (typeof(_global.require) == 'function') { - try { - var _rb = _global.require('crypto').randomBytes; - _rng = _rb && function() {return _rb(16);}; - } catch(e) {} - } - - if (!_rng && _global.crypto && crypto.getRandomValues) { - // WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto - // - // Moderately fast, high quality - var _rnds8 = new Uint8Array(16); - _rng = function whatwgRNG() { - crypto.getRandomValues(_rnds8); - return _rnds8; - }; - } - - if (!_rng) { - // Math.random()-based (RNG) - // - // If all else fails, use Math.random(). It's fast, but is of unspecified - // quality. - var _rnds = new Array(16); - _rng = function() { - for (var i = 0, r; i < 16; i++) { - if ((i & 0x03) === 0) r = Math.random() * 0x100000000; - _rnds[i] = r >>> ((i & 0x03) << 3) & 0xff; - } - - return _rnds; - }; - } - - // Buffer class to use - var BufferClass = typeof(_global.Buffer) == 'function' ? _global.Buffer : Array; - - // Maps for number <-> hex string conversion - var _byteToHex = []; - var _hexToByte = {}; - for (var i = 0; i < 256; i++) { - _byteToHex[i] = (i + 0x100).toString(16).substr(1); - _hexToByte[_byteToHex[i]] = i; - } - - // **`parse()` - Parse a UUID into it's component bytes** - function parse(s, buf, offset) { - var i = (buf && offset) || 0, ii = 0; - - buf = buf || []; - s.toLowerCase().replace(/[0-9a-f]{2}/g, function(oct) { - if (ii < 16) { // Don't overflow! - buf[i + ii++] = _hexToByte[oct]; - } - }); - - // Zero out remaining bytes if string was short - while (ii < 16) { - buf[i + ii++] = 0; - } - - return buf; - } - - // **`unparse()` - Convert UUID byte array (ala parse()) into a string** - function unparse(buf, offset) { - var i = offset || 0, bth = _byteToHex; - return bth[buf[i++]] + bth[buf[i++]] + - bth[buf[i++]] + bth[buf[i++]] + '-' + - bth[buf[i++]] + bth[buf[i++]] + '-' + - bth[buf[i++]] + bth[buf[i++]] + '-' + - bth[buf[i++]] + bth[buf[i++]] + '-' + - bth[buf[i++]] + bth[buf[i++]] + - bth[buf[i++]] + bth[buf[i++]] + - bth[buf[i++]] + bth[buf[i++]]; - } - - // **`v1()` - Generate time-based UUID** - // - // Inspired by https://github.com/LiosK/UUID.js - // and http://docs.python.org/library/uuid.html - - // random #'s we need to init node and clockseq - var _seedBytes = _rng(); - - // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) - var _nodeId = [ - _seedBytes[0] | 0x01, - _seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5] - ]; - - // Per 4.2.2, randomize (14 bit) clockseq - var _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 0x3fff; - - // Previous uuid creation time - var _lastMSecs = 0, _lastNSecs = 0; - - // See https://github.com/broofa/node-uuid for API details - function v1(options, buf, offset) { - var i = buf && offset || 0; - var b = buf || []; - - options = options || {}; - - var clockseq = options.clockseq != null ? options.clockseq : _clockseq; - - // UUID timestamps are 100 nano-second units since the Gregorian epoch, - // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so - // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' - // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. - var msecs = options.msecs != null ? options.msecs : new Date().getTime(); - - // Per 4.2.1.2, use count of uuid's generated during the current clock - // cycle to simulate higher resolution clock - var nsecs = options.nsecs != null ? options.nsecs : _lastNSecs + 1; - - // Time since last uuid creation (in msecs) - var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000; - - // Per 4.2.1.2, Bump clockseq on clock regression - if (dt < 0 && options.clockseq == null) { - clockseq = clockseq + 1 & 0x3fff; - } - - // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new - // time interval - if ((dt < 0 || msecs > _lastMSecs) && options.nsecs == null) { - nsecs = 0; - } - - // Per 4.2.1.2 Throw error if too many uuids are requested - if (nsecs >= 10000) { - throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec'); - } - - _lastMSecs = msecs; - _lastNSecs = nsecs; - _clockseq = clockseq; - - // Per 4.1.4 - Convert from unix epoch to Gregorian epoch - msecs += 12219292800000; - - // `time_low` - var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; - b[i++] = tl >>> 24 & 0xff; - b[i++] = tl >>> 16 & 0xff; - b[i++] = tl >>> 8 & 0xff; - b[i++] = tl & 0xff; - - // `time_mid` - var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff; - b[i++] = tmh >>> 8 & 0xff; - b[i++] = tmh & 0xff; - - // `time_high_and_version` - b[i++] = tmh >>> 24 & 0xf | 0x10; // include version - b[i++] = tmh >>> 16 & 0xff; - - // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) - b[i++] = clockseq >>> 8 | 0x80; - - // `clock_seq_low` - b[i++] = clockseq & 0xff; - - // `node` - var node = options.node || _nodeId; - for (var n = 0; n < 6; n++) { - b[i + n] = node[n]; - } - - return buf ? buf : unparse(b); - } - - // **`v4()` - Generate random UUID** - - // See https://github.com/broofa/node-uuid for API details - function v4(options, buf, offset) { - // Deprecated - 'format' argument, as supported in v1.2 - var i = buf && offset || 0; - - if (typeof(options) == 'string') { - buf = options == 'binary' ? new BufferClass(16) : null; - options = null; - } - options = options || {}; - - var rnds = options.random || (options.rng || _rng)(); - - // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` - rnds[6] = (rnds[6] & 0x0f) | 0x40; - rnds[8] = (rnds[8] & 0x3f) | 0x80; - - // Copy bytes to buffer, if provided - if (buf) { - for (var ii = 0; ii < 16; ii++) { - buf[i + ii] = rnds[ii]; - } - } - - return buf || unparse(rnds); - } - - // Export public API - var uuid = v4; - uuid.v1 = v1; - uuid.v4 = v4; - uuid.parse = parse; - uuid.unparse = unparse; - uuid.BufferClass = BufferClass; - - if (typeof(module) != 'undefined' && module.exports) { - // Publish as node.js module - module.exports = uuid; - } else if (typeof define === 'function' && define.amd) { - // Publish as AMD module - define(function() {return uuid;}); - - - } else { - // Publish as global (in browsers) - var _previousRoot = _global.uuid; - - // **`noConflict()` - (browser only) to reset global 'uuid' var** - uuid.noConflict = function() { - _global.uuid = _previousRoot; - return uuid; - }; - - _global.uuid = uuid; - } -}).call(this); diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/oauth-sign/LICENSE b/update_nation/node_modules/nano/node_modules/request/node_modules/oauth-sign/LICENSE deleted file mode 100644 index a4a9aee0c..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/oauth-sign/LICENSE +++ /dev/null @@ -1,55 +0,0 @@ -Apache License - -Version 2.0, January 2004 - -http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - -"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. - -"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. - -"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. - -"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. - -"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. - -"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. - -"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). - -"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. - -"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." - -"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: - -You must give any other recipients of the Work or Derivative Works a copy of this License; and - -You must cause any modified files to carry prominent notices stating that You changed the files; and - -You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and - -If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/oauth-sign/README.md b/update_nation/node_modules/nano/node_modules/request/node_modules/oauth-sign/README.md deleted file mode 100644 index 34c4a85d2..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/oauth-sign/README.md +++ /dev/null @@ -1,4 +0,0 @@ -oauth-sign -========== - -OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module. diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/oauth-sign/index.js b/update_nation/node_modules/nano/node_modules/request/node_modules/oauth-sign/index.js deleted file mode 100644 index 3a86aca12..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/oauth-sign/index.js +++ /dev/null @@ -1,81 +0,0 @@ -var crypto = require('crypto') - , qs = require('querystring') - ; - -function sha1 (key, body) { - return crypto.createHmac('sha1', key).update(body).digest('base64') -} - -function rfc3986 (str) { - return encodeURIComponent(str) - .replace(/!/g,'%21') - .replace(/\*/g,'%2A') - .replace(/\(/g,'%28') - .replace(/\)/g,'%29') - .replace(/'/g,'%27') - ; -} - -// Maps object to bi-dimensional array -// Converts { foo: 'A', bar: [ 'b', 'B' ]} to -// [ ['foo', 'A'], ['bar', 'b'], ['bar', 'B'] ] -function map (obj) { - var key, val, arr = [] - for (key in obj) { - val = obj[key] - if (Array.isArray(val)) - for (var i = 0; i < val.length; i++) - arr.push([key, val[i]]) - else - arr.push([key, val]) - } - return arr -} - -// Compare function for sort -function compare (a, b) { - return a > b ? 1 : a < b ? -1 : 0 -} - -function hmacsign (httpMethod, base_uri, params, consumer_secret, token_secret) { - // adapted from https://dev.twitter.com/docs/auth/oauth and - // https://dev.twitter.com/docs/auth/creating-signature - - // Parameter normalization - // http://tools.ietf.org/html/rfc5849#section-3.4.1.3.2 - var normalized = map(params) - // 1. First, the name and value of each parameter are encoded - .map(function (p) { - return [ rfc3986(p[0]), rfc3986(p[1] || '') ] - }) - // 2. The parameters are sorted by name, using ascending byte value - // ordering. If two or more parameters share the same name, they - // are sorted by their value. - .sort(function (a, b) { - return compare(a[0], b[0]) || compare(a[1], b[1]) - }) - // 3. The name of each parameter is concatenated to its corresponding - // value using an "=" character (ASCII code 61) as a separator, even - // if the value is empty. - .map(function (p) { return p.join('=') }) - // 4. The sorted name/value pairs are concatenated together into a - // single string by using an "&" character (ASCII code 38) as - // separator. - .join('&') - - var base = [ - rfc3986(httpMethod ? httpMethod.toUpperCase() : 'GET'), - rfc3986(base_uri), - rfc3986(normalized) - ].join('&') - - var key = [ - consumer_secret || '', - token_secret || '' - ].map(rfc3986).join('&') - - return sha1(key, base) -} - -exports.hmacsign = hmacsign -exports.rfc3986 = rfc3986 diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/oauth-sign/package.json b/update_nation/node_modules/nano/node_modules/request/node_modules/oauth-sign/package.json deleted file mode 100644 index 715ba7ef7..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/oauth-sign/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "author": { - "name": "Mikeal Rogers", - "email": "mikeal.rogers@gmail.com", - "url": "http://www.futurealoof.com" - }, - "name": "oauth-sign", - "description": "OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module.", - "version": "0.4.0", - "repository": { - "url": "https://github.com/mikeal/oauth-sign" - }, - "main": "index.js", - "dependencies": {}, - "devDependencies": {}, - "optionalDependencies": {}, - "engines": { - "node": "*" - }, - "scripts": { - "test": "node test.js" - }, - "bugs": { - "url": "https://github.com/mikeal/oauth-sign/issues" - }, - "_id": "oauth-sign@0.4.0", - "dist": { - "shasum": "f22956f31ea7151a821e5f2fb32c113cad8b9f69", - "tarball": "http://registry.npmjs.org/oauth-sign/-/oauth-sign-0.4.0.tgz" - }, - "_from": "oauth-sign@~0.4.0", - "_npmVersion": "1.3.2", - "_npmUser": { - "name": "mikeal", - "email": "mikeal.rogers@gmail.com" - }, - "maintainers": [ - { - "name": "mikeal", - "email": "mikeal.rogers@gmail.com" - } - ], - "directories": {}, - "_shasum": "f22956f31ea7151a821e5f2fb32c113cad8b9f69", - "_resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.4.0.tgz", - "readme": "ERROR: No README data found!", - "homepage": "https://github.com/mikeal/oauth-sign" -} diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/oauth-sign/test.js b/update_nation/node_modules/nano/node_modules/request/node_modules/oauth-sign/test.js deleted file mode 100644 index b7a4c8022..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/oauth-sign/test.js +++ /dev/null @@ -1,63 +0,0 @@ -var hmacsign = require('./index').hmacsign - , assert = require('assert') - , qs = require('querystring') - ; - -// Tests from Twitter documentation https://dev.twitter.com/docs/auth/oauth - -var reqsign = hmacsign('POST', 'https://api.twitter.com/oauth/request_token', - { oauth_callback: 'http://localhost:3005/the_dance/process_callback?service_provider_id=11' - , oauth_consumer_key: 'GDdmIQH6jhtmLUypg82g' - , oauth_nonce: 'QP70eNmVz8jvdPevU3oJD2AfF7R7odC2XJcn4XlZJqk' - , oauth_signature_method: 'HMAC-SHA1' - , oauth_timestamp: '1272323042' - , oauth_version: '1.0' - }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98") - -console.log(reqsign) -console.log('8wUi7m5HFQy76nowoCThusfgB+Q=') -assert.equal(reqsign, '8wUi7m5HFQy76nowoCThusfgB+Q=') - -var accsign = hmacsign('POST', 'https://api.twitter.com/oauth/access_token', - { oauth_consumer_key: 'GDdmIQH6jhtmLUypg82g' - , oauth_nonce: '9zWH6qe0qG7Lc1telCn7FhUbLyVdjEaL3MO5uHxn8' - , oauth_signature_method: 'HMAC-SHA1' - , oauth_token: '8ldIZyxQeVrFZXFOZH5tAwj6vzJYuLQpl0WUEYtWc' - , oauth_timestamp: '1272323047' - , oauth_verifier: 'pDNg57prOHapMbhv25RNf75lVRd6JDsni1AJJIDYoTY' - , oauth_version: '1.0' - }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98", "x6qpRnlEmW9JbQn4PQVVeVG8ZLPEx6A0TOebgwcuA") - -console.log(accsign) -console.log('PUw/dHA4fnlJYM6RhXk5IU/0fCc=') -assert.equal(accsign, 'PUw/dHA4fnlJYM6RhXk5IU/0fCc=') - -var upsign = hmacsign('POST', 'http://api.twitter.com/1/statuses/update.json', - { oauth_consumer_key: "GDdmIQH6jhtmLUypg82g" - , oauth_nonce: "oElnnMTQIZvqvlfXM56aBLAf5noGD0AQR3Fmi7Q6Y" - , oauth_signature_method: "HMAC-SHA1" - , oauth_token: "819797-Jxq8aYUDRmykzVKrgoLhXSq67TEa5ruc4GJC2rWimw" - , oauth_timestamp: "1272325550" - , oauth_version: "1.0" - , status: 'setting up my twitter 私のさえずりを設定する' - }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98", "J6zix3FfA9LofH0awS24M3HcBYXO5nI1iYe8EfBA") - -console.log(upsign) -console.log('yOahq5m0YjDDjfjxHaXEsW9D+X0=') -assert.equal(upsign, 'yOahq5m0YjDDjfjxHaXEsW9D+X0=') - -// example in rfc5849 -var params = qs.parse('b5=%3D%253D&a3=a&c%40=&a2=r%20b' + '&' + 'c2&a3=2+q') -params.oauth_consumer_key = '9djdj82h48djs9d2' -params.oauth_token = 'kkk9d7dh3k39sjv7' -params.oauth_nonce = '7d8f3e4a' -params.oauth_signature_method = 'HMAC-SHA1' -params.oauth_timestamp = '137131201' - -var rfc5849sign = hmacsign('POST', 'http://example.com/request', - params, "j49sk3j29djd", "dh893hdasih9") - -console.log(rfc5849sign) -console.log('r6/TJjbCOr97/+UU0NsvSne7s5g=') -assert.equal(rfc5849sign, 'r6/TJjbCOr97/+UU0NsvSne7s5g=') - diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/qs/.jshintignore b/update_nation/node_modules/nano/node_modules/request/node_modules/qs/.jshintignore deleted file mode 100644 index 3c3629e64..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/qs/.jshintignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/qs/.jshintrc b/update_nation/node_modules/nano/node_modules/request/node_modules/qs/.jshintrc deleted file mode 100644 index 997b3f7d4..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/qs/.jshintrc +++ /dev/null @@ -1,10 +0,0 @@ -{ - "node": true, - - "curly": true, - "latedef": true, - "quotmark": true, - "undef": true, - "unused": true, - "trailing": true -} diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/qs/.npmignore b/update_nation/node_modules/nano/node_modules/request/node_modules/qs/.npmignore deleted file mode 100644 index 7e1574dc5..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/qs/.npmignore +++ /dev/null @@ -1,18 +0,0 @@ -.idea -*.iml -npm-debug.log -dump.rdb -node_modules -results.tap -results.xml -npm-shrinkwrap.json -config.json -.DS_Store -*/.DS_Store -*/*/.DS_Store -._* -*/._* -*/*/._* -coverage.* -lib-cov -complexity.md diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/qs/.travis.yml b/update_nation/node_modules/nano/node_modules/request/node_modules/qs/.travis.yml deleted file mode 100644 index c891dd0e0..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/qs/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js - -node_js: - - 0.10 \ No newline at end of file diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/qs/CONTRIBUTING.md b/update_nation/node_modules/nano/node_modules/request/node_modules/qs/CONTRIBUTING.md deleted file mode 100644 index 892836159..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/qs/CONTRIBUTING.md +++ /dev/null @@ -1 +0,0 @@ -Please view our [hapijs contributing guide](https://github.com/hapijs/hapi/blob/master/CONTRIBUTING.md). diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/qs/LICENSE b/update_nation/node_modules/nano/node_modules/request/node_modules/qs/LICENSE deleted file mode 100644 index d4569487a..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/qs/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ -Copyright (c) 2014 Nathan LaFreniere and other contributors. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * The names of any contributors may not be used to endorse or promote - products derived from this software without specific prior written - permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - * * * - -The complete list of contributors can be found at: https://github.com/hapijs/qs/graphs/contributors diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/qs/Makefile b/update_nation/node_modules/nano/node_modules/request/node_modules/qs/Makefile deleted file mode 100644 index 600a700ec..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/qs/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -test: - @node node_modules/lab/bin/lab -test-cov: - @node node_modules/lab/bin/lab -t 100 -test-cov-html: - @node node_modules/lab/bin/lab -r html -o coverage.html - -.PHONY: test test-cov test-cov-html \ No newline at end of file diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/qs/README.md b/update_nation/node_modules/nano/node_modules/request/node_modules/qs/README.md deleted file mode 100644 index b8618877c..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/qs/README.md +++ /dev/null @@ -1,192 +0,0 @@ -# qs - -A querystring parsing and stringifying library with some added security. - -[![Build Status](https://secure.travis-ci.org/hapijs/qs.svg)](http://travis-ci.org/hapijs/qs) - -Lead Maintainer: [Nathan LaFreniere](https://github.com/nlf) - -The **qs** module was originally created and maintained by [TJ Holowaychuk](https://github.com/visionmedia/node-querystring). - -## Usage - -```javascript -var Qs = require('qs'); - -var obj = Qs.parse('a=c'); // { a: 'c' } -var str = Qs.stringify(obj); // 'a=c' -``` - -### Parsing Objects - -```javascript -Qs.parse(string, [depth], [delimiter]); -``` - -**qs** allows you to create nested objects within your query strings, by surrounding the name of sub-keys with square brackets `[]`. -For example, the string `'foo[bar]=baz'` converts to: - -```javascript -{ - foo: { - bar: 'baz' - } -} -``` - -URI encoded strings work too: - -```javascript -Qs.parse('a%5Bb%5D=c'); -// { a: { b: 'c' } } -``` - -You can also nest your objects, like `'foo[bar][baz]=foobarbaz'`: - -```javascript -{ - foo: { - bar: { - baz: 'foobarbaz' - } - } -} -``` - -By default, when nesting objects **qs** will only parse up to 5 children deep. This means if you attempt to parse a string like -`'a[b][c][d][e][f][g][h][i]=j'` your resulting object will be: - -```javascript -{ - a: { - b: { - c: { - d: { - e: { - f: { - '[g][h][i]': 'j' - } - } - } - } - } - } -} -``` - -This depth can be overridden by passing a `depth` option to `Qs.parse(string, depth)`: - -```javascript -Qs.parse('a[b][c][d][e][f][g][h][i]=j', 1); -// { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } } -``` - -The depth limit mitigate abuse when **qs** is used to parse user input, and it is recommended to keep it a reasonably small number. - -An optional delimiter can also be passed: - -```javascript -Qs.parse('a=b;c=d', ';'); -// { a: 'b', c: 'd' } -``` - -### Parsing Arrays - -**qs** can also parse arrays using a similar `[]` notation: - -```javascript -Qs.parse('a[]=b&a[]=c'); -// { a: ['b', 'c'] } -``` - -You may specify an index as well: - -```javascript -Qs.parse('a[1]=c&a[0]=b'); -// { a: ['b', 'c'] } -``` - -Note that the only difference between an index in an array and a key in an object is that the value between the brackets must be a number -to create an array. When creating arrays with specific indices, **qs** will compact a sparse array to only the existing values preserving -their order: - -```javascript -Qs.parse('a[1]=b&a[15]=c'); -// { a: ['b', 'c'] } -``` - -Note that an empty string is also a value, and will be preserved: - -```javascript -Qs.parse('a[]=&a[]=b'); -// { a: ['', 'b'] } -Qs.parse('a[0]=b&a[1]=&a[2]=c'); -// { a: ['b', '', 'c'] } -``` - -**qs** will also limit specifying indices in an array to a maximum index of `20`. Any array members with an index of greater than `20` will -instead be converted to an object with the index as the key: - -```javascript -Qs.parse('a[100]=b'); -// { a: { '100': 'b' } } -``` - -If you mix notations, **qs** will merge the two items into an object: - -```javascript -Qs.parse('a[0]=b&a[b]=c'); -// { a: { '0': 'b', b: 'c' } } -``` - -You can also create arrays of objects: - -```javascript -Qs.parse('a[][b]=c'); -// { a: [{ b: 'c' }] } -``` - -### Stringifying - -```javascript -Qs.stringify(object, [delimiter]); -``` - -When stringifying, **qs** always URI encodes output. Objects are stringified as you would expect: - -```javascript -Qs.stringify({ a: 'b' }); -// 'a=b' -Qs.stringify({ a: { b: 'c' } }); -// 'a%5Bb%5D=c' -``` - -Examples beyond this point will be shown as though the output is not URI encoded for clarity. Please note that the return values in these cases *will* be URI encoded during real usage. - -When arrays are stringified, they are always given explicit indices: - -```javascript -Qs.stringify({ a: ['b', 'c', 'd'] }); -// 'a[0]=b&a[1]=c&a[2]=d' -``` - -Empty strings and null values will omit the value, but the equals sign (=) remains in place: - -```javascript -Qs.stringify({ a: '' }); -// 'a=' -``` - -Properties that are set to `undefined` will be omitted entirely: - -```javascript -Qs.stringify({ a: null, b: undefined }); -// 'a=' -``` - -The delimiter may be overridden with stringify as well: - -```javascript -Qs.stringify({ a: 'b', c: 'd' }, ';'); -// 'a=b;c=d' -``` diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/qs/index.js b/update_nation/node_modules/nano/node_modules/request/node_modules/qs/index.js deleted file mode 100644 index bb0a047c4..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/qs/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib'); diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/qs/lib/index.js b/update_nation/node_modules/nano/node_modules/request/node_modules/qs/lib/index.js deleted file mode 100644 index 0e094933d..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/qs/lib/index.js +++ /dev/null @@ -1,15 +0,0 @@ -// Load modules - -var Stringify = require('./stringify'); -var Parse = require('./parse'); - - -// Declare internals - -var internals = {}; - - -module.exports = { - stringify: Stringify, - parse: Parse -}; diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/qs/lib/parse.js b/update_nation/node_modules/nano/node_modules/request/node_modules/qs/lib/parse.js deleted file mode 100644 index 4a3fdd974..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/qs/lib/parse.js +++ /dev/null @@ -1,155 +0,0 @@ -// Load modules - -var Utils = require('./utils'); - - -// Declare internals - -var internals = { - delimiter: '&', - depth: 5, - arrayLimit: 20, - parametersLimit: 1000 -}; - - -internals.parseValues = function (str, delimiter) { - - delimiter = typeof delimiter === 'string' ? delimiter : internals.delimiter; - - var obj = {}; - var parts = str.split(delimiter, internals.parametersLimit); - - for (var i = 0, il = parts.length; i < il; ++i) { - var part = parts[i]; - var pos = part.indexOf(']=') === -1 ? part.indexOf('=') : part.indexOf(']=') + 1; - - if (pos === -1) { - obj[Utils.decode(part)] = ''; - } - else { - var key = Utils.decode(part.slice(0, pos)); - var val = Utils.decode(part.slice(pos + 1)); - - if (!obj[key]) { - obj[key] = val; - } - else { - obj[key] = [].concat(obj[key]).concat(val); - } - } - } - - return obj; -}; - - -internals.parseObject = function (chain, val) { - - if (!chain.length) { - return val; - } - - var root = chain.shift(); - - var obj = {}; - if (root === '[]') { - obj = []; - obj = obj.concat(internals.parseObject(chain, val)); - } - else { - var cleanRoot = root[0] === '[' && root[root.length - 1] === ']' ? root.slice(1, root.length - 1) : root; - var index = parseInt(cleanRoot, 10); - if (!isNaN(index) && - root !== cleanRoot && - index <= internals.arrayLimit) { - - obj = []; - obj[index] = internals.parseObject(chain, val); - } - else { - obj[cleanRoot] = internals.parseObject(chain, val); - } - } - - return obj; -}; - - -internals.parseKeys = function (key, val, depth) { - - if (!key) { - return; - } - - // The regex chunks - - var parent = /^([^\[\]]*)/; - var child = /(\[[^\[\]]*\])/g; - - // Get the parent - - var segment = parent.exec(key); - - // Don't allow them to overwrite object prototype properties - - if (Object.prototype.hasOwnProperty(segment[1])) { - return; - } - - // Stash the parent if it exists - - var keys = []; - if (segment[1]) { - keys.push(segment[1]); - } - - // Loop through children appending to the array until we hit depth - - var i = 0; - while ((segment = child.exec(key)) !== null && i < depth) { - - ++i; - if (!Object.prototype.hasOwnProperty(segment[1].replace(/\[|\]/g, ''))) { - keys.push(segment[1]); - } - } - - // If there's a remainder, just add whatever is left - - if (segment) { - keys.push('[' + key.slice(segment.index) + ']'); - } - - return internals.parseObject(keys, val); -}; - - -module.exports = function (str, depth, delimiter) { - - if (str === '' || - str === null || - typeof str === 'undefined') { - - return {}; - } - - if (typeof depth !== 'number') { - delimiter = depth; - depth = internals.depth; - } - - var tempObj = typeof str === 'string' ? internals.parseValues(str, delimiter) : Utils.clone(str); - var obj = {}; - - // Iterate over the keys and setup the new object - // - for (var key in tempObj) { - if (tempObj.hasOwnProperty(key)) { - var newObj = internals.parseKeys(key, tempObj[key], depth); - obj = Utils.merge(obj, newObj); - } - } - - return Utils.compact(obj); -}; diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/qs/lib/stringify.js b/update_nation/node_modules/nano/node_modules/request/node_modules/qs/lib/stringify.js deleted file mode 100644 index 1cc3df9fc..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/qs/lib/stringify.js +++ /dev/null @@ -1,55 +0,0 @@ -// Load modules - - -// Declare internals - -var internals = { - delimiter: '&' -}; - - -internals.stringify = function (obj, prefix) { - - if (Buffer.isBuffer(obj)) { - obj = obj.toString(); - } - else if (obj instanceof Date) { - obj = obj.toISOString(); - } - else if (obj === null) { - obj = ''; - } - - if (typeof obj === 'string' || - typeof obj === 'number' || - typeof obj === 'boolean') { - - return [encodeURIComponent(prefix) + '=' + encodeURIComponent(obj)]; - } - - var values = []; - - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - values = values.concat(internals.stringify(obj[key], prefix + '[' + key + ']')); - } - } - - return values; -}; - - -module.exports = function (obj, delimiter) { - - delimiter = typeof delimiter === 'undefined' ? internals.delimiter : delimiter; - - var keys = []; - - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - keys = keys.concat(internals.stringify(obj[key], key)); - } - } - - return keys.join(delimiter); -}; diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/qs/lib/utils.js b/update_nation/node_modules/nano/node_modules/request/node_modules/qs/lib/utils.js deleted file mode 100644 index 3f5c149d5..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/qs/lib/utils.js +++ /dev/null @@ -1,133 +0,0 @@ -// Load modules - - -// Declare internals - -var internals = {}; - - -exports.arrayToObject = function (source) { - - var obj = {}; - for (var i = 0, il = source.length; i < il; ++i) { - if (typeof source[i] !== 'undefined') { - - obj[i] = source[i]; - } - } - - return obj; -}; - - -exports.clone = function (source) { - - if (typeof source !== 'object' || - source === null) { - - return source; - } - - if (Buffer.isBuffer(source)) { - return source.toString(); - } - - var obj = Array.isArray(source) ? [] : {}; - for (var i in source) { - if (source.hasOwnProperty(i)) { - obj[i] = exports.clone(source[i]); - } - } - - return obj; -}; - - -exports.merge = function (target, source) { - - if (!source) { - return target; - } - - var obj = exports.clone(target); - - if (Array.isArray(source)) { - for (var i = 0, il = source.length; i < il; ++i) { - if (typeof source[i] !== 'undefined') { - if (typeof obj[i] === 'object') { - obj[i] = exports.merge(obj[i], source[i]); - } - else { - obj[i] = source[i]; - } - } - } - - return obj; - } - - if (Array.isArray(obj)) { - obj = exports.arrayToObject(obj); - } - - var keys = Object.keys(source); - for (var k = 0, kl = keys.length; k < kl; ++k) { - var key = keys[k]; - var value = source[key]; - - if (value && - typeof value === 'object') { - - if (!obj[key]) { - obj[key] = exports.clone(value); - } - else { - obj[key] = exports.merge(obj[key], value); - } - } - else { - obj[key] = value; - } - } - - return obj; -}; - - -exports.decode = function (str) { - - try { - return decodeURIComponent(str.replace(/\+/g, ' ')); - } catch (e) { - return str; - } -}; - - -exports.compact = function (obj) { - - if (typeof obj !== 'object' || obj === null) { - return obj; - } - - var compacted = {}; - - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - if (Array.isArray(obj[key])) { - compacted[key] = []; - - for (var i = 0, l = obj[key].length; i < l; i++) { - if (typeof obj[key][i] !== 'undefined') { - compacted[key].push(obj[key][i]); - } - } - } - else { - compacted[key] = exports.compact(obj[key]); - } - } - } - - return compacted; -}; diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/qs/package.json b/update_nation/node_modules/nano/node_modules/request/node_modules/qs/package.json deleted file mode 100644 index 7b1917023..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/qs/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "qs", - "version": "1.2.2", - "description": "A querystring parser that supports nesting and arrays, with a depth limit", - "homepage": "https://github.com/hapijs/qs", - "main": "index.js", - "dependencies": {}, - "devDependencies": { - "lab": "3.x.x" - }, - "scripts": { - "test": "make test-cov" - }, - "repository": { - "type": "git", - "url": "https://github.com/hapijs/qs.git" - }, - "keywords": [ - "querystring", - "qs" - ], - "author": { - "name": "Nathan LaFreniere", - "email": "quitlahok@gmail.com" - }, - "licenses": [ - { - "type": "BSD", - "url": "http://github.com/hapijs/qs/raw/master/LICENSE" - } - ], - "gitHead": "bd9455fea88d1c51a80dbf57ef0f99b4e553177d", - "bugs": { - "url": "https://github.com/hapijs/qs/issues" - }, - "_id": "qs@1.2.2", - "_shasum": "19b57ff24dc2a99ce1f8bdf6afcda59f8ef61f88", - "_from": "qs@~1.2.0", - "_npmVersion": "1.4.21", - "_npmUser": { - "name": "hueniverse", - "email": "eran@hueniverse.com" - }, - "maintainers": [ - { - "name": "nlf", - "email": "quitlahok@gmail.com" - }, - { - "name": "hueniverse", - "email": "eran@hueniverse.com" - } - ], - "dist": { - "shasum": "19b57ff24dc2a99ce1f8bdf6afcda59f8ef61f88", - "tarball": "http://registry.npmjs.org/qs/-/qs-1.2.2.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/qs/-/qs-1.2.2.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/qs/test/parse.js b/update_nation/node_modules/nano/node_modules/request/node_modules/qs/test/parse.js deleted file mode 100644 index c00e7becf..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/qs/test/parse.js +++ /dev/null @@ -1,301 +0,0 @@ -// Load modules - -var Lab = require('lab'); -var Qs = require('../'); - - -// Declare internals - -var internals = {}; - - -// Test shortcuts - -var expect = Lab.expect; -var before = Lab.before; -var after = Lab.after; -var describe = Lab.experiment; -var it = Lab.test; - - -describe('#parse', function () { - - it('parses a simple string', function (done) { - - expect(Qs.parse('0=foo')).to.deep.equal({ '0': 'foo' }); - expect(Qs.parse('foo=c++')).to.deep.equal({ foo: 'c ' }); - expect(Qs.parse('a[>=]=23')).to.deep.equal({ a: { '>=': '23' } }); - expect(Qs.parse('a[<=>]==23')).to.deep.equal({ a: { '<=>': '=23' } }); - expect(Qs.parse('a[==]=23')).to.deep.equal({ a: { '==': '23' } }); - expect(Qs.parse('foo')).to.deep.equal({ foo: '' }); - expect(Qs.parse('foo=bar')).to.deep.equal({ foo: 'bar' }); - expect(Qs.parse(' foo = bar = baz ')).to.deep.equal({ ' foo ': ' bar = baz ' }); - expect(Qs.parse('foo=bar=baz')).to.deep.equal({ foo: 'bar=baz' }); - expect(Qs.parse('foo=bar&bar=baz')).to.deep.equal({ foo: 'bar', bar: 'baz' }); - expect(Qs.parse('foo=bar&baz')).to.deep.equal({ foo: 'bar', baz: '' }); - expect(Qs.parse('cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World')).to.deep.equal({ - cht: 'p3', - chd: 't:60,40', - chs: '250x100', - chl: 'Hello|World' - }); - done(); - }); - - it('parses a single nested string', function (done) { - - expect(Qs.parse('a[b]=c')).to.deep.equal({ a: { b: 'c' } }); - done(); - }); - - it('parses a double nested string', function (done) { - - expect(Qs.parse('a[b][c]=d')).to.deep.equal({ a: { b: { c: 'd' } } }); - done(); - }); - - it('defaults to a depth of 5', function (done) { - - expect(Qs.parse('a[b][c][d][e][f][g][h]=i')).to.deep.equal({ a: { b: { c: { d: { e: { f: { '[g][h]': 'i' } } } } } } }); - done(); - }); - - it('only parses one level when depth = 1', function (done) { - - expect(Qs.parse('a[b][c]=d', 1)).to.deep.equal({ a: { b: { '[c]': 'd' } } }); - expect(Qs.parse('a[b][c][d]=e', 1)).to.deep.equal({ a: { b: { '[c][d]': 'e' } } }); - done(); - }); - - it('parses a simple array', function (done) { - - expect(Qs.parse('a=b&a=c')).to.deep.equal({ a: ['b', 'c'] }); - done(); - }); - - it('parses an explicit array', function (done) { - - expect(Qs.parse('a[]=b')).to.deep.equal({ a: ['b'] }); - expect(Qs.parse('a[]=b&a[]=c')).to.deep.equal({ a: ['b', 'c'] }); - expect(Qs.parse('a[]=b&a[]=c&a[]=d')).to.deep.equal({ a: ['b', 'c', 'd'] }); - done(); - }); - - it('parses a nested array', function (done) { - - expect(Qs.parse('a[b][]=c&a[b][]=d')).to.deep.equal({ a: { b: ['c', 'd'] } }); - expect(Qs.parse('a[>=]=25')).to.deep.equal({ a: { '>=': '25' } }); - done(); - }); - - it('allows to specify array indices', function (done) { - - expect(Qs.parse('a[1]=c&a[0]=b&a[2]=d')).to.deep.equal({ a: ['b', 'c', 'd'] }); - expect(Qs.parse('a[1]=c&a[0]=b')).to.deep.equal({ a: ['b', 'c'] }); - expect(Qs.parse('a[1]=c')).to.deep.equal({ a: ['c'] }); - done(); - }); - - it('limits specific array indices to 20', function (done) { - - expect(Qs.parse('a[20]=a')).to.deep.equal({ a: ['a'] }); - expect(Qs.parse('a[21]=a')).to.deep.equal({ a: { '21': 'a' } }); - done(); - }); - - it('supports encoded = signs', function (done) { - - expect(Qs.parse('he%3Dllo=th%3Dere')).to.deep.equal({ 'he=llo': 'th=ere' }); - done(); - }); - - it('is ok with url encoded strings', function (done) { - - expect(Qs.parse('a[b%20c]=d')).to.deep.equal({ a: { 'b c': 'd' } }); - expect(Qs.parse('a[b]=c%20d')).to.deep.equal({ a: { b: 'c d' } }); - done(); - }); - - it('allows brackets in the value', function (done) { - - expect(Qs.parse('pets=["tobi"]')).to.deep.equal({ pets: '["tobi"]' }); - expect(Qs.parse('operators=[">=", "<="]')).to.deep.equal({ operators: '[">=", "<="]' }); - done(); - }); - - it('allows empty values', function (done) { - - expect(Qs.parse('')).to.deep.equal({}); - expect(Qs.parse(null)).to.deep.equal({}); - expect(Qs.parse(undefined)).to.deep.equal({}); - done(); - }); - - it('transforms arrays to objects', function (done) { - - expect(Qs.parse('foo[0]=bar&foo[bad]=baz')).to.deep.equal({ foo: { '0': 'bar', bad: 'baz' } }); - expect(Qs.parse('foo[bad]=baz&foo[0]=bar')).to.deep.equal({ foo: { bad: 'baz', '0': 'bar' } }); - expect(Qs.parse('foo[bad]=baz&foo[]=bar')).to.deep.equal({ foo: { bad: 'baz', '0': 'bar' } }); - expect(Qs.parse('foo[]=bar&foo[bad]=baz')).to.deep.equal({ foo: { '0': 'bar', bad: 'baz' } }); - expect(Qs.parse('foo[bad]=baz&foo[]=bar&foo[]=foo')).to.deep.equal({ foo: { bad: 'baz', '0': 'bar', '1': 'foo' } }); - expect(Qs.parse('foo[0][a]=a&foo[0][b]=b&foo[1][a]=aa&foo[1][b]=bb')).to.deep.equal({foo: [ {a: 'a', b: 'b'}, {a: 'aa', b: 'bb'} ]}); - done(); - }); - - it('correctly prunes undefined values when converting an array to an object', function (done) { - - expect(Qs.parse('a[2]=b&a[99999999]=c')).to.deep.equal({ a: { '2': 'b', '99999999': 'c' } }); - done(); - }); - - it('supports malformed uri characters', function (done) { - - expect(Qs.parse('{%:%}')).to.deep.equal({ '{%:%}': '' }); - expect(Qs.parse('foo=%:%}')).to.deep.equal({ foo: '%:%}' }); - done(); - }); - - it('doesn\'t produce empty keys', function (done) { - - expect(Qs.parse('_r=1&')).to.deep.equal({ '_r': '1' }); - done(); - }); - - it('cannot override prototypes', function (done) { - - var obj = Qs.parse('toString=bad&bad[toString]=bad&constructor=bad'); - expect(typeof obj.toString).to.equal('function'); - expect(typeof obj.bad.toString).to.equal('function'); - expect(typeof obj.constructor).to.equal('function'); - done(); - }); - - it('cannot access Object prototype', function (done) { - - Qs.parse('constructor[prototype][bad]=bad'); - Qs.parse('bad[constructor][prototype][bad]=bad'); - expect(typeof Object.prototype.bad).to.equal('undefined'); - done(); - }); - - it('parses arrays of objects', function (done) { - - expect(Qs.parse('a[][b]=c')).to.deep.equal({ a: [{ b: 'c' }] }); - expect(Qs.parse('a[0][b]=c')).to.deep.equal({ a: [{ b: 'c' }] }); - done(); - }); - - it('allows for empty strings in arrays', function (done) { - - expect(Qs.parse('a[]=b&a[]=&a[]=c')).to.deep.equal({ a: ['b', '', 'c'] }); - expect(Qs.parse('a[0]=b&a[1]=&a[2]=c&a[19]=')).to.deep.equal({ a: ['b', '', 'c', ''] }); - done(); - }); - - it('compacts sparse arrays', function (done) { - - expect(Qs.parse('a[10]=1&a[2]=2')).to.deep.equal({ a: ['2', '1'] }); - done(); - }); - - it('parses semi-parsed strings', function (done) { - - expect(Qs.parse({ 'a[b]': 'c' })).to.deep.equal({ a: { b: 'c' } }); - expect(Qs.parse({ 'a[b]': 'c', 'a[d]': 'e' })).to.deep.equal({ a: { b: 'c', d: 'e' } }); - done(); - }); - - it('parses buffers to strings', function (done) { - - var b = new Buffer('test'); - expect(Qs.parse({ a: b })).to.deep.equal({ a: b.toString() }); - done(); - }); - - it('continues parsing when no parent is found', function (done) { - - expect(Qs.parse('[]&a=b')).to.deep.equal({ '0': '', a: 'b' }); - expect(Qs.parse('[foo]=bar')).to.deep.equal({ foo: 'bar' }); - done(); - }); - - it('does not error when parsing a very long array', function (done) { - - var str = 'a[]=a'; - while (Buffer.byteLength(str) < 128 * 1024) { - str += '&' + str; - } - - expect(function () { - - Qs.parse(str); - }).to.not.throw(); - - done(); - }); - - it('should not throw when a native prototype has an enumerable property', { parallel: false }, function (done) { - - Object.prototype.crash = ''; - Array.prototype.crash = ''; - expect(Qs.parse.bind(null, 'a=b')).to.not.throw(); - expect(Qs.parse('a=b')).to.deep.equal({ a: 'b' }); - expect(Qs.parse.bind(null, 'a[][b]=c')).to.not.throw(); - expect(Qs.parse('a[][b]=c')).to.deep.equal({ a: [{ b: 'c' }] }); - delete Object.prototype.crash; - delete Array.prototype.crash; - done(); - }); - - it('parses a string with an alternative delimiter', function (done) { - - expect(Qs.parse('a=b;c=d', ';')).to.deep.equal({ a: 'b', c: 'd' }); - done(); - }); - - it('does not use non-string objects as delimiters', function (done) { - - expect(Qs.parse('a=b&c=d', {})).to.deep.equal({ a: 'b', c: 'd' }); - done(); - }); - - it('parses an object', function (done) { - - var input = { - "user[name]": {"pop[bob]": 3}, - "user[email]": null - }; - - var expected = { - "user": { - "name": {"pop[bob]": 3}, - "email": null - } - }; - - var result = Qs.parse(input); - - expect(result).to.deep.equal(expected); - done(); - }); - - it('parses an object and not child values', function (done) { - - var input = { - "user[name]": {"pop[bob]": { "test": 3 }}, - "user[email]": null - }; - - var expected = { - "user": { - "name": {"pop[bob]": { "test": 3 }}, - "email": null - } - }; - - var result = Qs.parse(input); - - expect(result).to.deep.equal(expected); - done(); - }); -}); diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/qs/test/stringify.js b/update_nation/node_modules/nano/node_modules/request/node_modules/qs/test/stringify.js deleted file mode 100644 index 7bf1df4b5..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/qs/test/stringify.js +++ /dev/null @@ -1,129 +0,0 @@ -// Load modules - -var Lab = require('lab'); -var Qs = require('../'); - - -// Declare internals - -var internals = {}; - - -// Test shortcuts - -var expect = Lab.expect; -var before = Lab.before; -var after = Lab.after; -var describe = Lab.experiment; -var it = Lab.test; - - -describe('#stringify', function () { - - it('stringifies a querystring object', function (done) { - - expect(Qs.stringify({ a: 'b' })).to.equal('a=b'); - expect(Qs.stringify({ a: 1 })).to.equal('a=1'); - expect(Qs.stringify({ a: 1, b: 2 })).to.equal('a=1&b=2'); - done(); - }); - - it('stringifies a nested object', function (done) { - - expect(Qs.stringify({ a: { b: 'c' } })).to.equal('a%5Bb%5D=c'); - expect(Qs.stringify({ a: { b: { c: { d: 'e' } } } })).to.equal('a%5Bb%5D%5Bc%5D%5Bd%5D=e'); - done(); - }); - - it('stringifies an array value', function (done) { - - expect(Qs.stringify({ a: ['b', 'c', 'd'] })).to.equal('a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d'); - done(); - }); - - it('stringifies a nested array value', function (done) { - - expect(Qs.stringify({ a: { b: ['c', 'd'] } })).to.equal('a%5Bb%5D%5B0%5D=c&a%5Bb%5D%5B1%5D=d'); - done(); - }); - - it('stringifies an object inside an array', function (done) { - - expect(Qs.stringify({ a: [{ b: 'c' }] })).to.equal('a%5B0%5D%5Bb%5D=c'); - expect(Qs.stringify({ a: [{ b: { c: [1] } }] })).to.equal('a%5B0%5D%5Bb%5D%5Bc%5D%5B0%5D=1'); - done(); - }); - - it('stringifies a complicated object', function (done) { - - expect(Qs.stringify({ a: { b: 'c', d: 'e' } })).to.equal('a%5Bb%5D=c&a%5Bd%5D=e'); - done(); - }); - - it('stringifies an empty value', function (done) { - - expect(Qs.stringify({ a: '' })).to.equal('a='); - expect(Qs.stringify({ a: '', b: '' })).to.equal('a=&b='); - expect(Qs.stringify({ a: null })).to.equal('a='); - expect(Qs.stringify({ a: { b: null } })).to.equal('a%5Bb%5D='); - done(); - }); - - it('drops keys with a value of undefined', function (done) { - - expect(Qs.stringify({ a: undefined })).to.equal(''); - expect(Qs.stringify({ a: { b: undefined, c: null } })).to.equal('a%5Bc%5D='); - done(); - }); - - it('url encodes values', function (done) { - - expect(Qs.stringify({ a: 'b c' })).to.equal('a=b%20c'); - done(); - }); - - it('stringifies a date', function (done) { - - var now = new Date(); - var str = 'a=' + encodeURIComponent(now.toISOString()); - expect(Qs.stringify({ a: now })).to.equal(str); - done(); - }); - - it('stringifies the weird object from qs', function (done) { - - expect(Qs.stringify({ 'my weird field': 'q1!2"\'w$5&7/z8)?' })).to.equal('my%20weird%20field=q1!2%22\'w%245%267%2Fz8)%3F'); - done(); - }); - - it('skips properties that are part of the object prototype', function (done) { - - Object.prototype.crash = 'test'; - expect(Qs.stringify({ a: 'b'})).to.equal('a=b'); - expect(Qs.stringify({ a: { b: 'c' } })).to.equal('a%5Bb%5D=c'); - delete Object.prototype.crash; - done(); - }); - - it('stringifies boolean values', function (done) { - - expect(Qs.stringify({ a: true })).to.equal('a=true'); - expect(Qs.stringify({ a: { b: true } })).to.equal('a%5Bb%5D=true'); - expect(Qs.stringify({ b: false })).to.equal('b=false'); - expect(Qs.stringify({ b: { c: false } })).to.equal('b%5Bc%5D=false'); - done(); - }); - - it('stringifies buffer values', function (done) { - - expect(Qs.stringify({ a: new Buffer('test') })).to.equal('a=test'); - expect(Qs.stringify({ a: { b: new Buffer('test') } })).to.equal('a%5Bb%5D=test'); - done(); - }); - - it('stringifies an object using an alternative delimiter', function (done) { - - expect(Qs.stringify({ a: 'b', c: 'd' }, ';')).to.equal('a=b;c=d'); - done(); - }); -}); diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/stringstream/.npmignore b/update_nation/node_modules/nano/node_modules/request/node_modules/stringstream/.npmignore deleted file mode 100644 index 7dccd9707..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/stringstream/.npmignore +++ /dev/null @@ -1,15 +0,0 @@ -lib-cov -*.seed -*.log -*.csv -*.dat -*.out -*.pid -*.gz - -pids -logs -results - -node_modules -npm-debug.log \ No newline at end of file diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/stringstream/.travis.yml b/update_nation/node_modules/nano/node_modules/request/node_modules/stringstream/.travis.yml deleted file mode 100644 index f1d0f13c8..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/stringstream/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.4 - - 0.6 diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/stringstream/LICENSE.txt b/update_nation/node_modules/nano/node_modules/request/node_modules/stringstream/LICENSE.txt deleted file mode 100644 index eac188156..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/stringstream/LICENSE.txt +++ /dev/null @@ -1,4 +0,0 @@ -Copyright 2012 Michael Hart (michael.hart.au@gmail.com) - -This project is free software released under the MIT license: -http://www.opensource.org/licenses/mit-license.php diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/stringstream/README.md b/update_nation/node_modules/nano/node_modules/request/node_modules/stringstream/README.md deleted file mode 100644 index 32fc98255..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/stringstream/README.md +++ /dev/null @@ -1,38 +0,0 @@ -# Decode streams into strings The Right Way(tm) - -```javascript -var fs = require('fs') -var zlib = require('zlib') -var strs = require('stringstream') - -var utf8Stream = fs.createReadStream('massiveLogFile.gz') - .pipe(zlib.createGunzip()) - .pipe(strs('utf8')) -``` - -No need to deal with `setEncoding()` weirdness, just compose streams -like they were supposed to be! - -Handles input and output encoding: - -```javascript -// Stream from utf8 to hex to base64... Why not, ay. -var hex64Stream = fs.createReadStream('myFile') - .pipe(strs('utf8', 'hex')) - .pipe(strs('hex', 'base64')) -``` - -Also deals with `base64` output correctly by aligning each emitted data -chunk so that there are no dangling `=` characters: - -```javascript -var stream = fs.createReadStream('myFile').pipe(strs('base64')) - -var base64Str = '' - -stream.on('data', function(data) { base64Str += data }) -stream.on('end', function() { - console.log('My base64 encoded file is: ' + base64Str) // Wouldn't work with setEncoding() - console.log('Original file is: ' + new Buffer(base64Str, 'base64')) -}) -``` diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/stringstream/example.js b/update_nation/node_modules/nano/node_modules/request/node_modules/stringstream/example.js deleted file mode 100644 index f82b85edc..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/stringstream/example.js +++ /dev/null @@ -1,27 +0,0 @@ -var fs = require('fs') -var zlib = require('zlib') -var strs = require('stringstream') - -var utf8Stream = fs.createReadStream('massiveLogFile.gz') - .pipe(zlib.createGunzip()) - .pipe(strs('utf8')) - -utf8Stream.pipe(process.stdout) - -// Stream from utf8 to hex to base64... Why not, ay. -var hex64Stream = fs.createReadStream('myFile') - .pipe(strs('utf8', 'hex')) - .pipe(strs('hex', 'base64')) - -hex64Stream.pipe(process.stdout) - -// Deals with base64 correctly by aligning chunks -var stream = fs.createReadStream('myFile').pipe(strs('base64')) - -var base64Str = '' - -stream.on('data', function(data) { base64Str += data }) -stream.on('end', function() { - console.log('My base64 encoded file is: ' + base64Str) // Wouldn't work with setEncoding() - console.log('Original file is: ' + new Buffer(base64Str, 'base64')) -}) diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/stringstream/package.json b/update_nation/node_modules/nano/node_modules/request/node_modules/stringstream/package.json deleted file mode 100644 index 3afb14488..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/stringstream/package.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "stringstream", - "version": "0.0.4", - "description": "Encode and decode streams into string streams", - "author": { - "name": "Michael Hart", - "email": "michael.hart.au@gmail.com", - "url": "http://github.com/mhart" - }, - "main": "stringstream.js", - "keywords": [ - "string", - "stream", - "base64", - "gzip" - ], - "repository": { - "type": "git", - "url": "https://github.com/mhart/StringStream.git" - }, - "license": "MIT", - "readme": "# Decode streams into strings The Right Way(tm)\n\n```javascript\nvar fs = require('fs')\nvar zlib = require('zlib')\nvar strs = require('stringstream')\n\nvar utf8Stream = fs.createReadStream('massiveLogFile.gz')\n .pipe(zlib.createGunzip())\n .pipe(strs('utf8'))\n```\n\nNo need to deal with `setEncoding()` weirdness, just compose streams\nlike they were supposed to be!\n\nHandles input and output encoding:\n\n```javascript\n// Stream from utf8 to hex to base64... Why not, ay.\nvar hex64Stream = fs.createReadStream('myFile')\n .pipe(strs('utf8', 'hex'))\n .pipe(strs('hex', 'base64'))\n```\n\nAlso deals with `base64` output correctly by aligning each emitted data\nchunk so that there are no dangling `=` characters:\n\n```javascript\nvar stream = fs.createReadStream('myFile').pipe(strs('base64'))\n\nvar base64Str = ''\n\nstream.on('data', function(data) { base64Str += data })\nstream.on('end', function() {\n console.log('My base64 encoded file is: ' + base64Str) // Wouldn't work with setEncoding()\n console.log('Original file is: ' + new Buffer(base64Str, 'base64'))\n})\n```\n", - "readmeFilename": "README.md", - "_id": "stringstream@0.0.4", - "dist": { - "shasum": "0f0e3423f942960b5692ac324a57dd093bc41a92", - "tarball": "http://registry.npmjs.org/stringstream/-/stringstream-0.0.4.tgz" - }, - "_npmVersion": "1.2.0", - "_npmUser": { - "name": "hichaelmart", - "email": "michael.hart.au@gmail.com" - }, - "maintainers": [ - { - "name": "hichaelmart", - "email": "michael.hart.au@gmail.com" - } - ], - "directories": {}, - "_shasum": "0f0e3423f942960b5692ac324a57dd093bc41a92", - "_from": "stringstream@~0.0.4", - "_resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.4.tgz", - "bugs": { - "url": "https://github.com/mhart/StringStream/issues" - }, - "homepage": "https://github.com/mhart/StringStream", - "scripts": {} -} diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/stringstream/stringstream.js b/update_nation/node_modules/nano/node_modules/request/node_modules/stringstream/stringstream.js deleted file mode 100644 index 4ece1275f..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/stringstream/stringstream.js +++ /dev/null @@ -1,102 +0,0 @@ -var util = require('util') -var Stream = require('stream') -var StringDecoder = require('string_decoder').StringDecoder - -module.exports = StringStream -module.exports.AlignedStringDecoder = AlignedStringDecoder - -function StringStream(from, to) { - if (!(this instanceof StringStream)) return new StringStream(from, to) - - Stream.call(this) - - if (from == null) from = 'utf8' - - this.readable = this.writable = true - this.paused = false - this.toEncoding = (to == null ? from : to) - this.fromEncoding = (to == null ? '' : from) - this.decoder = new AlignedStringDecoder(this.toEncoding) -} -util.inherits(StringStream, Stream) - -StringStream.prototype.write = function(data) { - if (!this.writable) { - var err = new Error('stream not writable') - err.code = 'EPIPE' - this.emit('error', err) - return false - } - if (this.fromEncoding) { - if (Buffer.isBuffer(data)) data = data.toString() - data = new Buffer(data, this.fromEncoding) - } - var string = this.decoder.write(data) - if (string.length) this.emit('data', string) - return !this.paused -} - -StringStream.prototype.flush = function() { - if (this.decoder.flush) { - var string = this.decoder.flush() - if (string.length) this.emit('data', string) - } -} - -StringStream.prototype.end = function() { - if (!this.writable && !this.readable) return - this.flush() - this.emit('end') - this.writable = this.readable = false - this.destroy() -} - -StringStream.prototype.destroy = function() { - this.decoder = null - this.writable = this.readable = false - this.emit('close') -} - -StringStream.prototype.pause = function() { - this.paused = true -} - -StringStream.prototype.resume = function () { - if (this.paused) this.emit('drain') - this.paused = false -} - -function AlignedStringDecoder(encoding) { - StringDecoder.call(this, encoding) - - switch (this.encoding) { - case 'base64': - this.write = alignedWrite - this.alignedBuffer = new Buffer(3) - this.alignedBytes = 0 - break - } -} -util.inherits(AlignedStringDecoder, StringDecoder) - -AlignedStringDecoder.prototype.flush = function() { - if (!this.alignedBuffer || !this.alignedBytes) return '' - var leftover = this.alignedBuffer.toString(this.encoding, 0, this.alignedBytes) - this.alignedBytes = 0 - return leftover -} - -function alignedWrite(buffer) { - var rem = (this.alignedBytes + buffer.length) % this.alignedBuffer.length - if (!rem && !this.alignedBytes) return buffer.toString(this.encoding) - - var returnBuffer = new Buffer(this.alignedBytes + buffer.length - rem) - - this.alignedBuffer.copy(returnBuffer, 0, 0, this.alignedBytes) - buffer.copy(returnBuffer, this.alignedBytes, 0, buffer.length - rem) - - buffer.copy(this.alignedBuffer, 0, buffer.length - rem, buffer.length) - this.alignedBytes = rem - - return returnBuffer.toString(this.encoding) -} diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/.jshintrc b/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/.jshintrc deleted file mode 100644 index fb11913a4..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/.jshintrc +++ /dev/null @@ -1,70 +0,0 @@ -{ - "passfail" : false, - "maxerr" : 100, - - "browser" : false, - "node" : true, - "rhino" : false, - "couch" : false, - "wsh" : false, - - "jquery" : false, - "prototypejs" : false, - "mootools" : false, - "dojo" : false, - - "debug" : false, - "devel" : false, - - "esnext" : true, - "strict" : true, - "globalstrict" : true, - - "asi" : false, - "laxbreak" : false, - "bitwise" : true, - "boss" : false, - "curly" : true, - "eqeqeq" : false, - "eqnull" : true, - "evil" : false, - "expr" : false, - "forin" : false, - "immed" : true, - "lastsemic" : true, - "latedef" : false, - "loopfunc" : false, - "noarg" : true, - "regexp" : false, - "regexdash" : false, - "scripturl" : false, - "shadow" : false, - "supernew" : false, - "undef" : true, - "unused" : true, - - "newcap" : true, - "noempty" : true, - "nonew" : true, - "nomen" : false, - "onevar" : false, - "onecase" : true, - "plusplus" : false, - "proto" : false, - "sub" : true, - "trailing" : true, - "white" : false, - - "predef": [ - "describe", - "it", - "before", - "beforeEach", - "after", - "afterEach", - "expect", - "setTimeout", - "clearTimeout" - ], - "maxlen": 0 -} diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/.npmignore b/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/.npmignore deleted file mode 100644 index 54efff98f..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules/ -.*.sw[nmop] -npm-debug.log diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/.travis.yml b/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/.travis.yml deleted file mode 100644 index 5d892654f..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: node_js -node_js: -- "0.10" -- "0.11" -matrix: - fast_finish: true - allow_failures: - - node_js: 0.11 diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/LICENSE b/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/LICENSE deleted file mode 100644 index 3fac4c85c..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/LICENSE +++ /dev/null @@ -1,78 +0,0 @@ -Copyright GoInstant, Inc. and other contributors. 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. - -The following exceptions apply: - -=== - -`pubSufTest()` of generate-pubsuffix.js is in the public domain. - - // Any copyright is dedicated to the Public Domain. - // http://creativecommons.org/publicdomain/zero/1.0/ - -=== - -`public-suffix.txt` was obtained from - -via . - -That file contains the usual Mozilla triple-license, for which this project uses it -under the terms of the MPL 1.1: - - // ***** BEGIN LICENSE BLOCK ***** - // Version: MPL 1.1/GPL 2.0/LGPL 2.1 - // - // The contents of this file are subject to the Mozilla Public License Version - // 1.1 (the "License"); you may not use this file except in compliance with - // the License. You may obtain a copy of the License at - // http://www.mozilla.org/MPL/ - // - // Software distributed under the License is distributed on an "AS IS" basis, - // WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - // for the specific language governing rights and limitations under the - // License. - // - // The Original Code is the Public Suffix List. - // - // The Initial Developer of the Original Code is - // Jo Hermans . - // Portions created by the Initial Developer are Copyright (C) 2007 - // the Initial Developer. All Rights Reserved. - // - // Contributor(s): - // Ruben Arakelyan - // Gervase Markham - // Pamela Greene - // David Triendl - // Jothan Frakes - // The kind representatives of many TLD registries - // - // Alternatively, the contents of this file may be used under the terms of - // either the GNU General Public License Version 2 or later (the "GPL"), or - // the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - // in which case the provisions of the GPL or the LGPL are applicable instead - // of those above. If you wish to allow use of your version of this file only - // under the terms of either the GPL or the LGPL, and not to allow others to - // use your version of this file under the terms of the MPL, indicate your - // decision by deleting the provisions above and replace them with the notice - // and other provisions required by the GPL or the LGPL. If you do not delete - // the provisions above, a recipient may use your version of this file under - // the terms of any one of the MPL, the GPL or the LGPL. - // - // ***** END LICENSE BLOCK ***** diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/README.md b/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/README.md deleted file mode 100644 index 9e6caee18..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/README.md +++ /dev/null @@ -1,412 +0,0 @@ -[RFC6265](http://tools.ietf.org/html/rfc6265) Cookies and CookieJar for Node.js - -![Tough Cookie](http://www.goinstant.com.s3.amazonaws.com/tough-cookie.jpg) - -[![Build Status](https://travis-ci.org/goinstant/node-cookie.png?branch=master)](https://travis-ci.org/goinstant/node-cookie) - -[![NPM Stats](https://nodei.co/npm/tough-cookie.png?downloads=true&stars=true)](https://npmjs.org/package/tough-cookie) -![NPM Downloads](https://nodei.co/npm-dl/tough-cookie.png?months=9) - -# Synopsis - -``` javascript -var tough = require('tough-cookie'); // note: not 'cookie', 'cookies' or 'node-cookie' -var Cookie = tough.Cookie; -var cookie = Cookie.parse(header); -cookie.value = 'somethingdifferent'; -header = cookie.toString(); - -var cookiejar = new tough.CookieJar(); -cookiejar.setCookie(cookie, 'http://currentdomain.example.com/path', cb); -// ... -cookiejar.getCookies('http://example.com/otherpath',function(err,cookies) { - res.headers['cookie'] = cookies.join('; '); -}); -``` - -# Installation - -It's _so_ easy! - -`npm install tough-cookie` - -Requires `punycode`, which should get installed automatically for you. Note that node.js v0.6.2+ bundles punycode by default. - -Why the name? NPM modules `cookie`, `cookies` and `cookiejar` were already taken. - -# API - -tough -===== - -Functions on the module you get from `require('tough-cookie')`. All can be used as pure functions and don't need to be "bound". - -parseDate(string[,strict]) ------------------ - -Parse a cookie date string into a `Date`. Parses according to RFC6265 Section 5.1.1, not `Date.parse()`. If strict is set to true then leading/trailing non-seperator characters around the time part will cause the parsing to fail (e.g. "Thu, 01 Jan 1970 00:00:010 GMT" has an extra trailing zero but Chrome, an assumedly RFC-compliant browser, treats this as valid). - -formatDate(date) ----------------- - -Format a Date into a RFC1123 string (the RFC6265-recommended format). - -canonicalDomain(str) --------------------- - -Transforms a domain-name into a canonical domain-name. The canonical domain-name is a trimmed, lowercased, stripped-of-leading-dot and optionally punycode-encoded domain-name (Section 5.1.2 of RFC6265). For the most part, this function is idempotent (can be run again on its output without ill effects). - -domainMatch(str,domStr[,canonicalize=true]) -------------------------------------------- - -Answers "does this real domain match the domain in a cookie?". The `str` is the "current" domain-name and the `domStr` is the "cookie" domain-name. Matches according to RFC6265 Section 5.1.3, but it helps to think of it as a "suffix match". - -The `canonicalize` parameter will run the other two paramters through `canonicalDomain` or not. - -defaultPath(path) ------------------ - -Given a current request/response path, gives the Path apropriate for storing in a cookie. This is basically the "directory" of a "file" in the path, but is specified by Section 5.1.4 of the RFC. - -The `path` parameter MUST be _only_ the pathname part of a URI (i.e. excludes the hostname, query, fragment, etc.). This is the `.pathname` property of node's `uri.parse()` output. - -pathMatch(reqPath,cookiePath) ------------------------------ - -Answers "does the request-path path-match a given cookie-path?" as per RFC6265 Section 5.1.4. Returns a boolean. - -This is essentially a prefix-match where `cookiePath` is a prefix of `reqPath`. - -parse(header[,strict=false]) ----------------------------- - -alias for `Cookie.parse(header[,strict])` - -fromJSON(string) ----------------- - -alias for `Cookie.fromJSON(string)` - -getPublicSuffix(hostname) -------------------------- - -Returns the public suffix of this hostname. The public suffix is the shortest domain-name upon which a cookie can be set. Returns `null` if the hostname cannot have cookies set for it. - -For example: `www.example.com` and `www.subdomain.example.com` both have public suffix `example.com`. - -For further information, see http://publicsuffix.org/. This module derives its list from that site. - -cookieCompare(a,b) ------------------- - -For use with `.sort()`, sorts a list of cookies into the recommended order given in the RFC (Section 5.4 step 2). Longest `.path`s go first, then sorted oldest to youngest. - -``` javascript -var cookies = [ /* unsorted array of Cookie objects */ ]; -cookies = cookies.sort(cookieCompare); -``` - -permuteDomain(domain) ---------------------- - -Generates a list of all possible domains that `domainMatch()` the parameter. May be handy for implementing cookie stores. - - -permutePath(path) ------------------ - -Generates a list of all possible paths that `pathMatch()` the parameter. May be handy for implementing cookie stores. - -Cookie -====== - -Cookie.parse(header[,strict=false]) ------------------------------------ - -Parses a single Cookie or Set-Cookie HTTP header into a `Cookie` object. Returns `undefined` if the string can't be parsed. If in strict mode, returns `undefined` if the cookie doesn't follow the guidelines in section 4 of RFC6265. Generally speaking, strict mode can be used to validate your own generated Set-Cookie headers, but acting as a client you want to be lenient and leave strict mode off. - -Here's how to process the Set-Cookie header(s) on a node HTTP/HTTPS response: - -``` javascript -if (res.headers['set-cookie'] instanceof Array) - cookies = res.headers['set-cookie'].map(function (c) { return (Cookie.parse(c)); }); -else - cookies = [Cookie.parse(res.headers['set-cookie'])]; -``` - -Cookie.fromJSON(string) ------------------------ - -Convert a JSON string to a `Cookie` object. Does a `JSON.parse()` and converts the `.created`, `.lastAccessed` and `.expires` properties into `Date` objects. - -Properties -========== - - * _key_ - string - the name or key of the cookie (default "") - * _value_ - string - the value of the cookie (default "") - * _expires_ - `Date` - if set, the `Expires=` attribute of the cookie (defaults to the string `"Infinity"`). See `setExpires()` - * _maxAge_ - seconds - if set, the `Max-Age=` attribute _in seconds_ of the cookie. May also be set to strings `"Infinity"` and `"-Infinity"` for non-expiry and immediate-expiry, respectively. See `setMaxAge()` - * _domain_ - string - the `Domain=` attribute of the cookie - * _path_ - string - the `Path=` of the cookie - * _secure_ - boolean - the `Secure` cookie flag - * _httpOnly_ - boolean - the `HttpOnly` cookie flag - * _extensions_ - `Array` - any unrecognized cookie attributes as strings (even if equal-signs inside) - -After a cookie has been passed through `CookieJar.setCookie()` it will have the following additional attributes: - - * _hostOnly_ - boolean - is this a host-only cookie (i.e. no Domain field was set, but was instead implied) - * _pathIsDefault_ - boolean - if true, there was no Path field on the cookie and `defaultPath()` was used to derive one. - * _created_ - `Date` - when this cookie was added to the jar - * _lastAccessed_ - `Date` - last time the cookie got accessed. Will affect cookie cleaning once implemented. Using `cookiejar.getCookies(...)` will update this attribute. - -Construction([{options}]) ------------- - -Receives an options object that can contain any Cookie properties, uses the default for unspecified properties. - -.toString() ------------ - -encode to a Set-Cookie header value. The Expires cookie field is set using `formatDate()`, but is omitted entirely if `.expires` is `Infinity`. - -.cookieString() ---------------- - -encode to a Cookie header value (i.e. the `.key` and `.value` properties joined with '='). - -.setExpires(String) -------------------- - -sets the expiry based on a date-string passed through `parseDate()`. If parseDate returns `null` (i.e. can't parse this date string), `.expires` is set to `"Infinity"` (a string) is set. - -.setMaxAge(number) -------------------- - -sets the maxAge in seconds. Coerces `-Infinity` to `"-Infinity"` and `Infinity` to `"Infinity"` so it JSON serializes correctly. - -.expiryTime([now=Date.now()]) ------------------------------ - -.expiryDate([now=Date.now()]) ------------------------------ - -expiryTime() Computes the absolute unix-epoch milliseconds that this cookie expires. expiryDate() works similarly, except it returns a `Date` object. Note that in both cases the `now` parameter should be milliseconds. - -Max-Age takes precedence over Expires (as per the RFC). The `.created` attribute -- or, by default, the `now` paramter -- is used to offset the `.maxAge` attribute. - -If Expires (`.expires`) is set, that's returned. - -Otherwise, `expiryTime()` returns `Infinity` and `expiryDate()` returns a `Date` object for "Tue, 19 Jan 2038 03:14:07 GMT" (latest date that can be expressed by a 32-bit `time_t`; the common limit for most user-agents). - -.TTL([now=Date.now()]) ---------- - -compute the TTL relative to `now` (milliseconds). The same precedence rules as for `expiryTime`/`expiryDate` apply. - -The "number" `Infinity` is returned for cookies without an explicit expiry and `0` is returned if the cookie is expired. Otherwise a time-to-live in milliseconds is returned. - -.canonicalizedDoman() ---------------------- - -.cdomain() ----------- - -return the canonicalized `.domain` field. This is lower-cased and punycode (RFC3490) encoded if the domain has any non-ASCII characters. - -.validate() ------------ - -Status: *IN PROGRESS*. Works for a few things, but is by no means comprehensive. - -validates cookie attributes for semantic correctness. Useful for "lint" checking any Set-Cookie headers you generate. For now, it returns a boolean, but eventually could return a reason string -- you can future-proof with this construct: - -``` javascript -if (cookie.validate() === true) { - // it's tasty -} else { - // yuck! -} -``` - -CookieJar -========= - -Construction([store = new MemoryCookieStore()][, rejectPublicSuffixes]) ------------- - -Simply use `new CookieJar()`. If you'd like to use a custom store, pass that to the constructor otherwise a `MemoryCookieStore` will be created and used. - - -Attributes ----------- - - * _rejectPublicSuffixes_ - boolean - reject cookies with domains like "com" and "co.uk" (default: `true`) - -Since eventually this module would like to support database/remote/etc. CookieJars, continuation passing style is used for CookieJar methods. - -.setCookie(cookieOrString, currentUrl, [{options},] cb(err,cookie)) -------------------------------------------------------------------- - -Attempt to set the cookie in the cookie jar. If the operation fails, an error will be given to the callback `cb`, otherwise the cookie is passed through. The cookie will have updated `.created`, `.lastAccessed` and `.hostOnly` properties. - -The `options` object can be omitted and can have the following properties: - - * _http_ - boolean - default `true` - indicates if this is an HTTP or non-HTTP API. Affects HttpOnly cookies. - * _secure_ - boolean - autodetect from url - indicates if this is a "Secure" API. If the currentUrl starts with `https:` or `wss:` then this is defaulted to `true`, otherwise `false`. - * _now_ - Date - default `new Date()` - what to use for the creation/access time of cookies - * _strict_ - boolean - default `false` - perform extra checks - * _ignoreError_ - boolean - default `false` - silently ignore things like parse errors and invalid domains. CookieStore errors aren't ignored by this option. - -As per the RFC, the `.hostOnly` property is set if there was no "Domain=" parameter in the cookie string (or `.domain` was null on the Cookie object). The `.domain` property is set to the fully-qualified hostname of `currentUrl` in this case. Matching this cookie requires an exact hostname match (not a `domainMatch` as per usual). - -.setCookieSync(cookieOrString, currentUrl, [{options}]) -------------------------------------------------------- - -Synchronous version of `setCookie`; only works with synchronous stores (e.g. the default `MemoryCookieStore`). - -.storeCookie(cookie, [{options},] cb(err,cookie)) -------------------------------------------------- - -__REMOVED__ removed in lieu of the CookieStore API below - -.getCookies(currentUrl, [{options},] cb(err,cookies)) ------------------------------------------------------ - -Retrieve the list of cookies that can be sent in a Cookie header for the current url. - -If an error is encountered, that's passed as `err` to the callback, otherwise an `Array` of `Cookie` objects is passed. The array is sorted with `cookieCompare()` unless the `{sort:false}` option is given. - -The `options` object can be omitted and can have the following properties: - - * _http_ - boolean - default `true` - indicates if this is an HTTP or non-HTTP API. Affects HttpOnly cookies. - * _secure_ - boolean - autodetect from url - indicates if this is a "Secure" API. If the currentUrl starts with `https:` or `wss:` then this is defaulted to `true`, otherwise `false`. - * _now_ - Date - default `new Date()` - what to use for the creation/access time of cookies - * _expire_ - boolean - default `true` - perform expiry-time checking of cookies and asynchronously remove expired cookies from the store. Using `false` will return expired cookies and **not** remove them from the store (which is useful for replaying Set-Cookie headers, potentially). - * _allPaths_ - boolean - default `false` - if `true`, do not scope cookies by path. The default uses RFC-compliant path scoping. **Note**: may not be supported by the CookieStore `fetchCookies` function (the default MemoryCookieStore supports it). - -The `.lastAccessed` property of the returned cookies will have been updated. - -.getCookiesSync(currentUrl, [{options}]) ----------------------------------------- - -Synchronous version of `getCookies`; only works with synchronous stores (e.g. the default `MemoryCookieStore`). - -.getCookieString(...) ---------------------- - -Accepts the same options as `.getCookies()` but passes a string suitable for a Cookie header rather than an array to the callback. Simply maps the `Cookie` array via `.cookieString()`. - -.getCookieStringSync(...) -------------------------- - -Synchronous version of `getCookieString`; only works with synchronous stores (e.g. the default `MemoryCookieStore`). - -.getSetCookieStrings(...) -------------------------- - -Returns an array of strings suitable for **Set-Cookie** headers. Accepts the same options as `.getCookies()`. Simply maps the cookie array via `.toString()`. - -.getSetCookieStringsSync(...) ------------------------------ - -Synchronous version of `getSetCookieStrings`; only works with synchronous stores (e.g. the default `MemoryCookieStore`). - -Store -===== - -Base class for CookieJar stores. - -# CookieStore API - -The storage model for each `CookieJar` instance can be replaced with a custom implementation. The default is `MemoryCookieStore` which can be found in the `lib/memstore.js` file. The API uses continuation-passing-style to allow for asynchronous stores. - -Stores should inherit from the base `Store` class, which is available as `require('tough-cookie').Store`. Stores are asynchronous by default, but if `store.synchronous` is set, then the `*Sync` methods on the CookieJar can be used. - -All `domain` parameters will have been normalized before calling. - -The Cookie store must have all of the following methods. - -store.findCookie(domain, path, key, cb(err,cookie)) ---------------------------------------------------- - -Retrieve a cookie with the given domain, path and key (a.k.a. name). The RFC maintains that exactly one of these cookies should exist in a store. If the store is using versioning, this means that the latest/newest such cookie should be returned. - -Callback takes an error and the resulting `Cookie` object. If no cookie is found then `null` MUST be passed instead (i.e. not an error). - -store.findCookies(domain, path, cb(err,cookies)) ------------------------------------------------- - -Locates cookies matching the given domain and path. This is most often called in the context of `cookiejar.getCookies()` above. - -If no cookies are found, the callback MUST be passed an empty array. - -The resulting list will be checked for applicability to the current request according to the RFC (domain-match, path-match, http-only-flag, secure-flag, expiry, etc.), so it's OK to use an optimistic search algorithm when implementing this method. However, the search algorithm used SHOULD try to find cookies that `domainMatch()` the domain and `pathMatch()` the path in order to limit the amount of checking that needs to be done. - -As of version 0.9.12, the `allPaths` option to `cookiejar.getCookies()` above will cause the path here to be `null`. If the path is `null`, path-matching MUST NOT be performed (i.e. domain-matching only). - -store.putCookie(cookie, cb(err)) --------------------------------- - -Adds a new cookie to the store. The implementation SHOULD replace any existing cookie with the same `.domain`, `.path`, and `.key` properties -- depending on the nature of the implementation, it's possible that between the call to `fetchCookie` and `putCookie` that a duplicate `putCookie` can occur. - -The `cookie` object MUST NOT be modified; the caller will have already updated the `.creation` and `.lastAccessed` properties. - -Pass an error if the cookie cannot be stored. - -store.updateCookie(oldCookie, newCookie, cb(err)) -------------------------------------------------- - -Update an existing cookie. The implementation MUST update the `.value` for a cookie with the same `domain`, `.path` and `.key`. The implementation SHOULD check that the old value in the store is equivalent to `oldCookie` - how the conflict is resolved is up to the store. - -The `.lastAccessed` property will always be different between the two objects and `.created` will always be the same. Stores MAY ignore or defer the `.lastAccessed` change at the cost of affecting how cookies are sorted (or selected for deletion). - -Stores may wish to optimize changing the `.value` of the cookie in the store versus storing a new cookie. If the implementation doesn't define this method a stub that calls `putCookie(newCookie,cb)` will be added to the store object. - -The `newCookie` and `oldCookie` objects MUST NOT be modified. - -Pass an error if the newCookie cannot be stored. - -store.removeCookie(domain, path, key, cb(err)) ----------------------------------------------- - -Remove a cookie from the store (see notes on `findCookie` about the uniqueness constraint). - -The implementation MUST NOT pass an error if the cookie doesn't exist; only pass an error due to the failure to remove an existing cookie. - -store.removeCookies(domain, path, cb(err)) ------------------------------------------- - -Removes matching cookies from the store. The `path` paramter is optional, and if missing means all paths in a domain should be removed. - -Pass an error ONLY if removing any existing cookies failed. - -# TODO - - * _full_ RFC5890/RFC5891 canonicalization for domains in `cdomain()` - * the optional `punycode` requirement implements RFC3492, but RFC6265 requires RFC5891 - * better tests for `validate()`? - -# Copyright and License - -(tl;dr: MIT with some MPL/1.1) - -Copyright 2012- GoInstant, Inc. and other contributors. 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. - -Portions may be licensed under different licenses (in particular public-suffix.txt is MPL/1.1); please read the LICENSE file for full details. diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/generate-pubsuffix.js b/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/generate-pubsuffix.js deleted file mode 100644 index 74d76aa1c..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/generate-pubsuffix.js +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Copyright GoInstant, Inc. and other contributors. 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. - */ -'use strict'; -var fs = require('fs'); -var assert = require('assert'); -var punycode = require('punycode'); - -fs.readFile('./public-suffix.txt', 'utf8', function(err,string) { - if (err) { - throw err; - } - var lines = string.split("\n"); - process.nextTick(function() { - processList(lines); - }); -}); - -var index = {}; - -var COMMENT = new RegExp('//.+'); -function processList(lines) { - while (lines.length) { - var line = lines.shift(); - line = line.replace(COMMENT,'').trim(); - if (!line) { - continue; - } - addToIndex(index,line); - } - - pubSufTest(); - - var w = fs.createWriteStream('./lib/pubsuffix.js',{ - flags: 'w', - encoding: 'utf8', - mode: parseInt('644',8) - }); - w.on('end', process.exit); - w.write("/****************************************************\n"); - w.write(" * AUTOMATICALLY GENERATED by generate-pubsuffix.js *\n"); - w.write(" * DO NOT EDIT! *\n"); - w.write(" ****************************************************/\n\n"); - - w.write("module.exports.getPublicSuffix = "); - w.write(getPublicSuffix.toString()); - w.write(";\n\n"); - - w.write("// The following generated structure is used under the MPL version 1.1\n"); - w.write("// See public-suffix.txt for more information\n\n"); - w.write("var index = module.exports.index = Object.freeze(\n"); - w.write(JSON.stringify(index)); - w.write(");\n\n"); - w.write("// END of automatically generated file\n"); - - w.end(); -} - -function addToIndex(index,line) { - var prefix = ''; - if (line.replace(/^(!|\*\.)/)) { - prefix = RegExp.$1; - line = line.slice(prefix.length); - } - line = prefix + punycode.toASCII(line); - - if (line.substr(0,1) == '!') { - index[line.substr(1)] = false; - } else { - index[line] = true; - } -} - -// include the licence in the function since it gets written to pubsuffix.js -function getPublicSuffix(domain) { - /* - * Copyright GoInstant, Inc. and other contributors. 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. - */ - if (!domain) { - return null; - } - if (domain.match(/^\./)) { - return null; - } - - domain = domain.toLowerCase(); - var parts = domain.split('.').reverse(); - - var suffix = ''; - var suffixLen = 0; - for (var i=0; i suffixLen) { - return parts.slice(0,suffixLen+1).reverse().join('.'); - } - - return null; -} - -function checkPublicSuffix(give,get) { - var got = getPublicSuffix(give); - assert.equal(got, get, give+' should be '+(get==null?'NULL':get)+' but got '+got); -} - -// pubSufTest() was converted to JavaScript from http://publicsuffix.org/list/test.txt -function pubSufTest() { - // For this function-scope and this function-scope ONLY: - // Any copyright is dedicated to the Public Domain. - // http://creativecommons.org/publicdomain/zero/1.0/ - - // NULL input. - checkPublicSuffix(null, null); - // Mixed case. - checkPublicSuffix('COM', null); - checkPublicSuffix('example.COM', 'example.com'); - checkPublicSuffix('WwW.example.COM', 'example.com'); - // Leading dot. - checkPublicSuffix('.com', null); - checkPublicSuffix('.example', null); - checkPublicSuffix('.example.com', null); - checkPublicSuffix('.example.example', null); - // Unlisted TLD. - checkPublicSuffix('example', null); - checkPublicSuffix('example.example', null); - checkPublicSuffix('b.example.example', null); - checkPublicSuffix('a.b.example.example', null); - // Listed, but non-Internet, TLD. - checkPublicSuffix('local', null); - checkPublicSuffix('example.local', null); - checkPublicSuffix('b.example.local', null); - checkPublicSuffix('a.b.example.local', null); - // TLD with only 1 rule. - checkPublicSuffix('biz', null); - checkPublicSuffix('domain.biz', 'domain.biz'); - checkPublicSuffix('b.domain.biz', 'domain.biz'); - checkPublicSuffix('a.b.domain.biz', 'domain.biz'); - // TLD with some 2-level rules. - checkPublicSuffix('com', null); - checkPublicSuffix('example.com', 'example.com'); - checkPublicSuffix('b.example.com', 'example.com'); - checkPublicSuffix('a.b.example.com', 'example.com'); - checkPublicSuffix('uk.com', null); - checkPublicSuffix('example.uk.com', 'example.uk.com'); - checkPublicSuffix('b.example.uk.com', 'example.uk.com'); - checkPublicSuffix('a.b.example.uk.com', 'example.uk.com'); - checkPublicSuffix('test.ac', 'test.ac'); - // TLD with only 1 (wildcard) rule. - checkPublicSuffix('cy', null); - checkPublicSuffix('c.cy', null); - checkPublicSuffix('b.c.cy', 'b.c.cy'); - checkPublicSuffix('a.b.c.cy', 'b.c.cy'); - // More complex TLD. - checkPublicSuffix('jp', null); - checkPublicSuffix('test.jp', 'test.jp'); - checkPublicSuffix('www.test.jp', 'test.jp'); - checkPublicSuffix('ac.jp', null); - checkPublicSuffix('test.ac.jp', 'test.ac.jp'); - checkPublicSuffix('www.test.ac.jp', 'test.ac.jp'); - checkPublicSuffix('kyoto.jp', null); - checkPublicSuffix('c.kyoto.jp', null); - checkPublicSuffix('b.c.kyoto.jp', 'b.c.kyoto.jp'); - checkPublicSuffix('a.b.c.kyoto.jp', 'b.c.kyoto.jp'); - checkPublicSuffix('pref.kyoto.jp', 'pref.kyoto.jp'); // Exception rule. - checkPublicSuffix('www.pref.kyoto.jp', 'pref.kyoto.jp'); // Exception rule. - checkPublicSuffix('city.kyoto.jp', 'city.kyoto.jp'); // Exception rule. - checkPublicSuffix('www.city.kyoto.jp', 'city.kyoto.jp'); // Exception rule. - // TLD with a wildcard rule and exceptions. - checkPublicSuffix('om', null); - checkPublicSuffix('test.om', null); - checkPublicSuffix('b.test.om', 'b.test.om'); - checkPublicSuffix('a.b.test.om', 'b.test.om'); - checkPublicSuffix('songfest.om', 'songfest.om'); - checkPublicSuffix('www.songfest.om', 'songfest.om'); - // US K12. - checkPublicSuffix('us', null); - checkPublicSuffix('test.us', 'test.us'); - checkPublicSuffix('www.test.us', 'test.us'); - checkPublicSuffix('ak.us', null); - checkPublicSuffix('test.ak.us', 'test.ak.us'); - checkPublicSuffix('www.test.ak.us', 'test.ak.us'); - checkPublicSuffix('k12.ak.us', null); - checkPublicSuffix('test.k12.ak.us', 'test.k12.ak.us'); - checkPublicSuffix('www.test.k12.ak.us', 'test.k12.ak.us'); - - -} diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/lib/cookie.js b/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/lib/cookie.js deleted file mode 100644 index c93e927ae..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/lib/cookie.js +++ /dev/null @@ -1,1107 +0,0 @@ -/* - * Copyright GoInstant, Inc. and other contributors. 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. - */ - -'use strict'; -var net = require('net'); -var urlParse = require('url').parse; -var pubsuffix = require('./pubsuffix'); -var Store = require('./store').Store; - -var punycode; -try { - punycode = require('punycode'); -} catch(e) { - console.warn("cookie: can't load punycode; won't use punycode for domain normalization"); -} - -var DATE_DELIM = /[\x09\x20-\x2F\x3B-\x40\x5B-\x60\x7B-\x7E]/; - -// From RFC2616 S2.2: -var TOKEN = /[\x21\x23-\x26\x2A\x2B\x2D\x2E\x30-\x39\x41-\x5A\x5E-\x7A\x7C\x7E]/; - -// From RFC6265 S4.1.1 -// note that it excludes \x3B ";" -var COOKIE_OCTET = /[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]/; -var COOKIE_OCTETS = new RegExp('^'+COOKIE_OCTET.source+'$'); - -// The name/key cannot be empty but the value can (S5.2): -var COOKIE_PAIR_STRICT = new RegExp('^('+TOKEN.source+'+)=("?)('+COOKIE_OCTET.source+'*)\\2$'); -var COOKIE_PAIR = /^([^=\s]+)\s*=\s*("?)\s*(.*)\s*\2\s*$/; - -// RFC6265 S4.1.1 defines extension-av as 'any CHAR except CTLs or ";"' -// Note ';' is \x3B -var NON_CTL_SEMICOLON = /[\x20-\x3A\x3C-\x7E]+/; -var EXTENSION_AV = NON_CTL_SEMICOLON; -var PATH_VALUE = NON_CTL_SEMICOLON; - -// Used for checking whether or not there is a trailing semi-colon -var TRAILING_SEMICOLON = /;+$/; - -/* RFC6265 S5.1.1.5: - * [fail if] the day-of-month-value is less than 1 or greater than 31 - */ -var DAY_OF_MONTH = /^(0?[1-9]|[12][0-9]|3[01])$/; - -/* RFC6265 S5.1.1.5: - * [fail if] - * * the hour-value is greater than 23, - * * the minute-value is greater than 59, or - * * the second-value is greater than 59. - */ -var TIME = /(0?[0-9]|1[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])/; -var STRICT_TIME = /^(0?[0-9]|1[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/; - -var MONTH = /^(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)$/i; -var MONTH_TO_NUM = { - jan:0, feb:1, mar:2, apr:3, may:4, jun:5, - jul:6, aug:7, sep:8, oct:9, nov:10, dec:11 -}; -var NUM_TO_MONTH = [ - 'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec' -]; -var NUM_TO_DAY = [ - 'Sun','Mon','Tue','Wed','Thu','Fri','Sat' -]; - -var YEAR = /^([1-9][0-9]{1,3})$/; // 2 to 4 digits - -var MAX_TIME = 2147483647000; // 31-bit max -var MIN_TIME = 0; // 31-bit min - - -// RFC6265 S5.1.1 date parser: -function parseDate(str,strict) { - if (!str) { - return; - } - var found_time, found_dom, found_month, found_year; - - /* RFC6265 S5.1.1: - * 2. Process each date-token sequentially in the order the date-tokens - * appear in the cookie-date - */ - var tokens = str.split(DATE_DELIM); - if (!tokens) { - return; - } - - var date = new Date(); - date.setMilliseconds(0); - - for (var i=0; i= 10 ? d : '0'+d; - var h = date.getUTCHours(); h = h >= 10 ? h : '0'+h; - var m = date.getUTCMinutes(); m = m >= 10 ? m : '0'+m; - var s = date.getUTCSeconds(); s = s >= 10 ? s : '0'+s; - return NUM_TO_DAY[date.getUTCDay()] + ', ' + - d+' '+ NUM_TO_MONTH[date.getUTCMonth()] +' '+ date.getUTCFullYear() +' '+ - h+':'+m+':'+s+' GMT'; -} - -// S5.1.2 Canonicalized Host Names -function canonicalDomain(str) { - if (str == null) { - return null; - } - str = str.trim().replace(/^\./,''); // S4.1.2.3 & S5.2.3: ignore leading . - - // convert to IDN if any non-ASCII characters - if (punycode && /[^\u0001-\u007f]/.test(str)) { - str = punycode.toASCII(str); - } - - return str.toLowerCase(); -} - -// S5.1.3 Domain Matching -function domainMatch(str, domStr, canonicalize) { - if (str == null || domStr == null) { - return null; - } - if (canonicalize !== false) { - str = canonicalDomain(str); - domStr = canonicalDomain(domStr); - } - - /* - * "The domain string and the string are identical. (Note that both the - * domain string and the string will have been canonicalized to lower case at - * this point)" - */ - if (str == domStr) { - return true; - } - - /* "All of the following [three] conditions hold:" (order adjusted from the RFC) */ - - /* "* The string is a host name (i.e., not an IP address)." */ - if (net.isIP(str)) { - return false; - } - - /* "* The domain string is a suffix of the string" */ - var idx = str.indexOf(domStr); - if (idx <= 0) { - return false; // it's a non-match (-1) or prefix (0) - } - - // e.g "a.b.c".indexOf("b.c") === 2 - // 5 === 3+2 - if (str.length !== domStr.length + idx) { // it's not a suffix - return false; - } - - /* "* The last character of the string that is not included in the domain - * string is a %x2E (".") character." */ - if (str.substr(idx-1,1) !== '.') { - return false; - } - - return true; -} - - -// RFC6265 S5.1.4 Paths and Path-Match - -/* - * "The user agent MUST use an algorithm equivalent to the following algorithm - * to compute the default-path of a cookie:" - * - * Assumption: the path (and not query part or absolute uri) is passed in. - */ -function defaultPath(path) { - // "2. If the uri-path is empty or if the first character of the uri-path is not - // a %x2F ("/") character, output %x2F ("/") and skip the remaining steps. - if (!path || path.substr(0,1) !== "/") { - return "/"; - } - - // "3. If the uri-path contains no more than one %x2F ("/") character, output - // %x2F ("/") and skip the remaining step." - if (path === "/") { - return path; - } - - var rightSlash = path.lastIndexOf("/"); - if (rightSlash === 0) { - return "/"; - } - - // "4. Output the characters of the uri-path from the first character up to, - // but not including, the right-most %x2F ("/")." - return path.slice(0, rightSlash); -} - -/* - * "A request-path path-matches a given cookie-path if at least one of the - * following conditions holds:" - */ -function pathMatch(reqPath,cookiePath) { - // "o The cookie-path and the request-path are identical." - if (cookiePath === reqPath) { - return true; - } - - var idx = reqPath.indexOf(cookiePath); - if (idx === 0) { - // "o The cookie-path is a prefix of the request-path, and the last - // character of the cookie-path is %x2F ("/")." - if (cookiePath.substr(-1) === "/") { - return true; - } - - // " o The cookie-path is a prefix of the request-path, and the first - // character of the request-path that is not included in the cookie- path - // is a %x2F ("/") character." - if (reqPath.substr(cookiePath.length,1) === "/") { - return true; - } - } - - return false; -} - -function parse(str, strict) { - str = str.trim(); - - // S4.1.1 Trailing semi-colons are not part of the specification. - // If we are not in strict mode we remove the trailing semi-colons. - var semiColonCheck = TRAILING_SEMICOLON.exec(str); - if (semiColonCheck) { - if (strict) { - return; - } - str = str.slice(0, semiColonCheck.index); - } - - // We use a regex to parse the "name-value-pair" part of S5.2 - var firstSemi = str.indexOf(';'); // S5.2 step 1 - var pairRx = strict ? COOKIE_PAIR_STRICT : COOKIE_PAIR; - var result = pairRx.exec(firstSemi === -1 ? str : str.substr(0,firstSemi)); - - // Rx satisfies the "the name string is empty" and "lacks a %x3D ("=")" - // constraints as well as trimming any whitespace. - if (!result) { - return; - } - - var c = new Cookie(); - c.key = result[1]; // the regexp should trim() already - c.value = result[3]; // [2] is quotes or empty-string - - if (firstSemi === -1) { - return c; - } - - // S5.2.3 "unparsed-attributes consist of the remainder of the set-cookie-string - // (including the %x3B (";") in question)." plus later on in the same section - // "discard the first ";" and trim". - var unparsed = str.slice(firstSemi).replace(/^\s*;\s*/,'').trim(); - - // "If the unparsed-attributes string is empty, skip the rest of these - // steps." - if (unparsed.length === 0) { - return c; - } - - /* - * S5.2 says that when looping over the items "[p]rocess the attribute-name - * and attribute-value according to the requirements in the following - * subsections" for every item. Plus, for many of the individual attributes - * in S5.3 it says to use the "attribute-value of the last attribute in the - * cookie-attribute-list". Therefore, in this implementation, we overwrite - * the previous value. - */ - var cookie_avs = unparsed.split(/\s*;\s*/); - while (cookie_avs.length) { - var av = cookie_avs.shift(); - - if (strict && !EXTENSION_AV.test(av)) { - return; - } - - var av_sep = av.indexOf('='); - var av_key, av_value; - if (av_sep === -1) { - av_key = av; - av_value = null; - } else { - av_key = av.substr(0,av_sep); - av_value = av.substr(av_sep+1); - } - - av_key = av_key.trim().toLowerCase(); - if (av_value) { - av_value = av_value.trim(); - } - - switch(av_key) { - case 'expires': // S5.2.1 - if (!av_value) {if(strict){return;}else{break;} } - var exp = parseDate(av_value,strict); - // "If the attribute-value failed to parse as a cookie date, ignore the - // cookie-av." - if (exp == null) { if(strict){return;}else{break;} } - c.expires = exp; - // over and underflow not realistically a concern: V8's getTime() seems to - // store something larger than a 32-bit time_t (even with 32-bit node) - break; - - case 'max-age': // S5.2.2 - if (!av_value) { if(strict){return;}else{break;} } - // "If the first character of the attribute-value is not a DIGIT or a "-" - // character ...[or]... If the remainder of attribute-value contains a - // non-DIGIT character, ignore the cookie-av." - if (!/^-?[0-9]+$/.test(av_value)) { if(strict){return;}else{break;} } - var delta = parseInt(av_value,10); - if (strict && delta <= 0) { - return; // S4.1.1 - } - // "If delta-seconds is less than or equal to zero (0), let expiry-time - // be the earliest representable date and time." - c.setMaxAge(delta); - break; - - case 'domain': // S5.2.3 - // "If the attribute-value is empty, the behavior is undefined. However, - // the user agent SHOULD ignore the cookie-av entirely." - if (!av_value) { if(strict){return;}else{break;} } - // S5.2.3 "Let cookie-domain be the attribute-value without the leading %x2E - // (".") character." - var domain = av_value.trim().replace(/^\./,''); - if (!domain) { if(strict){return;}else{break;} } // see "is empty" above - // "Convert the cookie-domain to lower case." - c.domain = domain.toLowerCase(); - break; - - case 'path': // S5.2.4 - /* - * "If the attribute-value is empty or if the first character of the - * attribute-value is not %x2F ("/"): - * Let cookie-path be the default-path. - * Otherwise: - * Let cookie-path be the attribute-value." - * - * We'll represent the default-path as null since it depends on the - * context of the parsing. - */ - if (!av_value || av_value.substr(0,1) != "/") { - if(strict){return;}else{break;} - } - c.path = av_value; - break; - - case 'secure': // S5.2.5 - /* - * "If the attribute-name case-insensitively matches the string "Secure", - * the user agent MUST append an attribute to the cookie-attribute-list - * with an attribute-name of Secure and an empty attribute-value." - */ - if (av_value != null) { if(strict){return;} } - c.secure = true; - break; - - case 'httponly': // S5.2.6 -- effectively the same as 'secure' - if (av_value != null) { if(strict){return;} } - c.httpOnly = true; - break; - - default: - c.extensions = c.extensions || []; - c.extensions.push(av); - break; - } - } - - // ensure a default date for sorting: - c.creation = new Date(); - return c; -} - -function fromJSON(str) { - if (!str) { - return null; - } - - var obj; - try { - obj = JSON.parse(str); - } catch (e) { - return null; - } - - var c = new Cookie(); - for (var i=0; i 1) { - var lindex = path.lastIndexOf('/'); - if (lindex === 0) { - break; - } - path = path.substr(0,lindex); - permutations.push(path); - } - permutations.push('/'); - return permutations; -} - - -function Cookie (opts) { - if (typeof opts !== "object") { - return; - } - Object.keys(opts).forEach(function (key) { - if (Cookie.prototype.hasOwnProperty(key)) { - this[key] = opts[key] || Cookie.prototype[key]; - } - }.bind(this)); -} - -Cookie.parse = parse; -Cookie.fromJSON = fromJSON; - -Cookie.prototype.key = ""; -Cookie.prototype.value = ""; - -// the order in which the RFC has them: -Cookie.prototype.expires = "Infinity"; // coerces to literal Infinity -Cookie.prototype.maxAge = null; // takes precedence over expires for TTL -Cookie.prototype.domain = null; -Cookie.prototype.path = null; -Cookie.prototype.secure = false; -Cookie.prototype.httpOnly = false; -Cookie.prototype.extensions = null; - -// set by the CookieJar: -Cookie.prototype.hostOnly = null; // boolean when set -Cookie.prototype.pathIsDefault = null; // boolean when set -Cookie.prototype.creation = null; // Date when set; defaulted by Cookie.parse -Cookie.prototype.lastAccessed = null; // Date when set - -var cookieProperties = Object.freeze(Object.keys(Cookie.prototype).map(function(p) { - if (p instanceof Function) { - return; - } - return p; -})); -var numCookieProperties = cookieProperties.length; - -Cookie.prototype.inspect = function inspect() { - var now = Date.now(); - return 'Cookie="'+this.toString() + - '; hostOnly='+(this.hostOnly != null ? this.hostOnly : '?') + - '; aAge='+(this.lastAccessed ? (now-this.lastAccessed.getTime())+'ms' : '?') + - '; cAge='+(this.creation ? (now-this.creation.getTime())+'ms' : '?') + - '"'; -}; - -Cookie.prototype.validate = function validate() { - if (!COOKIE_OCTETS.test(this.value)) { - return false; - } - if (this.expires != Infinity && !(this.expires instanceof Date) && !parseDate(this.expires,true)) { - return false; - } - if (this.maxAge != null && this.maxAge <= 0) { - return false; // "Max-Age=" non-zero-digit *DIGIT - } - if (this.path != null && !PATH_VALUE.test(this.path)) { - return false; - } - - var cdomain = this.cdomain(); - if (cdomain) { - if (cdomain.match(/\.$/)) { - return false; // S4.1.2.3 suggests that this is bad. domainMatch() tests confirm this - } - var suffix = pubsuffix.getPublicSuffix(cdomain); - if (suffix == null) { // it's a public suffix - return false; - } - } - return true; -}; - -Cookie.prototype.setExpires = function setExpires(exp) { - if (exp instanceof Date) { - this.expires = exp; - } else { - this.expires = parseDate(exp) || "Infinity"; - } -}; - -Cookie.prototype.setMaxAge = function setMaxAge(age) { - if (age === Infinity || age === -Infinity) { - this.maxAge = age.toString(); // so JSON.stringify() works - } else { - this.maxAge = age; - } -}; - -// gives Cookie header format -Cookie.prototype.cookieString = function cookieString() { - var val = this.value; - if (val == null) { - val = ''; - } - return this.key+'='+val; -}; - -// gives Set-Cookie header format -Cookie.prototype.toString = function toString() { - var str = this.cookieString(); - - if (this.expires != Infinity) { - if (this.expires instanceof Date) { - str += '; Expires='+formatDate(this.expires); - } else { - str += '; Expires='+this.expires; - } - } - - if (this.maxAge != null && this.maxAge != Infinity) { - str += '; Max-Age='+this.maxAge; - } - - if (this.domain && !this.hostOnly) { - str += '; Domain='+this.domain; - } - if (this.path) { - str += '; Path='+this.path; - } - - if (this.secure) { - str += '; Secure'; - } - if (this.httpOnly) { - str += '; HttpOnly'; - } - if (this.extensions) { - this.extensions.forEach(function(ext) { - str += '; '+ext; - }); - } - - return str; -}; - -// TTL() partially replaces the "expiry-time" parts of S5.3 step 3 (setCookie() -// elsewhere) -// S5.3 says to give the "latest representable date" for which we use Infinity -// For "expired" we use 0 -Cookie.prototype.TTL = function TTL(now) { - /* RFC6265 S4.1.2.2 If a cookie has both the Max-Age and the Expires - * attribute, the Max-Age attribute has precedence and controls the - * expiration date of the cookie. - * (Concurs with S5.3 step 3) - */ - if (this.maxAge != null) { - return this.maxAge<=0 ? 0 : this.maxAge*1000; - } - - var expires = this.expires; - if (expires != Infinity) { - if (!(expires instanceof Date)) { - expires = parseDate(expires) || Infinity; - } - - if (expires == Infinity) { - return Infinity; - } - - return expires.getTime() - (now || Date.now()); - } - - return Infinity; -}; - -// expiryTime() replaces the "expiry-time" parts of S5.3 step 3 (setCookie() -// elsewhere) -Cookie.prototype.expiryTime = function expiryTime(now) { - if (this.maxAge != null) { - var relativeTo = this.creation || now || new Date(); - var age = (this.maxAge <= 0) ? -Infinity : this.maxAge*1000; - return relativeTo.getTime() + age; - } - - if (this.expires == Infinity) { - return Infinity; - } - return this.expires.getTime(); -}; - -// expiryDate() replaces the "expiry-time" parts of S5.3 step 3 (setCookie() -// elsewhere), except it returns a Date -Cookie.prototype.expiryDate = function expiryDate(now) { - var millisec = this.expiryTime(now); - if (millisec == Infinity) { - return new Date(MAX_TIME); - } else if (millisec == -Infinity) { - return new Date(MIN_TIME); - } else { - return new Date(millisec); - } -}; - -// This replaces the "persistent-flag" parts of S5.3 step 3 -Cookie.prototype.isPersistent = function isPersistent() { - return (this.maxAge != null || this.expires != Infinity); -}; - -// Mostly S5.1.2 and S5.2.3: -Cookie.prototype.cdomain = -Cookie.prototype.canonicalizedDomain = function canonicalizedDomain() { - if (this.domain == null) { - return null; - } - return canonicalDomain(this.domain); -}; - - -var memstore; -function CookieJar(store, rejectPublicSuffixes) { - if (rejectPublicSuffixes != null) { - this.rejectPublicSuffixes = rejectPublicSuffixes; - } - - if (!store) { - memstore = memstore || require('./memstore'); - store = new memstore.MemoryCookieStore(); - } - this.store = store; -} -CookieJar.prototype.store = null; -CookieJar.prototype.rejectPublicSuffixes = true; -var CAN_BE_SYNC = []; - -CAN_BE_SYNC.push('setCookie'); -CookieJar.prototype.setCookie = function(cookie, url, options, cb) { - var err; - var context = (url instanceof Object) ? url : urlParse(url); - if (options instanceof Function) { - cb = options; - options = {}; - } - - var host = canonicalDomain(context.hostname); - - // S5.3 step 1 - if (!(cookie instanceof Cookie)) { - cookie = Cookie.parse(cookie, options.strict === true); - } - if (!cookie) { - err = new Error("Cookie failed to parse"); - return cb(options.ignoreError ? null : err); - } - - // S5.3 step 2 - var now = options.now || new Date(); // will assign later to save effort in the face of errors - - // S5.3 step 3: NOOP; persistent-flag and expiry-time is handled by getCookie() - - // S5.3 step 4: NOOP; domain is null by default - - // S5.3 step 5: public suffixes - if (this.rejectPublicSuffixes && cookie.domain) { - var suffix = pubsuffix.getPublicSuffix(cookie.cdomain()); - if (suffix == null) { // e.g. "com" - err = new Error("Cookie has domain set to a public suffix"); - return cb(options.ignoreError ? null : err); - } - } - - // S5.3 step 6: - if (cookie.domain) { - if (!domainMatch(host, cookie.cdomain(), false)) { - err = new Error("Cookie not in this host's domain. Cookie:"+cookie.cdomain()+" Request:"+host); - return cb(options.ignoreError ? null : err); - } - - if (cookie.hostOnly == null) { // don't reset if already set - cookie.hostOnly = false; - } - - } else { - cookie.hostOnly = true; - cookie.domain = host; - } - - // S5.3 step 7: "Otherwise, set the cookie's path to the default-path of the - // request-uri" - if (!cookie.path) { - cookie.path = defaultPath(context.pathname); - cookie.pathIsDefault = true; - } else { - if (cookie.path.length > 1 && cookie.path.substr(-1) == '/') { - cookie.path = cookie.path.slice(0,-1); - } - } - - // S5.3 step 8: NOOP; secure attribute - // S5.3 step 9: NOOP; httpOnly attribute - - // S5.3 step 10 - if (options.http === false && cookie.httpOnly) { - err = new Error("Cookie is HttpOnly and this isn't an HTTP API"); - return cb(options.ignoreError ? null : err); - } - - var store = this.store; - - if (!store.updateCookie) { - store.updateCookie = function(oldCookie, newCookie, cb) { - this.putCookie(newCookie, cb); - }; - } - - function withCookie(err, oldCookie) { - if (err) { - return cb(err); - } - - var next = function(err) { - if (err) { - return cb(err); - } else { - cb(null, cookie); - } - }; - - if (oldCookie) { - // S5.3 step 11 - "If the cookie store contains a cookie with the same name, - // domain, and path as the newly created cookie:" - if (options.http === false && oldCookie.httpOnly) { // step 11.2 - err = new Error("old Cookie is HttpOnly and this isn't an HTTP API"); - return cb(options.ignoreError ? null : err); - } - cookie.creation = oldCookie.creation; // step 11.3 - cookie.lastAccessed = now; - // Step 11.4 (delete cookie) is implied by just setting the new one: - store.updateCookie(oldCookie, cookie, next); // step 12 - - } else { - cookie.creation = cookie.lastAccessed = now; - store.putCookie(cookie, next); // step 12 - } - } - - store.findCookie(cookie.domain, cookie.path, cookie.key, withCookie); -}; - -// RFC6365 S5.4 -CAN_BE_SYNC.push('getCookies'); -CookieJar.prototype.getCookies = function(url, options, cb) { - var context = (url instanceof Object) ? url : urlParse(url); - if (options instanceof Function) { - cb = options; - options = {}; - } - - var host = canonicalDomain(context.hostname); - var path = context.pathname || '/'; - - var secure = options.secure; - if (secure == null && context.protocol && - (context.protocol == 'https:' || context.protocol == 'wss:')) - { - secure = true; - } - - var http = options.http; - if (http == null) { - http = true; - } - - var now = options.now || Date.now(); - var expireCheck = options.expire !== false; - var allPaths = !!options.allPaths; - var store = this.store; - - function matchingCookie(c) { - // "Either: - // The cookie's host-only-flag is true and the canonicalized - // request-host is identical to the cookie's domain. - // Or: - // The cookie's host-only-flag is false and the canonicalized - // request-host domain-matches the cookie's domain." - if (c.hostOnly) { - if (c.domain != host) { - return false; - } - } else { - if (!domainMatch(host, c.domain, false)) { - return false; - } - } - - // "The request-uri's path path-matches the cookie's path." - if (!allPaths && !pathMatch(path, c.path)) { - return false; - } - - // "If the cookie's secure-only-flag is true, then the request-uri's - // scheme must denote a "secure" protocol" - if (c.secure && !secure) { - return false; - } - - // "If the cookie's http-only-flag is true, then exclude the cookie if the - // cookie-string is being generated for a "non-HTTP" API" - if (c.httpOnly && !http) { - return false; - } - - // deferred from S5.3 - // non-RFC: allow retention of expired cookies by choice - if (expireCheck && c.expiryTime() <= now) { - store.removeCookie(c.domain, c.path, c.key, function(){}); // result ignored - return false; - } - - return true; - } - - store.findCookies(host, allPaths ? null : path, function(err,cookies) { - if (err) { - return cb(err); - } - - cookies = cookies.filter(matchingCookie); - - // sorting of S5.4 part 2 - if (options.sort !== false) { - cookies = cookies.sort(cookieCompare); - } - - // S5.4 part 3 - var now = new Date(); - cookies.forEach(function(c) { - c.lastAccessed = now; - }); - // TODO persist lastAccessed - - cb(null,cookies); - }); -}; - -CAN_BE_SYNC.push('getCookieString'); -CookieJar.prototype.getCookieString = function(/*..., cb*/) { - var args = Array.prototype.slice.call(arguments,0); - var cb = args.pop(); - var next = function(err,cookies) { - if (err) { - cb(err); - } else { - cb(null, cookies.map(function(c){ - return c.cookieString(); - }).join('; ')); - } - }; - args.push(next); - this.getCookies.apply(this,args); -}; - -CAN_BE_SYNC.push('getSetCookieStrings'); -CookieJar.prototype.getSetCookieStrings = function(/*..., cb*/) { - var args = Array.prototype.slice.call(arguments,0); - var cb = args.pop(); - var next = function(err,cookies) { - if (err) { - cb(err); - } else { - cb(null, cookies.map(function(c){ - return c.toString(); - })); - } - }; - args.push(next); - this.getCookies.apply(this,args); -}; - -// Use a closure to provide a true imperative API for synchronous stores. -function syncWrap(method) { - return function() { - if (!this.store.synchronous) { - throw new Error('CookieJar store is not synchronous; use async API instead.'); - } - - var args = Array.prototype.slice.call(arguments); - var syncErr, syncResult; - args.push(function syncCb(err, result) { - syncErr = err; - syncResult = result; - }); - this[method].apply(this, args); - - if (syncErr) { - throw syncErr; - } - return syncResult; - }; -} - -// wrap all declared CAN_BE_SYNC methods in the sync wrapper -CAN_BE_SYNC.forEach(function(method) { - CookieJar.prototype[method+'Sync'] = syncWrap(method); -}); - -module.exports = { - CookieJar: CookieJar, - Cookie: Cookie, - Store: Store, - parseDate: parseDate, - formatDate: formatDate, - parse: parse, - fromJSON: fromJSON, - domainMatch: domainMatch, - defaultPath: defaultPath, - pathMatch: pathMatch, - getPublicSuffix: pubsuffix.getPublicSuffix, - cookieCompare: cookieCompare, - permuteDomain: permuteDomain, - permutePath: permutePath, - canonicalDomain: canonicalDomain, -}; diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/lib/memstore.js b/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/lib/memstore.js deleted file mode 100644 index fc5774c8a..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/lib/memstore.js +++ /dev/null @@ -1,123 +0,0 @@ -'use strict'; -var tough = require('./cookie'); -var Store = require('./store').Store; -var permuteDomain = tough.permuteDomain; -var permutePath = tough.permutePath; -var util = require('util'); - -function MemoryCookieStore() { - Store.call(this); - this.idx = {}; -} -util.inherits(MemoryCookieStore, Store); -exports.MemoryCookieStore = MemoryCookieStore; -MemoryCookieStore.prototype.idx = null; -MemoryCookieStore.prototype.synchronous = true; - -// force a default depth: -MemoryCookieStore.prototype.inspect = function() { - return "{ idx: "+util.inspect(this.idx, false, 2)+' }'; -}; - -MemoryCookieStore.prototype.findCookie = function(domain, path, key, cb) { - if (!this.idx[domain]) { - return cb(null,undefined); - } - if (!this.idx[domain][path]) { - return cb(null,undefined); - } - return cb(null,this.idx[domain][path][key]||null); -}; - -MemoryCookieStore.prototype.findCookies = function(domain, path, cb) { - var results = []; - if (!domain) { - return cb(null,[]); - } - - var pathMatcher; - if (!path) { - // null or '/' means "all paths" - pathMatcher = function matchAll(domainIndex) { - for (var curPath in domainIndex) { - var pathIndex = domainIndex[curPath]; - for (var key in pathIndex) { - results.push(pathIndex[key]); - } - } - }; - - } else if (path === '/') { - pathMatcher = function matchSlash(domainIndex) { - var pathIndex = domainIndex['/']; - if (!pathIndex) { - return; - } - for (var key in pathIndex) { - results.push(pathIndex[key]); - } - }; - - } else { - var paths = permutePath(path) || [path]; - pathMatcher = function matchRFC(domainIndex) { - paths.forEach(function(curPath) { - var pathIndex = domainIndex[curPath]; - if (!pathIndex) { - return; - } - for (var key in pathIndex) { - results.push(pathIndex[key]); - } - }); - }; - } - - var domains = permuteDomain(domain) || [domain]; - var idx = this.idx; - domains.forEach(function(curDomain) { - var domainIndex = idx[curDomain]; - if (!domainIndex) { - return; - } - pathMatcher(domainIndex); - }); - - cb(null,results); -}; - -MemoryCookieStore.prototype.putCookie = function(cookie, cb) { - if (!this.idx[cookie.domain]) { - this.idx[cookie.domain] = {}; - } - if (!this.idx[cookie.domain][cookie.path]) { - this.idx[cookie.domain][cookie.path] = {}; - } - this.idx[cookie.domain][cookie.path][cookie.key] = cookie; - cb(null); -}; - -MemoryCookieStore.prototype.updateCookie = function updateCookie(oldCookie, newCookie, cb) { - // updateCookie() may avoid updating cookies that are identical. For example, - // lastAccessed may not be important to some stores and an equality - // comparison could exclude that field. - this.putCookie(newCookie,cb); -}; - -MemoryCookieStore.prototype.removeCookie = function removeCookie(domain, path, key, cb) { - if (this.idx[domain] && this.idx[domain][path] && this.idx[domain][path][key]) { - delete this.idx[domain][path][key]; - } - cb(null); -}; - -MemoryCookieStore.prototype.removeCookies = function removeCookies(domain, path, cb) { - if (this.idx[domain]) { - if (path) { - delete this.idx[domain][path]; - } else { - delete this.idx[domain]; - } - } - return cb(null); -}; diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/lib/pubsuffix.js b/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/lib/pubsuffix.js deleted file mode 100644 index a7031473b..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/lib/pubsuffix.js +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************** - * AUTOMATICALLY GENERATED by generate-pubsuffix.js * - * DO NOT EDIT! * - ****************************************************/ - -module.exports.getPublicSuffix = function getPublicSuffix(domain) { - /* - * Copyright GoInstant, Inc. and other contributors. 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. - */ - if (!domain) return null; - if (domain.match(/^\./)) return null; - - domain = domain.toLowerCase(); - var parts = domain.split('.').reverse(); - - var suffix = ''; - var suffixLen = 0; - for (var i=0; i suffixLen) { - return parts.slice(0,suffixLen+1).reverse().join('.'); - } - - return null; -}; - -// The following generated structure is used under the MPL version 1.1 -// See public-suffix.txt for more information - -var index = module.exports.index = Object.freeze( -{"ac":true,"com.ac":true,"edu.ac":true,"gov.ac":true,"net.ac":true,"mil.ac":true,"org.ac":true,"ad":true,"nom.ad":true,"ae":true,"co.ae":true,"net.ae":true,"org.ae":true,"sch.ae":true,"ac.ae":true,"gov.ae":true,"mil.ae":true,"aero":true,"accident-investigation.aero":true,"accident-prevention.aero":true,"aerobatic.aero":true,"aeroclub.aero":true,"aerodrome.aero":true,"agents.aero":true,"aircraft.aero":true,"airline.aero":true,"airport.aero":true,"air-surveillance.aero":true,"airtraffic.aero":true,"air-traffic-control.aero":true,"ambulance.aero":true,"amusement.aero":true,"association.aero":true,"author.aero":true,"ballooning.aero":true,"broker.aero":true,"caa.aero":true,"cargo.aero":true,"catering.aero":true,"certification.aero":true,"championship.aero":true,"charter.aero":true,"civilaviation.aero":true,"club.aero":true,"conference.aero":true,"consultant.aero":true,"consulting.aero":true,"control.aero":true,"council.aero":true,"crew.aero":true,"design.aero":true,"dgca.aero":true,"educator.aero":true,"emergency.aero":true,"engine.aero":true,"engineer.aero":true,"entertainment.aero":true,"equipment.aero":true,"exchange.aero":true,"express.aero":true,"federation.aero":true,"flight.aero":true,"freight.aero":true,"fuel.aero":true,"gliding.aero":true,"government.aero":true,"groundhandling.aero":true,"group.aero":true,"hanggliding.aero":true,"homebuilt.aero":true,"insurance.aero":true,"journal.aero":true,"journalist.aero":true,"leasing.aero":true,"logistics.aero":true,"magazine.aero":true,"maintenance.aero":true,"marketplace.aero":true,"media.aero":true,"microlight.aero":true,"modelling.aero":true,"navigation.aero":true,"parachuting.aero":true,"paragliding.aero":true,"passenger-association.aero":true,"pilot.aero":true,"press.aero":true,"production.aero":true,"recreation.aero":true,"repbody.aero":true,"res.aero":true,"research.aero":true,"rotorcraft.aero":true,"safety.aero":true,"scientist.aero":true,"services.aero":true,"show.aero":true,"skydiving.aero":true,"software.aero":true,"student.aero":true,"taxi.aero":true,"trader.aero":true,"trading.aero":true,"trainer.aero":true,"union.aero":true,"workinggroup.aero":true,"works.aero":true,"af":true,"gov.af":true,"com.af":true,"org.af":true,"net.af":true,"edu.af":true,"ag":true,"com.ag":true,"org.ag":true,"net.ag":true,"co.ag":true,"nom.ag":true,"ai":true,"off.ai":true,"com.ai":true,"net.ai":true,"org.ai":true,"al":true,"com.al":true,"edu.al":true,"gov.al":true,"mil.al":true,"net.al":true,"org.al":true,"am":true,"an":true,"com.an":true,"net.an":true,"org.an":true,"edu.an":true,"ao":true,"ed.ao":true,"gv.ao":true,"og.ao":true,"co.ao":true,"pb.ao":true,"it.ao":true,"aq":true,"*.ar":true,"congresodelalengua3.ar":false,"educ.ar":false,"gobiernoelectronico.ar":false,"mecon.ar":false,"nacion.ar":false,"nic.ar":false,"promocion.ar":false,"retina.ar":false,"uba.ar":false,"e164.arpa":true,"in-addr.arpa":true,"ip6.arpa":true,"iris.arpa":true,"uri.arpa":true,"urn.arpa":true,"as":true,"gov.as":true,"asia":true,"at":true,"ac.at":true,"co.at":true,"gv.at":true,"or.at":true,"com.au":true,"net.au":true,"org.au":true,"edu.au":true,"gov.au":true,"csiro.au":true,"asn.au":true,"id.au":true,"info.au":true,"conf.au":true,"oz.au":true,"act.au":true,"nsw.au":true,"nt.au":true,"qld.au":true,"sa.au":true,"tas.au":true,"vic.au":true,"wa.au":true,"act.edu.au":true,"nsw.edu.au":true,"nt.edu.au":true,"qld.edu.au":true,"sa.edu.au":true,"tas.edu.au":true,"vic.edu.au":true,"wa.edu.au":true,"act.gov.au":true,"nt.gov.au":true,"qld.gov.au":true,"sa.gov.au":true,"tas.gov.au":true,"vic.gov.au":true,"wa.gov.au":true,"aw":true,"com.aw":true,"ax":true,"az":true,"com.az":true,"net.az":true,"int.az":true,"gov.az":true,"org.az":true,"edu.az":true,"info.az":true,"pp.az":true,"mil.az":true,"name.az":true,"pro.az":true,"biz.az":true,"ba":true,"org.ba":true,"net.ba":true,"edu.ba":true,"gov.ba":true,"mil.ba":true,"unsa.ba":true,"unbi.ba":true,"co.ba":true,"com.ba":true,"rs.ba":true,"bb":true,"biz.bb":true,"com.bb":true,"edu.bb":true,"gov.bb":true,"info.bb":true,"net.bb":true,"org.bb":true,"store.bb":true,"*.bd":true,"be":true,"ac.be":true,"bf":true,"gov.bf":true,"bg":true,"a.bg":true,"b.bg":true,"c.bg":true,"d.bg":true,"e.bg":true,"f.bg":true,"g.bg":true,"h.bg":true,"i.bg":true,"j.bg":true,"k.bg":true,"l.bg":true,"m.bg":true,"n.bg":true,"o.bg":true,"p.bg":true,"q.bg":true,"r.bg":true,"s.bg":true,"t.bg":true,"u.bg":true,"v.bg":true,"w.bg":true,"x.bg":true,"y.bg":true,"z.bg":true,"0.bg":true,"1.bg":true,"2.bg":true,"3.bg":true,"4.bg":true,"5.bg":true,"6.bg":true,"7.bg":true,"8.bg":true,"9.bg":true,"bh":true,"com.bh":true,"edu.bh":true,"net.bh":true,"org.bh":true,"gov.bh":true,"bi":true,"co.bi":true,"com.bi":true,"edu.bi":true,"or.bi":true,"org.bi":true,"biz":true,"bj":true,"asso.bj":true,"barreau.bj":true,"gouv.bj":true,"bm":true,"com.bm":true,"edu.bm":true,"gov.bm":true,"net.bm":true,"org.bm":true,"*.bn":true,"bo":true,"com.bo":true,"edu.bo":true,"gov.bo":true,"gob.bo":true,"int.bo":true,"org.bo":true,"net.bo":true,"mil.bo":true,"tv.bo":true,"br":true,"adm.br":true,"adv.br":true,"agr.br":true,"am.br":true,"arq.br":true,"art.br":true,"ato.br":true,"b.br":true,"bio.br":true,"blog.br":true,"bmd.br":true,"can.br":true,"cim.br":true,"cng.br":true,"cnt.br":true,"com.br":true,"coop.br":true,"ecn.br":true,"edu.br":true,"emp.br":true,"eng.br":true,"esp.br":true,"etc.br":true,"eti.br":true,"far.br":true,"flog.br":true,"fm.br":true,"fnd.br":true,"fot.br":true,"fst.br":true,"g12.br":true,"ggf.br":true,"gov.br":true,"imb.br":true,"ind.br":true,"inf.br":true,"jor.br":true,"jus.br":true,"lel.br":true,"mat.br":true,"med.br":true,"mil.br":true,"mus.br":true,"net.br":true,"nom.br":true,"not.br":true,"ntr.br":true,"odo.br":true,"org.br":true,"ppg.br":true,"pro.br":true,"psc.br":true,"psi.br":true,"qsl.br":true,"radio.br":true,"rec.br":true,"slg.br":true,"srv.br":true,"taxi.br":true,"teo.br":true,"tmp.br":true,"trd.br":true,"tur.br":true,"tv.br":true,"vet.br":true,"vlog.br":true,"wiki.br":true,"zlg.br":true,"bs":true,"com.bs":true,"net.bs":true,"org.bs":true,"edu.bs":true,"gov.bs":true,"bt":true,"com.bt":true,"edu.bt":true,"gov.bt":true,"net.bt":true,"org.bt":true,"bw":true,"co.bw":true,"org.bw":true,"by":true,"gov.by":true,"mil.by":true,"com.by":true,"of.by":true,"bz":true,"com.bz":true,"net.bz":true,"org.bz":true,"edu.bz":true,"gov.bz":true,"ca":true,"ab.ca":true,"bc.ca":true,"mb.ca":true,"nb.ca":true,"nf.ca":true,"nl.ca":true,"ns.ca":true,"nt.ca":true,"nu.ca":true,"on.ca":true,"pe.ca":true,"qc.ca":true,"sk.ca":true,"yk.ca":true,"gc.ca":true,"cat":true,"cc":true,"cd":true,"gov.cd":true,"cf":true,"cg":true,"ch":true,"ci":true,"org.ci":true,"or.ci":true,"com.ci":true,"co.ci":true,"edu.ci":true,"ed.ci":true,"ac.ci":true,"net.ci":true,"go.ci":true,"asso.ci":true,"xn--aroport-bya.ci":true,"int.ci":true,"presse.ci":true,"md.ci":true,"gouv.ci":true,"*.ck":true,"www.ck":false,"cl":true,"gov.cl":true,"gob.cl":true,"co.cl":true,"mil.cl":true,"cm":true,"gov.cm":true,"cn":true,"ac.cn":true,"com.cn":true,"edu.cn":true,"gov.cn":true,"net.cn":true,"org.cn":true,"mil.cn":true,"xn--55qx5d.cn":true,"xn--io0a7i.cn":true,"xn--od0alg.cn":true,"ah.cn":true,"bj.cn":true,"cq.cn":true,"fj.cn":true,"gd.cn":true,"gs.cn":true,"gz.cn":true,"gx.cn":true,"ha.cn":true,"hb.cn":true,"he.cn":true,"hi.cn":true,"hl.cn":true,"hn.cn":true,"jl.cn":true,"js.cn":true,"jx.cn":true,"ln.cn":true,"nm.cn":true,"nx.cn":true,"qh.cn":true,"sc.cn":true,"sd.cn":true,"sh.cn":true,"sn.cn":true,"sx.cn":true,"tj.cn":true,"xj.cn":true,"xz.cn":true,"yn.cn":true,"zj.cn":true,"hk.cn":true,"mo.cn":true,"tw.cn":true,"co":true,"arts.co":true,"com.co":true,"edu.co":true,"firm.co":true,"gov.co":true,"info.co":true,"int.co":true,"mil.co":true,"net.co":true,"nom.co":true,"org.co":true,"rec.co":true,"web.co":true,"com":true,"coop":true,"cr":true,"ac.cr":true,"co.cr":true,"ed.cr":true,"fi.cr":true,"go.cr":true,"or.cr":true,"sa.cr":true,"cu":true,"com.cu":true,"edu.cu":true,"org.cu":true,"net.cu":true,"gov.cu":true,"inf.cu":true,"cv":true,"cx":true,"gov.cx":true,"*.cy":true,"cz":true,"de":true,"dj":true,"dk":true,"dm":true,"com.dm":true,"net.dm":true,"org.dm":true,"edu.dm":true,"gov.dm":true,"do":true,"art.do":true,"com.do":true,"edu.do":true,"gob.do":true,"gov.do":true,"mil.do":true,"net.do":true,"org.do":true,"sld.do":true,"web.do":true,"dz":true,"com.dz":true,"org.dz":true,"net.dz":true,"gov.dz":true,"edu.dz":true,"asso.dz":true,"pol.dz":true,"art.dz":true,"ec":true,"com.ec":true,"info.ec":true,"net.ec":true,"fin.ec":true,"k12.ec":true,"med.ec":true,"pro.ec":true,"org.ec":true,"edu.ec":true,"gov.ec":true,"gob.ec":true,"mil.ec":true,"edu":true,"ee":true,"edu.ee":true,"gov.ee":true,"riik.ee":true,"lib.ee":true,"med.ee":true,"com.ee":true,"pri.ee":true,"aip.ee":true,"org.ee":true,"fie.ee":true,"eg":true,"com.eg":true,"edu.eg":true,"eun.eg":true,"gov.eg":true,"mil.eg":true,"name.eg":true,"net.eg":true,"org.eg":true,"sci.eg":true,"*.er":true,"es":true,"com.es":true,"nom.es":true,"org.es":true,"gob.es":true,"edu.es":true,"*.et":true,"eu":true,"fi":true,"aland.fi":true,"*.fj":true,"*.fk":true,"fm":true,"fo":true,"fr":true,"com.fr":true,"asso.fr":true,"nom.fr":true,"prd.fr":true,"presse.fr":true,"tm.fr":true,"aeroport.fr":true,"assedic.fr":true,"avocat.fr":true,"avoues.fr":true,"cci.fr":true,"chambagri.fr":true,"chirurgiens-dentistes.fr":true,"experts-comptables.fr":true,"geometre-expert.fr":true,"gouv.fr":true,"greta.fr":true,"huissier-justice.fr":true,"medecin.fr":true,"notaires.fr":true,"pharmacien.fr":true,"port.fr":true,"veterinaire.fr":true,"ga":true,"gd":true,"ge":true,"com.ge":true,"edu.ge":true,"gov.ge":true,"org.ge":true,"mil.ge":true,"net.ge":true,"pvt.ge":true,"gf":true,"gg":true,"co.gg":true,"org.gg":true,"net.gg":true,"sch.gg":true,"gov.gg":true,"gh":true,"com.gh":true,"edu.gh":true,"gov.gh":true,"org.gh":true,"mil.gh":true,"gi":true,"com.gi":true,"ltd.gi":true,"gov.gi":true,"mod.gi":true,"edu.gi":true,"org.gi":true,"gl":true,"gm":true,"ac.gn":true,"com.gn":true,"edu.gn":true,"gov.gn":true,"org.gn":true,"net.gn":true,"gov":true,"gp":true,"com.gp":true,"net.gp":true,"mobi.gp":true,"edu.gp":true,"org.gp":true,"asso.gp":true,"gq":true,"gr":true,"com.gr":true,"edu.gr":true,"net.gr":true,"org.gr":true,"gov.gr":true,"gs":true,"*.gt":true,"www.gt":false,"*.gu":true,"gw":true,"gy":true,"co.gy":true,"com.gy":true,"net.gy":true,"hk":true,"com.hk":true,"edu.hk":true,"gov.hk":true,"idv.hk":true,"net.hk":true,"org.hk":true,"xn--55qx5d.hk":true,"xn--wcvs22d.hk":true,"xn--lcvr32d.hk":true,"xn--mxtq1m.hk":true,"xn--gmqw5a.hk":true,"xn--ciqpn.hk":true,"xn--gmq050i.hk":true,"xn--zf0avx.hk":true,"xn--io0a7i.hk":true,"xn--mk0axi.hk":true,"xn--od0alg.hk":true,"xn--od0aq3b.hk":true,"xn--tn0ag.hk":true,"xn--uc0atv.hk":true,"xn--uc0ay4a.hk":true,"hm":true,"hn":true,"com.hn":true,"edu.hn":true,"org.hn":true,"net.hn":true,"mil.hn":true,"gob.hn":true,"hr":true,"iz.hr":true,"from.hr":true,"name.hr":true,"com.hr":true,"ht":true,"com.ht":true,"shop.ht":true,"firm.ht":true,"info.ht":true,"adult.ht":true,"net.ht":true,"pro.ht":true,"org.ht":true,"med.ht":true,"art.ht":true,"coop.ht":true,"pol.ht":true,"asso.ht":true,"edu.ht":true,"rel.ht":true,"gouv.ht":true,"perso.ht":true,"hu":true,"co.hu":true,"info.hu":true,"org.hu":true,"priv.hu":true,"sport.hu":true,"tm.hu":true,"2000.hu":true,"agrar.hu":true,"bolt.hu":true,"casino.hu":true,"city.hu":true,"erotica.hu":true,"erotika.hu":true,"film.hu":true,"forum.hu":true,"games.hu":true,"hotel.hu":true,"ingatlan.hu":true,"jogasz.hu":true,"konyvelo.hu":true,"lakas.hu":true,"media.hu":true,"news.hu":true,"reklam.hu":true,"sex.hu":true,"shop.hu":true,"suli.hu":true,"szex.hu":true,"tozsde.hu":true,"utazas.hu":true,"video.hu":true,"id":true,"ac.id":true,"co.id":true,"go.id":true,"mil.id":true,"net.id":true,"or.id":true,"sch.id":true,"web.id":true,"ie":true,"gov.ie":true,"*.il":true,"im":true,"co.im":true,"ltd.co.im":true,"plc.co.im":true,"net.im":true,"gov.im":true,"org.im":true,"nic.im":true,"ac.im":true,"in":true,"co.in":true,"firm.in":true,"net.in":true,"org.in":true,"gen.in":true,"ind.in":true,"nic.in":true,"ac.in":true,"edu.in":true,"res.in":true,"gov.in":true,"mil.in":true,"info":true,"int":true,"eu.int":true,"io":true,"com.io":true,"iq":true,"gov.iq":true,"edu.iq":true,"mil.iq":true,"com.iq":true,"org.iq":true,"net.iq":true,"ir":true,"ac.ir":true,"co.ir":true,"gov.ir":true,"id.ir":true,"net.ir":true,"org.ir":true,"sch.ir":true,"xn--mgba3a4f16a.ir":true,"xn--mgba3a4fra.ir":true,"is":true,"net.is":true,"com.is":true,"edu.is":true,"gov.is":true,"org.is":true,"int.is":true,"it":true,"gov.it":true,"edu.it":true,"agrigento.it":true,"ag.it":true,"alessandria.it":true,"al.it":true,"ancona.it":true,"an.it":true,"aosta.it":true,"aoste.it":true,"ao.it":true,"arezzo.it":true,"ar.it":true,"ascoli-piceno.it":true,"ascolipiceno.it":true,"ap.it":true,"asti.it":true,"at.it":true,"avellino.it":true,"av.it":true,"bari.it":true,"ba.it":true,"andria-barletta-trani.it":true,"andriabarlettatrani.it":true,"trani-barletta-andria.it":true,"tranibarlettaandria.it":true,"barletta-trani-andria.it":true,"barlettatraniandria.it":true,"andria-trani-barletta.it":true,"andriatranibarletta.it":true,"trani-andria-barletta.it":true,"traniandriabarletta.it":true,"bt.it":true,"belluno.it":true,"bl.it":true,"benevento.it":true,"bn.it":true,"bergamo.it":true,"bg.it":true,"biella.it":true,"bi.it":true,"bologna.it":true,"bo.it":true,"bolzano.it":true,"bozen.it":true,"balsan.it":true,"alto-adige.it":true,"altoadige.it":true,"suedtirol.it":true,"bz.it":true,"brescia.it":true,"bs.it":true,"brindisi.it":true,"br.it":true,"cagliari.it":true,"ca.it":true,"caltanissetta.it":true,"cl.it":true,"campobasso.it":true,"cb.it":true,"carboniaiglesias.it":true,"carbonia-iglesias.it":true,"iglesias-carbonia.it":true,"iglesiascarbonia.it":true,"ci.it":true,"caserta.it":true,"ce.it":true,"catania.it":true,"ct.it":true,"catanzaro.it":true,"cz.it":true,"chieti.it":true,"ch.it":true,"como.it":true,"co.it":true,"cosenza.it":true,"cs.it":true,"cremona.it":true,"cr.it":true,"crotone.it":true,"kr.it":true,"cuneo.it":true,"cn.it":true,"dell-ogliastra.it":true,"dellogliastra.it":true,"ogliastra.it":true,"og.it":true,"enna.it":true,"en.it":true,"ferrara.it":true,"fe.it":true,"fermo.it":true,"fm.it":true,"firenze.it":true,"florence.it":true,"fi.it":true,"foggia.it":true,"fg.it":true,"forli-cesena.it":true,"forlicesena.it":true,"cesena-forli.it":true,"cesenaforli.it":true,"fc.it":true,"frosinone.it":true,"fr.it":true,"genova.it":true,"genoa.it":true,"ge.it":true,"gorizia.it":true,"go.it":true,"grosseto.it":true,"gr.it":true,"imperia.it":true,"im.it":true,"isernia.it":true,"is.it":true,"laquila.it":true,"aquila.it":true,"aq.it":true,"la-spezia.it":true,"laspezia.it":true,"sp.it":true,"latina.it":true,"lt.it":true,"lecce.it":true,"le.it":true,"lecco.it":true,"lc.it":true,"livorno.it":true,"li.it":true,"lodi.it":true,"lo.it":true,"lucca.it":true,"lu.it":true,"macerata.it":true,"mc.it":true,"mantova.it":true,"mn.it":true,"massa-carrara.it":true,"massacarrara.it":true,"carrara-massa.it":true,"carraramassa.it":true,"ms.it":true,"matera.it":true,"mt.it":true,"medio-campidano.it":true,"mediocampidano.it":true,"campidano-medio.it":true,"campidanomedio.it":true,"vs.it":true,"messina.it":true,"me.it":true,"milano.it":true,"milan.it":true,"mi.it":true,"modena.it":true,"mo.it":true,"monza.it":true,"monza-brianza.it":true,"monzabrianza.it":true,"monzaebrianza.it":true,"monzaedellabrianza.it":true,"monza-e-della-brianza.it":true,"mb.it":true,"napoli.it":true,"naples.it":true,"na.it":true,"novara.it":true,"no.it":true,"nuoro.it":true,"nu.it":true,"oristano.it":true,"or.it":true,"padova.it":true,"padua.it":true,"pd.it":true,"palermo.it":true,"pa.it":true,"parma.it":true,"pr.it":true,"pavia.it":true,"pv.it":true,"perugia.it":true,"pg.it":true,"pescara.it":true,"pe.it":true,"pesaro-urbino.it":true,"pesarourbino.it":true,"urbino-pesaro.it":true,"urbinopesaro.it":true,"pu.it":true,"piacenza.it":true,"pc.it":true,"pisa.it":true,"pi.it":true,"pistoia.it":true,"pt.it":true,"pordenone.it":true,"pn.it":true,"potenza.it":true,"pz.it":true,"prato.it":true,"po.it":true,"ragusa.it":true,"rg.it":true,"ravenna.it":true,"ra.it":true,"reggio-calabria.it":true,"reggiocalabria.it":true,"rc.it":true,"reggio-emilia.it":true,"reggioemilia.it":true,"re.it":true,"rieti.it":true,"ri.it":true,"rimini.it":true,"rn.it":true,"roma.it":true,"rome.it":true,"rm.it":true,"rovigo.it":true,"ro.it":true,"salerno.it":true,"sa.it":true,"sassari.it":true,"ss.it":true,"savona.it":true,"sv.it":true,"siena.it":true,"si.it":true,"siracusa.it":true,"sr.it":true,"sondrio.it":true,"so.it":true,"taranto.it":true,"ta.it":true,"tempio-olbia.it":true,"tempioolbia.it":true,"olbia-tempio.it":true,"olbiatempio.it":true,"ot.it":true,"teramo.it":true,"te.it":true,"terni.it":true,"tr.it":true,"torino.it":true,"turin.it":true,"to.it":true,"trapani.it":true,"tp.it":true,"trento.it":true,"trentino.it":true,"tn.it":true,"treviso.it":true,"tv.it":true,"trieste.it":true,"ts.it":true,"udine.it":true,"ud.it":true,"varese.it":true,"va.it":true,"venezia.it":true,"venice.it":true,"ve.it":true,"verbania.it":true,"vb.it":true,"vercelli.it":true,"vc.it":true,"verona.it":true,"vr.it":true,"vibo-valentia.it":true,"vibovalentia.it":true,"vv.it":true,"vicenza.it":true,"vi.it":true,"viterbo.it":true,"vt.it":true,"je":true,"co.je":true,"org.je":true,"net.je":true,"sch.je":true,"gov.je":true,"*.jm":true,"jo":true,"com.jo":true,"org.jo":true,"net.jo":true,"edu.jo":true,"sch.jo":true,"gov.jo":true,"mil.jo":true,"name.jo":true,"jobs":true,"jp":true,"ac.jp":true,"ad.jp":true,"co.jp":true,"ed.jp":true,"go.jp":true,"gr.jp":true,"lg.jp":true,"ne.jp":true,"or.jp":true,"*.aichi.jp":true,"*.akita.jp":true,"*.aomori.jp":true,"*.chiba.jp":true,"*.ehime.jp":true,"*.fukui.jp":true,"*.fukuoka.jp":true,"*.fukushima.jp":true,"*.gifu.jp":true,"*.gunma.jp":true,"*.hiroshima.jp":true,"*.hokkaido.jp":true,"*.hyogo.jp":true,"*.ibaraki.jp":true,"*.ishikawa.jp":true,"*.iwate.jp":true,"*.kagawa.jp":true,"*.kagoshima.jp":true,"*.kanagawa.jp":true,"*.kawasaki.jp":true,"*.kitakyushu.jp":true,"*.kobe.jp":true,"*.kochi.jp":true,"*.kumamoto.jp":true,"*.kyoto.jp":true,"*.mie.jp":true,"*.miyagi.jp":true,"*.miyazaki.jp":true,"*.nagano.jp":true,"*.nagasaki.jp":true,"*.nagoya.jp":true,"*.nara.jp":true,"*.niigata.jp":true,"*.oita.jp":true,"*.okayama.jp":true,"*.okinawa.jp":true,"*.osaka.jp":true,"*.saga.jp":true,"*.saitama.jp":true,"*.sapporo.jp":true,"*.sendai.jp":true,"*.shiga.jp":true,"*.shimane.jp":true,"*.shizuoka.jp":true,"*.tochigi.jp":true,"*.tokushima.jp":true,"*.tokyo.jp":true,"*.tottori.jp":true,"*.toyama.jp":true,"*.wakayama.jp":true,"*.yamagata.jp":true,"*.yamaguchi.jp":true,"*.yamanashi.jp":true,"*.yokohama.jp":true,"metro.tokyo.jp":false,"pref.aichi.jp":false,"pref.akita.jp":false,"pref.aomori.jp":false,"pref.chiba.jp":false,"pref.ehime.jp":false,"pref.fukui.jp":false,"pref.fukuoka.jp":false,"pref.fukushima.jp":false,"pref.gifu.jp":false,"pref.gunma.jp":false,"pref.hiroshima.jp":false,"pref.hokkaido.jp":false,"pref.hyogo.jp":false,"pref.ibaraki.jp":false,"pref.ishikawa.jp":false,"pref.iwate.jp":false,"pref.kagawa.jp":false,"pref.kagoshima.jp":false,"pref.kanagawa.jp":false,"pref.kochi.jp":false,"pref.kumamoto.jp":false,"pref.kyoto.jp":false,"pref.mie.jp":false,"pref.miyagi.jp":false,"pref.miyazaki.jp":false,"pref.nagano.jp":false,"pref.nagasaki.jp":false,"pref.nara.jp":false,"pref.niigata.jp":false,"pref.oita.jp":false,"pref.okayama.jp":false,"pref.okinawa.jp":false,"pref.osaka.jp":false,"pref.saga.jp":false,"pref.saitama.jp":false,"pref.shiga.jp":false,"pref.shimane.jp":false,"pref.shizuoka.jp":false,"pref.tochigi.jp":false,"pref.tokushima.jp":false,"pref.tottori.jp":false,"pref.toyama.jp":false,"pref.wakayama.jp":false,"pref.yamagata.jp":false,"pref.yamaguchi.jp":false,"pref.yamanashi.jp":false,"city.chiba.jp":false,"city.fukuoka.jp":false,"city.hiroshima.jp":false,"city.kawasaki.jp":false,"city.kitakyushu.jp":false,"city.kobe.jp":false,"city.kyoto.jp":false,"city.nagoya.jp":false,"city.niigata.jp":false,"city.okayama.jp":false,"city.osaka.jp":false,"city.saitama.jp":false,"city.sapporo.jp":false,"city.sendai.jp":false,"city.shizuoka.jp":false,"city.yokohama.jp":false,"*.ke":true,"kg":true,"org.kg":true,"net.kg":true,"com.kg":true,"edu.kg":true,"gov.kg":true,"mil.kg":true,"*.kh":true,"ki":true,"edu.ki":true,"biz.ki":true,"net.ki":true,"org.ki":true,"gov.ki":true,"info.ki":true,"com.ki":true,"km":true,"org.km":true,"nom.km":true,"gov.km":true,"prd.km":true,"tm.km":true,"edu.km":true,"mil.km":true,"ass.km":true,"com.km":true,"coop.km":true,"asso.km":true,"presse.km":true,"medecin.km":true,"notaires.km":true,"pharmaciens.km":true,"veterinaire.km":true,"gouv.km":true,"kn":true,"net.kn":true,"org.kn":true,"edu.kn":true,"gov.kn":true,"com.kp":true,"edu.kp":true,"gov.kp":true,"org.kp":true,"rep.kp":true,"tra.kp":true,"kr":true,"ac.kr":true,"co.kr":true,"es.kr":true,"go.kr":true,"hs.kr":true,"kg.kr":true,"mil.kr":true,"ms.kr":true,"ne.kr":true,"or.kr":true,"pe.kr":true,"re.kr":true,"sc.kr":true,"busan.kr":true,"chungbuk.kr":true,"chungnam.kr":true,"daegu.kr":true,"daejeon.kr":true,"gangwon.kr":true,"gwangju.kr":true,"gyeongbuk.kr":true,"gyeonggi.kr":true,"gyeongnam.kr":true,"incheon.kr":true,"jeju.kr":true,"jeonbuk.kr":true,"jeonnam.kr":true,"seoul.kr":true,"ulsan.kr":true,"*.kw":true,"ky":true,"edu.ky":true,"gov.ky":true,"com.ky":true,"org.ky":true,"net.ky":true,"kz":true,"org.kz":true,"edu.kz":true,"net.kz":true,"gov.kz":true,"mil.kz":true,"com.kz":true,"la":true,"int.la":true,"net.la":true,"info.la":true,"edu.la":true,"gov.la":true,"per.la":true,"com.la":true,"org.la":true,"com.lb":true,"edu.lb":true,"gov.lb":true,"net.lb":true,"org.lb":true,"lc":true,"com.lc":true,"net.lc":true,"co.lc":true,"org.lc":true,"edu.lc":true,"gov.lc":true,"li":true,"lk":true,"gov.lk":true,"sch.lk":true,"net.lk":true,"int.lk":true,"com.lk":true,"org.lk":true,"edu.lk":true,"ngo.lk":true,"soc.lk":true,"web.lk":true,"ltd.lk":true,"assn.lk":true,"grp.lk":true,"hotel.lk":true,"com.lr":true,"edu.lr":true,"gov.lr":true,"org.lr":true,"net.lr":true,"ls":true,"co.ls":true,"org.ls":true,"lt":true,"gov.lt":true,"lu":true,"lv":true,"com.lv":true,"edu.lv":true,"gov.lv":true,"org.lv":true,"mil.lv":true,"id.lv":true,"net.lv":true,"asn.lv":true,"conf.lv":true,"ly":true,"com.ly":true,"net.ly":true,"gov.ly":true,"plc.ly":true,"edu.ly":true,"sch.ly":true,"med.ly":true,"org.ly":true,"id.ly":true,"ma":true,"co.ma":true,"net.ma":true,"gov.ma":true,"org.ma":true,"ac.ma":true,"press.ma":true,"mc":true,"tm.mc":true,"asso.mc":true,"md":true,"me":true,"co.me":true,"net.me":true,"org.me":true,"edu.me":true,"ac.me":true,"gov.me":true,"its.me":true,"priv.me":true,"mg":true,"org.mg":true,"nom.mg":true,"gov.mg":true,"prd.mg":true,"tm.mg":true,"edu.mg":true,"mil.mg":true,"com.mg":true,"mh":true,"mil":true,"mk":true,"com.mk":true,"org.mk":true,"net.mk":true,"edu.mk":true,"gov.mk":true,"inf.mk":true,"name.mk":true,"ml":true,"com.ml":true,"edu.ml":true,"gouv.ml":true,"gov.ml":true,"net.ml":true,"org.ml":true,"presse.ml":true,"*.mm":true,"mn":true,"gov.mn":true,"edu.mn":true,"org.mn":true,"mo":true,"com.mo":true,"net.mo":true,"org.mo":true,"edu.mo":true,"gov.mo":true,"mobi":true,"mp":true,"mq":true,"mr":true,"gov.mr":true,"ms":true,"*.mt":true,"mu":true,"com.mu":true,"net.mu":true,"org.mu":true,"gov.mu":true,"ac.mu":true,"co.mu":true,"or.mu":true,"museum":true,"academy.museum":true,"agriculture.museum":true,"air.museum":true,"airguard.museum":true,"alabama.museum":true,"alaska.museum":true,"amber.museum":true,"ambulance.museum":true,"american.museum":true,"americana.museum":true,"americanantiques.museum":true,"americanart.museum":true,"amsterdam.museum":true,"and.museum":true,"annefrank.museum":true,"anthro.museum":true,"anthropology.museum":true,"antiques.museum":true,"aquarium.museum":true,"arboretum.museum":true,"archaeological.museum":true,"archaeology.museum":true,"architecture.museum":true,"art.museum":true,"artanddesign.museum":true,"artcenter.museum":true,"artdeco.museum":true,"arteducation.museum":true,"artgallery.museum":true,"arts.museum":true,"artsandcrafts.museum":true,"asmatart.museum":true,"assassination.museum":true,"assisi.museum":true,"association.museum":true,"astronomy.museum":true,"atlanta.museum":true,"austin.museum":true,"australia.museum":true,"automotive.museum":true,"aviation.museum":true,"axis.museum":true,"badajoz.museum":true,"baghdad.museum":true,"bahn.museum":true,"bale.museum":true,"baltimore.museum":true,"barcelona.museum":true,"baseball.museum":true,"basel.museum":true,"baths.museum":true,"bauern.museum":true,"beauxarts.museum":true,"beeldengeluid.museum":true,"bellevue.museum":true,"bergbau.museum":true,"berkeley.museum":true,"berlin.museum":true,"bern.museum":true,"bible.museum":true,"bilbao.museum":true,"bill.museum":true,"birdart.museum":true,"birthplace.museum":true,"bonn.museum":true,"boston.museum":true,"botanical.museum":true,"botanicalgarden.museum":true,"botanicgarden.museum":true,"botany.museum":true,"brandywinevalley.museum":true,"brasil.museum":true,"bristol.museum":true,"british.museum":true,"britishcolumbia.museum":true,"broadcast.museum":true,"brunel.museum":true,"brussel.museum":true,"brussels.museum":true,"bruxelles.museum":true,"building.museum":true,"burghof.museum":true,"bus.museum":true,"bushey.museum":true,"cadaques.museum":true,"california.museum":true,"cambridge.museum":true,"can.museum":true,"canada.museum":true,"capebreton.museum":true,"carrier.museum":true,"cartoonart.museum":true,"casadelamoneda.museum":true,"castle.museum":true,"castres.museum":true,"celtic.museum":true,"center.museum":true,"chattanooga.museum":true,"cheltenham.museum":true,"chesapeakebay.museum":true,"chicago.museum":true,"children.museum":true,"childrens.museum":true,"childrensgarden.museum":true,"chiropractic.museum":true,"chocolate.museum":true,"christiansburg.museum":true,"cincinnati.museum":true,"cinema.museum":true,"circus.museum":true,"civilisation.museum":true,"civilization.museum":true,"civilwar.museum":true,"clinton.museum":true,"clock.museum":true,"coal.museum":true,"coastaldefence.museum":true,"cody.museum":true,"coldwar.museum":true,"collection.museum":true,"colonialwilliamsburg.museum":true,"coloradoplateau.museum":true,"columbia.museum":true,"columbus.museum":true,"communication.museum":true,"communications.museum":true,"community.museum":true,"computer.museum":true,"computerhistory.museum":true,"xn--comunicaes-v6a2o.museum":true,"contemporary.museum":true,"contemporaryart.museum":true,"convent.museum":true,"copenhagen.museum":true,"corporation.museum":true,"xn--correios-e-telecomunicaes-ghc29a.museum":true,"corvette.museum":true,"costume.museum":true,"countryestate.museum":true,"county.museum":true,"crafts.museum":true,"cranbrook.museum":true,"creation.museum":true,"cultural.museum":true,"culturalcenter.museum":true,"culture.museum":true,"cyber.museum":true,"cymru.museum":true,"dali.museum":true,"dallas.museum":true,"database.museum":true,"ddr.museum":true,"decorativearts.museum":true,"delaware.museum":true,"delmenhorst.museum":true,"denmark.museum":true,"depot.museum":true,"design.museum":true,"detroit.museum":true,"dinosaur.museum":true,"discovery.museum":true,"dolls.museum":true,"donostia.museum":true,"durham.museum":true,"eastafrica.museum":true,"eastcoast.museum":true,"education.museum":true,"educational.museum":true,"egyptian.museum":true,"eisenbahn.museum":true,"elburg.museum":true,"elvendrell.museum":true,"embroidery.museum":true,"encyclopedic.museum":true,"england.museum":true,"entomology.museum":true,"environment.museum":true,"environmentalconservation.museum":true,"epilepsy.museum":true,"essex.museum":true,"estate.museum":true,"ethnology.museum":true,"exeter.museum":true,"exhibition.museum":true,"family.museum":true,"farm.museum":true,"farmequipment.museum":true,"farmers.museum":true,"farmstead.museum":true,"field.museum":true,"figueres.museum":true,"filatelia.museum":true,"film.museum":true,"fineart.museum":true,"finearts.museum":true,"finland.museum":true,"flanders.museum":true,"florida.museum":true,"force.museum":true,"fortmissoula.museum":true,"fortworth.museum":true,"foundation.museum":true,"francaise.museum":true,"frankfurt.museum":true,"franziskaner.museum":true,"freemasonry.museum":true,"freiburg.museum":true,"fribourg.museum":true,"frog.museum":true,"fundacio.museum":true,"furniture.museum":true,"gallery.museum":true,"garden.museum":true,"gateway.museum":true,"geelvinck.museum":true,"gemological.museum":true,"geology.museum":true,"georgia.museum":true,"giessen.museum":true,"glas.museum":true,"glass.museum":true,"gorge.museum":true,"grandrapids.museum":true,"graz.museum":true,"guernsey.museum":true,"halloffame.museum":true,"hamburg.museum":true,"handson.museum":true,"harvestcelebration.museum":true,"hawaii.museum":true,"health.museum":true,"heimatunduhren.museum":true,"hellas.museum":true,"helsinki.museum":true,"hembygdsforbund.museum":true,"heritage.museum":true,"histoire.museum":true,"historical.museum":true,"historicalsociety.museum":true,"historichouses.museum":true,"historisch.museum":true,"historisches.museum":true,"history.museum":true,"historyofscience.museum":true,"horology.museum":true,"house.museum":true,"humanities.museum":true,"illustration.museum":true,"imageandsound.museum":true,"indian.museum":true,"indiana.museum":true,"indianapolis.museum":true,"indianmarket.museum":true,"intelligence.museum":true,"interactive.museum":true,"iraq.museum":true,"iron.museum":true,"isleofman.museum":true,"jamison.museum":true,"jefferson.museum":true,"jerusalem.museum":true,"jewelry.museum":true,"jewish.museum":true,"jewishart.museum":true,"jfk.museum":true,"journalism.museum":true,"judaica.museum":true,"judygarland.museum":true,"juedisches.museum":true,"juif.museum":true,"karate.museum":true,"karikatur.museum":true,"kids.museum":true,"koebenhavn.museum":true,"koeln.museum":true,"kunst.museum":true,"kunstsammlung.museum":true,"kunstunddesign.museum":true,"labor.museum":true,"labour.museum":true,"lajolla.museum":true,"lancashire.museum":true,"landes.museum":true,"lans.museum":true,"xn--lns-qla.museum":true,"larsson.museum":true,"lewismiller.museum":true,"lincoln.museum":true,"linz.museum":true,"living.museum":true,"livinghistory.museum":true,"localhistory.museum":true,"london.museum":true,"losangeles.museum":true,"louvre.museum":true,"loyalist.museum":true,"lucerne.museum":true,"luxembourg.museum":true,"luzern.museum":true,"mad.museum":true,"madrid.museum":true,"mallorca.museum":true,"manchester.museum":true,"mansion.museum":true,"mansions.museum":true,"manx.museum":true,"marburg.museum":true,"maritime.museum":true,"maritimo.museum":true,"maryland.museum":true,"marylhurst.museum":true,"media.museum":true,"medical.museum":true,"medizinhistorisches.museum":true,"meeres.museum":true,"memorial.museum":true,"mesaverde.museum":true,"michigan.museum":true,"midatlantic.museum":true,"military.museum":true,"mill.museum":true,"miners.museum":true,"mining.museum":true,"minnesota.museum":true,"missile.museum":true,"missoula.museum":true,"modern.museum":true,"moma.museum":true,"money.museum":true,"monmouth.museum":true,"monticello.museum":true,"montreal.museum":true,"moscow.museum":true,"motorcycle.museum":true,"muenchen.museum":true,"muenster.museum":true,"mulhouse.museum":true,"muncie.museum":true,"museet.museum":true,"museumcenter.museum":true,"museumvereniging.museum":true,"music.museum":true,"national.museum":true,"nationalfirearms.museum":true,"nationalheritage.museum":true,"nativeamerican.museum":true,"naturalhistory.museum":true,"naturalhistorymuseum.museum":true,"naturalsciences.museum":true,"nature.museum":true,"naturhistorisches.museum":true,"natuurwetenschappen.museum":true,"naumburg.museum":true,"naval.museum":true,"nebraska.museum":true,"neues.museum":true,"newhampshire.museum":true,"newjersey.museum":true,"newmexico.museum":true,"newport.museum":true,"newspaper.museum":true,"newyork.museum":true,"niepce.museum":true,"norfolk.museum":true,"north.museum":true,"nrw.museum":true,"nuernberg.museum":true,"nuremberg.museum":true,"nyc.museum":true,"nyny.museum":true,"oceanographic.museum":true,"oceanographique.museum":true,"omaha.museum":true,"online.museum":true,"ontario.museum":true,"openair.museum":true,"oregon.museum":true,"oregontrail.museum":true,"otago.museum":true,"oxford.museum":true,"pacific.museum":true,"paderborn.museum":true,"palace.museum":true,"paleo.museum":true,"palmsprings.museum":true,"panama.museum":true,"paris.museum":true,"pasadena.museum":true,"pharmacy.museum":true,"philadelphia.museum":true,"philadelphiaarea.museum":true,"philately.museum":true,"phoenix.museum":true,"photography.museum":true,"pilots.museum":true,"pittsburgh.museum":true,"planetarium.museum":true,"plantation.museum":true,"plants.museum":true,"plaza.museum":true,"portal.museum":true,"portland.museum":true,"portlligat.museum":true,"posts-and-telecommunications.museum":true,"preservation.museum":true,"presidio.museum":true,"press.museum":true,"project.museum":true,"public.museum":true,"pubol.museum":true,"quebec.museum":true,"railroad.museum":true,"railway.museum":true,"research.museum":true,"resistance.museum":true,"riodejaneiro.museum":true,"rochester.museum":true,"rockart.museum":true,"roma.museum":true,"russia.museum":true,"saintlouis.museum":true,"salem.museum":true,"salvadordali.museum":true,"salzburg.museum":true,"sandiego.museum":true,"sanfrancisco.museum":true,"santabarbara.museum":true,"santacruz.museum":true,"santafe.museum":true,"saskatchewan.museum":true,"satx.museum":true,"savannahga.museum":true,"schlesisches.museum":true,"schoenbrunn.museum":true,"schokoladen.museum":true,"school.museum":true,"schweiz.museum":true,"science.museum":true,"scienceandhistory.museum":true,"scienceandindustry.museum":true,"sciencecenter.museum":true,"sciencecenters.museum":true,"science-fiction.museum":true,"sciencehistory.museum":true,"sciences.museum":true,"sciencesnaturelles.museum":true,"scotland.museum":true,"seaport.museum":true,"settlement.museum":true,"settlers.museum":true,"shell.museum":true,"sherbrooke.museum":true,"sibenik.museum":true,"silk.museum":true,"ski.museum":true,"skole.museum":true,"society.museum":true,"sologne.museum":true,"soundandvision.museum":true,"southcarolina.museum":true,"southwest.museum":true,"space.museum":true,"spy.museum":true,"square.museum":true,"stadt.museum":true,"stalbans.museum":true,"starnberg.museum":true,"state.museum":true,"stateofdelaware.museum":true,"station.museum":true,"steam.museum":true,"steiermark.museum":true,"stjohn.museum":true,"stockholm.museum":true,"stpetersburg.museum":true,"stuttgart.museum":true,"suisse.museum":true,"surgeonshall.museum":true,"surrey.museum":true,"svizzera.museum":true,"sweden.museum":true,"sydney.museum":true,"tank.museum":true,"tcm.museum":true,"technology.museum":true,"telekommunikation.museum":true,"television.museum":true,"texas.museum":true,"textile.museum":true,"theater.museum":true,"time.museum":true,"timekeeping.museum":true,"topology.museum":true,"torino.museum":true,"touch.museum":true,"town.museum":true,"transport.museum":true,"tree.museum":true,"trolley.museum":true,"trust.museum":true,"trustee.museum":true,"uhren.museum":true,"ulm.museum":true,"undersea.museum":true,"university.museum":true,"usa.museum":true,"usantiques.museum":true,"usarts.museum":true,"uscountryestate.museum":true,"usculture.museum":true,"usdecorativearts.museum":true,"usgarden.museum":true,"ushistory.museum":true,"ushuaia.museum":true,"uslivinghistory.museum":true,"utah.museum":true,"uvic.museum":true,"valley.museum":true,"vantaa.museum":true,"versailles.museum":true,"viking.museum":true,"village.museum":true,"virginia.museum":true,"virtual.museum":true,"virtuel.museum":true,"vlaanderen.museum":true,"volkenkunde.museum":true,"wales.museum":true,"wallonie.museum":true,"war.museum":true,"washingtondc.museum":true,"watchandclock.museum":true,"watch-and-clock.museum":true,"western.museum":true,"westfalen.museum":true,"whaling.museum":true,"wildlife.museum":true,"williamsburg.museum":true,"windmill.museum":true,"workshop.museum":true,"york.museum":true,"yorkshire.museum":true,"yosemite.museum":true,"youth.museum":true,"zoological.museum":true,"zoology.museum":true,"xn--9dbhblg6di.museum":true,"xn--h1aegh.museum":true,"mv":true,"aero.mv":true,"biz.mv":true,"com.mv":true,"coop.mv":true,"edu.mv":true,"gov.mv":true,"info.mv":true,"int.mv":true,"mil.mv":true,"museum.mv":true,"name.mv":true,"net.mv":true,"org.mv":true,"pro.mv":true,"mw":true,"ac.mw":true,"biz.mw":true,"co.mw":true,"com.mw":true,"coop.mw":true,"edu.mw":true,"gov.mw":true,"int.mw":true,"museum.mw":true,"net.mw":true,"org.mw":true,"mx":true,"com.mx":true,"org.mx":true,"gob.mx":true,"edu.mx":true,"net.mx":true,"my":true,"com.my":true,"net.my":true,"org.my":true,"gov.my":true,"edu.my":true,"mil.my":true,"name.my":true,"*.mz":true,"na":true,"info.na":true,"pro.na":true,"name.na":true,"school.na":true,"or.na":true,"dr.na":true,"us.na":true,"mx.na":true,"ca.na":true,"in.na":true,"cc.na":true,"tv.na":true,"ws.na":true,"mobi.na":true,"co.na":true,"com.na":true,"org.na":true,"name":true,"nc":true,"asso.nc":true,"ne":true,"net":true,"nf":true,"com.nf":true,"net.nf":true,"per.nf":true,"rec.nf":true,"web.nf":true,"arts.nf":true,"firm.nf":true,"info.nf":true,"other.nf":true,"store.nf":true,"ac.ng":true,"com.ng":true,"edu.ng":true,"gov.ng":true,"net.ng":true,"org.ng":true,"*.ni":true,"nl":true,"bv.nl":true,"no":true,"fhs.no":true,"vgs.no":true,"fylkesbibl.no":true,"folkebibl.no":true,"museum.no":true,"idrett.no":true,"priv.no":true,"mil.no":true,"stat.no":true,"dep.no":true,"kommune.no":true,"herad.no":true,"aa.no":true,"ah.no":true,"bu.no":true,"fm.no":true,"hl.no":true,"hm.no":true,"jan-mayen.no":true,"mr.no":true,"nl.no":true,"nt.no":true,"of.no":true,"ol.no":true,"oslo.no":true,"rl.no":true,"sf.no":true,"st.no":true,"svalbard.no":true,"tm.no":true,"tr.no":true,"va.no":true,"vf.no":true,"gs.aa.no":true,"gs.ah.no":true,"gs.bu.no":true,"gs.fm.no":true,"gs.hl.no":true,"gs.hm.no":true,"gs.jan-mayen.no":true,"gs.mr.no":true,"gs.nl.no":true,"gs.nt.no":true,"gs.of.no":true,"gs.ol.no":true,"gs.oslo.no":true,"gs.rl.no":true,"gs.sf.no":true,"gs.st.no":true,"gs.svalbard.no":true,"gs.tm.no":true,"gs.tr.no":true,"gs.va.no":true,"gs.vf.no":true,"akrehamn.no":true,"xn--krehamn-dxa.no":true,"algard.no":true,"xn--lgrd-poac.no":true,"arna.no":true,"brumunddal.no":true,"bryne.no":true,"bronnoysund.no":true,"xn--brnnysund-m8ac.no":true,"drobak.no":true,"xn--drbak-wua.no":true,"egersund.no":true,"fetsund.no":true,"floro.no":true,"xn--flor-jra.no":true,"fredrikstad.no":true,"hokksund.no":true,"honefoss.no":true,"xn--hnefoss-q1a.no":true,"jessheim.no":true,"jorpeland.no":true,"xn--jrpeland-54a.no":true,"kirkenes.no":true,"kopervik.no":true,"krokstadelva.no":true,"langevag.no":true,"xn--langevg-jxa.no":true,"leirvik.no":true,"mjondalen.no":true,"xn--mjndalen-64a.no":true,"mo-i-rana.no":true,"mosjoen.no":true,"xn--mosjen-eya.no":true,"nesoddtangen.no":true,"orkanger.no":true,"osoyro.no":true,"xn--osyro-wua.no":true,"raholt.no":true,"xn--rholt-mra.no":true,"sandnessjoen.no":true,"xn--sandnessjen-ogb.no":true,"skedsmokorset.no":true,"slattum.no":true,"spjelkavik.no":true,"stathelle.no":true,"stavern.no":true,"stjordalshalsen.no":true,"xn--stjrdalshalsen-sqb.no":true,"tananger.no":true,"tranby.no":true,"vossevangen.no":true,"afjord.no":true,"xn--fjord-lra.no":true,"agdenes.no":true,"al.no":true,"xn--l-1fa.no":true,"alesund.no":true,"xn--lesund-hua.no":true,"alstahaug.no":true,"alta.no":true,"xn--lt-liac.no":true,"alaheadju.no":true,"xn--laheadju-7ya.no":true,"alvdal.no":true,"amli.no":true,"xn--mli-tla.no":true,"amot.no":true,"xn--mot-tla.no":true,"andebu.no":true,"andoy.no":true,"xn--andy-ira.no":true,"andasuolo.no":true,"ardal.no":true,"xn--rdal-poa.no":true,"aremark.no":true,"arendal.no":true,"xn--s-1fa.no":true,"aseral.no":true,"xn--seral-lra.no":true,"asker.no":true,"askim.no":true,"askvoll.no":true,"askoy.no":true,"xn--asky-ira.no":true,"asnes.no":true,"xn--snes-poa.no":true,"audnedaln.no":true,"aukra.no":true,"aure.no":true,"aurland.no":true,"aurskog-holand.no":true,"xn--aurskog-hland-jnb.no":true,"austevoll.no":true,"austrheim.no":true,"averoy.no":true,"xn--avery-yua.no":true,"balestrand.no":true,"ballangen.no":true,"balat.no":true,"xn--blt-elab.no":true,"balsfjord.no":true,"bahccavuotna.no":true,"xn--bhccavuotna-k7a.no":true,"bamble.no":true,"bardu.no":true,"beardu.no":true,"beiarn.no":true,"bajddar.no":true,"xn--bjddar-pta.no":true,"baidar.no":true,"xn--bidr-5nac.no":true,"berg.no":true,"bergen.no":true,"berlevag.no":true,"xn--berlevg-jxa.no":true,"bearalvahki.no":true,"xn--bearalvhki-y4a.no":true,"bindal.no":true,"birkenes.no":true,"bjarkoy.no":true,"xn--bjarky-fya.no":true,"bjerkreim.no":true,"bjugn.no":true,"bodo.no":true,"xn--bod-2na.no":true,"badaddja.no":true,"xn--bdddj-mrabd.no":true,"budejju.no":true,"bokn.no":true,"bremanger.no":true,"bronnoy.no":true,"xn--brnny-wuac.no":true,"bygland.no":true,"bykle.no":true,"barum.no":true,"xn--brum-voa.no":true,"bo.telemark.no":true,"xn--b-5ga.telemark.no":true,"bo.nordland.no":true,"xn--b-5ga.nordland.no":true,"bievat.no":true,"xn--bievt-0qa.no":true,"bomlo.no":true,"xn--bmlo-gra.no":true,"batsfjord.no":true,"xn--btsfjord-9za.no":true,"bahcavuotna.no":true,"xn--bhcavuotna-s4a.no":true,"dovre.no":true,"drammen.no":true,"drangedal.no":true,"dyroy.no":true,"xn--dyry-ira.no":true,"donna.no":true,"xn--dnna-gra.no":true,"eid.no":true,"eidfjord.no":true,"eidsberg.no":true,"eidskog.no":true,"eidsvoll.no":true,"eigersund.no":true,"elverum.no":true,"enebakk.no":true,"engerdal.no":true,"etne.no":true,"etnedal.no":true,"evenes.no":true,"evenassi.no":true,"xn--eveni-0qa01ga.no":true,"evje-og-hornnes.no":true,"farsund.no":true,"fauske.no":true,"fuossko.no":true,"fuoisku.no":true,"fedje.no":true,"fet.no":true,"finnoy.no":true,"xn--finny-yua.no":true,"fitjar.no":true,"fjaler.no":true,"fjell.no":true,"flakstad.no":true,"flatanger.no":true,"flekkefjord.no":true,"flesberg.no":true,"flora.no":true,"fla.no":true,"xn--fl-zia.no":true,"folldal.no":true,"forsand.no":true,"fosnes.no":true,"frei.no":true,"frogn.no":true,"froland.no":true,"frosta.no":true,"frana.no":true,"xn--frna-woa.no":true,"froya.no":true,"xn--frya-hra.no":true,"fusa.no":true,"fyresdal.no":true,"forde.no":true,"xn--frde-gra.no":true,"gamvik.no":true,"gangaviika.no":true,"xn--ggaviika-8ya47h.no":true,"gaular.no":true,"gausdal.no":true,"gildeskal.no":true,"xn--gildeskl-g0a.no":true,"giske.no":true,"gjemnes.no":true,"gjerdrum.no":true,"gjerstad.no":true,"gjesdal.no":true,"gjovik.no":true,"xn--gjvik-wua.no":true,"gloppen.no":true,"gol.no":true,"gran.no":true,"grane.no":true,"granvin.no":true,"gratangen.no":true,"grimstad.no":true,"grong.no":true,"kraanghke.no":true,"xn--kranghke-b0a.no":true,"grue.no":true,"gulen.no":true,"hadsel.no":true,"halden.no":true,"halsa.no":true,"hamar.no":true,"hamaroy.no":true,"habmer.no":true,"xn--hbmer-xqa.no":true,"hapmir.no":true,"xn--hpmir-xqa.no":true,"hammerfest.no":true,"hammarfeasta.no":true,"xn--hmmrfeasta-s4ac.no":true,"haram.no":true,"hareid.no":true,"harstad.no":true,"hasvik.no":true,"aknoluokta.no":true,"xn--koluokta-7ya57h.no":true,"hattfjelldal.no":true,"aarborte.no":true,"haugesund.no":true,"hemne.no":true,"hemnes.no":true,"hemsedal.no":true,"heroy.more-og-romsdal.no":true,"xn--hery-ira.xn--mre-og-romsdal-qqb.no":true,"heroy.nordland.no":true,"xn--hery-ira.nordland.no":true,"hitra.no":true,"hjartdal.no":true,"hjelmeland.no":true,"hobol.no":true,"xn--hobl-ira.no":true,"hof.no":true,"hol.no":true,"hole.no":true,"holmestrand.no":true,"holtalen.no":true,"xn--holtlen-hxa.no":true,"hornindal.no":true,"horten.no":true,"hurdal.no":true,"hurum.no":true,"hvaler.no":true,"hyllestad.no":true,"hagebostad.no":true,"xn--hgebostad-g3a.no":true,"hoyanger.no":true,"xn--hyanger-q1a.no":true,"hoylandet.no":true,"xn--hylandet-54a.no":true,"ha.no":true,"xn--h-2fa.no":true,"ibestad.no":true,"inderoy.no":true,"xn--indery-fya.no":true,"iveland.no":true,"jevnaker.no":true,"jondal.no":true,"jolster.no":true,"xn--jlster-bya.no":true,"karasjok.no":true,"karasjohka.no":true,"xn--krjohka-hwab49j.no":true,"karlsoy.no":true,"galsa.no":true,"xn--gls-elac.no":true,"karmoy.no":true,"xn--karmy-yua.no":true,"kautokeino.no":true,"guovdageaidnu.no":true,"klepp.no":true,"klabu.no":true,"xn--klbu-woa.no":true,"kongsberg.no":true,"kongsvinger.no":true,"kragero.no":true,"xn--krager-gya.no":true,"kristiansand.no":true,"kristiansund.no":true,"krodsherad.no":true,"xn--krdsherad-m8a.no":true,"kvalsund.no":true,"rahkkeravju.no":true,"xn--rhkkervju-01af.no":true,"kvam.no":true,"kvinesdal.no":true,"kvinnherad.no":true,"kviteseid.no":true,"kvitsoy.no":true,"xn--kvitsy-fya.no":true,"kvafjord.no":true,"xn--kvfjord-nxa.no":true,"giehtavuoatna.no":true,"kvanangen.no":true,"xn--kvnangen-k0a.no":true,"navuotna.no":true,"xn--nvuotna-hwa.no":true,"kafjord.no":true,"xn--kfjord-iua.no":true,"gaivuotna.no":true,"xn--givuotna-8ya.no":true,"larvik.no":true,"lavangen.no":true,"lavagis.no":true,"loabat.no":true,"xn--loabt-0qa.no":true,"lebesby.no":true,"davvesiida.no":true,"leikanger.no":true,"leirfjord.no":true,"leka.no":true,"leksvik.no":true,"lenvik.no":true,"leangaviika.no":true,"xn--leagaviika-52b.no":true,"lesja.no":true,"levanger.no":true,"lier.no":true,"lierne.no":true,"lillehammer.no":true,"lillesand.no":true,"lindesnes.no":true,"lindas.no":true,"xn--linds-pra.no":true,"lom.no":true,"loppa.no":true,"lahppi.no":true,"xn--lhppi-xqa.no":true,"lund.no":true,"lunner.no":true,"luroy.no":true,"xn--lury-ira.no":true,"luster.no":true,"lyngdal.no":true,"lyngen.no":true,"ivgu.no":true,"lardal.no":true,"lerdal.no":true,"xn--lrdal-sra.no":true,"lodingen.no":true,"xn--ldingen-q1a.no":true,"lorenskog.no":true,"xn--lrenskog-54a.no":true,"loten.no":true,"xn--lten-gra.no":true,"malvik.no":true,"masoy.no":true,"xn--msy-ula0h.no":true,"muosat.no":true,"xn--muost-0qa.no":true,"mandal.no":true,"marker.no":true,"marnardal.no":true,"masfjorden.no":true,"meland.no":true,"meldal.no":true,"melhus.no":true,"meloy.no":true,"xn--mely-ira.no":true,"meraker.no":true,"xn--merker-kua.no":true,"moareke.no":true,"xn--moreke-jua.no":true,"midsund.no":true,"midtre-gauldal.no":true,"modalen.no":true,"modum.no":true,"molde.no":true,"moskenes.no":true,"moss.no":true,"mosvik.no":true,"malselv.no":true,"xn--mlselv-iua.no":true,"malatvuopmi.no":true,"xn--mlatvuopmi-s4a.no":true,"namdalseid.no":true,"aejrie.no":true,"namsos.no":true,"namsskogan.no":true,"naamesjevuemie.no":true,"xn--nmesjevuemie-tcba.no":true,"laakesvuemie.no":true,"nannestad.no":true,"narvik.no":true,"narviika.no":true,"naustdal.no":true,"nedre-eiker.no":true,"nes.akershus.no":true,"nes.buskerud.no":true,"nesna.no":true,"nesodden.no":true,"nesseby.no":true,"unjarga.no":true,"xn--unjrga-rta.no":true,"nesset.no":true,"nissedal.no":true,"nittedal.no":true,"nord-aurdal.no":true,"nord-fron.no":true,"nord-odal.no":true,"norddal.no":true,"nordkapp.no":true,"davvenjarga.no":true,"xn--davvenjrga-y4a.no":true,"nordre-land.no":true,"nordreisa.no":true,"raisa.no":true,"xn--risa-5na.no":true,"nore-og-uvdal.no":true,"notodden.no":true,"naroy.no":true,"xn--nry-yla5g.no":true,"notteroy.no":true,"xn--nttery-byae.no":true,"odda.no":true,"oksnes.no":true,"xn--ksnes-uua.no":true,"oppdal.no":true,"oppegard.no":true,"xn--oppegrd-ixa.no":true,"orkdal.no":true,"orland.no":true,"xn--rland-uua.no":true,"orskog.no":true,"xn--rskog-uua.no":true,"orsta.no":true,"xn--rsta-fra.no":true,"os.hedmark.no":true,"os.hordaland.no":true,"osen.no":true,"osteroy.no":true,"xn--ostery-fya.no":true,"ostre-toten.no":true,"xn--stre-toten-zcb.no":true,"overhalla.no":true,"ovre-eiker.no":true,"xn--vre-eiker-k8a.no":true,"oyer.no":true,"xn--yer-zna.no":true,"oygarden.no":true,"xn--ygarden-p1a.no":true,"oystre-slidre.no":true,"xn--ystre-slidre-ujb.no":true,"porsanger.no":true,"porsangu.no":true,"xn--porsgu-sta26f.no":true,"porsgrunn.no":true,"radoy.no":true,"xn--rady-ira.no":true,"rakkestad.no":true,"rana.no":true,"ruovat.no":true,"randaberg.no":true,"rauma.no":true,"rendalen.no":true,"rennebu.no":true,"rennesoy.no":true,"xn--rennesy-v1a.no":true,"rindal.no":true,"ringebu.no":true,"ringerike.no":true,"ringsaker.no":true,"rissa.no":true,"risor.no":true,"xn--risr-ira.no":true,"roan.no":true,"rollag.no":true,"rygge.no":true,"ralingen.no":true,"xn--rlingen-mxa.no":true,"rodoy.no":true,"xn--rdy-0nab.no":true,"romskog.no":true,"xn--rmskog-bya.no":true,"roros.no":true,"xn--rros-gra.no":true,"rost.no":true,"xn--rst-0na.no":true,"royken.no":true,"xn--ryken-vua.no":true,"royrvik.no":true,"xn--ryrvik-bya.no":true,"rade.no":true,"xn--rde-ula.no":true,"salangen.no":true,"siellak.no":true,"saltdal.no":true,"salat.no":true,"xn--slt-elab.no":true,"xn--slat-5na.no":true,"samnanger.no":true,"sande.more-og-romsdal.no":true,"sande.xn--mre-og-romsdal-qqb.no":true,"sande.vestfold.no":true,"sandefjord.no":true,"sandnes.no":true,"sandoy.no":true,"xn--sandy-yua.no":true,"sarpsborg.no":true,"sauda.no":true,"sauherad.no":true,"sel.no":true,"selbu.no":true,"selje.no":true,"seljord.no":true,"sigdal.no":true,"siljan.no":true,"sirdal.no":true,"skaun.no":true,"skedsmo.no":true,"ski.no":true,"skien.no":true,"skiptvet.no":true,"skjervoy.no":true,"xn--skjervy-v1a.no":true,"skierva.no":true,"xn--skierv-uta.no":true,"skjak.no":true,"xn--skjk-soa.no":true,"skodje.no":true,"skanland.no":true,"xn--sknland-fxa.no":true,"skanit.no":true,"xn--sknit-yqa.no":true,"smola.no":true,"xn--smla-hra.no":true,"snillfjord.no":true,"snasa.no":true,"xn--snsa-roa.no":true,"snoasa.no":true,"snaase.no":true,"xn--snase-nra.no":true,"sogndal.no":true,"sokndal.no":true,"sola.no":true,"solund.no":true,"songdalen.no":true,"sortland.no":true,"spydeberg.no":true,"stange.no":true,"stavanger.no":true,"steigen.no":true,"steinkjer.no":true,"stjordal.no":true,"xn--stjrdal-s1a.no":true,"stokke.no":true,"stor-elvdal.no":true,"stord.no":true,"stordal.no":true,"storfjord.no":true,"omasvuotna.no":true,"strand.no":true,"stranda.no":true,"stryn.no":true,"sula.no":true,"suldal.no":true,"sund.no":true,"sunndal.no":true,"surnadal.no":true,"sveio.no":true,"svelvik.no":true,"sykkylven.no":true,"sogne.no":true,"xn--sgne-gra.no":true,"somna.no":true,"xn--smna-gra.no":true,"sondre-land.no":true,"xn--sndre-land-0cb.no":true,"sor-aurdal.no":true,"xn--sr-aurdal-l8a.no":true,"sor-fron.no":true,"xn--sr-fron-q1a.no":true,"sor-odal.no":true,"xn--sr-odal-q1a.no":true,"sor-varanger.no":true,"xn--sr-varanger-ggb.no":true,"matta-varjjat.no":true,"xn--mtta-vrjjat-k7af.no":true,"sorfold.no":true,"xn--srfold-bya.no":true,"sorreisa.no":true,"xn--srreisa-q1a.no":true,"sorum.no":true,"xn--srum-gra.no":true,"tana.no":true,"deatnu.no":true,"time.no":true,"tingvoll.no":true,"tinn.no":true,"tjeldsund.no":true,"dielddanuorri.no":true,"tjome.no":true,"xn--tjme-hra.no":true,"tokke.no":true,"tolga.no":true,"torsken.no":true,"tranoy.no":true,"xn--trany-yua.no":true,"tromso.no":true,"xn--troms-zua.no":true,"tromsa.no":true,"romsa.no":true,"trondheim.no":true,"troandin.no":true,"trysil.no":true,"trana.no":true,"xn--trna-woa.no":true,"trogstad.no":true,"xn--trgstad-r1a.no":true,"tvedestrand.no":true,"tydal.no":true,"tynset.no":true,"tysfjord.no":true,"divtasvuodna.no":true,"divttasvuotna.no":true,"tysnes.no":true,"tysvar.no":true,"xn--tysvr-vra.no":true,"tonsberg.no":true,"xn--tnsberg-q1a.no":true,"ullensaker.no":true,"ullensvang.no":true,"ulvik.no":true,"utsira.no":true,"vadso.no":true,"xn--vads-jra.no":true,"cahcesuolo.no":true,"xn--hcesuolo-7ya35b.no":true,"vaksdal.no":true,"valle.no":true,"vang.no":true,"vanylven.no":true,"vardo.no":true,"xn--vard-jra.no":true,"varggat.no":true,"xn--vrggt-xqad.no":true,"vefsn.no":true,"vaapste.no":true,"vega.no":true,"vegarshei.no":true,"xn--vegrshei-c0a.no":true,"vennesla.no":true,"verdal.no":true,"verran.no":true,"vestby.no":true,"vestnes.no":true,"vestre-slidre.no":true,"vestre-toten.no":true,"vestvagoy.no":true,"xn--vestvgy-ixa6o.no":true,"vevelstad.no":true,"vik.no":true,"vikna.no":true,"vindafjord.no":true,"volda.no":true,"voss.no":true,"varoy.no":true,"xn--vry-yla5g.no":true,"vagan.no":true,"xn--vgan-qoa.no":true,"voagat.no":true,"vagsoy.no":true,"xn--vgsy-qoa0j.no":true,"vaga.no":true,"xn--vg-yiab.no":true,"valer.ostfold.no":true,"xn--vler-qoa.xn--stfold-9xa.no":true,"valer.hedmark.no":true,"xn--vler-qoa.hedmark.no":true,"*.np":true,"nr":true,"biz.nr":true,"info.nr":true,"gov.nr":true,"edu.nr":true,"org.nr":true,"net.nr":true,"com.nr":true,"nu":true,"*.nz":true,"*.om":true,"mediaphone.om":false,"nawrastelecom.om":false,"nawras.om":false,"omanmobile.om":false,"omanpost.om":false,"omantel.om":false,"rakpetroleum.om":false,"siemens.om":false,"songfest.om":false,"statecouncil.om":false,"org":true,"pa":true,"ac.pa":true,"gob.pa":true,"com.pa":true,"org.pa":true,"sld.pa":true,"edu.pa":true,"net.pa":true,"ing.pa":true,"abo.pa":true,"med.pa":true,"nom.pa":true,"pe":true,"edu.pe":true,"gob.pe":true,"nom.pe":true,"mil.pe":true,"org.pe":true,"com.pe":true,"net.pe":true,"pf":true,"com.pf":true,"org.pf":true,"edu.pf":true,"*.pg":true,"ph":true,"com.ph":true,"net.ph":true,"org.ph":true,"gov.ph":true,"edu.ph":true,"ngo.ph":true,"mil.ph":true,"i.ph":true,"pk":true,"com.pk":true,"net.pk":true,"edu.pk":true,"org.pk":true,"fam.pk":true,"biz.pk":true,"web.pk":true,"gov.pk":true,"gob.pk":true,"gok.pk":true,"gon.pk":true,"gop.pk":true,"gos.pk":true,"info.pk":true,"pl":true,"aid.pl":true,"agro.pl":true,"atm.pl":true,"auto.pl":true,"biz.pl":true,"com.pl":true,"edu.pl":true,"gmina.pl":true,"gsm.pl":true,"info.pl":true,"mail.pl":true,"miasta.pl":true,"media.pl":true,"mil.pl":true,"net.pl":true,"nieruchomosci.pl":true,"nom.pl":true,"org.pl":true,"pc.pl":true,"powiat.pl":true,"priv.pl":true,"realestate.pl":true,"rel.pl":true,"sex.pl":true,"shop.pl":true,"sklep.pl":true,"sos.pl":true,"szkola.pl":true,"targi.pl":true,"tm.pl":true,"tourism.pl":true,"travel.pl":true,"turystyka.pl":true,"6bone.pl":true,"art.pl":true,"mbone.pl":true,"gov.pl":true,"uw.gov.pl":true,"um.gov.pl":true,"ug.gov.pl":true,"upow.gov.pl":true,"starostwo.gov.pl":true,"so.gov.pl":true,"sr.gov.pl":true,"po.gov.pl":true,"pa.gov.pl":true,"ngo.pl":true,"irc.pl":true,"usenet.pl":true,"augustow.pl":true,"babia-gora.pl":true,"bedzin.pl":true,"beskidy.pl":true,"bialowieza.pl":true,"bialystok.pl":true,"bielawa.pl":true,"bieszczady.pl":true,"boleslawiec.pl":true,"bydgoszcz.pl":true,"bytom.pl":true,"cieszyn.pl":true,"czeladz.pl":true,"czest.pl":true,"dlugoleka.pl":true,"elblag.pl":true,"elk.pl":true,"glogow.pl":true,"gniezno.pl":true,"gorlice.pl":true,"grajewo.pl":true,"ilawa.pl":true,"jaworzno.pl":true,"jelenia-gora.pl":true,"jgora.pl":true,"kalisz.pl":true,"kazimierz-dolny.pl":true,"karpacz.pl":true,"kartuzy.pl":true,"kaszuby.pl":true,"katowice.pl":true,"kepno.pl":true,"ketrzyn.pl":true,"klodzko.pl":true,"kobierzyce.pl":true,"kolobrzeg.pl":true,"konin.pl":true,"konskowola.pl":true,"kutno.pl":true,"lapy.pl":true,"lebork.pl":true,"legnica.pl":true,"lezajsk.pl":true,"limanowa.pl":true,"lomza.pl":true,"lowicz.pl":true,"lubin.pl":true,"lukow.pl":true,"malbork.pl":true,"malopolska.pl":true,"mazowsze.pl":true,"mazury.pl":true,"mielec.pl":true,"mielno.pl":true,"mragowo.pl":true,"naklo.pl":true,"nowaruda.pl":true,"nysa.pl":true,"olawa.pl":true,"olecko.pl":true,"olkusz.pl":true,"olsztyn.pl":true,"opoczno.pl":true,"opole.pl":true,"ostroda.pl":true,"ostroleka.pl":true,"ostrowiec.pl":true,"ostrowwlkp.pl":true,"pila.pl":true,"pisz.pl":true,"podhale.pl":true,"podlasie.pl":true,"polkowice.pl":true,"pomorze.pl":true,"pomorskie.pl":true,"prochowice.pl":true,"pruszkow.pl":true,"przeworsk.pl":true,"pulawy.pl":true,"radom.pl":true,"rawa-maz.pl":true,"rybnik.pl":true,"rzeszow.pl":true,"sanok.pl":true,"sejny.pl":true,"siedlce.pl":true,"slask.pl":true,"slupsk.pl":true,"sosnowiec.pl":true,"stalowa-wola.pl":true,"skoczow.pl":true,"starachowice.pl":true,"stargard.pl":true,"suwalki.pl":true,"swidnica.pl":true,"swiebodzin.pl":true,"swinoujscie.pl":true,"szczecin.pl":true,"szczytno.pl":true,"tarnobrzeg.pl":true,"tgory.pl":true,"turek.pl":true,"tychy.pl":true,"ustka.pl":true,"walbrzych.pl":true,"warmia.pl":true,"warszawa.pl":true,"waw.pl":true,"wegrow.pl":true,"wielun.pl":true,"wlocl.pl":true,"wloclawek.pl":true,"wodzislaw.pl":true,"wolomin.pl":true,"wroclaw.pl":true,"zachpomor.pl":true,"zagan.pl":true,"zarow.pl":true,"zgora.pl":true,"zgorzelec.pl":true,"gda.pl":true,"gdansk.pl":true,"gdynia.pl":true,"med.pl":true,"sopot.pl":true,"gliwice.pl":true,"krakow.pl":true,"poznan.pl":true,"wroc.pl":true,"zakopane.pl":true,"pm":true,"pn":true,"gov.pn":true,"co.pn":true,"org.pn":true,"edu.pn":true,"net.pn":true,"pr":true,"com.pr":true,"net.pr":true,"org.pr":true,"gov.pr":true,"edu.pr":true,"isla.pr":true,"pro.pr":true,"biz.pr":true,"info.pr":true,"name.pr":true,"est.pr":true,"prof.pr":true,"ac.pr":true,"pro":true,"aca.pro":true,"bar.pro":true,"cpa.pro":true,"jur.pro":true,"law.pro":true,"med.pro":true,"eng.pro":true,"ps":true,"edu.ps":true,"gov.ps":true,"sec.ps":true,"plo.ps":true,"com.ps":true,"org.ps":true,"net.ps":true,"pt":true,"net.pt":true,"gov.pt":true,"org.pt":true,"edu.pt":true,"int.pt":true,"publ.pt":true,"com.pt":true,"nome.pt":true,"pw":true,"co.pw":true,"ne.pw":true,"or.pw":true,"ed.pw":true,"go.pw":true,"belau.pw":true,"*.py":true,"qa":true,"com.qa":true,"edu.qa":true,"gov.qa":true,"mil.qa":true,"name.qa":true,"net.qa":true,"org.qa":true,"sch.qa":true,"re":true,"com.re":true,"asso.re":true,"nom.re":true,"ro":true,"com.ro":true,"org.ro":true,"tm.ro":true,"nt.ro":true,"nom.ro":true,"info.ro":true,"rec.ro":true,"arts.ro":true,"firm.ro":true,"store.ro":true,"www.ro":true,"rs":true,"co.rs":true,"org.rs":true,"edu.rs":true,"ac.rs":true,"gov.rs":true,"in.rs":true,"ru":true,"ac.ru":true,"com.ru":true,"edu.ru":true,"int.ru":true,"net.ru":true,"org.ru":true,"pp.ru":true,"adygeya.ru":true,"altai.ru":true,"amur.ru":true,"arkhangelsk.ru":true,"astrakhan.ru":true,"bashkiria.ru":true,"belgorod.ru":true,"bir.ru":true,"bryansk.ru":true,"buryatia.ru":true,"cbg.ru":true,"chel.ru":true,"chelyabinsk.ru":true,"chita.ru":true,"chukotka.ru":true,"chuvashia.ru":true,"dagestan.ru":true,"dudinka.ru":true,"e-burg.ru":true,"grozny.ru":true,"irkutsk.ru":true,"ivanovo.ru":true,"izhevsk.ru":true,"jar.ru":true,"joshkar-ola.ru":true,"kalmykia.ru":true,"kaluga.ru":true,"kamchatka.ru":true,"karelia.ru":true,"kazan.ru":true,"kchr.ru":true,"kemerovo.ru":true,"khabarovsk.ru":true,"khakassia.ru":true,"khv.ru":true,"kirov.ru":true,"koenig.ru":true,"komi.ru":true,"kostroma.ru":true,"krasnoyarsk.ru":true,"kuban.ru":true,"kurgan.ru":true,"kursk.ru":true,"lipetsk.ru":true,"magadan.ru":true,"mari.ru":true,"mari-el.ru":true,"marine.ru":true,"mordovia.ru":true,"mosreg.ru":true,"msk.ru":true,"murmansk.ru":true,"nalchik.ru":true,"nnov.ru":true,"nov.ru":true,"novosibirsk.ru":true,"nsk.ru":true,"omsk.ru":true,"orenburg.ru":true,"oryol.ru":true,"palana.ru":true,"penza.ru":true,"perm.ru":true,"pskov.ru":true,"ptz.ru":true,"rnd.ru":true,"ryazan.ru":true,"sakhalin.ru":true,"samara.ru":true,"saratov.ru":true,"simbirsk.ru":true,"smolensk.ru":true,"spb.ru":true,"stavropol.ru":true,"stv.ru":true,"surgut.ru":true,"tambov.ru":true,"tatarstan.ru":true,"tom.ru":true,"tomsk.ru":true,"tsaritsyn.ru":true,"tsk.ru":true,"tula.ru":true,"tuva.ru":true,"tver.ru":true,"tyumen.ru":true,"udm.ru":true,"udmurtia.ru":true,"ulan-ude.ru":true,"vladikavkaz.ru":true,"vladimir.ru":true,"vladivostok.ru":true,"volgograd.ru":true,"vologda.ru":true,"voronezh.ru":true,"vrn.ru":true,"vyatka.ru":true,"yakutia.ru":true,"yamal.ru":true,"yaroslavl.ru":true,"yekaterinburg.ru":true,"yuzhno-sakhalinsk.ru":true,"amursk.ru":true,"baikal.ru":true,"cmw.ru":true,"fareast.ru":true,"jamal.ru":true,"kms.ru":true,"k-uralsk.ru":true,"kustanai.ru":true,"kuzbass.ru":true,"magnitka.ru":true,"mytis.ru":true,"nakhodka.ru":true,"nkz.ru":true,"norilsk.ru":true,"oskol.ru":true,"pyatigorsk.ru":true,"rubtsovsk.ru":true,"snz.ru":true,"syzran.ru":true,"vdonsk.ru":true,"zgrad.ru":true,"gov.ru":true,"mil.ru":true,"test.ru":true,"rw":true,"gov.rw":true,"net.rw":true,"edu.rw":true,"ac.rw":true,"com.rw":true,"co.rw":true,"int.rw":true,"mil.rw":true,"gouv.rw":true,"sa":true,"com.sa":true,"net.sa":true,"org.sa":true,"gov.sa":true,"med.sa":true,"pub.sa":true,"edu.sa":true,"sch.sa":true,"sb":true,"com.sb":true,"edu.sb":true,"gov.sb":true,"net.sb":true,"org.sb":true,"sc":true,"com.sc":true,"gov.sc":true,"net.sc":true,"org.sc":true,"edu.sc":true,"sd":true,"com.sd":true,"net.sd":true,"org.sd":true,"edu.sd":true,"med.sd":true,"gov.sd":true,"info.sd":true,"se":true,"a.se":true,"ac.se":true,"b.se":true,"bd.se":true,"brand.se":true,"c.se":true,"d.se":true,"e.se":true,"f.se":true,"fh.se":true,"fhsk.se":true,"fhv.se":true,"g.se":true,"h.se":true,"i.se":true,"k.se":true,"komforb.se":true,"kommunalforbund.se":true,"komvux.se":true,"l.se":true,"lanbib.se":true,"m.se":true,"n.se":true,"naturbruksgymn.se":true,"o.se":true,"org.se":true,"p.se":true,"parti.se":true,"pp.se":true,"press.se":true,"r.se":true,"s.se":true,"sshn.se":true,"t.se":true,"tm.se":true,"u.se":true,"w.se":true,"x.se":true,"y.se":true,"z.se":true,"sg":true,"com.sg":true,"net.sg":true,"org.sg":true,"gov.sg":true,"edu.sg":true,"per.sg":true,"sh":true,"si":true,"sk":true,"sl":true,"com.sl":true,"net.sl":true,"edu.sl":true,"gov.sl":true,"org.sl":true,"sm":true,"sn":true,"art.sn":true,"com.sn":true,"edu.sn":true,"gouv.sn":true,"org.sn":true,"perso.sn":true,"univ.sn":true,"so":true,"com.so":true,"net.so":true,"org.so":true,"sr":true,"st":true,"co.st":true,"com.st":true,"consulado.st":true,"edu.st":true,"embaixada.st":true,"gov.st":true,"mil.st":true,"net.st":true,"org.st":true,"principe.st":true,"saotome.st":true,"store.st":true,"su":true,"*.sv":true,"sy":true,"edu.sy":true,"gov.sy":true,"net.sy":true,"mil.sy":true,"com.sy":true,"org.sy":true,"sz":true,"co.sz":true,"ac.sz":true,"org.sz":true,"tc":true,"td":true,"tel":true,"tf":true,"tg":true,"th":true,"ac.th":true,"co.th":true,"go.th":true,"in.th":true,"mi.th":true,"net.th":true,"or.th":true,"tj":true,"ac.tj":true,"biz.tj":true,"co.tj":true,"com.tj":true,"edu.tj":true,"go.tj":true,"gov.tj":true,"int.tj":true,"mil.tj":true,"name.tj":true,"net.tj":true,"nic.tj":true,"org.tj":true,"test.tj":true,"web.tj":true,"tk":true,"tl":true,"gov.tl":true,"tm":true,"tn":true,"com.tn":true,"ens.tn":true,"fin.tn":true,"gov.tn":true,"ind.tn":true,"intl.tn":true,"nat.tn":true,"net.tn":true,"org.tn":true,"info.tn":true,"perso.tn":true,"tourism.tn":true,"edunet.tn":true,"rnrt.tn":true,"rns.tn":true,"rnu.tn":true,"mincom.tn":true,"agrinet.tn":true,"defense.tn":true,"turen.tn":true,"to":true,"com.to":true,"gov.to":true,"net.to":true,"org.to":true,"edu.to":true,"mil.to":true,"*.tr":true,"nic.tr":false,"gov.nc.tr":true,"travel":true,"tt":true,"co.tt":true,"com.tt":true,"org.tt":true,"net.tt":true,"biz.tt":true,"info.tt":true,"pro.tt":true,"int.tt":true,"coop.tt":true,"jobs.tt":true,"mobi.tt":true,"travel.tt":true,"museum.tt":true,"aero.tt":true,"name.tt":true,"gov.tt":true,"edu.tt":true,"tv":true,"tw":true,"edu.tw":true,"gov.tw":true,"mil.tw":true,"com.tw":true,"net.tw":true,"org.tw":true,"idv.tw":true,"game.tw":true,"ebiz.tw":true,"club.tw":true,"xn--zf0ao64a.tw":true,"xn--uc0atv.tw":true,"xn--czrw28b.tw":true,"ac.tz":true,"co.tz":true,"go.tz":true,"mil.tz":true,"ne.tz":true,"or.tz":true,"sc.tz":true,"ua":true,"com.ua":true,"edu.ua":true,"gov.ua":true,"in.ua":true,"net.ua":true,"org.ua":true,"cherkassy.ua":true,"chernigov.ua":true,"chernovtsy.ua":true,"ck.ua":true,"cn.ua":true,"crimea.ua":true,"cv.ua":true,"dn.ua":true,"dnepropetrovsk.ua":true,"donetsk.ua":true,"dp.ua":true,"if.ua":true,"ivano-frankivsk.ua":true,"kh.ua":true,"kharkov.ua":true,"kherson.ua":true,"khmelnitskiy.ua":true,"kiev.ua":true,"kirovograd.ua":true,"km.ua":true,"kr.ua":true,"ks.ua":true,"kv.ua":true,"lg.ua":true,"lugansk.ua":true,"lutsk.ua":true,"lviv.ua":true,"mk.ua":true,"nikolaev.ua":true,"od.ua":true,"odessa.ua":true,"pl.ua":true,"poltava.ua":true,"rovno.ua":true,"rv.ua":true,"sebastopol.ua":true,"sumy.ua":true,"te.ua":true,"ternopil.ua":true,"uzhgorod.ua":true,"vinnica.ua":true,"vn.ua":true,"zaporizhzhe.ua":true,"zp.ua":true,"zhitomir.ua":true,"zt.ua":true,"co.ua":true,"pp.ua":true,"ug":true,"co.ug":true,"ac.ug":true,"sc.ug":true,"go.ug":true,"ne.ug":true,"or.ug":true,"*.uk":true,"*.sch.uk":true,"bl.uk":false,"british-library.uk":false,"icnet.uk":false,"jet.uk":false,"mod.uk":false,"nel.uk":false,"nhs.uk":false,"nic.uk":false,"nls.uk":false,"national-library-scotland.uk":false,"parliament.uk":false,"police.uk":false,"us":true,"dni.us":true,"fed.us":true,"isa.us":true,"kids.us":true,"nsn.us":true,"ak.us":true,"al.us":true,"ar.us":true,"as.us":true,"az.us":true,"ca.us":true,"co.us":true,"ct.us":true,"dc.us":true,"de.us":true,"fl.us":true,"ga.us":true,"gu.us":true,"hi.us":true,"ia.us":true,"id.us":true,"il.us":true,"in.us":true,"ks.us":true,"ky.us":true,"la.us":true,"ma.us":true,"md.us":true,"me.us":true,"mi.us":true,"mn.us":true,"mo.us":true,"ms.us":true,"mt.us":true,"nc.us":true,"nd.us":true,"ne.us":true,"nh.us":true,"nj.us":true,"nm.us":true,"nv.us":true,"ny.us":true,"oh.us":true,"ok.us":true,"or.us":true,"pa.us":true,"pr.us":true,"ri.us":true,"sc.us":true,"sd.us":true,"tn.us":true,"tx.us":true,"ut.us":true,"vi.us":true,"vt.us":true,"va.us":true,"wa.us":true,"wi.us":true,"wv.us":true,"wy.us":true,"k12.ak.us":true,"k12.al.us":true,"k12.ar.us":true,"k12.as.us":true,"k12.az.us":true,"k12.ca.us":true,"k12.co.us":true,"k12.ct.us":true,"k12.dc.us":true,"k12.de.us":true,"k12.fl.us":true,"k12.ga.us":true,"k12.gu.us":true,"k12.ia.us":true,"k12.id.us":true,"k12.il.us":true,"k12.in.us":true,"k12.ks.us":true,"k12.ky.us":true,"k12.la.us":true,"k12.ma.us":true,"k12.md.us":true,"k12.me.us":true,"k12.mi.us":true,"k12.mn.us":true,"k12.mo.us":true,"k12.ms.us":true,"k12.mt.us":true,"k12.nc.us":true,"k12.nd.us":true,"k12.ne.us":true,"k12.nh.us":true,"k12.nj.us":true,"k12.nm.us":true,"k12.nv.us":true,"k12.ny.us":true,"k12.oh.us":true,"k12.ok.us":true,"k12.or.us":true,"k12.pa.us":true,"k12.pr.us":true,"k12.ri.us":true,"k12.sc.us":true,"k12.sd.us":true,"k12.tn.us":true,"k12.tx.us":true,"k12.ut.us":true,"k12.vi.us":true,"k12.vt.us":true,"k12.va.us":true,"k12.wa.us":true,"k12.wi.us":true,"k12.wv.us":true,"k12.wy.us":true,"cc.ak.us":true,"cc.al.us":true,"cc.ar.us":true,"cc.as.us":true,"cc.az.us":true,"cc.ca.us":true,"cc.co.us":true,"cc.ct.us":true,"cc.dc.us":true,"cc.de.us":true,"cc.fl.us":true,"cc.ga.us":true,"cc.gu.us":true,"cc.hi.us":true,"cc.ia.us":true,"cc.id.us":true,"cc.il.us":true,"cc.in.us":true,"cc.ks.us":true,"cc.ky.us":true,"cc.la.us":true,"cc.ma.us":true,"cc.md.us":true,"cc.me.us":true,"cc.mi.us":true,"cc.mn.us":true,"cc.mo.us":true,"cc.ms.us":true,"cc.mt.us":true,"cc.nc.us":true,"cc.nd.us":true,"cc.ne.us":true,"cc.nh.us":true,"cc.nj.us":true,"cc.nm.us":true,"cc.nv.us":true,"cc.ny.us":true,"cc.oh.us":true,"cc.ok.us":true,"cc.or.us":true,"cc.pa.us":true,"cc.pr.us":true,"cc.ri.us":true,"cc.sc.us":true,"cc.sd.us":true,"cc.tn.us":true,"cc.tx.us":true,"cc.ut.us":true,"cc.vi.us":true,"cc.vt.us":true,"cc.va.us":true,"cc.wa.us":true,"cc.wi.us":true,"cc.wv.us":true,"cc.wy.us":true,"lib.ak.us":true,"lib.al.us":true,"lib.ar.us":true,"lib.as.us":true,"lib.az.us":true,"lib.ca.us":true,"lib.co.us":true,"lib.ct.us":true,"lib.dc.us":true,"lib.de.us":true,"lib.fl.us":true,"lib.ga.us":true,"lib.gu.us":true,"lib.hi.us":true,"lib.ia.us":true,"lib.id.us":true,"lib.il.us":true,"lib.in.us":true,"lib.ks.us":true,"lib.ky.us":true,"lib.la.us":true,"lib.ma.us":true,"lib.md.us":true,"lib.me.us":true,"lib.mi.us":true,"lib.mn.us":true,"lib.mo.us":true,"lib.ms.us":true,"lib.mt.us":true,"lib.nc.us":true,"lib.nd.us":true,"lib.ne.us":true,"lib.nh.us":true,"lib.nj.us":true,"lib.nm.us":true,"lib.nv.us":true,"lib.ny.us":true,"lib.oh.us":true,"lib.ok.us":true,"lib.or.us":true,"lib.pa.us":true,"lib.pr.us":true,"lib.ri.us":true,"lib.sc.us":true,"lib.sd.us":true,"lib.tn.us":true,"lib.tx.us":true,"lib.ut.us":true,"lib.vi.us":true,"lib.vt.us":true,"lib.va.us":true,"lib.wa.us":true,"lib.wi.us":true,"lib.wv.us":true,"lib.wy.us":true,"pvt.k12.ma.us":true,"chtr.k12.ma.us":true,"paroch.k12.ma.us":true,"*.uy":true,"uz":true,"com.uz":true,"co.uz":true,"va":true,"vc":true,"com.vc":true,"net.vc":true,"org.vc":true,"gov.vc":true,"mil.vc":true,"edu.vc":true,"*.ve":true,"vg":true,"vi":true,"co.vi":true,"com.vi":true,"k12.vi":true,"net.vi":true,"org.vi":true,"vn":true,"com.vn":true,"net.vn":true,"org.vn":true,"edu.vn":true,"gov.vn":true,"int.vn":true,"ac.vn":true,"biz.vn":true,"info.vn":true,"name.vn":true,"pro.vn":true,"health.vn":true,"vu":true,"wf":true,"ws":true,"com.ws":true,"net.ws":true,"org.ws":true,"gov.ws":true,"edu.ws":true,"yt":true,"xn--mgbaam7a8h":true,"xn--54b7fta0cc":true,"xn--fiqs8s":true,"xn--fiqz9s":true,"xn--lgbbat1ad8j":true,"xn--wgbh1c":true,"xn--node":true,"xn--j6w193g":true,"xn--h2brj9c":true,"xn--mgbbh1a71e":true,"xn--fpcrj9c3d":true,"xn--gecrj9c":true,"xn--s9brj9c":true,"xn--45brj9c":true,"xn--xkc2dl3a5ee0h":true,"xn--mgba3a4f16a":true,"xn--mgba3a4fra":true,"xn--mgbayh7gpa":true,"xn--3e0b707e":true,"xn--fzc2c9e2c":true,"xn--xkc2al3hye2a":true,"xn--mgbc0a9azcg":true,"xn--mgb9awbf":true,"xn--ygbi2ammx":true,"xn--90a3ac":true,"xn--p1ai":true,"xn--wgbl6a":true,"xn--mgberp4a5d4ar":true,"xn--mgberp4a5d4a87g":true,"xn--mgbqly7c0a67fbc":true,"xn--mgbqly7cvafr":true,"xn--ogbpf8fl":true,"xn--mgbtf8fl":true,"xn--yfro4i67o":true,"xn--clchc0ea0b2g2a9gcd":true,"xn--o3cw4h":true,"xn--pgbs0dh":true,"xn--kpry57d":true,"xn--kprw13d":true,"xn--nnx388a":true,"xn--j1amh":true,"xn--mgb2ddes":true,"xxx":true,"*.ye":true,"*.za":true,"*.zm":true,"*.zw":true,"biz.at":true,"info.at":true,"priv.at":true,"co.ca":true,"ar.com":true,"br.com":true,"cn.com":true,"de.com":true,"eu.com":true,"gb.com":true,"gr.com":true,"hu.com":true,"jpn.com":true,"kr.com":true,"no.com":true,"qc.com":true,"ru.com":true,"sa.com":true,"se.com":true,"uk.com":true,"us.com":true,"uy.com":true,"za.com":true,"gb.net":true,"jp.net":true,"se.net":true,"uk.net":true,"ae.org":true,"us.org":true,"com.de":true,"operaunite.com":true,"appspot.com":true,"iki.fi":true,"c.la":true,"za.net":true,"za.org":true,"co.nl":true,"co.no":true,"co.pl":true,"dyndns-at-home.com":true,"dyndns-at-work.com":true,"dyndns-blog.com":true,"dyndns-free.com":true,"dyndns-home.com":true,"dyndns-ip.com":true,"dyndns-mail.com":true,"dyndns-office.com":true,"dyndns-pics.com":true,"dyndns-remote.com":true,"dyndns-server.com":true,"dyndns-web.com":true,"dyndns-wiki.com":true,"dyndns-work.com":true,"dyndns.biz":true,"dyndns.info":true,"dyndns.org":true,"dyndns.tv":true,"at-band-camp.net":true,"ath.cx":true,"barrel-of-knowledge.info":true,"barrell-of-knowledge.info":true,"better-than.tv":true,"blogdns.com":true,"blogdns.net":true,"blogdns.org":true,"blogsite.org":true,"boldlygoingnowhere.org":true,"broke-it.net":true,"buyshouses.net":true,"cechire.com":true,"dnsalias.com":true,"dnsalias.net":true,"dnsalias.org":true,"dnsdojo.com":true,"dnsdojo.net":true,"dnsdojo.org":true,"does-it.net":true,"doesntexist.com":true,"doesntexist.org":true,"dontexist.com":true,"dontexist.net":true,"dontexist.org":true,"doomdns.com":true,"doomdns.org":true,"dvrdns.org":true,"dyn-o-saur.com":true,"dynalias.com":true,"dynalias.net":true,"dynalias.org":true,"dynathome.net":true,"dyndns.ws":true,"endofinternet.net":true,"endofinternet.org":true,"endoftheinternet.org":true,"est-a-la-maison.com":true,"est-a-la-masion.com":true,"est-le-patron.com":true,"est-mon-blogueur.com":true,"for-better.biz":true,"for-more.biz":true,"for-our.info":true,"for-some.biz":true,"for-the.biz":true,"forgot.her.name":true,"forgot.his.name":true,"from-ak.com":true,"from-al.com":true,"from-ar.com":true,"from-az.net":true,"from-ca.com":true,"from-co.net":true,"from-ct.com":true,"from-dc.com":true,"from-de.com":true,"from-fl.com":true,"from-ga.com":true,"from-hi.com":true,"from-ia.com":true,"from-id.com":true,"from-il.com":true,"from-in.com":true,"from-ks.com":true,"from-ky.com":true,"from-la.net":true,"from-ma.com":true,"from-md.com":true,"from-me.org":true,"from-mi.com":true,"from-mn.com":true,"from-mo.com":true,"from-ms.com":true,"from-mt.com":true,"from-nc.com":true,"from-nd.com":true,"from-ne.com":true,"from-nh.com":true,"from-nj.com":true,"from-nm.com":true,"from-nv.com":true,"from-ny.net":true,"from-oh.com":true,"from-ok.com":true,"from-or.com":true,"from-pa.com":true,"from-pr.com":true,"from-ri.com":true,"from-sc.com":true,"from-sd.com":true,"from-tn.com":true,"from-tx.com":true,"from-ut.com":true,"from-va.com":true,"from-vt.com":true,"from-wa.com":true,"from-wi.com":true,"from-wv.com":true,"from-wy.com":true,"ftpaccess.cc":true,"fuettertdasnetz.de":true,"game-host.org":true,"game-server.cc":true,"getmyip.com":true,"gets-it.net":true,"go.dyndns.org":true,"gotdns.com":true,"gotdns.org":true,"groks-the.info":true,"groks-this.info":true,"ham-radio-op.net":true,"here-for-more.info":true,"hobby-site.com":true,"hobby-site.org":true,"home.dyndns.org":true,"homedns.org":true,"homeftp.net":true,"homeftp.org":true,"homeip.net":true,"homelinux.com":true,"homelinux.net":true,"homelinux.org":true,"homeunix.com":true,"homeunix.net":true,"homeunix.org":true,"iamallama.com":true,"in-the-band.net":true,"is-a-anarchist.com":true,"is-a-blogger.com":true,"is-a-bookkeeper.com":true,"is-a-bruinsfan.org":true,"is-a-bulls-fan.com":true,"is-a-candidate.org":true,"is-a-caterer.com":true,"is-a-celticsfan.org":true,"is-a-chef.com":true,"is-a-chef.net":true,"is-a-chef.org":true,"is-a-conservative.com":true,"is-a-cpa.com":true,"is-a-cubicle-slave.com":true,"is-a-democrat.com":true,"is-a-designer.com":true,"is-a-doctor.com":true,"is-a-financialadvisor.com":true,"is-a-geek.com":true,"is-a-geek.net":true,"is-a-geek.org":true,"is-a-green.com":true,"is-a-guru.com":true,"is-a-hard-worker.com":true,"is-a-hunter.com":true,"is-a-knight.org":true,"is-a-landscaper.com":true,"is-a-lawyer.com":true,"is-a-liberal.com":true,"is-a-libertarian.com":true,"is-a-linux-user.org":true,"is-a-llama.com":true,"is-a-musician.com":true,"is-a-nascarfan.com":true,"is-a-nurse.com":true,"is-a-painter.com":true,"is-a-patsfan.org":true,"is-a-personaltrainer.com":true,"is-a-photographer.com":true,"is-a-player.com":true,"is-a-republican.com":true,"is-a-rockstar.com":true,"is-a-socialist.com":true,"is-a-soxfan.org":true,"is-a-student.com":true,"is-a-teacher.com":true,"is-a-techie.com":true,"is-a-therapist.com":true,"is-an-accountant.com":true,"is-an-actor.com":true,"is-an-actress.com":true,"is-an-anarchist.com":true,"is-an-artist.com":true,"is-an-engineer.com":true,"is-an-entertainer.com":true,"is-by.us":true,"is-certified.com":true,"is-found.org":true,"is-gone.com":true,"is-into-anime.com":true,"is-into-cars.com":true,"is-into-cartoons.com":true,"is-into-games.com":true,"is-leet.com":true,"is-lost.org":true,"is-not-certified.com":true,"is-saved.org":true,"is-slick.com":true,"is-uberleet.com":true,"is-very-bad.org":true,"is-very-evil.org":true,"is-very-good.org":true,"is-very-nice.org":true,"is-very-sweet.org":true,"is-with-theband.com":true,"isa-geek.com":true,"isa-geek.net":true,"isa-geek.org":true,"isa-hockeynut.com":true,"issmarterthanyou.com":true,"isteingeek.de":true,"istmein.de":true,"kicks-ass.net":true,"kicks-ass.org":true,"knowsitall.info":true,"land-4-sale.us":true,"lebtimnetz.de":true,"leitungsen.de":true,"likes-pie.com":true,"likescandy.com":true,"merseine.nu":true,"mine.nu":true,"misconfused.org":true,"mypets.ws":true,"myphotos.cc":true,"neat-url.com":true,"office-on-the.net":true,"on-the-web.tv":true,"podzone.net":true,"podzone.org":true,"readmyblog.org":true,"saves-the-whales.com":true,"scrapper-site.net":true,"scrapping.cc":true,"selfip.biz":true,"selfip.com":true,"selfip.info":true,"selfip.net":true,"selfip.org":true,"sells-for-less.com":true,"sells-for-u.com":true,"sells-it.net":true,"sellsyourhome.org":true,"servebbs.com":true,"servebbs.net":true,"servebbs.org":true,"serveftp.net":true,"serveftp.org":true,"servegame.org":true,"shacknet.nu":true,"simple-url.com":true,"space-to-rent.com":true,"stuff-4-sale.org":true,"stuff-4-sale.us":true,"teaches-yoga.com":true,"thruhere.net":true,"traeumtgerade.de":true,"webhop.biz":true,"webhop.info":true,"webhop.net":true,"webhop.org":true,"worse-than.tv":true,"writesthisblog.com":true}); - -// END of automatically generated file diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/lib/store.js b/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/lib/store.js deleted file mode 100644 index f8433dfcb..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/lib/store.js +++ /dev/null @@ -1,37 +0,0 @@ -'use strict'; -/*jshint unused:false */ - -function Store() { -} -exports.Store = Store; - -// Stores may be synchronous, but are still required to use a -// Continuation-Passing Style API. The CookieJar itself will expose a "*Sync" -// API that converts from synchronous-callbacks to imperative style. -Store.prototype.synchronous = false; - -Store.prototype.findCookie = function(domain, path, key, cb) { - throw new Error('findCookie is not implemented'); -}; - -Store.prototype.findCookies = function(domain, path, cb) { - throw new Error('findCookies is not implemented'); -}; - -Store.prototype.putCookie = function(cookie, cb) { - throw new Error('putCookie is not implemented'); -}; - -Store.prototype.updateCookie = function(oldCookie, newCookie, cb) { - // recommended default implementation: - // return this.putCookie(newCookie, cb); - throw new Error('updateCookie is not implemented'); -}; - -Store.prototype.removeCookie = function(domain, path, key, cb) { - throw new Error('removeCookie is not implemented'); -}; - -Store.prototype.removeCookies = function removeCookies(domain, path, cb) { - throw new Error('removeCookies is not implemented'); -}; diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/node_modules/punycode/LICENSE-MIT.txt b/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/node_modules/punycode/LICENSE-MIT.txt deleted file mode 100644 index a41e0a7ef..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/node_modules/punycode/LICENSE-MIT.txt +++ /dev/null @@ -1,20 +0,0 @@ -Copyright Mathias Bynens - -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/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/node_modules/punycode/README.md b/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/node_modules/punycode/README.md deleted file mode 100644 index 831e6379b..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/node_modules/punycode/README.md +++ /dev/null @@ -1,176 +0,0 @@ -# Punycode.js [![Build status](https://travis-ci.org/bestiejs/punycode.js.svg?branch=master)](https://travis-ci.org/bestiejs/punycode.js) [![Code coverage status](http://img.shields.io/coveralls/bestiejs/punycode.js/master.svg)](https://coveralls.io/r/bestiejs/punycode.js) [![Dependency status](https://gemnasium.com/bestiejs/punycode.js.svg)](https://gemnasium.com/bestiejs/punycode.js) - -A robust Punycode converter that fully complies to [RFC 3492](http://tools.ietf.org/html/rfc3492) and [RFC 5891](http://tools.ietf.org/html/rfc5891), and works on nearly all JavaScript platforms. - -This JavaScript library is the result of comparing, optimizing and documenting different open-source implementations of the Punycode algorithm: - -* [The C example code from RFC 3492](http://tools.ietf.org/html/rfc3492#appendix-C) -* [`punycode.c` by _Markus W. Scherer_ (IBM)](http://opensource.apple.com/source/ICU/ICU-400.42/icuSources/common/punycode.c) -* [`punycode.c` by _Ben Noordhuis_](https://github.com/bnoordhuis/punycode/blob/master/punycode.c) -* [JavaScript implementation by _some_](http://stackoverflow.com/questions/183485/can-anyone-recommend-a-good-free-javascript-for-punycode-to-unicode-conversion/301287#301287) -* [`punycode.js` by _Ben Noordhuis_](https://github.com/joyent/node/blob/426298c8c1c0d5b5224ac3658c41e7c2a3fe9377/lib/punycode.js) (note: [not fully compliant](https://github.com/joyent/node/issues/2072)) - -This project is [bundled](https://github.com/joyent/node/blob/master/lib/punycode.js) with [Node.js v0.6.2+](https://github.com/joyent/node/compare/975f1930b1...61e796decc). - -## Installation - -Via [npm](http://npmjs.org/) (only required for Node.js releases older than v0.6.2): - -```bash -npm install punycode -``` - -Via [Bower](http://bower.io/): - -```bash -bower install punycode -``` - -Via [Component](https://github.com/component/component): - -```bash -component install bestiejs/punycode.js -``` - -In a browser: - -```html - -``` - -In [Narwhal](http://narwhaljs.org/), [Node.js](http://nodejs.org/), and [RingoJS](http://ringojs.org/): - -```js -var punycode = require('punycode'); -``` - -In [Rhino](http://www.mozilla.org/rhino/): - -```js -load('punycode.js'); -``` - -Using an AMD loader like [RequireJS](http://requirejs.org/): - -```js -require( - { - 'paths': { - 'punycode': 'path/to/punycode' - } - }, - ['punycode'], - function(punycode) { - console.log(punycode); - } -); -``` - -## API - -### `punycode.decode(string)` - -Converts a Punycode string of ASCII symbols to a string of Unicode symbols. - -```js -// decode domain name parts -punycode.decode('maana-pta'); // 'mañana' -punycode.decode('--dqo34k'); // '☃-⌘' -``` - -### `punycode.encode(string)` - -Converts a string of Unicode symbols to a Punycode string of ASCII symbols. - -```js -// encode domain name parts -punycode.encode('mañana'); // 'maana-pta' -punycode.encode('☃-⌘'); // '--dqo34k' -``` - -### `punycode.toUnicode(input)` - -Converts a Punycode string representing a domain name or an email address to Unicode. Only the Punycoded parts of the input will be converted, i.e. it doesn’t matter if you call it on a string that has already been converted to Unicode. - -```js -// decode domain names -punycode.toUnicode('xn--maana-pta.com'); -// → 'mañana.com' -punycode.toUnicode('xn----dqo34k.com'); -// → '☃-⌘.com' - -// decode email addresses -punycode.toUnicode('джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq'); -// → 'джумла@джpумлатест.bрфa' -``` - -### `punycode.toASCII(input)` - -Converts a Unicode string representing a domain name or an email address to Punycode. Only the non-ASCII parts of the input will be converted, i.e. it doesn’t matter if you call it with a domain that's already in ASCII. - -```js -// encode domain names -punycode.toASCII('mañana.com'); -// → 'xn--maana-pta.com' -punycode.toASCII('☃-⌘.com'); -// → 'xn----dqo34k.com' - -// encode email addresses -punycode.toASCII('джумла@джpумлатест.bрфa'); -// → 'джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq' -``` - -### `punycode.ucs2` - -#### `punycode.ucs2.decode(string)` - -Creates an array containing the numeric code point values of each Unicode symbol in the string. While [JavaScript uses UCS-2 internally](https://mathiasbynens.be/notes/javascript-encoding), this function will convert a pair of surrogate halves (each of which UCS-2 exposes as separate characters) into a single code point, matching UTF-16. - -```js -punycode.ucs2.decode('abc'); -// → [0x61, 0x62, 0x63] -// surrogate pair for U+1D306 TETRAGRAM FOR CENTRE: -punycode.ucs2.decode('\uD834\uDF06'); -// → [0x1D306] -``` - -#### `punycode.ucs2.encode(codePoints)` - -Creates a string based on an array of numeric code point values. - -```js -punycode.ucs2.encode([0x61, 0x62, 0x63]); -// → 'abc' -punycode.ucs2.encode([0x1D306]); -// → '\uD834\uDF06' -``` - -### `punycode.version` - -A string representing the current Punycode.js version number. - -## Unit tests & code coverage - -After cloning this repository, run `npm install --dev` to install the dependencies needed for Punycode.js development and testing. You may want to install Istanbul _globally_ using `npm install istanbul -g`. - -Once that’s done, you can run the unit tests in Node using `npm test` or `node tests/tests.js`. To run the tests in Rhino, Ringo, Narwhal, PhantomJS, and web browsers as well, use `grunt test`. - -To generate the code coverage report, use `grunt cover`. - -Feel free to fork if you see possible improvements! - -## Author - -| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | -|---| -| [Mathias Bynens](https://mathiasbynens.be/) | - -## Contributors - -| [![twitter/jdalton](https://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") | -|---| -| [John-David Dalton](http://allyoucanleet.com/) | - -## License - -Punycode.js is available under the [MIT](https://mths.be/mit) license. diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/node_modules/punycode/package.json b/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/node_modules/punycode/package.json deleted file mode 100644 index acee7eba3..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/node_modules/punycode/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "name": "punycode", - "version": "1.3.2", - "description": "A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.", - "homepage": "https://mths.be/punycode", - "main": "punycode.js", - "keywords": [ - "punycode", - "unicode", - "idn", - "idna", - "dns", - "url", - "domain" - ], - "license": "MIT", - "author": { - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - }, - "contributors": [ - { - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - }, - { - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - } - ], - "repository": { - "type": "git", - "url": "https://github.com/bestiejs/punycode.js.git" - }, - "bugs": { - "url": "https://github.com/bestiejs/punycode.js/issues" - }, - "files": [ - "LICENSE-MIT.txt", - "punycode.js" - ], - "scripts": { - "test": "node tests/tests.js" - }, - "devDependencies": { - "coveralls": "^2.10.1", - "grunt": "^0.4.5", - "grunt-contrib-uglify": "^0.5.0", - "grunt-shell": "^0.7.0", - "istanbul": "^0.2.13", - "qunit-extras": "^1.2.0", - "qunitjs": "~1.11.0", - "requirejs": "^2.1.14" - }, - "readme": "# Punycode.js [![Build status](https://travis-ci.org/bestiejs/punycode.js.svg?branch=master)](https://travis-ci.org/bestiejs/punycode.js) [![Code coverage status](http://img.shields.io/coveralls/bestiejs/punycode.js/master.svg)](https://coveralls.io/r/bestiejs/punycode.js) [![Dependency status](https://gemnasium.com/bestiejs/punycode.js.svg)](https://gemnasium.com/bestiejs/punycode.js)\n\nA robust Punycode converter that fully complies to [RFC 3492](http://tools.ietf.org/html/rfc3492) and [RFC 5891](http://tools.ietf.org/html/rfc5891), and works on nearly all JavaScript platforms.\n\nThis JavaScript library is the result of comparing, optimizing and documenting different open-source implementations of the Punycode algorithm:\n\n* [The C example code from RFC 3492](http://tools.ietf.org/html/rfc3492#appendix-C)\n* [`punycode.c` by _Markus W. Scherer_ (IBM)](http://opensource.apple.com/source/ICU/ICU-400.42/icuSources/common/punycode.c)\n* [`punycode.c` by _Ben Noordhuis_](https://github.com/bnoordhuis/punycode/blob/master/punycode.c)\n* [JavaScript implementation by _some_](http://stackoverflow.com/questions/183485/can-anyone-recommend-a-good-free-javascript-for-punycode-to-unicode-conversion/301287#301287)\n* [`punycode.js` by _Ben Noordhuis_](https://github.com/joyent/node/blob/426298c8c1c0d5b5224ac3658c41e7c2a3fe9377/lib/punycode.js) (note: [not fully compliant](https://github.com/joyent/node/issues/2072))\n\nThis project is [bundled](https://github.com/joyent/node/blob/master/lib/punycode.js) with [Node.js v0.6.2+](https://github.com/joyent/node/compare/975f1930b1...61e796decc).\n\n## Installation\n\nVia [npm](http://npmjs.org/) (only required for Node.js releases older than v0.6.2):\n\n```bash\nnpm install punycode\n```\n\nVia [Bower](http://bower.io/):\n\n```bash\nbower install punycode\n```\n\nVia [Component](https://github.com/component/component):\n\n```bash\ncomponent install bestiejs/punycode.js\n```\n\nIn a browser:\n\n```html\n\n```\n\nIn [Narwhal](http://narwhaljs.org/), [Node.js](http://nodejs.org/), and [RingoJS](http://ringojs.org/):\n\n```js\nvar punycode = require('punycode');\n```\n\nIn [Rhino](http://www.mozilla.org/rhino/):\n\n```js\nload('punycode.js');\n```\n\nUsing an AMD loader like [RequireJS](http://requirejs.org/):\n\n```js\nrequire(\n {\n 'paths': {\n 'punycode': 'path/to/punycode'\n }\n },\n ['punycode'],\n function(punycode) {\n console.log(punycode);\n }\n);\n```\n\n## API\n\n### `punycode.decode(string)`\n\nConverts a Punycode string of ASCII symbols to a string of Unicode symbols.\n\n```js\n// decode domain name parts\npunycode.decode('maana-pta'); // 'mañana'\npunycode.decode('--dqo34k'); // '☃-⌘'\n```\n\n### `punycode.encode(string)`\n\nConverts a string of Unicode symbols to a Punycode string of ASCII symbols.\n\n```js\n// encode domain name parts\npunycode.encode('mañana'); // 'maana-pta'\npunycode.encode('☃-⌘'); // '--dqo34k'\n```\n\n### `punycode.toUnicode(input)`\n\nConverts a Punycode string representing a domain name or an email address to Unicode. Only the Punycoded parts of the input will be converted, i.e. it doesn’t matter if you call it on a string that has already been converted to Unicode.\n\n```js\n// decode domain names\npunycode.toUnicode('xn--maana-pta.com');\n// → 'mañana.com'\npunycode.toUnicode('xn----dqo34k.com');\n// → '☃-⌘.com'\n\n// decode email addresses\npunycode.toUnicode('джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq');\n// → 'джумла@джpумлатест.bрфa'\n```\n\n### `punycode.toASCII(input)`\n\nConverts a Unicode string representing a domain name or an email address to Punycode. Only the non-ASCII parts of the input will be converted, i.e. it doesn’t matter if you call it with a domain that's already in ASCII.\n\n```js\n// encode domain names\npunycode.toASCII('mañana.com');\n// → 'xn--maana-pta.com'\npunycode.toASCII('☃-⌘.com');\n// → 'xn----dqo34k.com'\n\n// encode email addresses\npunycode.toASCII('джумла@джpумлатест.bрфa');\n// → 'джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq'\n```\n\n### `punycode.ucs2`\n\n#### `punycode.ucs2.decode(string)`\n\nCreates an array containing the numeric code point values of each Unicode symbol in the string. While [JavaScript uses UCS-2 internally](https://mathiasbynens.be/notes/javascript-encoding), this function will convert a pair of surrogate halves (each of which UCS-2 exposes as separate characters) into a single code point, matching UTF-16.\n\n```js\npunycode.ucs2.decode('abc');\n// → [0x61, 0x62, 0x63]\n// surrogate pair for U+1D306 TETRAGRAM FOR CENTRE:\npunycode.ucs2.decode('\\uD834\\uDF06');\n// → [0x1D306]\n```\n\n#### `punycode.ucs2.encode(codePoints)`\n\nCreates a string based on an array of numeric code point values.\n\n```js\npunycode.ucs2.encode([0x61, 0x62, 0x63]);\n// → 'abc'\npunycode.ucs2.encode([0x1D306]);\n// → '\\uD834\\uDF06'\n```\n\n### `punycode.version`\n\nA string representing the current Punycode.js version number.\n\n## Unit tests & code coverage\n\nAfter cloning this repository, run `npm install --dev` to install the dependencies needed for Punycode.js development and testing. You may want to install Istanbul _globally_ using `npm install istanbul -g`.\n\nOnce that’s done, you can run the unit tests in Node using `npm test` or `node tests/tests.js`. To run the tests in Rhino, Ringo, Narwhal, PhantomJS, and web browsers as well, use `grunt test`.\n\nTo generate the code coverage report, use `grunt cover`.\n\nFeel free to fork if you see possible improvements!\n\n## Author\n\n| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias \"Follow @mathias on Twitter\") |\n|---|\n| [Mathias Bynens](https://mathiasbynens.be/) |\n\n## Contributors\n\n| [![twitter/jdalton](https://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton \"Follow @jdalton on Twitter\") |\n|---|\n| [John-David Dalton](http://allyoucanleet.com/) |\n\n## License\n\nPunycode.js is available under the [MIT](https://mths.be/mit) license.\n", - "readmeFilename": "README.md", - "_id": "punycode@1.3.2", - "_from": "punycode@>=0.2.0" -} diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/node_modules/punycode/punycode.js b/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/node_modules/punycode/punycode.js deleted file mode 100644 index ac6859738..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/node_modules/punycode/punycode.js +++ /dev/null @@ -1,530 +0,0 @@ -/*! https://mths.be/punycode v1.3.2 by @mathias */ -;(function(root) { - - /** Detect free variables */ - var freeExports = typeof exports == 'object' && exports && - !exports.nodeType && exports; - var freeModule = typeof module == 'object' && module && - !module.nodeType && module; - var freeGlobal = typeof global == 'object' && global; - if ( - freeGlobal.global === freeGlobal || - freeGlobal.window === freeGlobal || - freeGlobal.self === freeGlobal - ) { - root = freeGlobal; - } - - /** - * The `punycode` object. - * @name punycode - * @type Object - */ - var punycode, - - /** Highest positive signed 32-bit float value */ - maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1 - - /** Bootstring parameters */ - base = 36, - tMin = 1, - tMax = 26, - skew = 38, - damp = 700, - initialBias = 72, - initialN = 128, // 0x80 - delimiter = '-', // '\x2D' - - /** Regular expressions */ - regexPunycode = /^xn--/, - regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars - regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators - - /** Error messages */ - errors = { - 'overflow': 'Overflow: input needs wider integers to process', - 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', - 'invalid-input': 'Invalid input' - }, - - /** Convenience shortcuts */ - baseMinusTMin = base - tMin, - floor = Math.floor, - stringFromCharCode = String.fromCharCode, - - /** Temporary variable */ - key; - - /*--------------------------------------------------------------------------*/ - - /** - * A generic error utility function. - * @private - * @param {String} type The error type. - * @returns {Error} Throws a `RangeError` with the applicable error message. - */ - function error(type) { - throw RangeError(errors[type]); - } - - /** - * A generic `Array#map` utility function. - * @private - * @param {Array} array The array to iterate over. - * @param {Function} callback The function that gets called for every array - * item. - * @returns {Array} A new array of values returned by the callback function. - */ - function map(array, fn) { - var length = array.length; - var result = []; - while (length--) { - result[length] = fn(array[length]); - } - return result; - } - - /** - * A simple `Array#map`-like wrapper to work with domain name strings or email - * addresses. - * @private - * @param {String} domain The domain name or email address. - * @param {Function} callback The function that gets called for every - * character. - * @returns {Array} A new string of characters returned by the callback - * function. - */ - function mapDomain(string, fn) { - var parts = string.split('@'); - var result = ''; - if (parts.length > 1) { - // In email addresses, only the domain name should be punycoded. Leave - // the local part (i.e. everything up to `@`) intact. - result = parts[0] + '@'; - string = parts[1]; - } - // Avoid `split(regex)` for IE8 compatibility. See #17. - string = string.replace(regexSeparators, '\x2E'); - var labels = string.split('.'); - var encoded = map(labels, fn).join('.'); - return result + encoded; - } - - /** - * Creates an array containing the numeric code points of each Unicode - * character in the string. While JavaScript uses UCS-2 internally, - * this function will convert a pair of surrogate halves (each of which - * UCS-2 exposes as separate characters) into a single code point, - * matching UTF-16. - * @see `punycode.ucs2.encode` - * @see - * @memberOf punycode.ucs2 - * @name decode - * @param {String} string The Unicode input string (UCS-2). - * @returns {Array} The new array of code points. - */ - function ucs2decode(string) { - var output = [], - counter = 0, - length = string.length, - value, - extra; - while (counter < length) { - value = string.charCodeAt(counter++); - if (value >= 0xD800 && value <= 0xDBFF && counter < length) { - // high surrogate, and there is a next character - extra = string.charCodeAt(counter++); - if ((extra & 0xFC00) == 0xDC00) { // low surrogate - output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); - } else { - // unmatched surrogate; only append this code unit, in case the next - // code unit is the high surrogate of a surrogate pair - output.push(value); - counter--; - } - } else { - output.push(value); - } - } - return output; - } - - /** - * Creates a string based on an array of numeric code points. - * @see `punycode.ucs2.decode` - * @memberOf punycode.ucs2 - * @name encode - * @param {Array} codePoints The array of numeric code points. - * @returns {String} The new Unicode string (UCS-2). - */ - function ucs2encode(array) { - return map(array, function(value) { - var output = ''; - if (value > 0xFFFF) { - value -= 0x10000; - output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); - value = 0xDC00 | value & 0x3FF; - } - output += stringFromCharCode(value); - return output; - }).join(''); - } - - /** - * Converts a basic code point into a digit/integer. - * @see `digitToBasic()` - * @private - * @param {Number} codePoint The basic numeric code point value. - * @returns {Number} The numeric value of a basic code point (for use in - * representing integers) in the range `0` to `base - 1`, or `base` if - * the code point does not represent a value. - */ - function basicToDigit(codePoint) { - if (codePoint - 48 < 10) { - return codePoint - 22; - } - if (codePoint - 65 < 26) { - return codePoint - 65; - } - if (codePoint - 97 < 26) { - return codePoint - 97; - } - return base; - } - - /** - * Converts a digit/integer into a basic code point. - * @see `basicToDigit()` - * @private - * @param {Number} digit The numeric value of a basic code point. - * @returns {Number} The basic code point whose value (when used for - * representing integers) is `digit`, which needs to be in the range - * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is - * used; else, the lowercase form is used. The behavior is undefined - * if `flag` is non-zero and `digit` has no uppercase form. - */ - function digitToBasic(digit, flag) { - // 0..25 map to ASCII a..z or A..Z - // 26..35 map to ASCII 0..9 - return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); - } - - /** - * Bias adaptation function as per section 3.4 of RFC 3492. - * http://tools.ietf.org/html/rfc3492#section-3.4 - * @private - */ - function adapt(delta, numPoints, firstTime) { - var k = 0; - delta = firstTime ? floor(delta / damp) : delta >> 1; - delta += floor(delta / numPoints); - for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { - delta = floor(delta / baseMinusTMin); - } - return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); - } - - /** - * Converts a Punycode string of ASCII-only symbols to a string of Unicode - * symbols. - * @memberOf punycode - * @param {String} input The Punycode string of ASCII-only symbols. - * @returns {String} The resulting string of Unicode symbols. - */ - function decode(input) { - // Don't use UCS-2 - var output = [], - inputLength = input.length, - out, - i = 0, - n = initialN, - bias = initialBias, - basic, - j, - index, - oldi, - w, - k, - digit, - t, - /** Cached calculation results */ - baseMinusT; - - // Handle the basic code points: let `basic` be the number of input code - // points before the last delimiter, or `0` if there is none, then copy - // the first basic code points to the output. - - basic = input.lastIndexOf(delimiter); - if (basic < 0) { - basic = 0; - } - - for (j = 0; j < basic; ++j) { - // if it's not a basic code point - if (input.charCodeAt(j) >= 0x80) { - error('not-basic'); - } - output.push(input.charCodeAt(j)); - } - - // Main decoding loop: start just after the last delimiter if any basic code - // points were copied; start at the beginning otherwise. - - for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { - - // `index` is the index of the next character to be consumed. - // Decode a generalized variable-length integer into `delta`, - // which gets added to `i`. The overflow checking is easier - // if we increase `i` as we go, then subtract off its starting - // value at the end to obtain `delta`. - for (oldi = i, w = 1, k = base; /* no condition */; k += base) { - - if (index >= inputLength) { - error('invalid-input'); - } - - digit = basicToDigit(input.charCodeAt(index++)); - - if (digit >= base || digit > floor((maxInt - i) / w)) { - error('overflow'); - } - - i += digit * w; - t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); - - if (digit < t) { - break; - } - - baseMinusT = base - t; - if (w > floor(maxInt / baseMinusT)) { - error('overflow'); - } - - w *= baseMinusT; - - } - - out = output.length + 1; - bias = adapt(i - oldi, out, oldi == 0); - - // `i` was supposed to wrap around from `out` to `0`, - // incrementing `n` each time, so we'll fix that now: - if (floor(i / out) > maxInt - n) { - error('overflow'); - } - - n += floor(i / out); - i %= out; - - // Insert `n` at position `i` of the output - output.splice(i++, 0, n); - - } - - return ucs2encode(output); - } - - /** - * Converts a string of Unicode symbols (e.g. a domain name label) to a - * Punycode string of ASCII-only symbols. - * @memberOf punycode - * @param {String} input The string of Unicode symbols. - * @returns {String} The resulting Punycode string of ASCII-only symbols. - */ - function encode(input) { - var n, - delta, - handledCPCount, - basicLength, - bias, - j, - m, - q, - k, - t, - currentValue, - output = [], - /** `inputLength` will hold the number of code points in `input`. */ - inputLength, - /** Cached calculation results */ - handledCPCountPlusOne, - baseMinusT, - qMinusT; - - // Convert the input in UCS-2 to Unicode - input = ucs2decode(input); - - // Cache the length - inputLength = input.length; - - // Initialize the state - n = initialN; - delta = 0; - bias = initialBias; - - // Handle the basic code points - for (j = 0; j < inputLength; ++j) { - currentValue = input[j]; - if (currentValue < 0x80) { - output.push(stringFromCharCode(currentValue)); - } - } - - handledCPCount = basicLength = output.length; - - // `handledCPCount` is the number of code points that have been handled; - // `basicLength` is the number of basic code points. - - // Finish the basic string - if it is not empty - with a delimiter - if (basicLength) { - output.push(delimiter); - } - - // Main encoding loop: - while (handledCPCount < inputLength) { - - // All non-basic code points < n have been handled already. Find the next - // larger one: - for (m = maxInt, j = 0; j < inputLength; ++j) { - currentValue = input[j]; - if (currentValue >= n && currentValue < m) { - m = currentValue; - } - } - - // Increase `delta` enough to advance the decoder's state to , - // but guard against overflow - handledCPCountPlusOne = handledCPCount + 1; - if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { - error('overflow'); - } - - delta += (m - n) * handledCPCountPlusOne; - n = m; - - for (j = 0; j < inputLength; ++j) { - currentValue = input[j]; - - if (currentValue < n && ++delta > maxInt) { - error('overflow'); - } - - if (currentValue == n) { - // Represent delta as a generalized variable-length integer - for (q = delta, k = base; /* no condition */; k += base) { - t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); - if (q < t) { - break; - } - qMinusT = q - t; - baseMinusT = base - t; - output.push( - stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) - ); - q = floor(qMinusT / baseMinusT); - } - - output.push(stringFromCharCode(digitToBasic(q, 0))); - bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); - delta = 0; - ++handledCPCount; - } - } - - ++delta; - ++n; - - } - return output.join(''); - } - - /** - * Converts a Punycode string representing a domain name or an email address - * to Unicode. Only the Punycoded parts of the input will be converted, i.e. - * it doesn't matter if you call it on a string that has already been - * converted to Unicode. - * @memberOf punycode - * @param {String} input The Punycoded domain name or email address to - * convert to Unicode. - * @returns {String} The Unicode representation of the given Punycode - * string. - */ - function toUnicode(input) { - return mapDomain(input, function(string) { - return regexPunycode.test(string) - ? decode(string.slice(4).toLowerCase()) - : string; - }); - } - - /** - * Converts a Unicode string representing a domain name or an email address to - * Punycode. Only the non-ASCII parts of the domain name will be converted, - * i.e. it doesn't matter if you call it with a domain that's already in - * ASCII. - * @memberOf punycode - * @param {String} input The domain name or email address to convert, as a - * Unicode string. - * @returns {String} The Punycode representation of the given domain name or - * email address. - */ - function toASCII(input) { - return mapDomain(input, function(string) { - return regexNonASCII.test(string) - ? 'xn--' + encode(string) - : string; - }); - } - - /*--------------------------------------------------------------------------*/ - - /** Define the public API */ - punycode = { - /** - * A string representing the current Punycode.js version number. - * @memberOf punycode - * @type String - */ - 'version': '1.3.2', - /** - * An object of methods to convert from JavaScript's internal character - * representation (UCS-2) to Unicode code points, and back. - * @see - * @memberOf punycode - * @type Object - */ - 'ucs2': { - 'decode': ucs2decode, - 'encode': ucs2encode - }, - 'decode': decode, - 'encode': encode, - 'toASCII': toASCII, - 'toUnicode': toUnicode - }; - - /** Expose `punycode` */ - // Some AMD build optimizers, like r.js, check for specific condition patterns - // like the following: - if ( - typeof define == 'function' && - typeof define.amd == 'object' && - define.amd - ) { - define('punycode', function() { - return punycode; - }); - } else if (freeExports && freeModule) { - if (module.exports == freeExports) { // in Node.js or RingoJS v0.8.0+ - freeModule.exports = punycode; - } else { // in Narwhal or RingoJS v0.7.0- - for (key in punycode) { - punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]); - } - } - } else { // in Rhino or a web browser - root.punycode = punycode; - } - -}(this)); diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/package.json b/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/package.json deleted file mode 100644 index f4ede6689..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "author": { - "name": "GoInstant Inc., a salesforce.com company" - }, - "license": "MIT", - "name": "tough-cookie", - "description": "RFC6265 Cookies and Cookie Jar for node.js", - "keywords": [ - "HTTP", - "cookie", - "cookies", - "set-cookie", - "cookiejar", - "jar", - "RFC6265", - "RFC2965" - ], - "version": "0.12.1", - "homepage": "https://github.com/goinstant/tough-cookie", - "repository": { - "type": "git", - "url": "git://github.com/goinstant/tough-cookie.git" - }, - "bugs": { - "url": "https://github.com/goinstant/tough-cookie/issues" - }, - "main": "./lib/cookie", - "scripts": { - "test": "vows test.js" - }, - "engines": { - "node": ">=0.4.12" - }, - "dependencies": { - "punycode": ">=0.2.0" - }, - "devDependencies": { - "vows": "0.7.0", - "async": ">=0.1.12" - }, - "readme": "[RFC6265](http://tools.ietf.org/html/rfc6265) Cookies and CookieJar for Node.js\n\n![Tough Cookie](http://www.goinstant.com.s3.amazonaws.com/tough-cookie.jpg)\n\n[![Build Status](https://travis-ci.org/goinstant/node-cookie.png?branch=master)](https://travis-ci.org/goinstant/node-cookie)\n\n[![NPM Stats](https://nodei.co/npm/tough-cookie.png?downloads=true&stars=true)](https://npmjs.org/package/tough-cookie)\n![NPM Downloads](https://nodei.co/npm-dl/tough-cookie.png?months=9)\n\n# Synopsis\n\n``` javascript\nvar tough = require('tough-cookie'); // note: not 'cookie', 'cookies' or 'node-cookie'\nvar Cookie = tough.Cookie;\nvar cookie = Cookie.parse(header);\ncookie.value = 'somethingdifferent';\nheader = cookie.toString();\n\nvar cookiejar = new tough.CookieJar();\ncookiejar.setCookie(cookie, 'http://currentdomain.example.com/path', cb);\n// ...\ncookiejar.getCookies('http://example.com/otherpath',function(err,cookies) {\n res.headers['cookie'] = cookies.join('; ');\n});\n```\n\n# Installation\n\nIt's _so_ easy!\n\n`npm install tough-cookie`\n\nRequires `punycode`, which should get installed automatically for you. Note that node.js v0.6.2+ bundles punycode by default.\n\nWhy the name? NPM modules `cookie`, `cookies` and `cookiejar` were already taken.\n\n# API\n\ntough\n=====\n\nFunctions on the module you get from `require('tough-cookie')`. All can be used as pure functions and don't need to be \"bound\".\n\nparseDate(string[,strict])\n-----------------\n\nParse a cookie date string into a `Date`. Parses according to RFC6265 Section 5.1.1, not `Date.parse()`. If strict is set to true then leading/trailing non-seperator characters around the time part will cause the parsing to fail (e.g. \"Thu, 01 Jan 1970 00:00:010 GMT\" has an extra trailing zero but Chrome, an assumedly RFC-compliant browser, treats this as valid).\n\nformatDate(date)\n----------------\n\nFormat a Date into a RFC1123 string (the RFC6265-recommended format).\n\ncanonicalDomain(str)\n--------------------\n\nTransforms a domain-name into a canonical domain-name. The canonical domain-name is a trimmed, lowercased, stripped-of-leading-dot and optionally punycode-encoded domain-name (Section 5.1.2 of RFC6265). For the most part, this function is idempotent (can be run again on its output without ill effects).\n\ndomainMatch(str,domStr[,canonicalize=true])\n-------------------------------------------\n\nAnswers \"does this real domain match the domain in a cookie?\". The `str` is the \"current\" domain-name and the `domStr` is the \"cookie\" domain-name. Matches according to RFC6265 Section 5.1.3, but it helps to think of it as a \"suffix match\".\n\nThe `canonicalize` parameter will run the other two paramters through `canonicalDomain` or not.\n\ndefaultPath(path)\n-----------------\n\nGiven a current request/response path, gives the Path apropriate for storing in a cookie. This is basically the \"directory\" of a \"file\" in the path, but is specified by Section 5.1.4 of the RFC.\n\nThe `path` parameter MUST be _only_ the pathname part of a URI (i.e. excludes the hostname, query, fragment, etc.). This is the `.pathname` property of node's `uri.parse()` output.\n\npathMatch(reqPath,cookiePath)\n-----------------------------\n\nAnswers \"does the request-path path-match a given cookie-path?\" as per RFC6265 Section 5.1.4. Returns a boolean.\n\nThis is essentially a prefix-match where `cookiePath` is a prefix of `reqPath`.\n\nparse(header[,strict=false])\n----------------------------\n\nalias for `Cookie.parse(header[,strict])`\n\nfromJSON(string)\n----------------\n\nalias for `Cookie.fromJSON(string)`\n\ngetPublicSuffix(hostname)\n-------------------------\n\nReturns the public suffix of this hostname. The public suffix is the shortest domain-name upon which a cookie can be set. Returns `null` if the hostname cannot have cookies set for it.\n\nFor example: `www.example.com` and `www.subdomain.example.com` both have public suffix `example.com`.\n\nFor further information, see http://publicsuffix.org/. This module derives its list from that site.\n\ncookieCompare(a,b)\n------------------\n\nFor use with `.sort()`, sorts a list of cookies into the recommended order given in the RFC (Section 5.4 step 2). Longest `.path`s go first, then sorted oldest to youngest.\n\n``` javascript\nvar cookies = [ /* unsorted array of Cookie objects */ ];\ncookies = cookies.sort(cookieCompare);\n```\n\npermuteDomain(domain)\n---------------------\n\nGenerates a list of all possible domains that `domainMatch()` the parameter. May be handy for implementing cookie stores.\n\n\npermutePath(path)\n-----------------\n\nGenerates a list of all possible paths that `pathMatch()` the parameter. May be handy for implementing cookie stores.\n\nCookie\n======\n\nCookie.parse(header[,strict=false])\n-----------------------------------\n\nParses a single Cookie or Set-Cookie HTTP header into a `Cookie` object. Returns `undefined` if the string can't be parsed. If in strict mode, returns `undefined` if the cookie doesn't follow the guidelines in section 4 of RFC6265. Generally speaking, strict mode can be used to validate your own generated Set-Cookie headers, but acting as a client you want to be lenient and leave strict mode off.\n\nHere's how to process the Set-Cookie header(s) on a node HTTP/HTTPS response:\n\n``` javascript\nif (res.headers['set-cookie'] instanceof Array)\n cookies = res.headers['set-cookie'].map(function (c) { return (Cookie.parse(c)); });\nelse\n cookies = [Cookie.parse(res.headers['set-cookie'])];\n```\n\nCookie.fromJSON(string)\n-----------------------\n\nConvert a JSON string to a `Cookie` object. Does a `JSON.parse()` and converts the `.created`, `.lastAccessed` and `.expires` properties into `Date` objects.\n\nProperties\n==========\n\n * _key_ - string - the name or key of the cookie (default \"\")\n * _value_ - string - the value of the cookie (default \"\")\n * _expires_ - `Date` - if set, the `Expires=` attribute of the cookie (defaults to the string `\"Infinity\"`). See `setExpires()`\n * _maxAge_ - seconds - if set, the `Max-Age=` attribute _in seconds_ of the cookie. May also be set to strings `\"Infinity\"` and `\"-Infinity\"` for non-expiry and immediate-expiry, respectively. See `setMaxAge()`\n * _domain_ - string - the `Domain=` attribute of the cookie\n * _path_ - string - the `Path=` of the cookie\n * _secure_ - boolean - the `Secure` cookie flag\n * _httpOnly_ - boolean - the `HttpOnly` cookie flag\n * _extensions_ - `Array` - any unrecognized cookie attributes as strings (even if equal-signs inside)\n\nAfter a cookie has been passed through `CookieJar.setCookie()` it will have the following additional attributes:\n\n * _hostOnly_ - boolean - is this a host-only cookie (i.e. no Domain field was set, but was instead implied)\n * _pathIsDefault_ - boolean - if true, there was no Path field on the cookie and `defaultPath()` was used to derive one.\n * _created_ - `Date` - when this cookie was added to the jar\n * _lastAccessed_ - `Date` - last time the cookie got accessed. Will affect cookie cleaning once implemented. Using `cookiejar.getCookies(...)` will update this attribute.\n\nConstruction([{options}])\n------------\n\nReceives an options object that can contain any Cookie properties, uses the default for unspecified properties.\n\n.toString()\n-----------\n\nencode to a Set-Cookie header value. The Expires cookie field is set using `formatDate()`, but is omitted entirely if `.expires` is `Infinity`.\n\n.cookieString()\n---------------\n\nencode to a Cookie header value (i.e. the `.key` and `.value` properties joined with '=').\n\n.setExpires(String)\n-------------------\n\nsets the expiry based on a date-string passed through `parseDate()`. If parseDate returns `null` (i.e. can't parse this date string), `.expires` is set to `\"Infinity\"` (a string) is set.\n\n.setMaxAge(number)\n-------------------\n\nsets the maxAge in seconds. Coerces `-Infinity` to `\"-Infinity\"` and `Infinity` to `\"Infinity\"` so it JSON serializes correctly.\n\n.expiryTime([now=Date.now()])\n-----------------------------\n\n.expiryDate([now=Date.now()])\n-----------------------------\n\nexpiryTime() Computes the absolute unix-epoch milliseconds that this cookie expires. expiryDate() works similarly, except it returns a `Date` object. Note that in both cases the `now` parameter should be milliseconds.\n\nMax-Age takes precedence over Expires (as per the RFC). The `.created` attribute -- or, by default, the `now` paramter -- is used to offset the `.maxAge` attribute.\n\nIf Expires (`.expires`) is set, that's returned.\n\nOtherwise, `expiryTime()` returns `Infinity` and `expiryDate()` returns a `Date` object for \"Tue, 19 Jan 2038 03:14:07 GMT\" (latest date that can be expressed by a 32-bit `time_t`; the common limit for most user-agents).\n\n.TTL([now=Date.now()])\n---------\n\ncompute the TTL relative to `now` (milliseconds). The same precedence rules as for `expiryTime`/`expiryDate` apply.\n\nThe \"number\" `Infinity` is returned for cookies without an explicit expiry and `0` is returned if the cookie is expired. Otherwise a time-to-live in milliseconds is returned.\n\n.canonicalizedDoman()\n---------------------\n\n.cdomain()\n----------\n\nreturn the canonicalized `.domain` field. This is lower-cased and punycode (RFC3490) encoded if the domain has any non-ASCII characters.\n\n.validate()\n-----------\n\nStatus: *IN PROGRESS*. Works for a few things, but is by no means comprehensive.\n\nvalidates cookie attributes for semantic correctness. Useful for \"lint\" checking any Set-Cookie headers you generate. For now, it returns a boolean, but eventually could return a reason string -- you can future-proof with this construct:\n\n``` javascript\nif (cookie.validate() === true) {\n // it's tasty\n} else {\n // yuck!\n}\n```\n\nCookieJar\n=========\n\nConstruction([store = new MemoryCookieStore()][, rejectPublicSuffixes])\n------------\n\nSimply use `new CookieJar()`. If you'd like to use a custom store, pass that to the constructor otherwise a `MemoryCookieStore` will be created and used.\n\n\nAttributes\n----------\n\n * _rejectPublicSuffixes_ - boolean - reject cookies with domains like \"com\" and \"co.uk\" (default: `true`)\n\nSince eventually this module would like to support database/remote/etc. CookieJars, continuation passing style is used for CookieJar methods.\n\n.setCookie(cookieOrString, currentUrl, [{options},] cb(err,cookie))\n-------------------------------------------------------------------\n\nAttempt to set the cookie in the cookie jar. If the operation fails, an error will be given to the callback `cb`, otherwise the cookie is passed through. The cookie will have updated `.created`, `.lastAccessed` and `.hostOnly` properties.\n\nThe `options` object can be omitted and can have the following properties:\n\n * _http_ - boolean - default `true` - indicates if this is an HTTP or non-HTTP API. Affects HttpOnly cookies.\n * _secure_ - boolean - autodetect from url - indicates if this is a \"Secure\" API. If the currentUrl starts with `https:` or `wss:` then this is defaulted to `true`, otherwise `false`.\n * _now_ - Date - default `new Date()` - what to use for the creation/access time of cookies\n * _strict_ - boolean - default `false` - perform extra checks\n * _ignoreError_ - boolean - default `false` - silently ignore things like parse errors and invalid domains. CookieStore errors aren't ignored by this option.\n\nAs per the RFC, the `.hostOnly` property is set if there was no \"Domain=\" parameter in the cookie string (or `.domain` was null on the Cookie object). The `.domain` property is set to the fully-qualified hostname of `currentUrl` in this case. Matching this cookie requires an exact hostname match (not a `domainMatch` as per usual).\n\n.setCookieSync(cookieOrString, currentUrl, [{options}])\n-------------------------------------------------------\n\nSynchronous version of `setCookie`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).\n\n.storeCookie(cookie, [{options},] cb(err,cookie))\n-------------------------------------------------\n\n__REMOVED__ removed in lieu of the CookieStore API below\n\n.getCookies(currentUrl, [{options},] cb(err,cookies))\n-----------------------------------------------------\n\nRetrieve the list of cookies that can be sent in a Cookie header for the current url.\n\nIf an error is encountered, that's passed as `err` to the callback, otherwise an `Array` of `Cookie` objects is passed. The array is sorted with `cookieCompare()` unless the `{sort:false}` option is given.\n\nThe `options` object can be omitted and can have the following properties:\n\n * _http_ - boolean - default `true` - indicates if this is an HTTP or non-HTTP API. Affects HttpOnly cookies.\n * _secure_ - boolean - autodetect from url - indicates if this is a \"Secure\" API. If the currentUrl starts with `https:` or `wss:` then this is defaulted to `true`, otherwise `false`.\n * _now_ - Date - default `new Date()` - what to use for the creation/access time of cookies\n * _expire_ - boolean - default `true` - perform expiry-time checking of cookies and asynchronously remove expired cookies from the store. Using `false` will return expired cookies and **not** remove them from the store (which is useful for replaying Set-Cookie headers, potentially).\n * _allPaths_ - boolean - default `false` - if `true`, do not scope cookies by path. The default uses RFC-compliant path scoping. **Note**: may not be supported by the CookieStore `fetchCookies` function (the default MemoryCookieStore supports it).\n\nThe `.lastAccessed` property of the returned cookies will have been updated.\n\n.getCookiesSync(currentUrl, [{options}])\n----------------------------------------\n\nSynchronous version of `getCookies`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).\n\n.getCookieString(...)\n---------------------\n\nAccepts the same options as `.getCookies()` but passes a string suitable for a Cookie header rather than an array to the callback. Simply maps the `Cookie` array via `.cookieString()`.\n\n.getCookieStringSync(...)\n-------------------------\n\nSynchronous version of `getCookieString`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).\n\n.getSetCookieStrings(...)\n-------------------------\n\nReturns an array of strings suitable for **Set-Cookie** headers. Accepts the same options as `.getCookies()`. Simply maps the cookie array via `.toString()`.\n\n.getSetCookieStringsSync(...)\n-----------------------------\n\nSynchronous version of `getSetCookieStrings`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).\n\nStore\n=====\n\nBase class for CookieJar stores.\n\n# CookieStore API\n\nThe storage model for each `CookieJar` instance can be replaced with a custom implementation. The default is `MemoryCookieStore` which can be found in the `lib/memstore.js` file. The API uses continuation-passing-style to allow for asynchronous stores.\n\nStores should inherit from the base `Store` class, which is available as `require('tough-cookie').Store`. Stores are asynchronous by default, but if `store.synchronous` is set, then the `*Sync` methods on the CookieJar can be used.\n\nAll `domain` parameters will have been normalized before calling.\n\nThe Cookie store must have all of the following methods.\n\nstore.findCookie(domain, path, key, cb(err,cookie))\n---------------------------------------------------\n\nRetrieve a cookie with the given domain, path and key (a.k.a. name). The RFC maintains that exactly one of these cookies should exist in a store. If the store is using versioning, this means that the latest/newest such cookie should be returned.\n\nCallback takes an error and the resulting `Cookie` object. If no cookie is found then `null` MUST be passed instead (i.e. not an error).\n\nstore.findCookies(domain, path, cb(err,cookies))\n------------------------------------------------\n\nLocates cookies matching the given domain and path. This is most often called in the context of `cookiejar.getCookies()` above.\n\nIf no cookies are found, the callback MUST be passed an empty array.\n\nThe resulting list will be checked for applicability to the current request according to the RFC (domain-match, path-match, http-only-flag, secure-flag, expiry, etc.), so it's OK to use an optimistic search algorithm when implementing this method. However, the search algorithm used SHOULD try to find cookies that `domainMatch()` the domain and `pathMatch()` the path in order to limit the amount of checking that needs to be done.\n\nAs of version 0.9.12, the `allPaths` option to `cookiejar.getCookies()` above will cause the path here to be `null`. If the path is `null`, path-matching MUST NOT be performed (i.e. domain-matching only).\n\nstore.putCookie(cookie, cb(err))\n--------------------------------\n\nAdds a new cookie to the store. The implementation SHOULD replace any existing cookie with the same `.domain`, `.path`, and `.key` properties -- depending on the nature of the implementation, it's possible that between the call to `fetchCookie` and `putCookie` that a duplicate `putCookie` can occur.\n\nThe `cookie` object MUST NOT be modified; the caller will have already updated the `.creation` and `.lastAccessed` properties.\n\nPass an error if the cookie cannot be stored.\n\nstore.updateCookie(oldCookie, newCookie, cb(err))\n-------------------------------------------------\n\nUpdate an existing cookie. The implementation MUST update the `.value` for a cookie with the same `domain`, `.path` and `.key`. The implementation SHOULD check that the old value in the store is equivalent to `oldCookie` - how the conflict is resolved is up to the store.\n\nThe `.lastAccessed` property will always be different between the two objects and `.created` will always be the same. Stores MAY ignore or defer the `.lastAccessed` change at the cost of affecting how cookies are sorted (or selected for deletion).\n\nStores may wish to optimize changing the `.value` of the cookie in the store versus storing a new cookie. If the implementation doesn't define this method a stub that calls `putCookie(newCookie,cb)` will be added to the store object.\n\nThe `newCookie` and `oldCookie` objects MUST NOT be modified.\n\nPass an error if the newCookie cannot be stored.\n\nstore.removeCookie(domain, path, key, cb(err))\n----------------------------------------------\n\nRemove a cookie from the store (see notes on `findCookie` about the uniqueness constraint).\n\nThe implementation MUST NOT pass an error if the cookie doesn't exist; only pass an error due to the failure to remove an existing cookie.\n\nstore.removeCookies(domain, path, cb(err))\n------------------------------------------\n\nRemoves matching cookies from the store. The `path` paramter is optional, and if missing means all paths in a domain should be removed.\n\nPass an error ONLY if removing any existing cookies failed.\n\n# TODO\n\n * _full_ RFC5890/RFC5891 canonicalization for domains in `cdomain()`\n * the optional `punycode` requirement implements RFC3492, but RFC6265 requires RFC5891\n * better tests for `validate()`?\n\n# Copyright and License\n\n(tl;dr: MIT with some MPL/1.1)\n\nCopyright 2012- GoInstant, Inc. and other contributors. All rights reserved.\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to\ndeal in the Software without restriction, including without limitation the\nrights to use, copy, modify, merge, publish, distribute, sublicense, and/or\nsell copies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\nIN THE SOFTWARE.\n\nPortions may be licensed under different licenses (in particular public-suffix.txt is MPL/1.1); please read the LICENSE file for full details.\n", - "readmeFilename": "README.md", - "_id": "tough-cookie@0.12.1", - "dist": { - "shasum": "8220c7e21abd5b13d96804254bd5a81ebf2c7d62", - "tarball": "http://registry.npmjs.org/tough-cookie/-/tough-cookie-0.12.1.tgz" - }, - "_from": "tough-cookie@>=0.12.0", - "_npmVersion": "1.3.11", - "_npmUser": { - "name": "goinstant", - "email": "support@goinstant.com" - }, - "maintainers": [ - { - "name": "jstash", - "email": "jeremy@goinstant.com" - }, - { - "name": "goinstant", - "email": "services@goinstant.com" - } - ], - "directories": {}, - "_shasum": "8220c7e21abd5b13d96804254bd5a81ebf2c7d62", - "_resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-0.12.1.tgz" -} diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/public-suffix.txt b/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/public-suffix.txt deleted file mode 100644 index 2c2013127..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/public-suffix.txt +++ /dev/null @@ -1,5229 +0,0 @@ -// ***** BEGIN LICENSE BLOCK ***** -// Version: MPL 1.1/GPL 2.0/LGPL 2.1 -// -// The contents of this file are subject to the Mozilla Public License Version -// 1.1 (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// http://www.mozilla.org/MPL/ -// -// Software distributed under the License is distributed on an "AS IS" basis, -// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -// for the specific language governing rights and limitations under the -// License. -// -// The Original Code is the Public Suffix List. -// -// The Initial Developer of the Original Code is -// Jo Hermans . -// Portions created by the Initial Developer are Copyright (C) 2007 -// the Initial Developer. All Rights Reserved. -// -// Contributor(s): -// Ruben Arakelyan -// Gervase Markham -// Pamela Greene -// David Triendl -// Jothan Frakes -// The kind representatives of many TLD registries -// -// Alternatively, the contents of this file may be used under the terms of -// either the GNU General Public License Version 2 or later (the "GPL"), or -// the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -// in which case the provisions of the GPL or the LGPL are applicable instead -// of those above. If you wish to allow use of your version of this file only -// under the terms of either the GPL or the LGPL, and not to allow others to -// use your version of this file under the terms of the MPL, indicate your -// decision by deleting the provisions above and replace them with the notice -// and other provisions required by the GPL or the LGPL. If you do not delete -// the provisions above, a recipient may use your version of this file under -// the terms of any one of the MPL, the GPL or the LGPL. -// -// ***** END LICENSE BLOCK ***** - -// ===BEGIN ICANN DOMAINS=== - -// ac : http://en.wikipedia.org/wiki/.ac -ac -com.ac -edu.ac -gov.ac -net.ac -mil.ac -org.ac - -// ad : http://en.wikipedia.org/wiki/.ad -ad -nom.ad - -// ae : http://en.wikipedia.org/wiki/.ae -// see also: "Domain Name Eligibility Policy" at http://www.aeda.ae/eng/aepolicy.php -ae -co.ae -net.ae -org.ae -sch.ae -ac.ae -gov.ae -mil.ae - -// aero : see http://www.information.aero/index.php?id=66 -aero -accident-investigation.aero -accident-prevention.aero -aerobatic.aero -aeroclub.aero -aerodrome.aero -agents.aero -aircraft.aero -airline.aero -airport.aero -air-surveillance.aero -airtraffic.aero -air-traffic-control.aero -ambulance.aero -amusement.aero -association.aero -author.aero -ballooning.aero -broker.aero -caa.aero -cargo.aero -catering.aero -certification.aero -championship.aero -charter.aero -civilaviation.aero -club.aero -conference.aero -consultant.aero -consulting.aero -control.aero -council.aero -crew.aero -design.aero -dgca.aero -educator.aero -emergency.aero -engine.aero -engineer.aero -entertainment.aero -equipment.aero -exchange.aero -express.aero -federation.aero -flight.aero -freight.aero -fuel.aero -gliding.aero -government.aero -groundhandling.aero -group.aero -hanggliding.aero -homebuilt.aero -insurance.aero -journal.aero -journalist.aero -leasing.aero -logistics.aero -magazine.aero -maintenance.aero -marketplace.aero -media.aero -microlight.aero -modelling.aero -navigation.aero -parachuting.aero -paragliding.aero -passenger-association.aero -pilot.aero -press.aero -production.aero -recreation.aero -repbody.aero -res.aero -research.aero -rotorcraft.aero -safety.aero -scientist.aero -services.aero -show.aero -skydiving.aero -software.aero -student.aero -taxi.aero -trader.aero -trading.aero -trainer.aero -union.aero -workinggroup.aero -works.aero - -// af : http://www.nic.af/help.jsp -af -gov.af -com.af -org.af -net.af -edu.af - -// ag : http://www.nic.ag/prices.htm -ag -com.ag -org.ag -net.ag -co.ag -nom.ag - -// ai : http://nic.com.ai/ -ai -off.ai -com.ai -net.ai -org.ai - -// al : http://www.ert.gov.al/ert_alb/faq_det.html?Id=31 -al -com.al -edu.al -gov.al -mil.al -net.al -org.al - -// am : http://en.wikipedia.org/wiki/.am -am - -// an : http://www.una.an/an_domreg/default.asp -an -com.an -net.an -org.an -edu.an - -// ao : http://en.wikipedia.org/wiki/.ao -// http://www.dns.ao/REGISTR.DOC -ao -ed.ao -gv.ao -og.ao -co.ao -pb.ao -it.ao - -// aq : http://en.wikipedia.org/wiki/.aq -aq - -// ar : http://en.wikipedia.org/wiki/.ar -*.ar -!congresodelalengua3.ar -!educ.ar -!gobiernoelectronico.ar -!mecon.ar -!nacion.ar -!nic.ar -!promocion.ar -!retina.ar -!uba.ar - -// arpa : http://en.wikipedia.org/wiki/.arpa -// Confirmed by registry 2008-06-18 -e164.arpa -in-addr.arpa -ip6.arpa -iris.arpa -uri.arpa -urn.arpa - -// as : http://en.wikipedia.org/wiki/.as -as -gov.as - -// asia : http://en.wikipedia.org/wiki/.asia -asia - -// at : http://en.wikipedia.org/wiki/.at -// Confirmed by registry 2008-06-17 -at -ac.at -co.at -gv.at -or.at - -// au : http://en.wikipedia.org/wiki/.au -// http://www.auda.org.au/ -// 2LDs -com.au -net.au -org.au -edu.au -gov.au -csiro.au -asn.au -id.au -// Historic 2LDs (closed to new registration, but sites still exist) -info.au -conf.au -oz.au -// CGDNs - http://www.cgdn.org.au/ -act.au -nsw.au -nt.au -qld.au -sa.au -tas.au -vic.au -wa.au -// 3LDs -act.edu.au -nsw.edu.au -nt.edu.au -qld.edu.au -sa.edu.au -tas.edu.au -vic.edu.au -wa.edu.au -act.gov.au -// Removed at request of Shae.Donelan@services.nsw.gov.au, 2010-03-04 -// nsw.gov.au -nt.gov.au -qld.gov.au -sa.gov.au -tas.gov.au -vic.gov.au -wa.gov.au - -// aw : http://en.wikipedia.org/wiki/.aw -aw -com.aw - -// ax : http://en.wikipedia.org/wiki/.ax -ax - -// az : http://en.wikipedia.org/wiki/.az -az -com.az -net.az -int.az -gov.az -org.az -edu.az -info.az -pp.az -mil.az -name.az -pro.az -biz.az - -// ba : http://en.wikipedia.org/wiki/.ba -ba -org.ba -net.ba -edu.ba -gov.ba -mil.ba -unsa.ba -unbi.ba -co.ba -com.ba -rs.ba - -// bb : http://en.wikipedia.org/wiki/.bb -bb -biz.bb -com.bb -edu.bb -gov.bb -info.bb -net.bb -org.bb -store.bb - -// bd : http://en.wikipedia.org/wiki/.bd -*.bd - -// be : http://en.wikipedia.org/wiki/.be -// Confirmed by registry 2008-06-08 -be -ac.be - -// bf : http://en.wikipedia.org/wiki/.bf -bf -gov.bf - -// bg : http://en.wikipedia.org/wiki/.bg -// https://www.register.bg/user/static/rules/en/index.html -bg -a.bg -b.bg -c.bg -d.bg -e.bg -f.bg -g.bg -h.bg -i.bg -j.bg -k.bg -l.bg -m.bg -n.bg -o.bg -p.bg -q.bg -r.bg -s.bg -t.bg -u.bg -v.bg -w.bg -x.bg -y.bg -z.bg -0.bg -1.bg -2.bg -3.bg -4.bg -5.bg -6.bg -7.bg -8.bg -9.bg - -// bh : http://en.wikipedia.org/wiki/.bh -bh -com.bh -edu.bh -net.bh -org.bh -gov.bh - -// bi : http://en.wikipedia.org/wiki/.bi -// http://whois.nic.bi/ -bi -co.bi -com.bi -edu.bi -or.bi -org.bi - -// biz : http://en.wikipedia.org/wiki/.biz -biz - -// bj : http://en.wikipedia.org/wiki/.bj -bj -asso.bj -barreau.bj -gouv.bj - -// bm : http://www.bermudanic.bm/dnr-text.txt -bm -com.bm -edu.bm -gov.bm -net.bm -org.bm - -// bn : http://en.wikipedia.org/wiki/.bn -*.bn - -// bo : http://www.nic.bo/ -bo -com.bo -edu.bo -gov.bo -gob.bo -int.bo -org.bo -net.bo -mil.bo -tv.bo - -// br : http://registro.br/dominio/dpn.html -// Updated by registry 2011-03-01 -br -adm.br -adv.br -agr.br -am.br -arq.br -art.br -ato.br -b.br -bio.br -blog.br -bmd.br -can.br -cim.br -cng.br -cnt.br -com.br -coop.br -ecn.br -edu.br -emp.br -eng.br -esp.br -etc.br -eti.br -far.br -flog.br -fm.br -fnd.br -fot.br -fst.br -g12.br -ggf.br -gov.br -imb.br -ind.br -inf.br -jor.br -jus.br -lel.br -mat.br -med.br -mil.br -mus.br -net.br -nom.br -not.br -ntr.br -odo.br -org.br -ppg.br -pro.br -psc.br -psi.br -qsl.br -radio.br -rec.br -slg.br -srv.br -taxi.br -teo.br -tmp.br -trd.br -tur.br -tv.br -vet.br -vlog.br -wiki.br -zlg.br - -// bs : http://www.nic.bs/rules.html -bs -com.bs -net.bs -org.bs -edu.bs -gov.bs - -// bt : http://en.wikipedia.org/wiki/.bt -bt -com.bt -edu.bt -gov.bt -net.bt -org.bt - -// bv : No registrations at this time. -// Submitted by registry 2006-06-16 - -// bw : http://en.wikipedia.org/wiki/.bw -// http://www.gobin.info/domainname/bw.doc -// list of other 2nd level tlds ? -bw -co.bw -org.bw - -// by : http://en.wikipedia.org/wiki/.by -// http://tld.by/rules_2006_en.html -// list of other 2nd level tlds ? -by -gov.by -mil.by -// Official information does not indicate that com.by is a reserved -// second-level domain, but it's being used as one (see www.google.com.by and -// www.yahoo.com.by, for example), so we list it here for safety's sake. -com.by - -// http://hoster.by/ -of.by - -// bz : http://en.wikipedia.org/wiki/.bz -// http://www.belizenic.bz/ -bz -com.bz -net.bz -org.bz -edu.bz -gov.bz - -// ca : http://en.wikipedia.org/wiki/.ca -ca -// ca geographical names -ab.ca -bc.ca -mb.ca -nb.ca -nf.ca -nl.ca -ns.ca -nt.ca -nu.ca -on.ca -pe.ca -qc.ca -sk.ca -yk.ca -// gc.ca: http://en.wikipedia.org/wiki/.gc.ca -// see also: http://registry.gc.ca/en/SubdomainFAQ -gc.ca - -// cat : http://en.wikipedia.org/wiki/.cat -cat - -// cc : http://en.wikipedia.org/wiki/.cc -cc - -// cd : http://en.wikipedia.org/wiki/.cd -// see also: https://www.nic.cd/domain/insertDomain_2.jsp?act=1 -cd -gov.cd - -// cf : http://en.wikipedia.org/wiki/.cf -cf - -// cg : http://en.wikipedia.org/wiki/.cg -cg - -// ch : http://en.wikipedia.org/wiki/.ch -ch - -// ci : http://en.wikipedia.org/wiki/.ci -// http://www.nic.ci/index.php?page=charte -ci -org.ci -or.ci -com.ci -co.ci -edu.ci -ed.ci -ac.ci -net.ci -go.ci -asso.ci -aéroport.ci -int.ci -presse.ci -md.ci -gouv.ci - -// ck : http://en.wikipedia.org/wiki/.ck -*.ck -!www.ck - -// cl : http://en.wikipedia.org/wiki/.cl -cl -gov.cl -gob.cl -co.cl -mil.cl - -// cm : http://en.wikipedia.org/wiki/.cm -cm -gov.cm - -// cn : http://en.wikipedia.org/wiki/.cn -// Submitted by registry 2008-06-11 -cn -ac.cn -com.cn -edu.cn -gov.cn -net.cn -org.cn -mil.cn -公司.cn -网络.cn -網絡.cn -// cn geographic names -ah.cn -bj.cn -cq.cn -fj.cn -gd.cn -gs.cn -gz.cn -gx.cn -ha.cn -hb.cn -he.cn -hi.cn -hl.cn -hn.cn -jl.cn -js.cn -jx.cn -ln.cn -nm.cn -nx.cn -qh.cn -sc.cn -sd.cn -sh.cn -sn.cn -sx.cn -tj.cn -xj.cn -xz.cn -yn.cn -zj.cn -hk.cn -mo.cn -tw.cn - -// co : http://en.wikipedia.org/wiki/.co -// Submitted by registry 2008-06-11 -co -arts.co -com.co -edu.co -firm.co -gov.co -info.co -int.co -mil.co -net.co -nom.co -org.co -rec.co -web.co - -// com : http://en.wikipedia.org/wiki/.com -com - -// coop : http://en.wikipedia.org/wiki/.coop -coop - -// cr : http://www.nic.cr/niccr_publico/showRegistroDominiosScreen.do -cr -ac.cr -co.cr -ed.cr -fi.cr -go.cr -or.cr -sa.cr - -// cu : http://en.wikipedia.org/wiki/.cu -cu -com.cu -edu.cu -org.cu -net.cu -gov.cu -inf.cu - -// cv : http://en.wikipedia.org/wiki/.cv -cv - -// cx : http://en.wikipedia.org/wiki/.cx -// list of other 2nd level tlds ? -cx -gov.cx - -// cy : http://en.wikipedia.org/wiki/.cy -*.cy - -// cz : http://en.wikipedia.org/wiki/.cz -cz - -// de : http://en.wikipedia.org/wiki/.de -// Confirmed by registry (with technical -// reservations) 2008-07-01 -de - -// dj : http://en.wikipedia.org/wiki/.dj -dj - -// dk : http://en.wikipedia.org/wiki/.dk -// Confirmed by registry 2008-06-17 -dk - -// dm : http://en.wikipedia.org/wiki/.dm -dm -com.dm -net.dm -org.dm -edu.dm -gov.dm - -// do : http://en.wikipedia.org/wiki/.do -do -art.do -com.do -edu.do -gob.do -gov.do -mil.do -net.do -org.do -sld.do -web.do - -// dz : http://en.wikipedia.org/wiki/.dz -dz -com.dz -org.dz -net.dz -gov.dz -edu.dz -asso.dz -pol.dz -art.dz - -// ec : http://www.nic.ec/reg/paso1.asp -// Submitted by registry 2008-07-04 -ec -com.ec -info.ec -net.ec -fin.ec -k12.ec -med.ec -pro.ec -org.ec -edu.ec -gov.ec -gob.ec -mil.ec - -// edu : http://en.wikipedia.org/wiki/.edu -edu - -// ee : http://www.eenet.ee/EENet/dom_reeglid.html#lisa_B -ee -edu.ee -gov.ee -riik.ee -lib.ee -med.ee -com.ee -pri.ee -aip.ee -org.ee -fie.ee - -// eg : http://en.wikipedia.org/wiki/.eg -eg -com.eg -edu.eg -eun.eg -gov.eg -mil.eg -name.eg -net.eg -org.eg -sci.eg - -// er : http://en.wikipedia.org/wiki/.er -*.er - -// es : https://www.nic.es/site_ingles/ingles/dominios/index.html -es -com.es -nom.es -org.es -gob.es -edu.es - -// et : http://en.wikipedia.org/wiki/.et -*.et - -// eu : http://en.wikipedia.org/wiki/.eu -eu - -// fi : http://en.wikipedia.org/wiki/.fi -fi -// aland.fi : http://en.wikipedia.org/wiki/.ax -// This domain is being phased out in favor of .ax. As there are still many -// domains under aland.fi, we still keep it on the list until aland.fi is -// completely removed. -// TODO: Check for updates (expected to be phased out around Q1/2009) -aland.fi - -// fj : http://en.wikipedia.org/wiki/.fj -*.fj - -// fk : http://en.wikipedia.org/wiki/.fk -*.fk - -// fm : http://en.wikipedia.org/wiki/.fm -fm - -// fo : http://en.wikipedia.org/wiki/.fo -fo - -// fr : http://www.afnic.fr/ -// domaines descriptifs : http://www.afnic.fr/obtenir/chartes/nommage-fr/annexe-descriptifs -fr -com.fr -asso.fr -nom.fr -prd.fr -presse.fr -tm.fr -// domaines sectoriels : http://www.afnic.fr/obtenir/chartes/nommage-fr/annexe-sectoriels -aeroport.fr -assedic.fr -avocat.fr -avoues.fr -cci.fr -chambagri.fr -chirurgiens-dentistes.fr -experts-comptables.fr -geometre-expert.fr -gouv.fr -greta.fr -huissier-justice.fr -medecin.fr -notaires.fr -pharmacien.fr -port.fr -veterinaire.fr - -// ga : http://en.wikipedia.org/wiki/.ga -ga - -// gb : This registry is effectively dormant -// Submitted by registry 2008-06-12 - -// gd : http://en.wikipedia.org/wiki/.gd -gd - -// ge : http://www.nic.net.ge/policy_en.pdf -ge -com.ge -edu.ge -gov.ge -org.ge -mil.ge -net.ge -pvt.ge - -// gf : http://en.wikipedia.org/wiki/.gf -gf - -// gg : http://www.channelisles.net/applic/avextn.shtml -gg -co.gg -org.gg -net.gg -sch.gg -gov.gg - -// gh : http://en.wikipedia.org/wiki/.gh -// see also: http://www.nic.gh/reg_now.php -// Although domains directly at second level are not possible at the moment, -// they have been possible for some time and may come back. -gh -com.gh -edu.gh -gov.gh -org.gh -mil.gh - -// gi : http://www.nic.gi/rules.html -gi -com.gi -ltd.gi -gov.gi -mod.gi -edu.gi -org.gi - -// gl : http://en.wikipedia.org/wiki/.gl -// http://nic.gl -gl - -// gm : http://www.nic.gm/htmlpages%5Cgm-policy.htm -gm - -// gn : http://psg.com/dns/gn/gn.txt -// Submitted by registry 2008-06-17 -ac.gn -com.gn -edu.gn -gov.gn -org.gn -net.gn - -// gov : http://en.wikipedia.org/wiki/.gov -gov - -// gp : http://www.nic.gp/index.php?lang=en -gp -com.gp -net.gp -mobi.gp -edu.gp -org.gp -asso.gp - -// gq : http://en.wikipedia.org/wiki/.gq -gq - -// gr : https://grweb.ics.forth.gr/english/1617-B-2005.html -// Submitted by registry 2008-06-09 -gr -com.gr -edu.gr -net.gr -org.gr -gov.gr - -// gs : http://en.wikipedia.org/wiki/.gs -gs - -// gt : http://www.gt/politicas.html -*.gt -!www.gt - -// gu : http://gadao.gov.gu/registration.txt -*.gu - -// gw : http://en.wikipedia.org/wiki/.gw -gw - -// gy : http://en.wikipedia.org/wiki/.gy -// http://registry.gy/ -gy -co.gy -com.gy -net.gy - -// hk : https://www.hkdnr.hk -// Submitted by registry 2008-06-11 -hk -com.hk -edu.hk -gov.hk -idv.hk -net.hk -org.hk -公司.hk -教育.hk -敎育.hk -政府.hk -個人.hk -个人.hk -箇人.hk -網络.hk -网络.hk -组織.hk -網絡.hk -网絡.hk -组织.hk -組織.hk -組织.hk - -// hm : http://en.wikipedia.org/wiki/.hm -hm - -// hn : http://www.nic.hn/politicas/ps02,,05.html -hn -com.hn -edu.hn -org.hn -net.hn -mil.hn -gob.hn - -// hr : http://www.dns.hr/documents/pdf/HRTLD-regulations.pdf -hr -iz.hr -from.hr -name.hr -com.hr - -// ht : http://www.nic.ht/info/charte.cfm -ht -com.ht -shop.ht -firm.ht -info.ht -adult.ht -net.ht -pro.ht -org.ht -med.ht -art.ht -coop.ht -pol.ht -asso.ht -edu.ht -rel.ht -gouv.ht -perso.ht - -// hu : http://www.domain.hu/domain/English/sld.html -// Confirmed by registry 2008-06-12 -hu -co.hu -info.hu -org.hu -priv.hu -sport.hu -tm.hu -2000.hu -agrar.hu -bolt.hu -casino.hu -city.hu -erotica.hu -erotika.hu -film.hu -forum.hu -games.hu -hotel.hu -ingatlan.hu -jogasz.hu -konyvelo.hu -lakas.hu -media.hu -news.hu -reklam.hu -sex.hu -shop.hu -suli.hu -szex.hu -tozsde.hu -utazas.hu -video.hu - -// id : http://en.wikipedia.org/wiki/.id -// see also: https://register.pandi.or.id/ -id -ac.id -co.id -go.id -mil.id -net.id -or.id -sch.id -web.id - -// ie : http://en.wikipedia.org/wiki/.ie -ie -gov.ie - -// il : http://en.wikipedia.org/wiki/.il -*.il - -// im : https://www.nic.im/pdfs/imfaqs.pdf -im -co.im -ltd.co.im -plc.co.im -net.im -gov.im -org.im -nic.im -ac.im - -// in : http://en.wikipedia.org/wiki/.in -// see also: http://www.inregistry.in/policies/ -// Please note, that nic.in is not an offical eTLD, but used by most -// government institutions. -in -co.in -firm.in -net.in -org.in -gen.in -ind.in -nic.in -ac.in -edu.in -res.in -gov.in -mil.in - -// info : http://en.wikipedia.org/wiki/.info -info - -// int : http://en.wikipedia.org/wiki/.int -// Confirmed by registry 2008-06-18 -int -eu.int - -// io : http://www.nic.io/rules.html -// list of other 2nd level tlds ? -io -com.io - -// iq : http://www.cmc.iq/english/iq/iqregister1.htm -iq -gov.iq -edu.iq -mil.iq -com.iq -org.iq -net.iq - -// ir : http://www.nic.ir/Terms_and_Conditions_ir,_Appendix_1_Domain_Rules -// Also see http://www.nic.ir/Internationalized_Domain_Names -// Two .ir entries added at request of , 2010-04-16 -ir -ac.ir -co.ir -gov.ir -id.ir -net.ir -org.ir -sch.ir -// xn--mgba3a4f16a.ir (.ir, Persian YEH) -ایران.ir -// xn--mgba3a4fra.ir (.ir, Arabic YEH) -ايران.ir - -// is : http://www.isnic.is/domain/rules.php -// Confirmed by registry 2008-12-06 -is -net.is -com.is -edu.is -gov.is -org.is -int.is - -// it : http://en.wikipedia.org/wiki/.it -it -gov.it -edu.it -// list of reserved geo-names : -// http://www.nic.it/documenti/regolamenti-e-linee-guida/regolamento-assegnazione-versione-6.0.pdf -// (There is also a list of reserved geo-names corresponding to Italian -// municipalities : http://www.nic.it/documenti/appendice-c.pdf , but it is -// not included here.) -agrigento.it -ag.it -alessandria.it -al.it -ancona.it -an.it -aosta.it -aoste.it -ao.it -arezzo.it -ar.it -ascoli-piceno.it -ascolipiceno.it -ap.it -asti.it -at.it -avellino.it -av.it -bari.it -ba.it -andria-barletta-trani.it -andriabarlettatrani.it -trani-barletta-andria.it -tranibarlettaandria.it -barletta-trani-andria.it -barlettatraniandria.it -andria-trani-barletta.it -andriatranibarletta.it -trani-andria-barletta.it -traniandriabarletta.it -bt.it -belluno.it -bl.it -benevento.it -bn.it -bergamo.it -bg.it -biella.it -bi.it -bologna.it -bo.it -bolzano.it -bozen.it -balsan.it -alto-adige.it -altoadige.it -suedtirol.it -bz.it -brescia.it -bs.it -brindisi.it -br.it -cagliari.it -ca.it -caltanissetta.it -cl.it -campobasso.it -cb.it -carboniaiglesias.it -carbonia-iglesias.it -iglesias-carbonia.it -iglesiascarbonia.it -ci.it -caserta.it -ce.it -catania.it -ct.it -catanzaro.it -cz.it -chieti.it -ch.it -como.it -co.it -cosenza.it -cs.it -cremona.it -cr.it -crotone.it -kr.it -cuneo.it -cn.it -dell-ogliastra.it -dellogliastra.it -ogliastra.it -og.it -enna.it -en.it -ferrara.it -fe.it -fermo.it -fm.it -firenze.it -florence.it -fi.it -foggia.it -fg.it -forli-cesena.it -forlicesena.it -cesena-forli.it -cesenaforli.it -fc.it -frosinone.it -fr.it -genova.it -genoa.it -ge.it -gorizia.it -go.it -grosseto.it -gr.it -imperia.it -im.it -isernia.it -is.it -laquila.it -aquila.it -aq.it -la-spezia.it -laspezia.it -sp.it -latina.it -lt.it -lecce.it -le.it -lecco.it -lc.it -livorno.it -li.it -lodi.it -lo.it -lucca.it -lu.it -macerata.it -mc.it -mantova.it -mn.it -massa-carrara.it -massacarrara.it -carrara-massa.it -carraramassa.it -ms.it -matera.it -mt.it -medio-campidano.it -mediocampidano.it -campidano-medio.it -campidanomedio.it -vs.it -messina.it -me.it -milano.it -milan.it -mi.it -modena.it -mo.it -monza.it -monza-brianza.it -monzabrianza.it -monzaebrianza.it -monzaedellabrianza.it -monza-e-della-brianza.it -mb.it -napoli.it -naples.it -na.it -novara.it -no.it -nuoro.it -nu.it -oristano.it -or.it -padova.it -padua.it -pd.it -palermo.it -pa.it -parma.it -pr.it -pavia.it -pv.it -perugia.it -pg.it -pescara.it -pe.it -pesaro-urbino.it -pesarourbino.it -urbino-pesaro.it -urbinopesaro.it -pu.it -piacenza.it -pc.it -pisa.it -pi.it -pistoia.it -pt.it -pordenone.it -pn.it -potenza.it -pz.it -prato.it -po.it -ragusa.it -rg.it -ravenna.it -ra.it -reggio-calabria.it -reggiocalabria.it -rc.it -reggio-emilia.it -reggioemilia.it -re.it -rieti.it -ri.it -rimini.it -rn.it -roma.it -rome.it -rm.it -rovigo.it -ro.it -salerno.it -sa.it -sassari.it -ss.it -savona.it -sv.it -siena.it -si.it -siracusa.it -sr.it -sondrio.it -so.it -taranto.it -ta.it -tempio-olbia.it -tempioolbia.it -olbia-tempio.it -olbiatempio.it -ot.it -teramo.it -te.it -terni.it -tr.it -torino.it -turin.it -to.it -trapani.it -tp.it -trento.it -trentino.it -tn.it -treviso.it -tv.it -trieste.it -ts.it -udine.it -ud.it -varese.it -va.it -venezia.it -venice.it -ve.it -verbania.it -vb.it -vercelli.it -vc.it -verona.it -vr.it -vibo-valentia.it -vibovalentia.it -vv.it -vicenza.it -vi.it -viterbo.it -vt.it - -// je : http://www.channelisles.net/applic/avextn.shtml -je -co.je -org.je -net.je -sch.je -gov.je - -// jm : http://www.com.jm/register.html -*.jm - -// jo : http://www.dns.jo/Registration_policy.aspx -jo -com.jo -org.jo -net.jo -edu.jo -sch.jo -gov.jo -mil.jo -name.jo - -// jobs : http://en.wikipedia.org/wiki/.jobs -jobs - -// jp : http://en.wikipedia.org/wiki/.jp -// http://jprs.co.jp/en/jpdomain.html -// Submitted by registry 2008-06-11 -// Updated by registry 2008-12-04 -jp -// jp organizational type names -ac.jp -ad.jp -co.jp -ed.jp -go.jp -gr.jp -lg.jp -ne.jp -or.jp -// jp geographic type names -// http://jprs.jp/doc/rule/saisoku-1.html -*.aichi.jp -*.akita.jp -*.aomori.jp -*.chiba.jp -*.ehime.jp -*.fukui.jp -*.fukuoka.jp -*.fukushima.jp -*.gifu.jp -*.gunma.jp -*.hiroshima.jp -*.hokkaido.jp -*.hyogo.jp -*.ibaraki.jp -*.ishikawa.jp -*.iwate.jp -*.kagawa.jp -*.kagoshima.jp -*.kanagawa.jp -*.kawasaki.jp -*.kitakyushu.jp -*.kobe.jp -*.kochi.jp -*.kumamoto.jp -*.kyoto.jp -*.mie.jp -*.miyagi.jp -*.miyazaki.jp -*.nagano.jp -*.nagasaki.jp -*.nagoya.jp -*.nara.jp -*.niigata.jp -*.oita.jp -*.okayama.jp -*.okinawa.jp -*.osaka.jp -*.saga.jp -*.saitama.jp -*.sapporo.jp -*.sendai.jp -*.shiga.jp -*.shimane.jp -*.shizuoka.jp -*.tochigi.jp -*.tokushima.jp -*.tokyo.jp -*.tottori.jp -*.toyama.jp -*.wakayama.jp -*.yamagata.jp -*.yamaguchi.jp -*.yamanashi.jp -*.yokohama.jp -!metro.tokyo.jp -!pref.aichi.jp -!pref.akita.jp -!pref.aomori.jp -!pref.chiba.jp -!pref.ehime.jp -!pref.fukui.jp -!pref.fukuoka.jp -!pref.fukushima.jp -!pref.gifu.jp -!pref.gunma.jp -!pref.hiroshima.jp -!pref.hokkaido.jp -!pref.hyogo.jp -!pref.ibaraki.jp -!pref.ishikawa.jp -!pref.iwate.jp -!pref.kagawa.jp -!pref.kagoshima.jp -!pref.kanagawa.jp -!pref.kochi.jp -!pref.kumamoto.jp -!pref.kyoto.jp -!pref.mie.jp -!pref.miyagi.jp -!pref.miyazaki.jp -!pref.nagano.jp -!pref.nagasaki.jp -!pref.nara.jp -!pref.niigata.jp -!pref.oita.jp -!pref.okayama.jp -!pref.okinawa.jp -!pref.osaka.jp -!pref.saga.jp -!pref.saitama.jp -!pref.shiga.jp -!pref.shimane.jp -!pref.shizuoka.jp -!pref.tochigi.jp -!pref.tokushima.jp -!pref.tottori.jp -!pref.toyama.jp -!pref.wakayama.jp -!pref.yamagata.jp -!pref.yamaguchi.jp -!pref.yamanashi.jp -!city.chiba.jp -!city.fukuoka.jp -!city.hiroshima.jp -!city.kawasaki.jp -!city.kitakyushu.jp -!city.kobe.jp -!city.kyoto.jp -!city.nagoya.jp -!city.niigata.jp -!city.okayama.jp -!city.osaka.jp -!city.saitama.jp -!city.sapporo.jp -!city.sendai.jp -!city.shizuoka.jp -!city.yokohama.jp - -// ke : http://www.kenic.or.ke/index.php?option=com_content&task=view&id=117&Itemid=145 -*.ke - -// kg : http://www.domain.kg/dmn_n.html -kg -org.kg -net.kg -com.kg -edu.kg -gov.kg -mil.kg - -// kh : http://www.mptc.gov.kh/dns_registration.htm -*.kh - -// ki : http://www.ki/dns/index.html -ki -edu.ki -biz.ki -net.ki -org.ki -gov.ki -info.ki -com.ki - -// km : http://en.wikipedia.org/wiki/.km -// http://www.domaine.km/documents/charte.doc -km -org.km -nom.km -gov.km -prd.km -tm.km -edu.km -mil.km -ass.km -com.km -// These are only mentioned as proposed suggestions at domaine.km, but -// http://en.wikipedia.org/wiki/.km says they're available for registration: -coop.km -asso.km -presse.km -medecin.km -notaires.km -pharmaciens.km -veterinaire.km -gouv.km - -// kn : http://en.wikipedia.org/wiki/.kn -// http://www.dot.kn/domainRules.html -kn -net.kn -org.kn -edu.kn -gov.kn - -// kp : http://www.kcce.kp/en_index.php -com.kp -edu.kp -gov.kp -org.kp -rep.kp -tra.kp - -// kr : http://en.wikipedia.org/wiki/.kr -// see also: http://domain.nida.or.kr/eng/registration.jsp -kr -ac.kr -co.kr -es.kr -go.kr -hs.kr -kg.kr -mil.kr -ms.kr -ne.kr -or.kr -pe.kr -re.kr -sc.kr -// kr geographical names -busan.kr -chungbuk.kr -chungnam.kr -daegu.kr -daejeon.kr -gangwon.kr -gwangju.kr -gyeongbuk.kr -gyeonggi.kr -gyeongnam.kr -incheon.kr -jeju.kr -jeonbuk.kr -jeonnam.kr -seoul.kr -ulsan.kr - -// kw : http://en.wikipedia.org/wiki/.kw -*.kw - -// ky : http://www.icta.ky/da_ky_reg_dom.php -// Confirmed by registry 2008-06-17 -ky -edu.ky -gov.ky -com.ky -org.ky -net.ky - -// kz : http://en.wikipedia.org/wiki/.kz -// see also: http://www.nic.kz/rules/index.jsp -kz -org.kz -edu.kz -net.kz -gov.kz -mil.kz -com.kz - -// la : http://en.wikipedia.org/wiki/.la -// Submitted by registry 2008-06-10 -la -int.la -net.la -info.la -edu.la -gov.la -per.la -com.la -org.la - -// lb : http://en.wikipedia.org/wiki/.lb -// Submitted by registry 2008-06-17 -com.lb -edu.lb -gov.lb -net.lb -org.lb - -// lc : http://en.wikipedia.org/wiki/.lc -// see also: http://www.nic.lc/rules.htm -lc -com.lc -net.lc -co.lc -org.lc -edu.lc -gov.lc - -// li : http://en.wikipedia.org/wiki/.li -li - -// lk : http://www.nic.lk/seclevpr.html -lk -gov.lk -sch.lk -net.lk -int.lk -com.lk -org.lk -edu.lk -ngo.lk -soc.lk -web.lk -ltd.lk -assn.lk -grp.lk -hotel.lk - -// lr : http://psg.com/dns/lr/lr.txt -// Submitted by registry 2008-06-17 -com.lr -edu.lr -gov.lr -org.lr -net.lr - -// ls : http://en.wikipedia.org/wiki/.ls -ls -co.ls -org.ls - -// lt : http://en.wikipedia.org/wiki/.lt -lt -// gov.lt : http://www.gov.lt/index_en.php -gov.lt - -// lu : http://www.dns.lu/en/ -lu - -// lv : http://www.nic.lv/DNS/En/generic.php -lv -com.lv -edu.lv -gov.lv -org.lv -mil.lv -id.lv -net.lv -asn.lv -conf.lv - -// ly : http://www.nic.ly/regulations.php -ly -com.ly -net.ly -gov.ly -plc.ly -edu.ly -sch.ly -med.ly -org.ly -id.ly - -// ma : http://en.wikipedia.org/wiki/.ma -// http://www.anrt.ma/fr/admin/download/upload/file_fr782.pdf -ma -co.ma -net.ma -gov.ma -org.ma -ac.ma -press.ma - -// mc : http://www.nic.mc/ -mc -tm.mc -asso.mc - -// md : http://en.wikipedia.org/wiki/.md -md - -// me : http://en.wikipedia.org/wiki/.me -me -co.me -net.me -org.me -edu.me -ac.me -gov.me -its.me -priv.me - -// mg : http://www.nic.mg/tarif.htm -mg -org.mg -nom.mg -gov.mg -prd.mg -tm.mg -edu.mg -mil.mg -com.mg - -// mh : http://en.wikipedia.org/wiki/.mh -mh - -// mil : http://en.wikipedia.org/wiki/.mil -mil - -// mk : http://en.wikipedia.org/wiki/.mk -// see also: http://dns.marnet.net.mk/postapka.php -mk -com.mk -org.mk -net.mk -edu.mk -gov.mk -inf.mk -name.mk - -// ml : http://www.gobin.info/domainname/ml-template.doc -// see also: http://en.wikipedia.org/wiki/.ml -ml -com.ml -edu.ml -gouv.ml -gov.ml -net.ml -org.ml -presse.ml - -// mm : http://en.wikipedia.org/wiki/.mm -*.mm - -// mn : http://en.wikipedia.org/wiki/.mn -mn -gov.mn -edu.mn -org.mn - -// mo : http://www.monic.net.mo/ -mo -com.mo -net.mo -org.mo -edu.mo -gov.mo - -// mobi : http://en.wikipedia.org/wiki/.mobi -mobi - -// mp : http://www.dot.mp/ -// Confirmed by registry 2008-06-17 -mp - -// mq : http://en.wikipedia.org/wiki/.mq -mq - -// mr : http://en.wikipedia.org/wiki/.mr -mr -gov.mr - -// ms : http://en.wikipedia.org/wiki/.ms -ms - -// mt : https://www.nic.org.mt/dotmt/ -*.mt - -// mu : http://en.wikipedia.org/wiki/.mu -mu -com.mu -net.mu -org.mu -gov.mu -ac.mu -co.mu -or.mu - -// museum : http://about.museum/naming/ -// http://index.museum/ -museum -academy.museum -agriculture.museum -air.museum -airguard.museum -alabama.museum -alaska.museum -amber.museum -ambulance.museum -american.museum -americana.museum -americanantiques.museum -americanart.museum -amsterdam.museum -and.museum -annefrank.museum -anthro.museum -anthropology.museum -antiques.museum -aquarium.museum -arboretum.museum -archaeological.museum -archaeology.museum -architecture.museum -art.museum -artanddesign.museum -artcenter.museum -artdeco.museum -arteducation.museum -artgallery.museum -arts.museum -artsandcrafts.museum -asmatart.museum -assassination.museum -assisi.museum -association.museum -astronomy.museum -atlanta.museum -austin.museum -australia.museum -automotive.museum -aviation.museum -axis.museum -badajoz.museum -baghdad.museum -bahn.museum -bale.museum -baltimore.museum -barcelona.museum -baseball.museum -basel.museum -baths.museum -bauern.museum -beauxarts.museum -beeldengeluid.museum -bellevue.museum -bergbau.museum -berkeley.museum -berlin.museum -bern.museum -bible.museum -bilbao.museum -bill.museum -birdart.museum -birthplace.museum -bonn.museum -boston.museum -botanical.museum -botanicalgarden.museum -botanicgarden.museum -botany.museum -brandywinevalley.museum -brasil.museum -bristol.museum -british.museum -britishcolumbia.museum -broadcast.museum -brunel.museum -brussel.museum -brussels.museum -bruxelles.museum -building.museum -burghof.museum -bus.museum -bushey.museum -cadaques.museum -california.museum -cambridge.museum -can.museum -canada.museum -capebreton.museum -carrier.museum -cartoonart.museum -casadelamoneda.museum -castle.museum -castres.museum -celtic.museum -center.museum -chattanooga.museum -cheltenham.museum -chesapeakebay.museum -chicago.museum -children.museum -childrens.museum -childrensgarden.museum -chiropractic.museum -chocolate.museum -christiansburg.museum -cincinnati.museum -cinema.museum -circus.museum -civilisation.museum -civilization.museum -civilwar.museum -clinton.museum -clock.museum -coal.museum -coastaldefence.museum -cody.museum -coldwar.museum -collection.museum -colonialwilliamsburg.museum -coloradoplateau.museum -columbia.museum -columbus.museum -communication.museum -communications.museum -community.museum -computer.museum -computerhistory.museum -comunicações.museum -contemporary.museum -contemporaryart.museum -convent.museum -copenhagen.museum -corporation.museum -correios-e-telecomunicações.museum -corvette.museum -costume.museum -countryestate.museum -county.museum -crafts.museum -cranbrook.museum -creation.museum -cultural.museum -culturalcenter.museum -culture.museum -cyber.museum -cymru.museum -dali.museum -dallas.museum -database.museum -ddr.museum -decorativearts.museum -delaware.museum -delmenhorst.museum -denmark.museum -depot.museum -design.museum -detroit.museum -dinosaur.museum -discovery.museum -dolls.museum -donostia.museum -durham.museum -eastafrica.museum -eastcoast.museum -education.museum -educational.museum -egyptian.museum -eisenbahn.museum -elburg.museum -elvendrell.museum -embroidery.museum -encyclopedic.museum -england.museum -entomology.museum -environment.museum -environmentalconservation.museum -epilepsy.museum -essex.museum -estate.museum -ethnology.museum -exeter.museum -exhibition.museum -family.museum -farm.museum -farmequipment.museum -farmers.museum -farmstead.museum -field.museum -figueres.museum -filatelia.museum -film.museum -fineart.museum -finearts.museum -finland.museum -flanders.museum -florida.museum -force.museum -fortmissoula.museum -fortworth.museum -foundation.museum -francaise.museum -frankfurt.museum -franziskaner.museum -freemasonry.museum -freiburg.museum -fribourg.museum -frog.museum -fundacio.museum -furniture.museum -gallery.museum -garden.museum -gateway.museum -geelvinck.museum -gemological.museum -geology.museum -georgia.museum -giessen.museum -glas.museum -glass.museum -gorge.museum -grandrapids.museum -graz.museum -guernsey.museum -halloffame.museum -hamburg.museum -handson.museum -harvestcelebration.museum -hawaii.museum -health.museum -heimatunduhren.museum -hellas.museum -helsinki.museum -hembygdsforbund.museum -heritage.museum -histoire.museum -historical.museum -historicalsociety.museum -historichouses.museum -historisch.museum -historisches.museum -history.museum -historyofscience.museum -horology.museum -house.museum -humanities.museum -illustration.museum -imageandsound.museum -indian.museum -indiana.museum -indianapolis.museum -indianmarket.museum -intelligence.museum -interactive.museum -iraq.museum -iron.museum -isleofman.museum -jamison.museum -jefferson.museum -jerusalem.museum -jewelry.museum -jewish.museum -jewishart.museum -jfk.museum -journalism.museum -judaica.museum -judygarland.museum -juedisches.museum -juif.museum -karate.museum -karikatur.museum -kids.museum -koebenhavn.museum -koeln.museum -kunst.museum -kunstsammlung.museum -kunstunddesign.museum -labor.museum -labour.museum -lajolla.museum -lancashire.museum -landes.museum -lans.museum -läns.museum -larsson.museum -lewismiller.museum -lincoln.museum -linz.museum -living.museum -livinghistory.museum -localhistory.museum -london.museum -losangeles.museum -louvre.museum -loyalist.museum -lucerne.museum -luxembourg.museum -luzern.museum -mad.museum -madrid.museum -mallorca.museum -manchester.museum -mansion.museum -mansions.museum -manx.museum -marburg.museum -maritime.museum -maritimo.museum -maryland.museum -marylhurst.museum -media.museum -medical.museum -medizinhistorisches.museum -meeres.museum -memorial.museum -mesaverde.museum -michigan.museum -midatlantic.museum -military.museum -mill.museum -miners.museum -mining.museum -minnesota.museum -missile.museum -missoula.museum -modern.museum -moma.museum -money.museum -monmouth.museum -monticello.museum -montreal.museum -moscow.museum -motorcycle.museum -muenchen.museum -muenster.museum -mulhouse.museum -muncie.museum -museet.museum -museumcenter.museum -museumvereniging.museum -music.museum -national.museum -nationalfirearms.museum -nationalheritage.museum -nativeamerican.museum -naturalhistory.museum -naturalhistorymuseum.museum -naturalsciences.museum -nature.museum -naturhistorisches.museum -natuurwetenschappen.museum -naumburg.museum -naval.museum -nebraska.museum -neues.museum -newhampshire.museum -newjersey.museum -newmexico.museum -newport.museum -newspaper.museum -newyork.museum -niepce.museum -norfolk.museum -north.museum -nrw.museum -nuernberg.museum -nuremberg.museum -nyc.museum -nyny.museum -oceanographic.museum -oceanographique.museum -omaha.museum -online.museum -ontario.museum -openair.museum -oregon.museum -oregontrail.museum -otago.museum -oxford.museum -pacific.museum -paderborn.museum -palace.museum -paleo.museum -palmsprings.museum -panama.museum -paris.museum -pasadena.museum -pharmacy.museum -philadelphia.museum -philadelphiaarea.museum -philately.museum -phoenix.museum -photography.museum -pilots.museum -pittsburgh.museum -planetarium.museum -plantation.museum -plants.museum -plaza.museum -portal.museum -portland.museum -portlligat.museum -posts-and-telecommunications.museum -preservation.museum -presidio.museum -press.museum -project.museum -public.museum -pubol.museum -quebec.museum -railroad.museum -railway.museum -research.museum -resistance.museum -riodejaneiro.museum -rochester.museum -rockart.museum -roma.museum -russia.museum -saintlouis.museum -salem.museum -salvadordali.museum -salzburg.museum -sandiego.museum -sanfrancisco.museum -santabarbara.museum -santacruz.museum -santafe.museum -saskatchewan.museum -satx.museum -savannahga.museum -schlesisches.museum -schoenbrunn.museum -schokoladen.museum -school.museum -schweiz.museum -science.museum -scienceandhistory.museum -scienceandindustry.museum -sciencecenter.museum -sciencecenters.museum -science-fiction.museum -sciencehistory.museum -sciences.museum -sciencesnaturelles.museum -scotland.museum -seaport.museum -settlement.museum -settlers.museum -shell.museum -sherbrooke.museum -sibenik.museum -silk.museum -ski.museum -skole.museum -society.museum -sologne.museum -soundandvision.museum -southcarolina.museum -southwest.museum -space.museum -spy.museum -square.museum -stadt.museum -stalbans.museum -starnberg.museum -state.museum -stateofdelaware.museum -station.museum -steam.museum -steiermark.museum -stjohn.museum -stockholm.museum -stpetersburg.museum -stuttgart.museum -suisse.museum -surgeonshall.museum -surrey.museum -svizzera.museum -sweden.museum -sydney.museum -tank.museum -tcm.museum -technology.museum -telekommunikation.museum -television.museum -texas.museum -textile.museum -theater.museum -time.museum -timekeeping.museum -topology.museum -torino.museum -touch.museum -town.museum -transport.museum -tree.museum -trolley.museum -trust.museum -trustee.museum -uhren.museum -ulm.museum -undersea.museum -university.museum -usa.museum -usantiques.museum -usarts.museum -uscountryestate.museum -usculture.museum -usdecorativearts.museum -usgarden.museum -ushistory.museum -ushuaia.museum -uslivinghistory.museum -utah.museum -uvic.museum -valley.museum -vantaa.museum -versailles.museum -viking.museum -village.museum -virginia.museum -virtual.museum -virtuel.museum -vlaanderen.museum -volkenkunde.museum -wales.museum -wallonie.museum -war.museum -washingtondc.museum -watchandclock.museum -watch-and-clock.museum -western.museum -westfalen.museum -whaling.museum -wildlife.museum -williamsburg.museum -windmill.museum -workshop.museum -york.museum -yorkshire.museum -yosemite.museum -youth.museum -zoological.museum -zoology.museum -ירושלים.museum -иком.museum - -// mv : http://en.wikipedia.org/wiki/.mv -// "mv" included because, contra Wikipedia, google.mv exists. -mv -aero.mv -biz.mv -com.mv -coop.mv -edu.mv -gov.mv -info.mv -int.mv -mil.mv -museum.mv -name.mv -net.mv -org.mv -pro.mv - -// mw : http://www.registrar.mw/ -mw -ac.mw -biz.mw -co.mw -com.mw -coop.mw -edu.mw -gov.mw -int.mw -museum.mw -net.mw -org.mw - -// mx : http://www.nic.mx/ -// Submitted by registry 2008-06-19 -mx -com.mx -org.mx -gob.mx -edu.mx -net.mx - -// my : http://www.mynic.net.my/ -my -com.my -net.my -org.my -gov.my -edu.my -mil.my -name.my - -// mz : http://www.gobin.info/domainname/mz-template.doc -*.mz - -// na : http://www.na-nic.com.na/ -// http://www.info.na/domain/ -na -info.na -pro.na -name.na -school.na -or.na -dr.na -us.na -mx.na -ca.na -in.na -cc.na -tv.na -ws.na -mobi.na -co.na -com.na -org.na - -// name : has 2nd-level tlds, but there's no list of them -name - -// nc : http://www.cctld.nc/ -nc -asso.nc - -// ne : http://en.wikipedia.org/wiki/.ne -ne - -// net : http://en.wikipedia.org/wiki/.net -net - -// nf : http://en.wikipedia.org/wiki/.nf -nf -com.nf -net.nf -per.nf -rec.nf -web.nf -arts.nf -firm.nf -info.nf -other.nf -store.nf - -// ng : http://psg.com/dns/ng/ -// Submitted by registry 2008-06-17 -ac.ng -com.ng -edu.ng -gov.ng -net.ng -org.ng - -// ni : http://www.nic.ni/dominios.htm -*.ni - -// nl : http://www.domain-registry.nl/ace.php/c,728,122,,,,Home.html -// Confirmed by registry (with technical -// reservations) 2008-06-08 -nl - -// BV.nl will be a registry for dutch BV's (besloten vennootschap) -bv.nl - -// no : http://www.norid.no/regelverk/index.en.html -// The Norwegian registry has declined to notify us of updates. The web pages -// referenced below are the official source of the data. There is also an -// announce mailing list: -// https://postlister.uninett.no/sympa/info/norid-diskusjon -no -// Norid generic domains : http://www.norid.no/regelverk/vedlegg-c.en.html -fhs.no -vgs.no -fylkesbibl.no -folkebibl.no -museum.no -idrett.no -priv.no -// Non-Norid generic domains : http://www.norid.no/regelverk/vedlegg-d.en.html -mil.no -stat.no -dep.no -kommune.no -herad.no -// no geographical names : http://www.norid.no/regelverk/vedlegg-b.en.html -// counties -aa.no -ah.no -bu.no -fm.no -hl.no -hm.no -jan-mayen.no -mr.no -nl.no -nt.no -of.no -ol.no -oslo.no -rl.no -sf.no -st.no -svalbard.no -tm.no -tr.no -va.no -vf.no -// primary and lower secondary schools per county -gs.aa.no -gs.ah.no -gs.bu.no -gs.fm.no -gs.hl.no -gs.hm.no -gs.jan-mayen.no -gs.mr.no -gs.nl.no -gs.nt.no -gs.of.no -gs.ol.no -gs.oslo.no -gs.rl.no -gs.sf.no -gs.st.no -gs.svalbard.no -gs.tm.no -gs.tr.no -gs.va.no -gs.vf.no -// cities -akrehamn.no -åkrehamn.no -algard.no -ålgård.no -arna.no -brumunddal.no -bryne.no -bronnoysund.no -brønnøysund.no -drobak.no -drøbak.no -egersund.no -fetsund.no -floro.no -florø.no -fredrikstad.no -hokksund.no -honefoss.no -hønefoss.no -jessheim.no -jorpeland.no -jørpeland.no -kirkenes.no -kopervik.no -krokstadelva.no -langevag.no -langevåg.no -leirvik.no -mjondalen.no -mjøndalen.no -mo-i-rana.no -mosjoen.no -mosjøen.no -nesoddtangen.no -orkanger.no -osoyro.no -osøyro.no -raholt.no -råholt.no -sandnessjoen.no -sandnessjøen.no -skedsmokorset.no -slattum.no -spjelkavik.no -stathelle.no -stavern.no -stjordalshalsen.no -stjørdalshalsen.no -tananger.no -tranby.no -vossevangen.no -// communities -afjord.no -åfjord.no -agdenes.no -al.no -ål.no -alesund.no -ålesund.no -alstahaug.no -alta.no -áltá.no -alaheadju.no -álaheadju.no -alvdal.no -amli.no -åmli.no -amot.no -åmot.no -andebu.no -andoy.no -andøy.no -andasuolo.no -ardal.no -årdal.no -aremark.no -arendal.no -ås.no -aseral.no -åseral.no -asker.no -askim.no -askvoll.no -askoy.no -askøy.no -asnes.no -åsnes.no -audnedaln.no -aukra.no -aure.no -aurland.no -aurskog-holand.no -aurskog-høland.no -austevoll.no -austrheim.no -averoy.no -averøy.no -balestrand.no -ballangen.no -balat.no -bálát.no -balsfjord.no -bahccavuotna.no -báhccavuotna.no -bamble.no -bardu.no -beardu.no -beiarn.no -bajddar.no -bájddar.no -baidar.no -báidár.no -berg.no -bergen.no -berlevag.no -berlevåg.no -bearalvahki.no -bearalváhki.no -bindal.no -birkenes.no -bjarkoy.no -bjarkøy.no -bjerkreim.no -bjugn.no -bodo.no -bodø.no -badaddja.no -bådåddjå.no -budejju.no -bokn.no -bremanger.no -bronnoy.no -brønnøy.no -bygland.no -bykle.no -barum.no -bærum.no -bo.telemark.no -bø.telemark.no -bo.nordland.no -bø.nordland.no -bievat.no -bievát.no -bomlo.no -bømlo.no -batsfjord.no -båtsfjord.no -bahcavuotna.no -báhcavuotna.no -dovre.no -drammen.no -drangedal.no -dyroy.no -dyrøy.no -donna.no -dønna.no -eid.no -eidfjord.no -eidsberg.no -eidskog.no -eidsvoll.no -eigersund.no -elverum.no -enebakk.no -engerdal.no -etne.no -etnedal.no -evenes.no -evenassi.no -evenášši.no -evje-og-hornnes.no -farsund.no -fauske.no -fuossko.no -fuoisku.no -fedje.no -fet.no -finnoy.no -finnøy.no -fitjar.no -fjaler.no -fjell.no -flakstad.no -flatanger.no -flekkefjord.no -flesberg.no -flora.no -fla.no -flå.no -folldal.no -forsand.no -fosnes.no -frei.no -frogn.no -froland.no -frosta.no -frana.no -fræna.no -froya.no -frøya.no -fusa.no -fyresdal.no -forde.no -førde.no -gamvik.no -gangaviika.no -gáŋgaviika.no -gaular.no -gausdal.no -gildeskal.no -gildeskål.no -giske.no -gjemnes.no -gjerdrum.no -gjerstad.no -gjesdal.no -gjovik.no -gjøvik.no -gloppen.no -gol.no -gran.no -grane.no -granvin.no -gratangen.no -grimstad.no -grong.no -kraanghke.no -kråanghke.no -grue.no -gulen.no -hadsel.no -halden.no -halsa.no -hamar.no -hamaroy.no -habmer.no -hábmer.no -hapmir.no -hápmir.no -hammerfest.no -hammarfeasta.no -hámmárfeasta.no -haram.no -hareid.no -harstad.no -hasvik.no -aknoluokta.no -ákŋoluokta.no -hattfjelldal.no -aarborte.no -haugesund.no -hemne.no -hemnes.no -hemsedal.no -heroy.more-og-romsdal.no -herøy.møre-og-romsdal.no -heroy.nordland.no -herøy.nordland.no -hitra.no -hjartdal.no -hjelmeland.no -hobol.no -hobøl.no -hof.no -hol.no -hole.no -holmestrand.no -holtalen.no -holtålen.no -hornindal.no -horten.no -hurdal.no -hurum.no -hvaler.no -hyllestad.no -hagebostad.no -hægebostad.no -hoyanger.no -høyanger.no -hoylandet.no -høylandet.no -ha.no -hå.no -ibestad.no -inderoy.no -inderøy.no -iveland.no -jevnaker.no -jondal.no -jolster.no -jølster.no -karasjok.no -karasjohka.no -kárášjohka.no -karlsoy.no -galsa.no -gálsá.no -karmoy.no -karmøy.no -kautokeino.no -guovdageaidnu.no -klepp.no -klabu.no -klæbu.no -kongsberg.no -kongsvinger.no -kragero.no -kragerø.no -kristiansand.no -kristiansund.no -krodsherad.no -krødsherad.no -kvalsund.no -rahkkeravju.no -ráhkkerávju.no -kvam.no -kvinesdal.no -kvinnherad.no -kviteseid.no -kvitsoy.no -kvitsøy.no -kvafjord.no -kvæfjord.no -giehtavuoatna.no -kvanangen.no -kvænangen.no -navuotna.no -návuotna.no -kafjord.no -kåfjord.no -gaivuotna.no -gáivuotna.no -larvik.no -lavangen.no -lavagis.no -loabat.no -loabát.no -lebesby.no -davvesiida.no -leikanger.no -leirfjord.no -leka.no -leksvik.no -lenvik.no -leangaviika.no -leaŋgaviika.no -lesja.no -levanger.no -lier.no -lierne.no -lillehammer.no -lillesand.no -lindesnes.no -lindas.no -lindås.no -lom.no -loppa.no -lahppi.no -láhppi.no -lund.no -lunner.no -luroy.no -lurøy.no -luster.no -lyngdal.no -lyngen.no -ivgu.no -lardal.no -lerdal.no -lærdal.no -lodingen.no -lødingen.no -lorenskog.no -lørenskog.no -loten.no -løten.no -malvik.no -masoy.no -måsøy.no -muosat.no -muosát.no -mandal.no -marker.no -marnardal.no -masfjorden.no -meland.no -meldal.no -melhus.no -meloy.no -meløy.no -meraker.no -meråker.no -moareke.no -moåreke.no -midsund.no -midtre-gauldal.no -modalen.no -modum.no -molde.no -moskenes.no -moss.no -mosvik.no -malselv.no -målselv.no -malatvuopmi.no -málatvuopmi.no -namdalseid.no -aejrie.no -namsos.no -namsskogan.no -naamesjevuemie.no -nååmesjevuemie.no -laakesvuemie.no -nannestad.no -narvik.no -narviika.no -naustdal.no -nedre-eiker.no -nes.akershus.no -nes.buskerud.no -nesna.no -nesodden.no -nesseby.no -unjarga.no -unjárga.no -nesset.no -nissedal.no -nittedal.no -nord-aurdal.no -nord-fron.no -nord-odal.no -norddal.no -nordkapp.no -davvenjarga.no -davvenjárga.no -nordre-land.no -nordreisa.no -raisa.no -ráisa.no -nore-og-uvdal.no -notodden.no -naroy.no -nærøy.no -notteroy.no -nøtterøy.no -odda.no -oksnes.no -øksnes.no -oppdal.no -oppegard.no -oppegård.no -orkdal.no -orland.no -ørland.no -orskog.no -ørskog.no -orsta.no -ørsta.no -os.hedmark.no -os.hordaland.no -osen.no -osteroy.no -osterøy.no -ostre-toten.no -østre-toten.no -overhalla.no -ovre-eiker.no -øvre-eiker.no -oyer.no -øyer.no -oygarden.no -øygarden.no -oystre-slidre.no -øystre-slidre.no -porsanger.no -porsangu.no -porsáŋgu.no -porsgrunn.no -radoy.no -radøy.no -rakkestad.no -rana.no -ruovat.no -randaberg.no -rauma.no -rendalen.no -rennebu.no -rennesoy.no -rennesøy.no -rindal.no -ringebu.no -ringerike.no -ringsaker.no -rissa.no -risor.no -risør.no -roan.no -rollag.no -rygge.no -ralingen.no -rælingen.no -rodoy.no -rødøy.no -romskog.no -rømskog.no -roros.no -røros.no -rost.no -røst.no -royken.no -røyken.no -royrvik.no -røyrvik.no -rade.no -råde.no -salangen.no -siellak.no -saltdal.no -salat.no -sálát.no -sálat.no -samnanger.no -sande.more-og-romsdal.no -sande.møre-og-romsdal.no -sande.vestfold.no -sandefjord.no -sandnes.no -sandoy.no -sandøy.no -sarpsborg.no -sauda.no -sauherad.no -sel.no -selbu.no -selje.no -seljord.no -sigdal.no -siljan.no -sirdal.no -skaun.no -skedsmo.no -ski.no -skien.no -skiptvet.no -skjervoy.no -skjervøy.no -skierva.no -skiervá.no -skjak.no -skjåk.no -skodje.no -skanland.no -skånland.no -skanit.no -skánit.no -smola.no -smøla.no -snillfjord.no -snasa.no -snåsa.no -snoasa.no -snaase.no -snåase.no -sogndal.no -sokndal.no -sola.no -solund.no -songdalen.no -sortland.no -spydeberg.no -stange.no -stavanger.no -steigen.no -steinkjer.no -stjordal.no -stjørdal.no -stokke.no -stor-elvdal.no -stord.no -stordal.no -storfjord.no -omasvuotna.no -strand.no -stranda.no -stryn.no -sula.no -suldal.no -sund.no -sunndal.no -surnadal.no -sveio.no -svelvik.no -sykkylven.no -sogne.no -søgne.no -somna.no -sømna.no -sondre-land.no -søndre-land.no -sor-aurdal.no -sør-aurdal.no -sor-fron.no -sør-fron.no -sor-odal.no -sør-odal.no -sor-varanger.no -sør-varanger.no -matta-varjjat.no -mátta-várjjat.no -sorfold.no -sørfold.no -sorreisa.no -sørreisa.no -sorum.no -sørum.no -tana.no -deatnu.no -time.no -tingvoll.no -tinn.no -tjeldsund.no -dielddanuorri.no -tjome.no -tjøme.no -tokke.no -tolga.no -torsken.no -tranoy.no -tranøy.no -tromso.no -tromsø.no -tromsa.no -romsa.no -trondheim.no -troandin.no -trysil.no -trana.no -træna.no -trogstad.no -trøgstad.no -tvedestrand.no -tydal.no -tynset.no -tysfjord.no -divtasvuodna.no -divttasvuotna.no -tysnes.no -tysvar.no -tysvær.no -tonsberg.no -tønsberg.no -ullensaker.no -ullensvang.no -ulvik.no -utsira.no -vadso.no -vadsø.no -cahcesuolo.no -čáhcesuolo.no -vaksdal.no -valle.no -vang.no -vanylven.no -vardo.no -vardø.no -varggat.no -várggát.no -vefsn.no -vaapste.no -vega.no -vegarshei.no -vegårshei.no -vennesla.no -verdal.no -verran.no -vestby.no -vestnes.no -vestre-slidre.no -vestre-toten.no -vestvagoy.no -vestvågøy.no -vevelstad.no -vik.no -vikna.no -vindafjord.no -volda.no -voss.no -varoy.no -værøy.no -vagan.no -vågan.no -voagat.no -vagsoy.no -vågsøy.no -vaga.no -vågå.no -valer.ostfold.no -våler.østfold.no -valer.hedmark.no -våler.hedmark.no - -// np : http://www.mos.com.np/register.html -*.np - -// nr : http://cenpac.net.nr/dns/index.html -// Confirmed by registry 2008-06-17 -nr -biz.nr -info.nr -gov.nr -edu.nr -org.nr -net.nr -com.nr - -// nu : http://en.wikipedia.org/wiki/.nu -nu - -// nz : http://en.wikipedia.org/wiki/.nz -*.nz - -// om : http://en.wikipedia.org/wiki/.om -*.om -!mediaphone.om -!nawrastelecom.om -!nawras.om -!omanmobile.om -!omanpost.om -!omantel.om -!rakpetroleum.om -!siemens.om -!songfest.om -!statecouncil.om - -// org : http://en.wikipedia.org/wiki/.org -org - -// pa : http://www.nic.pa/ -// Some additional second level "domains" resolve directly as hostnames, such as -// pannet.pa, so we add a rule for "pa". -pa -ac.pa -gob.pa -com.pa -org.pa -sld.pa -edu.pa -net.pa -ing.pa -abo.pa -med.pa -nom.pa - -// pe : https://www.nic.pe/InformeFinalComision.pdf -pe -edu.pe -gob.pe -nom.pe -mil.pe -org.pe -com.pe -net.pe - -// pf : http://www.gobin.info/domainname/formulaire-pf.pdf -pf -com.pf -org.pf -edu.pf - -// pg : http://en.wikipedia.org/wiki/.pg -*.pg - -// ph : http://www.domains.ph/FAQ2.asp -// Submitted by registry 2008-06-13 -ph -com.ph -net.ph -org.ph -gov.ph -edu.ph -ngo.ph -mil.ph -i.ph - -// pk : http://pk5.pknic.net.pk/pk5/msgNamepk.PK -pk -com.pk -net.pk -edu.pk -org.pk -fam.pk -biz.pk -web.pk -gov.pk -gob.pk -gok.pk -gon.pk -gop.pk -gos.pk -info.pk - -// pl : http://www.dns.pl/english/ -pl -// NASK functional domains (nask.pl / dns.pl) : http://www.dns.pl/english/dns-funk.html -aid.pl -agro.pl -atm.pl -auto.pl -biz.pl -com.pl -edu.pl -gmina.pl -gsm.pl -info.pl -mail.pl -miasta.pl -media.pl -mil.pl -net.pl -nieruchomosci.pl -nom.pl -org.pl -pc.pl -powiat.pl -priv.pl -realestate.pl -rel.pl -sex.pl -shop.pl -sklep.pl -sos.pl -szkola.pl -targi.pl -tm.pl -tourism.pl -travel.pl -turystyka.pl -// ICM functional domains (icm.edu.pl) -6bone.pl -art.pl -mbone.pl -// Government domains (administred by ippt.gov.pl) -gov.pl -uw.gov.pl -um.gov.pl -ug.gov.pl -upow.gov.pl -starostwo.gov.pl -so.gov.pl -sr.gov.pl -po.gov.pl -pa.gov.pl -// other functional domains -ngo.pl -irc.pl -usenet.pl -// NASK geographical domains : http://www.dns.pl/english/dns-regiony.html -augustow.pl -babia-gora.pl -bedzin.pl -beskidy.pl -bialowieza.pl -bialystok.pl -bielawa.pl -bieszczady.pl -boleslawiec.pl -bydgoszcz.pl -bytom.pl -cieszyn.pl -czeladz.pl -czest.pl -dlugoleka.pl -elblag.pl -elk.pl -glogow.pl -gniezno.pl -gorlice.pl -grajewo.pl -ilawa.pl -jaworzno.pl -jelenia-gora.pl -jgora.pl -kalisz.pl -kazimierz-dolny.pl -karpacz.pl -kartuzy.pl -kaszuby.pl -katowice.pl -kepno.pl -ketrzyn.pl -klodzko.pl -kobierzyce.pl -kolobrzeg.pl -konin.pl -konskowola.pl -kutno.pl -lapy.pl -lebork.pl -legnica.pl -lezajsk.pl -limanowa.pl -lomza.pl -lowicz.pl -lubin.pl -lukow.pl -malbork.pl -malopolska.pl -mazowsze.pl -mazury.pl -mielec.pl -mielno.pl -mragowo.pl -naklo.pl -nowaruda.pl -nysa.pl -olawa.pl -olecko.pl -olkusz.pl -olsztyn.pl -opoczno.pl -opole.pl -ostroda.pl -ostroleka.pl -ostrowiec.pl -ostrowwlkp.pl -pila.pl -pisz.pl -podhale.pl -podlasie.pl -polkowice.pl -pomorze.pl -pomorskie.pl -prochowice.pl -pruszkow.pl -przeworsk.pl -pulawy.pl -radom.pl -rawa-maz.pl -rybnik.pl -rzeszow.pl -sanok.pl -sejny.pl -siedlce.pl -slask.pl -slupsk.pl -sosnowiec.pl -stalowa-wola.pl -skoczow.pl -starachowice.pl -stargard.pl -suwalki.pl -swidnica.pl -swiebodzin.pl -swinoujscie.pl -szczecin.pl -szczytno.pl -tarnobrzeg.pl -tgory.pl -turek.pl -tychy.pl -ustka.pl -walbrzych.pl -warmia.pl -warszawa.pl -waw.pl -wegrow.pl -wielun.pl -wlocl.pl -wloclawek.pl -wodzislaw.pl -wolomin.pl -wroclaw.pl -zachpomor.pl -zagan.pl -zarow.pl -zgora.pl -zgorzelec.pl -// TASK geographical domains (www.task.gda.pl/uslugi/dns) -gda.pl -gdansk.pl -gdynia.pl -med.pl -sopot.pl -// other geographical domains -gliwice.pl -krakow.pl -poznan.pl -wroc.pl -zakopane.pl - -// pm : http://www.afnic.fr/medias/documents/AFNIC-naming-policy2012.pdf -pm - -// pn : http://www.government.pn/PnRegistry/policies.htm -pn -gov.pn -co.pn -org.pn -edu.pn -net.pn - -// pr : http://www.nic.pr/index.asp?f=1 -pr -com.pr -net.pr -org.pr -gov.pr -edu.pr -isla.pr -pro.pr -biz.pr -info.pr -name.pr -// these aren't mentioned on nic.pr, but on http://en.wikipedia.org/wiki/.pr -est.pr -prof.pr -ac.pr - -// pro : http://www.nic.pro/support_faq.htm -pro -aca.pro -bar.pro -cpa.pro -jur.pro -law.pro -med.pro -eng.pro - -// ps : http://en.wikipedia.org/wiki/.ps -// http://www.nic.ps/registration/policy.html#reg -ps -edu.ps -gov.ps -sec.ps -plo.ps -com.ps -org.ps -net.ps - -// pt : http://online.dns.pt/dns/start_dns -pt -net.pt -gov.pt -org.pt -edu.pt -int.pt -publ.pt -com.pt -nome.pt - -// pw : http://en.wikipedia.org/wiki/.pw -pw -co.pw -ne.pw -or.pw -ed.pw -go.pw -belau.pw - -// py : http://www.nic.py/faq_a.html#faq_b -*.py - -// qa : http://domains.qa/en/ -qa -com.qa -edu.qa -gov.qa -mil.qa -name.qa -net.qa -org.qa -sch.qa - -// re : http://www.afnic.re/obtenir/chartes/nommage-re/annexe-descriptifs -re -com.re -asso.re -nom.re - -// ro : http://www.rotld.ro/ -ro -com.ro -org.ro -tm.ro -nt.ro -nom.ro -info.ro -rec.ro -arts.ro -firm.ro -store.ro -www.ro - -// rs : http://en.wikipedia.org/wiki/.rs -rs -co.rs -org.rs -edu.rs -ac.rs -gov.rs -in.rs - -// ru : http://www.cctld.ru/ru/docs/aktiv_8.php -// Industry domains -ru -ac.ru -com.ru -edu.ru -int.ru -net.ru -org.ru -pp.ru -// Geographical domains -adygeya.ru -altai.ru -amur.ru -arkhangelsk.ru -astrakhan.ru -bashkiria.ru -belgorod.ru -bir.ru -bryansk.ru -buryatia.ru -cbg.ru -chel.ru -chelyabinsk.ru -chita.ru -chukotka.ru -chuvashia.ru -dagestan.ru -dudinka.ru -e-burg.ru -grozny.ru -irkutsk.ru -ivanovo.ru -izhevsk.ru -jar.ru -joshkar-ola.ru -kalmykia.ru -kaluga.ru -kamchatka.ru -karelia.ru -kazan.ru -kchr.ru -kemerovo.ru -khabarovsk.ru -khakassia.ru -khv.ru -kirov.ru -koenig.ru -komi.ru -kostroma.ru -krasnoyarsk.ru -kuban.ru -kurgan.ru -kursk.ru -lipetsk.ru -magadan.ru -mari.ru -mari-el.ru -marine.ru -mordovia.ru -mosreg.ru -msk.ru -murmansk.ru -nalchik.ru -nnov.ru -nov.ru -novosibirsk.ru -nsk.ru -omsk.ru -orenburg.ru -oryol.ru -palana.ru -penza.ru -perm.ru -pskov.ru -ptz.ru -rnd.ru -ryazan.ru -sakhalin.ru -samara.ru -saratov.ru -simbirsk.ru -smolensk.ru -spb.ru -stavropol.ru -stv.ru -surgut.ru -tambov.ru -tatarstan.ru -tom.ru -tomsk.ru -tsaritsyn.ru -tsk.ru -tula.ru -tuva.ru -tver.ru -tyumen.ru -udm.ru -udmurtia.ru -ulan-ude.ru -vladikavkaz.ru -vladimir.ru -vladivostok.ru -volgograd.ru -vologda.ru -voronezh.ru -vrn.ru -vyatka.ru -yakutia.ru -yamal.ru -yaroslavl.ru -yekaterinburg.ru -yuzhno-sakhalinsk.ru -// More geographical domains -amursk.ru -baikal.ru -cmw.ru -fareast.ru -jamal.ru -kms.ru -k-uralsk.ru -kustanai.ru -kuzbass.ru -magnitka.ru -mytis.ru -nakhodka.ru -nkz.ru -norilsk.ru -oskol.ru -pyatigorsk.ru -rubtsovsk.ru -snz.ru -syzran.ru -vdonsk.ru -zgrad.ru -// State domains -gov.ru -mil.ru -// Technical domains -test.ru - -// rw : http://www.nic.rw/cgi-bin/policy.pl -rw -gov.rw -net.rw -edu.rw -ac.rw -com.rw -co.rw -int.rw -mil.rw -gouv.rw - -// sa : http://www.nic.net.sa/ -sa -com.sa -net.sa -org.sa -gov.sa -med.sa -pub.sa -edu.sa -sch.sa - -// sb : http://www.sbnic.net.sb/ -// Submitted by registry 2008-06-08 -sb -com.sb -edu.sb -gov.sb -net.sb -org.sb - -// sc : http://www.nic.sc/ -sc -com.sc -gov.sc -net.sc -org.sc -edu.sc - -// sd : http://www.isoc.sd/sudanic.isoc.sd/billing_pricing.htm -// Submitted by registry 2008-06-17 -sd -com.sd -net.sd -org.sd -edu.sd -med.sd -gov.sd -info.sd - -// se : http://en.wikipedia.org/wiki/.se -// Submitted by registry 2008-06-24 -se -a.se -ac.se -b.se -bd.se -brand.se -c.se -d.se -e.se -f.se -fh.se -fhsk.se -fhv.se -g.se -h.se -i.se -k.se -komforb.se -kommunalforbund.se -komvux.se -l.se -lanbib.se -m.se -n.se -naturbruksgymn.se -o.se -org.se -p.se -parti.se -pp.se -press.se -r.se -s.se -sshn.se -t.se -tm.se -u.se -w.se -x.se -y.se -z.se - -// sg : http://www.nic.net.sg/sub_policies_agreement/2ld.html -sg -com.sg -net.sg -org.sg -gov.sg -edu.sg -per.sg - -// sh : http://www.nic.sh/rules.html -// list of 2nd level domains ? -sh - -// si : http://en.wikipedia.org/wiki/.si -si - -// sj : No registrations at this time. -// Submitted by registry 2008-06-16 - -// sk : http://en.wikipedia.org/wiki/.sk -// list of 2nd level domains ? -sk - -// sl : http://www.nic.sl -// Submitted by registry 2008-06-12 -sl -com.sl -net.sl -edu.sl -gov.sl -org.sl - -// sm : http://en.wikipedia.org/wiki/.sm -sm - -// sn : http://en.wikipedia.org/wiki/.sn -sn -art.sn -com.sn -edu.sn -gouv.sn -org.sn -perso.sn -univ.sn - -// so : http://www.soregistry.com/ -so -com.so -net.so -org.so - -// sr : http://en.wikipedia.org/wiki/.sr -sr - -// st : http://www.nic.st/html/policyrules/ -st -co.st -com.st -consulado.st -edu.st -embaixada.st -gov.st -mil.st -net.st -org.st -principe.st -saotome.st -store.st - -// su : http://en.wikipedia.org/wiki/.su -su - -// sv : http://www.svnet.org.sv/svpolicy.html -*.sv - -// sy : http://en.wikipedia.org/wiki/.sy -// see also: http://www.gobin.info/domainname/sy.doc -sy -edu.sy -gov.sy -net.sy -mil.sy -com.sy -org.sy - -// sz : http://en.wikipedia.org/wiki/.sz -// http://www.sispa.org.sz/ -sz -co.sz -ac.sz -org.sz - -// tc : http://en.wikipedia.org/wiki/.tc -tc - -// td : http://en.wikipedia.org/wiki/.td -td - -// tel: http://en.wikipedia.org/wiki/.tel -// http://www.telnic.org/ -tel - -// tf : http://en.wikipedia.org/wiki/.tf -tf - -// tg : http://en.wikipedia.org/wiki/.tg -// http://www.nic.tg/nictg/index.php implies no reserved 2nd-level domains, -// although this contradicts wikipedia. -tg - -// th : http://en.wikipedia.org/wiki/.th -// Submitted by registry 2008-06-17 -th -ac.th -co.th -go.th -in.th -mi.th -net.th -or.th - -// tj : http://www.nic.tj/policy.htm -tj -ac.tj -biz.tj -co.tj -com.tj -edu.tj -go.tj -gov.tj -int.tj -mil.tj -name.tj -net.tj -nic.tj -org.tj -test.tj -web.tj - -// tk : http://en.wikipedia.org/wiki/.tk -tk - -// tl : http://en.wikipedia.org/wiki/.tl -tl -gov.tl - -// tm : http://www.nic.tm/rules.html -// list of 2nd level tlds ? -tm - -// tn : http://en.wikipedia.org/wiki/.tn -// http://whois.ati.tn/ -tn -com.tn -ens.tn -fin.tn -gov.tn -ind.tn -intl.tn -nat.tn -net.tn -org.tn -info.tn -perso.tn -tourism.tn -edunet.tn -rnrt.tn -rns.tn -rnu.tn -mincom.tn -agrinet.tn -defense.tn -turen.tn - -// to : http://en.wikipedia.org/wiki/.to -// Submitted by registry 2008-06-17 -to -com.to -gov.to -net.to -org.to -edu.to -mil.to - -// tr : http://en.wikipedia.org/wiki/.tr -*.tr -!nic.tr -// Used by government in the TRNC -// http://en.wikipedia.org/wiki/.nc.tr -gov.nc.tr - -// travel : http://en.wikipedia.org/wiki/.travel -travel - -// tt : http://www.nic.tt/ -tt -co.tt -com.tt -org.tt -net.tt -biz.tt -info.tt -pro.tt -int.tt -coop.tt -jobs.tt -mobi.tt -travel.tt -museum.tt -aero.tt -name.tt -gov.tt -edu.tt - -// tv : http://en.wikipedia.org/wiki/.tv -// Not listing any 2LDs as reserved since none seem to exist in practice, -// Wikipedia notwithstanding. -tv - -// tw : http://en.wikipedia.org/wiki/.tw -tw -edu.tw -gov.tw -mil.tw -com.tw -net.tw -org.tw -idv.tw -game.tw -ebiz.tw -club.tw -網路.tw -組織.tw -商業.tw - -// tz : http://en.wikipedia.org/wiki/.tz -// Submitted by registry 2008-06-17 -// Updated from http://www.tznic.or.tz/index.php/domains.html 2010-10-25 -ac.tz -co.tz -go.tz -mil.tz -ne.tz -or.tz -sc.tz - -// ua : http://www.nic.net.ua/ -ua -com.ua -edu.ua -gov.ua -in.ua -net.ua -org.ua -// ua geo-names -cherkassy.ua -chernigov.ua -chernovtsy.ua -ck.ua -cn.ua -crimea.ua -cv.ua -dn.ua -dnepropetrovsk.ua -donetsk.ua -dp.ua -if.ua -ivano-frankivsk.ua -kh.ua -kharkov.ua -kherson.ua -khmelnitskiy.ua -kiev.ua -kirovograd.ua -km.ua -kr.ua -ks.ua -kv.ua -lg.ua -lugansk.ua -lutsk.ua -lviv.ua -mk.ua -nikolaev.ua -od.ua -odessa.ua -pl.ua -poltava.ua -rovno.ua -rv.ua -sebastopol.ua -sumy.ua -te.ua -ternopil.ua -uzhgorod.ua -vinnica.ua -vn.ua -zaporizhzhe.ua -zp.ua -zhitomir.ua -zt.ua - -// Private registries in .ua -co.ua -pp.ua - -// ug : http://www.registry.co.ug/ -ug -co.ug -ac.ug -sc.ug -go.ug -ne.ug -or.ug - -// uk : http://en.wikipedia.org/wiki/.uk -*.uk -*.sch.uk -!bl.uk -!british-library.uk -!icnet.uk -!jet.uk -!mod.uk -!nel.uk -!nhs.uk -!nic.uk -!nls.uk -!national-library-scotland.uk -!parliament.uk -!police.uk - -// us : http://en.wikipedia.org/wiki/.us -us -dni.us -fed.us -isa.us -kids.us -nsn.us -// us geographic names -ak.us -al.us -ar.us -as.us -az.us -ca.us -co.us -ct.us -dc.us -de.us -fl.us -ga.us -gu.us -hi.us -ia.us -id.us -il.us -in.us -ks.us -ky.us -la.us -ma.us -md.us -me.us -mi.us -mn.us -mo.us -ms.us -mt.us -nc.us -nd.us -ne.us -nh.us -nj.us -nm.us -nv.us -ny.us -oh.us -ok.us -or.us -pa.us -pr.us -ri.us -sc.us -sd.us -tn.us -tx.us -ut.us -vi.us -vt.us -va.us -wa.us -wi.us -wv.us -wy.us -// The registrar notes several more specific domains available in each state, -// such as state.*.us, dst.*.us, etc., but resolution of these is somewhat -// haphazard; in some states these domains resolve as addresses, while in others -// only subdomains are available, or even nothing at all. We include the -// most common ones where it's clear that different sites are different -// entities. -k12.ak.us -k12.al.us -k12.ar.us -k12.as.us -k12.az.us -k12.ca.us -k12.co.us -k12.ct.us -k12.dc.us -k12.de.us -k12.fl.us -k12.ga.us -k12.gu.us -// k12.hi.us Hawaii has a state-wide DOE login: bug 614565 -k12.ia.us -k12.id.us -k12.il.us -k12.in.us -k12.ks.us -k12.ky.us -k12.la.us -k12.ma.us -k12.md.us -k12.me.us -k12.mi.us -k12.mn.us -k12.mo.us -k12.ms.us -k12.mt.us -k12.nc.us -k12.nd.us -k12.ne.us -k12.nh.us -k12.nj.us -k12.nm.us -k12.nv.us -k12.ny.us -k12.oh.us -k12.ok.us -k12.or.us -k12.pa.us -k12.pr.us -k12.ri.us -k12.sc.us -k12.sd.us -k12.tn.us -k12.tx.us -k12.ut.us -k12.vi.us -k12.vt.us -k12.va.us -k12.wa.us -k12.wi.us -k12.wv.us -k12.wy.us - -cc.ak.us -cc.al.us -cc.ar.us -cc.as.us -cc.az.us -cc.ca.us -cc.co.us -cc.ct.us -cc.dc.us -cc.de.us -cc.fl.us -cc.ga.us -cc.gu.us -cc.hi.us -cc.ia.us -cc.id.us -cc.il.us -cc.in.us -cc.ks.us -cc.ky.us -cc.la.us -cc.ma.us -cc.md.us -cc.me.us -cc.mi.us -cc.mn.us -cc.mo.us -cc.ms.us -cc.mt.us -cc.nc.us -cc.nd.us -cc.ne.us -cc.nh.us -cc.nj.us -cc.nm.us -cc.nv.us -cc.ny.us -cc.oh.us -cc.ok.us -cc.or.us -cc.pa.us -cc.pr.us -cc.ri.us -cc.sc.us -cc.sd.us -cc.tn.us -cc.tx.us -cc.ut.us -cc.vi.us -cc.vt.us -cc.va.us -cc.wa.us -cc.wi.us -cc.wv.us -cc.wy.us - -lib.ak.us -lib.al.us -lib.ar.us -lib.as.us -lib.az.us -lib.ca.us -lib.co.us -lib.ct.us -lib.dc.us -lib.de.us -lib.fl.us -lib.ga.us -lib.gu.us -lib.hi.us -lib.ia.us -lib.id.us -lib.il.us -lib.in.us -lib.ks.us -lib.ky.us -lib.la.us -lib.ma.us -lib.md.us -lib.me.us -lib.mi.us -lib.mn.us -lib.mo.us -lib.ms.us -lib.mt.us -lib.nc.us -lib.nd.us -lib.ne.us -lib.nh.us -lib.nj.us -lib.nm.us -lib.nv.us -lib.ny.us -lib.oh.us -lib.ok.us -lib.or.us -lib.pa.us -lib.pr.us -lib.ri.us -lib.sc.us -lib.sd.us -lib.tn.us -lib.tx.us -lib.ut.us -lib.vi.us -lib.vt.us -lib.va.us -lib.wa.us -lib.wi.us -lib.wv.us -lib.wy.us - -// k12.ma.us contains school districts in Massachusetts. The 4LDs are -// managed indepedently except for private (PVT), charter (CHTR) and -// parochial (PAROCH) schools. Those are delegated dorectly to the -// 5LD operators. -pvt.k12.ma.us -chtr.k12.ma.us -paroch.k12.ma.us - -// uy : http://www.antel.com.uy/ -*.uy - -// uz : http://www.reg.uz/registerr.html -// are there other 2nd level tlds ? -uz -com.uz -co.uz - -// va : http://en.wikipedia.org/wiki/.va -va - -// vc : http://en.wikipedia.org/wiki/.vc -// Submitted by registry 2008-06-13 -vc -com.vc -net.vc -org.vc -gov.vc -mil.vc -edu.vc - -// ve : http://registro.nic.ve/nicve/registro/index.html -*.ve - -// vg : http://en.wikipedia.org/wiki/.vg -vg - -// vi : http://www.nic.vi/newdomainform.htm -// http://www.nic.vi/Domain_Rules/body_domain_rules.html indicates some other -// TLDs are "reserved", such as edu.vi and gov.vi, but doesn't actually say they -// are available for registration (which they do not seem to be). -vi -co.vi -com.vi -k12.vi -net.vi -org.vi - -// vn : https://www.dot.vn/vnnic/vnnic/domainregistration.jsp -vn -com.vn -net.vn -org.vn -edu.vn -gov.vn -int.vn -ac.vn -biz.vn -info.vn -name.vn -pro.vn -health.vn - -// vu : http://en.wikipedia.org/wiki/.vu -// list of 2nd level tlds ? -vu - -// wf : http://www.afnic.fr/medias/documents/AFNIC-naming-policy2012.pdf -wf - -// ws : http://en.wikipedia.org/wiki/.ws -// http://samoanic.ws/index.dhtml -ws -com.ws -net.ws -org.ws -gov.ws -edu.ws - -// yt : http://www.afnic.fr/medias/documents/AFNIC-naming-policy2012.pdf -yt - -// IDN ccTLDs -// Please sort by ISO 3166 ccTLD, then punicode string -// when submitting patches and follow this format: -// ("" ) : -// [optional sponsoring org] -// - -// xn--mgbaam7a8h ("Emerat" Arabic) : AE -//http://nic.ae/english/arabicdomain/rules.jsp -امارات - -// xn--54b7fta0cc ("Bangla" Bangla) : BD -বাংলা - -// xn--fiqs8s ("China" Chinese-Han-Simplified <.Zhonggou>) : CN -// CNNIC -// http://cnnic.cn/html/Dir/2005/10/11/3218.htm -中国 - -// xn--fiqz9s ("China" Chinese-Han-Traditional <.Zhonggou>) : CN -// CNNIC -// http://cnnic.cn/html/Dir/2005/10/11/3218.htm -中國 - -// xn--lgbbat1ad8j ("Algeria / Al Jazair" Arabic) : DZ -الجزائر - -// xn--wgbh1c ("Egypt" Arabic .masr) : EG -// http://www.dotmasr.eg/ -مصر - -// xn--node ("ge" Georgian (Mkhedruli)) : GE -გე - -// xn--j6w193g ("Hong Kong" Chinese-Han) : HK -// https://www2.hkirc.hk/register/rules.jsp -香港 - -// xn--h2brj9c ("Bharat" Devanagari) : IN -// India -भारत - -// xn--mgbbh1a71e ("Bharat" Arabic) : IN -// India -بھارت - -// xn--fpcrj9c3d ("Bharat" Telugu) : IN -// India -భారత్ - -// xn--gecrj9c ("Bharat" Gujarati) : IN -// India -ભારત - -// xn--s9brj9c ("Bharat" Gurmukhi) : IN -// India -ਭਾਰਤ - -// xn--45brj9c ("Bharat" Bengali) : IN -// India -ভারত - -// xn--xkc2dl3a5ee0h ("India" Tamil) : IN -// India -இந்தியா - -// xn--mgba3a4f16a ("Iran" Persian) : IR -ایران - -// xn--mgba3a4fra ("Iran" Arabic) : IR -ايران - -//xn--mgbayh7gpa ("al-Ordon" Arabic) JO -//National Information Technology Center (NITC) -//Royal Scientific Society, Al-Jubeiha -الاردن - -// xn--3e0b707e ("Republic of Korea" Hangul) : KR -한국 - -// xn--fzc2c9e2c ("Lanka" Sinhalese-Sinhala) : LK -// http://nic.lk -ලංකා - -// xn--xkc2al3hye2a ("Ilangai" Tamil) : LK -// http://nic.lk -இலங்கை - -// xn--mgbc0a9azcg ("Morocco / al-Maghrib" Arabic) : MA -المغرب - -// xn--mgb9awbf ("Oman" Arabic) : OM -عمان - -// xn--ygbi2ammx ("Falasteen" Arabic) : PS -// The Palestinian National Internet Naming Authority (PNINA) -// http://www.pnina.ps -فلسطين - -// xn--90a3ac ("srb" Cyrillic) : RS -срб - -// xn--p1ai ("rf" Russian-Cyrillic) : RU -// http://www.cctld.ru/en/docs/rulesrf.php -рф - -// xn--wgbl6a ("Qatar" Arabic) : QA -// http://www.ict.gov.qa/ -قطر - -// xn--mgberp4a5d4ar ("AlSaudiah" Arabic) : SA -// http://www.nic.net.sa/ -السعودية - -// xn--mgberp4a5d4a87g ("AlSaudiah" Arabic) variant : SA -السعودیة - -// xn--mgbqly7c0a67fbc ("AlSaudiah" Arabic) variant : SA -السعودیۃ - -// xn--mgbqly7cvafr ("AlSaudiah" Arabic) variant : SA -السعوديه - -// xn--ogbpf8fl ("Syria" Arabic) : SY -سورية - -// xn--mgbtf8fl ("Syria" Arabic) variant : SY -سوريا - -// xn--yfro4i67o Singapore ("Singapore" Chinese-Han) : SG -新加坡 - -// xn--clchc0ea0b2g2a9gcd ("Singapore" Tamil) : SG -சிங்கப்பூர் - -// xn--o3cw4h ("Thai" Thai) : TH -// http://www.thnic.co.th -ไทย - -// xn--pgbs0dh ("Tunis") : TN -// http://nic.tn -تونس - -// xn--kpry57d ("Taiwan" Chinese-Han-Traditional) : TW -// http://www.twnic.net/english/dn/dn_07a.htm -台灣 - -// xn--kprw13d ("Taiwan" Chinese-Han-Simplified) : TW -// http://www.twnic.net/english/dn/dn_07a.htm -台湾 - -// xn--nnx388a ("Taiwan") variant : TW -臺灣 - -// xn--j1amh ("ukr" Cyrillic) : UA -укр - -// xn--mgb2ddes ("AlYemen" Arabic) : YE -اليمن - -// xxx : http://icmregistry.com -xxx - -// ye : http://www.y.net.ye/services/domain_name.htm -*.ye - -// za : http://www.zadna.org.za/slds.html -*.za - -// zm : http://en.wikipedia.org/wiki/.zm -*.zm - -// zw : http://en.wikipedia.org/wiki/.zw -*.zw - -// ===END ICANN DOMAINS=== -// ===BEGIN PRIVATE DOMAINS=== - -// info.at : http://www.info.at/ -biz.at -info.at - -// priv.at : http://www.nic.priv.at/ -// Submitted by registry 2008-06-09 -priv.at - -// co.ca : http://registry.co.ca -co.ca - -// CentralNic : http://www.centralnic.com/names/domains -// Confirmed by registry 2008-06-09 -ar.com -br.com -cn.com -de.com -eu.com -gb.com -gr.com -hu.com -jpn.com -kr.com -no.com -qc.com -ru.com -sa.com -se.com -uk.com -us.com -uy.com -za.com -gb.net -jp.net -se.net -uk.net -ae.org -us.org -com.de - -// Opera Software, A.S.A. -// Requested by Yngve Pettersen 2009-11-26 -operaunite.com - -// Google, Inc. -// Requested by Eduardo Vela 2010-09-06 -appspot.com - -// iki.fi : Submitted by Hannu Aronsson 2009-11-05 -iki.fi - -// c.la : http://www.c.la/ -c.la - -// ZaNiC : http://www.za.net/ -// Confirmed by registry 2009-10-03 -za.net -za.org - -// CoDNS B.V. -// Added 2010-05-23. -co.nl -co.no - -// Mainseek Sp. z o.o. : http://www.co.pl/ -co.pl - -// DynDNS.com : http://www.dyndns.com/services/dns/dyndns/ -dyndns-at-home.com -dyndns-at-work.com -dyndns-blog.com -dyndns-free.com -dyndns-home.com -dyndns-ip.com -dyndns-mail.com -dyndns-office.com -dyndns-pics.com -dyndns-remote.com -dyndns-server.com -dyndns-web.com -dyndns-wiki.com -dyndns-work.com -dyndns.biz -dyndns.info -dyndns.org -dyndns.tv -at-band-camp.net -ath.cx -barrel-of-knowledge.info -barrell-of-knowledge.info -better-than.tv -blogdns.com -blogdns.net -blogdns.org -blogsite.org -boldlygoingnowhere.org -broke-it.net -buyshouses.net -cechire.com -dnsalias.com -dnsalias.net -dnsalias.org -dnsdojo.com -dnsdojo.net -dnsdojo.org -does-it.net -doesntexist.com -doesntexist.org -dontexist.com -dontexist.net -dontexist.org -doomdns.com -doomdns.org -dvrdns.org -dyn-o-saur.com -dynalias.com -dynalias.net -dynalias.org -dynathome.net -dyndns.ws -endofinternet.net -endofinternet.org -endoftheinternet.org -est-a-la-maison.com -est-a-la-masion.com -est-le-patron.com -est-mon-blogueur.com -for-better.biz -for-more.biz -for-our.info -for-some.biz -for-the.biz -forgot.her.name -forgot.his.name -from-ak.com -from-al.com -from-ar.com -from-az.net -from-ca.com -from-co.net -from-ct.com -from-dc.com -from-de.com -from-fl.com -from-ga.com -from-hi.com -from-ia.com -from-id.com -from-il.com -from-in.com -from-ks.com -from-ky.com -from-la.net -from-ma.com -from-md.com -from-me.org -from-mi.com -from-mn.com -from-mo.com -from-ms.com -from-mt.com -from-nc.com -from-nd.com -from-ne.com -from-nh.com -from-nj.com -from-nm.com -from-nv.com -from-ny.net -from-oh.com -from-ok.com -from-or.com -from-pa.com -from-pr.com -from-ri.com -from-sc.com -from-sd.com -from-tn.com -from-tx.com -from-ut.com -from-va.com -from-vt.com -from-wa.com -from-wi.com -from-wv.com -from-wy.com -ftpaccess.cc -fuettertdasnetz.de -game-host.org -game-server.cc -getmyip.com -gets-it.net -go.dyndns.org -gotdns.com -gotdns.org -groks-the.info -groks-this.info -ham-radio-op.net -here-for-more.info -hobby-site.com -hobby-site.org -home.dyndns.org -homedns.org -homeftp.net -homeftp.org -homeip.net -homelinux.com -homelinux.net -homelinux.org -homeunix.com -homeunix.net -homeunix.org -iamallama.com -in-the-band.net -is-a-anarchist.com -is-a-blogger.com -is-a-bookkeeper.com -is-a-bruinsfan.org -is-a-bulls-fan.com -is-a-candidate.org -is-a-caterer.com -is-a-celticsfan.org -is-a-chef.com -is-a-chef.net -is-a-chef.org -is-a-conservative.com -is-a-cpa.com -is-a-cubicle-slave.com -is-a-democrat.com -is-a-designer.com -is-a-doctor.com -is-a-financialadvisor.com -is-a-geek.com -is-a-geek.net -is-a-geek.org -is-a-green.com -is-a-guru.com -is-a-hard-worker.com -is-a-hunter.com -is-a-knight.org -is-a-landscaper.com -is-a-lawyer.com -is-a-liberal.com -is-a-libertarian.com -is-a-linux-user.org -is-a-llama.com -is-a-musician.com -is-a-nascarfan.com -is-a-nurse.com -is-a-painter.com -is-a-patsfan.org -is-a-personaltrainer.com -is-a-photographer.com -is-a-player.com -is-a-republican.com -is-a-rockstar.com -is-a-socialist.com -is-a-soxfan.org -is-a-student.com -is-a-teacher.com -is-a-techie.com -is-a-therapist.com -is-an-accountant.com -is-an-actor.com -is-an-actress.com -is-an-anarchist.com -is-an-artist.com -is-an-engineer.com -is-an-entertainer.com -is-by.us -is-certified.com -is-found.org -is-gone.com -is-into-anime.com -is-into-cars.com -is-into-cartoons.com -is-into-games.com -is-leet.com -is-lost.org -is-not-certified.com -is-saved.org -is-slick.com -is-uberleet.com -is-very-bad.org -is-very-evil.org -is-very-good.org -is-very-nice.org -is-very-sweet.org -is-with-theband.com -isa-geek.com -isa-geek.net -isa-geek.org -isa-hockeynut.com -issmarterthanyou.com -isteingeek.de -istmein.de -kicks-ass.net -kicks-ass.org -knowsitall.info -land-4-sale.us -lebtimnetz.de -leitungsen.de -likes-pie.com -likescandy.com -merseine.nu -mine.nu -misconfused.org -mypets.ws -myphotos.cc -neat-url.com -office-on-the.net -on-the-web.tv -podzone.net -podzone.org -readmyblog.org -saves-the-whales.com -scrapper-site.net -scrapping.cc -selfip.biz -selfip.com -selfip.info -selfip.net -selfip.org -sells-for-less.com -sells-for-u.com -sells-it.net -sellsyourhome.org -servebbs.com -servebbs.net -servebbs.org -serveftp.net -serveftp.org -servegame.org -shacknet.nu -simple-url.com -space-to-rent.com -stuff-4-sale.org -stuff-4-sale.us -teaches-yoga.com -thruhere.net -traeumtgerade.de -webhop.biz -webhop.info -webhop.net -webhop.org -worse-than.tv -writesthisblog.com - -// ===END PRIVATE DOMAINS=== diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/test.js b/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/test.js deleted file mode 100644 index 5cbf536ca..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/tough-cookie/test.js +++ /dev/null @@ -1,1625 +0,0 @@ -/* - * Copyright GoInstant, Inc. and other contributors. 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. - */ -'use strict'; -var vows = require('vows'); -var assert = require('assert'); -var async = require('async'); - -// NOTE use require("tough-cookie") in your own code: -var tough = require('./lib/cookie'); -var Cookie = tough.Cookie; -var CookieJar = tough.CookieJar; - - -function dateVows(table) { - var theVows = { }; - Object.keys(table).forEach(function(date) { - var expect = table[date]; - theVows[date] = function() { - var got = tough.parseDate(date) ? 'valid' : 'invalid'; - assert.equal(got, expect ? 'valid' : 'invalid'); - }; - }); - return { "date parsing": theVows }; -} - -function matchVows(func,table) { - var theVows = {}; - table.forEach(function(item) { - var str = item[0]; - var dom = item[1]; - var expect = item[2]; - var label = str+(expect?" matches ":" doesn't match ")+dom; - theVows[label] = function() { - assert.equal(func(str,dom),expect); - }; - }); - return theVows; -} - -function defaultPathVows(table) { - var theVows = {}; - table.forEach(function(item) { - var str = item[0]; - var expect = item[1]; - var label = str+" gives "+expect; - theVows[label] = function() { - assert.equal(tough.defaultPath(str),expect); - }; - }); - return theVows; -} - -var atNow = Date.now(); -function at(offset) { return {now: new Date(atNow+offset)}; } - -vows.describe('Cookie Jar') -.addBatch({ - "all defined": function() { - assert.ok(Cookie); - assert.ok(CookieJar); - }, -}) -.addBatch( - dateVows({ - "Wed, 09 Jun 2021 10:18:14 GMT": true, - "Wed, 09 Jun 2021 22:18:14 GMT": true, - "Tue, 18 Oct 2011 07:42:42.123 GMT": true, - "18 Oct 2011 07:42:42 GMT": true, - "8 Oct 2011 7:42:42 GMT": true, - "8 Oct 2011 7:2:42 GMT": false, - "Oct 18 2011 07:42:42 GMT": true, - "Tue Oct 18 2011 07:05:03 GMT+0000 (GMT)": true, - "09 Jun 2021 10:18:14 GMT": true, - "99 Jix 3038 48:86:72 ZMT": false, - '01 Jan 1970 00:00:00 GMT': true, - '01 Jan 1600 00:00:00 GMT': false, // before 1601 - '01 Jan 1601 00:00:00 GMT': true, - '10 Feb 81 13:00:00 GMT': true, // implicit year - 'Thu, 01 Jan 1970 00:00:010 GMT': true, // strange time, non-strict OK - 'Thu, 17-Apr-2014 02:12:29 GMT': true, // dashes - 'Thu, 17-Apr-2014 02:12:29 UTC': true, // dashes and UTC - }) -) -.addBatch({ - "strict date parse of Thu, 01 Jan 1970 00:00:010 GMT": { - topic: function() { - return tough.parseDate('Thu, 01 Jan 1970 00:00:010 GMT', true) ? true : false; - }, - "invalid": function(date) { - assert.equal(date,false); - }, - } -}) -.addBatch({ - "formatting": { - "a simple cookie": { - topic: function() { - var c = new Cookie(); - c.key = 'a'; - c.value = 'b'; - return c; - }, - "validates": function(c) { - assert.ok(c.validate()); - }, - "to string": function(c) { - assert.equal(c.toString(), 'a=b'); - }, - }, - "a cookie with spaces in the value": { - topic: function() { - var c = new Cookie(); - c.key = 'a'; - c.value = 'beta gamma'; - return c; - }, - "doesn't validate": function(c) { - assert.ok(!c.validate()); - }, - "'garbage in, garbage out'": function(c) { - assert.equal(c.toString(), 'a=beta gamma'); - }, - }, - "with an empty value and HttpOnly": { - topic: function() { - var c = new Cookie(); - c.key = 'a'; - c.httpOnly = true; - return c; - }, - "to string": function(c) { - assert.equal(c.toString(), 'a=; HttpOnly'); - } - }, - "with an expiry": { - topic: function() { - var c = new Cookie(); - c.key = 'a'; - c.value = 'b'; - c.setExpires("Oct 18 2011 07:05:03 GMT"); - return c; - }, - "validates": function(c) { - assert.ok(c.validate()); - }, - "to string": function(c) { - assert.equal(c.toString(), 'a=b; Expires=Tue, 18 Oct 2011 07:05:03 GMT'); - }, - "to short string": function(c) { - assert.equal(c.cookieString(), 'a=b'); - }, - }, - "with a max-age": { - topic: function() { - var c = new Cookie(); - c.key = 'a'; - c.value = 'b'; - c.setExpires("Oct 18 2011 07:05:03 GMT"); - c.maxAge = 12345; - return c; - }, - "validates": function(c) { - assert.ok(c.validate()); // mabe this one *shouldn't*? - }, - "to string": function(c) { - assert.equal(c.toString(), 'a=b; Expires=Tue, 18 Oct 2011 07:05:03 GMT; Max-Age=12345'); - }, - }, - "with a bunch of things": function() { - var c = new Cookie(); - c.key = 'a'; - c.value = 'b'; - c.setExpires("Oct 18 2011 07:05:03 GMT"); - c.maxAge = 12345; - c.domain = 'example.com'; - c.path = '/foo'; - c.secure = true; - c.httpOnly = true; - c.extensions = ['MyExtension']; - assert.equal(c.toString(), 'a=b; Expires=Tue, 18 Oct 2011 07:05:03 GMT; Max-Age=12345; Domain=example.com; Path=/foo; Secure; HttpOnly; MyExtension'); - }, - "a host-only cookie": { - topic: function() { - var c = new Cookie(); - c.key = 'a'; - c.value = 'b'; - c.hostOnly = true; - c.domain = 'shouldnt-stringify.example.com'; - c.path = '/should-stringify'; - return c; - }, - "validates": function(c) { - assert.ok(c.validate()); - }, - "to string": function(c) { - assert.equal(c.toString(), 'a=b; Path=/should-stringify'); - }, - }, - "minutes are '10'": { - topic: function() { - var c = new Cookie(); - c.key = 'a'; - c.value = 'b'; - c.expires = new Date(1284113410000); - return c; - }, - "validates": function(c) { - assert.ok(c.validate()); - }, - "to string": function(c) { - var str = c.toString(); - assert.notEqual(str, 'a=b; Expires=Fri, 010 Sep 2010 010:010:010 GMT'); - assert.equal(str, 'a=b; Expires=Fri, 10 Sep 2010 10:10:10 GMT'); - }, - } - } -}) -.addBatch({ - "TTL with max-age": function() { - var c = new Cookie(); - c.maxAge = 123; - assert.equal(c.TTL(), 123000); - assert.equal(c.expiryTime(new Date(9000000)), 9123000); - }, - "TTL with zero max-age": function() { - var c = new Cookie(); - c.key = 'a'; c.value = 'b'; - c.maxAge = 0; // should be treated as "earliest representable" - assert.equal(c.TTL(), 0); - assert.equal(c.expiryTime(new Date(9000000)), -Infinity); - assert.ok(!c.validate()); // not valid, really: non-zero-digit *DIGIT - }, - "TTL with negative max-age": function() { - var c = new Cookie(); - c.key = 'a'; c.value = 'b'; - c.maxAge = -1; // should be treated as "earliest representable" - assert.equal(c.TTL(), 0); - assert.equal(c.expiryTime(new Date(9000000)), -Infinity); - assert.ok(!c.validate()); // not valid, really: non-zero-digit *DIGIT - }, - "TTL with max-age and expires": function() { - var c = new Cookie(); - c.maxAge = 123; - c.expires = new Date(Date.now()+9000); - assert.equal(c.TTL(), 123000); - assert.ok(c.isPersistent()); - }, - "TTL with expires": function() { - var c = new Cookie(); - var now = Date.now(); - c.expires = new Date(now+9000); - assert.equal(c.TTL(now), 9000); - assert.equal(c.expiryTime(), c.expires.getTime()); - }, - "TTL with old expires": function() { - var c = new Cookie(); - c.setExpires('17 Oct 2010 00:00:00 GMT'); - assert.ok(c.TTL() < 0); - assert.ok(c.isPersistent()); - }, - "default TTL": { - topic: function() { return new Cookie(); }, - "is Infinite-future": function(c) { assert.equal(c.TTL(), Infinity) }, - "is a 'session' cookie": function(c) { assert.ok(!c.isPersistent()) }, - }, -}).addBatch({ - "Parsing": { - "simple": { - topic: function() { - return Cookie.parse('a=bcd',true) || null; - }, - "parsed": function(c) { assert.ok(c) }, - "key": function(c) { assert.equal(c.key, 'a') }, - "value": function(c) { assert.equal(c.value, 'bcd') }, - "no path": function(c) { assert.equal(c.path, null) }, - "no domain": function(c) { assert.equal(c.domain, null) }, - "no extensions": function(c) { assert.ok(!c.extensions) }, - }, - "with expiry": { - topic: function() { - return Cookie.parse('a=bcd; Expires=Tue, 18 Oct 2011 07:05:03 GMT',true) || null; - }, - "parsed": function(c) { assert.ok(c) }, - "key": function(c) { assert.equal(c.key, 'a') }, - "value": function(c) { assert.equal(c.value, 'bcd') }, - "has expires": function(c) { - assert.ok(c.expires !== Infinity, 'expiry is infinite when it shouldn\'t be'); - assert.equal(c.expires.getTime(), 1318921503000); - }, - }, - "with expiry and path": { - topic: function() { - return Cookie.parse('abc="xyzzy!"; Expires=Tue, 18 Oct 2011 07:05:03 GMT; Path=/aBc',true) || null; - }, - "parsed": function(c) { assert.ok(c) }, - "key": function(c) { assert.equal(c.key, 'abc') }, - "value": function(c) { assert.equal(c.value, 'xyzzy!') }, - "has expires": function(c) { - assert.ok(c.expires !== Infinity, 'expiry is infinite when it shouldn\'t be'); - assert.equal(c.expires.getTime(), 1318921503000); - }, - "has path": function(c) { assert.equal(c.path, '/aBc'); }, - "no httponly or secure": function(c) { - assert.ok(!c.httpOnly); - assert.ok(!c.secure); - }, - }, - "with everything": { - topic: function() { - return Cookie.parse('abc="xyzzy!"; Expires=Tue, 18 Oct 2011 07:05:03 GMT; Path=/aBc; Domain=example.com; Secure; HTTPOnly; Max-Age=1234; Foo=Bar; Baz', true) || null; - }, - "parsed": function(c) { assert.ok(c) }, - "key": function(c) { assert.equal(c.key, 'abc') }, - "value": function(c) { assert.equal(c.value, 'xyzzy!') }, - "has expires": function(c) { - assert.ok(c.expires !== Infinity, 'expiry is infinite when it shouldn\'t be'); - assert.equal(c.expires.getTime(), 1318921503000); - }, - "has path": function(c) { assert.equal(c.path, '/aBc'); }, - "has domain": function(c) { assert.equal(c.domain, 'example.com'); }, - "has httponly": function(c) { assert.equal(c.httpOnly, true); }, - "has secure": function(c) { assert.equal(c.secure, true); }, - "has max-age": function(c) { assert.equal(c.maxAge, 1234); }, - "has extensions": function(c) { - assert.ok(c.extensions); - assert.equal(c.extensions[0], 'Foo=Bar'); - assert.equal(c.extensions[1], 'Baz'); - }, - }, - "invalid expires": { - "strict": function() { assert.ok(!Cookie.parse("a=b; Expires=xyzzy", true)) }, - "non-strict": function() { - var c = Cookie.parse("a=b; Expires=xyzzy"); - assert.ok(c); - assert.equal(c.expires, Infinity); - }, - }, - "zero max-age": { - "strict": function() { assert.ok(!Cookie.parse("a=b; Max-Age=0", true)) }, - "non-strict": function() { - var c = Cookie.parse("a=b; Max-Age=0"); - assert.ok(c); - assert.equal(c.maxAge, 0); - }, - }, - "negative max-age": { - "strict": function() { assert.ok(!Cookie.parse("a=b; Max-Age=-1", true)) }, - "non-strict": function() { - var c = Cookie.parse("a=b; Max-Age=-1"); - assert.ok(c); - assert.equal(c.maxAge, -1); - }, - }, - "empty domain": { - "strict": function() { assert.ok(!Cookie.parse("a=b; domain=", true)) }, - "non-strict": function() { - var c = Cookie.parse("a=b; domain="); - assert.ok(c); - assert.equal(c.domain, null); - }, - }, - "dot domain": { - "strict": function() { assert.ok(!Cookie.parse("a=b; domain=.", true)) }, - "non-strict": function() { - var c = Cookie.parse("a=b; domain=."); - assert.ok(c); - assert.equal(c.domain, null); - }, - }, - "uppercase domain": { - "strict lowercases": function() { - var c = Cookie.parse("a=b; domain=EXAMPLE.COM"); - assert.ok(c); - assert.equal(c.domain, 'example.com'); - }, - "non-strict lowercases": function() { - var c = Cookie.parse("a=b; domain=EXAMPLE.COM"); - assert.ok(c); - assert.equal(c.domain, 'example.com'); - }, - }, - "trailing dot in domain": { - topic: function() { - return Cookie.parse("a=b; Domain=example.com.", true) || null; - }, - "has the domain": function(c) { assert.equal(c.domain,"example.com.") }, - "but doesn't validate": function(c) { assert.equal(c.validate(),false) }, - }, - "empty path": { - "strict": function() { assert.ok(!Cookie.parse("a=b; path=", true)) }, - "non-strict": function() { - var c = Cookie.parse("a=b; path="); - assert.ok(c); - assert.equal(c.path, null); - }, - }, - "no-slash path": { - "strict": function() { assert.ok(!Cookie.parse("a=b; path=xyzzy", true)) }, - "non-strict": function() { - var c = Cookie.parse("a=b; path=xyzzy"); - assert.ok(c); - assert.equal(c.path, null); - }, - }, - "trailing semi-colons after path": { - topic: function () { - return [ - "a=b; path=/;", - "c=d;;;;" - ]; - }, - "strict": function (t) { - assert.ok(!Cookie.parse(t[0], true)); - assert.ok(!Cookie.parse(t[1], true)); - }, - "non-strict": function (t) { - var c1 = Cookie.parse(t[0]); - var c2 = Cookie.parse(t[1]); - assert.ok(c1); - assert.ok(c2); - assert.equal(c1.path, '/'); - } - }, - "secure-with-value": { - "strict": function() { assert.ok(!Cookie.parse("a=b; Secure=xyzzy", true)) }, - "non-strict": function() { - var c = Cookie.parse("a=b; Secure=xyzzy"); - assert.ok(c); - assert.equal(c.secure, true); - }, - }, - "httponly-with-value": { - "strict": function() { assert.ok(!Cookie.parse("a=b; HttpOnly=xyzzy", true)) }, - "non-strict": function() { - var c = Cookie.parse("a=b; HttpOnly=xyzzy"); - assert.ok(c); - assert.equal(c.httpOnly, true); - }, - }, - "garbage": { - topic: function() { - return Cookie.parse("\x08", true) || null; - }, - "doesn't parse": function(c) { assert.equal(c,null) }, - }, - "public suffix domain": { - topic: function() { - return Cookie.parse("a=b; domain=kyoto.jp", true) || null; - }, - "parses fine": function(c) { - assert.ok(c); - assert.equal(c.domain, 'kyoto.jp'); - }, - "but fails validation": function(c) { - assert.ok(c); - assert.ok(!c.validate()); - }, - }, - "Ironically, Google 'GAPS' cookie has very little whitespace": { - topic: function() { - return Cookie.parse("GAPS=1:A1aaaaAaAAa1aaAaAaaAAAaaa1a11a:aaaAaAaAa-aaaA1-;Path=/;Expires=Thu, 17-Apr-2014 02:12:29 GMT;Secure;HttpOnly"); - }, - "parsed": function(c) { assert.ok(c) }, - "key": function(c) { assert.equal(c.key, 'GAPS') }, - "value": function(c) { assert.equal(c.value, '1:A1aaaaAaAAa1aaAaAaaAAAaaa1a11a:aaaAaAaAa-aaaA1-') }, - "path": function(c) { - assert.notEqual(c.path, '/;Expires'); // BUG - assert.equal(c.path, '/'); - }, - "expires": function(c) { - assert.notEqual(c.expires, Infinity); - assert.equal(c.expires.getTime(), 1397700749000); - }, - "secure": function(c) { assert.ok(c.secure) }, - "httponly": function(c) { assert.ok(c.httpOnly) }, - }, - "lots of equal signs": { - topic: function() { - return Cookie.parse("queryPref=b=c&d=e; Path=/f=g; Expires=Thu, 17 Apr 2014 02:12:29 GMT; HttpOnly"); - }, - "parsed": function(c) { assert.ok(c) }, - "key": function(c) { assert.equal(c.key, 'queryPref') }, - "value": function(c) { assert.equal(c.value, 'b=c&d=e') }, - "path": function(c) { - assert.equal(c.path, '/f=g'); - }, - "expires": function(c) { - assert.notEqual(c.expires, Infinity); - assert.equal(c.expires.getTime(), 1397700749000); - }, - "httponly": function(c) { assert.ok(c.httpOnly) }, - }, - "spaces in value": { - "strict": { - topic: function() { - return Cookie.parse('a=one two three',true) || null; - }, - "did not parse": function(c) { assert.isNull(c) }, - }, - "non-strict": { - topic: function() { - return Cookie.parse('a=one two three',false) || null; - }, - "parsed": function(c) { assert.ok(c) }, - "key": function(c) { assert.equal(c.key, 'a') }, - "value": function(c) { assert.equal(c.value, 'one two three') }, - "no path": function(c) { assert.equal(c.path, null) }, - "no domain": function(c) { assert.equal(c.domain, null) }, - "no extensions": function(c) { assert.ok(!c.extensions) }, - }, - }, - "quoted spaces in value": { - "strict": { - topic: function() { - return Cookie.parse('a="one two three"',true) || null; - }, - "did not parse": function(c) { assert.isNull(c) }, - }, - "non-strict": { - topic: function() { - return Cookie.parse('a="one two three"',false) || null; - }, - "parsed": function(c) { assert.ok(c) }, - "key": function(c) { assert.equal(c.key, 'a') }, - "value": function(c) { assert.equal(c.value, 'one two three') }, - "no path": function(c) { assert.equal(c.path, null) }, - "no domain": function(c) { assert.equal(c.domain, null) }, - "no extensions": function(c) { assert.ok(!c.extensions) }, - } - }, - "non-ASCII in value": { - "strict": { - topic: function() { - return Cookie.parse('farbe=weiß',true) || null; - }, - "did not parse": function(c) { assert.isNull(c) }, - }, - "non-strict": { - topic: function() { - return Cookie.parse('farbe=weiß',false) || null; - }, - "parsed": function(c) { assert.ok(c) }, - "key": function(c) { assert.equal(c.key, 'farbe') }, - "value": function(c) { assert.equal(c.value, 'weiß') }, - "no path": function(c) { assert.equal(c.path, null) }, - "no domain": function(c) { assert.equal(c.domain, null) }, - "no extensions": function(c) { assert.ok(!c.extensions) }, - }, - }, - } -}) -.addBatch({ - "domain normalization": { - "simple": function() { - var c = new Cookie(); - c.domain = "EXAMPLE.com"; - assert.equal(c.canonicalizedDomain(), "example.com"); - }, - "extra dots": function() { - var c = new Cookie(); - c.domain = ".EXAMPLE.com"; - assert.equal(c.cdomain(), "example.com"); - }, - "weird trailing dot": function() { - var c = new Cookie(); - c.domain = "EXAMPLE.ca."; - assert.equal(c.canonicalizedDomain(), "example.ca."); - }, - "weird internal dots": function() { - var c = new Cookie(); - c.domain = "EXAMPLE...ca."; - assert.equal(c.canonicalizedDomain(), "example...ca."); - }, - "IDN": function() { - var c = new Cookie(); - c.domain = "δοκιμή.δοκιμή"; // "test.test" in greek - assert.equal(c.canonicalizedDomain(), "xn--jxalpdlp.xn--jxalpdlp"); - } - } -}) -.addBatch({ - "Domain Match":matchVows(tough.domainMatch, [ - // str, dom, expect - ["example.com", "example.com", true], - ["eXaMpLe.cOm", "ExAmPlE.CoM", true], - ["no.ca", "yes.ca", false], - ["wwwexample.com", "example.com", false], - ["www.example.com", "example.com", true], - ["example.com", "www.example.com", false], - ["www.subdom.example.com", "example.com", true], - ["www.subdom.example.com", "subdom.example.com", true], - ["example.com", "example.com.", false], // RFC6265 S4.1.2.3 - ["192.168.0.1", "168.0.1", false], // S5.1.3 "The string is a host name" - [null, "example.com", null], - ["example.com", null, null], - [null, null, null], - [undefined, undefined, null], - ]) -}) -.addBatch({ - "default-path": defaultPathVows([ - [null,"/"], - ["/","/"], - ["/file","/"], - ["/dir/file","/dir"], - ["noslash","/"], - ]) -}) -.addBatch({ - "Path-Match": matchVows(tough.pathMatch, [ - // request, cookie, match - ["/","/",true], - ["/dir","/",true], - ["/","/dir",false], - ["/dir/","/dir/", true], - ["/dir/file","/dir/",true], - ["/dir/file","/dir",true], - ["/directory","/dir",false], - ]) -}) -.addBatch({ - "Cookie Sorting": { - topic: function() { - var cookies = []; - var now = Date.now(); - cookies.push(Cookie.parse("a=0; Domain=example.com")); - cookies.push(Cookie.parse("b=1; Domain=www.example.com")); - cookies.push(Cookie.parse("c=2; Domain=example.com; Path=/pathA")); - cookies.push(Cookie.parse("d=3; Domain=www.example.com; Path=/pathA")); - cookies.push(Cookie.parse("e=4; Domain=example.com; Path=/pathA/pathB")); - cookies.push(Cookie.parse("f=5; Domain=www.example.com; Path=/pathA/pathB")); - - // force a stable creation time consistent with the order above since - // some may have been created at now + 1ms. - var i = cookies.length; - cookies.forEach(function(cookie) { - cookie.creation = new Date(now - 100*(i--)); - }); - - // weak shuffle: - cookies = cookies.sort(function(){return Math.random()-0.5}); - - cookies = cookies.sort(tough.cookieCompare); - return cookies; - }, - "got": function(cookies) { - assert.lengthOf(cookies, 6); - var names = cookies.map(function(c) {return c.key}); - assert.deepEqual(names, ['e','f','c','d','a','b']); - }, - } -}) -.addBatch({ - "CookieJar": { - "Setting a basic cookie": { - topic: function() { - var cj = new CookieJar(); - var c = Cookie.parse("a=b; Domain=example.com; Path=/"); - assert.strictEqual(c.hostOnly, null); - assert.instanceOf(c.creation, Date); - assert.strictEqual(c.lastAccessed, null); - c.creation = new Date(Date.now()-10000); - cj.setCookie(c, 'http://example.com/index.html', this.callback); - }, - "works": function(c) { assert.instanceOf(c,Cookie) }, // C is for Cookie, good enough for me - "gets timestamped": function(c) { - assert.ok(c.creation); - assert.ok(Date.now() - c.creation.getTime() < 5000); // recently stamped - assert.ok(c.lastAccessed); - assert.equal(c.creation, c.lastAccessed); - assert.equal(c.TTL(), Infinity); - assert.ok(!c.isPersistent()); - }, - }, - "Setting a no-path cookie": { - topic: function() { - var cj = new CookieJar(); - var c = Cookie.parse("a=b; Domain=example.com"); - assert.strictEqual(c.hostOnly, null); - assert.instanceOf(c.creation, Date); - assert.strictEqual(c.lastAccessed, null); - c.creation = new Date(Date.now()-10000); - cj.setCookie(c, 'http://example.com/index.html', this.callback); - }, - "domain": function(c) { assert.equal(c.domain, 'example.com') }, - "path is /": function(c) { assert.equal(c.path, '/') }, - "path was derived": function(c) { assert.strictEqual(c.pathIsDefault, true) }, - }, - "Setting a cookie already marked as host-only": { - topic: function() { - var cj = new CookieJar(); - var c = Cookie.parse("a=b; Domain=example.com"); - assert.strictEqual(c.hostOnly, null); - assert.instanceOf(c.creation, Date); - assert.strictEqual(c.lastAccessed, null); - c.creation = new Date(Date.now()-10000); - c.hostOnly = true; - cj.setCookie(c, 'http://example.com/index.html', this.callback); - }, - "domain": function(c) { assert.equal(c.domain, 'example.com') }, - "still hostOnly": function(c) { assert.strictEqual(c.hostOnly, true) }, - }, - "Setting a session cookie": { - topic: function() { - var cj = new CookieJar(); - var c = Cookie.parse("a=b"); - assert.strictEqual(c.path, null); - cj.setCookie(c, 'http://www.example.com/dir/index.html', this.callback); - }, - "works": function(c) { assert.instanceOf(c,Cookie) }, - "gets the domain": function(c) { assert.equal(c.domain, 'www.example.com') }, - "gets the default path": function(c) { assert.equal(c.path, '/dir') }, - "is 'hostOnly'": function(c) { assert.ok(c.hostOnly) }, - }, - "Setting wrong domain cookie": { - topic: function() { - var cj = new CookieJar(); - var c = Cookie.parse("a=b; Domain=fooxample.com; Path=/"); - cj.setCookie(c, 'http://example.com/index.html', this.callback); - }, - "fails": function(err,c) { - assert.ok(err.message.match(/domain/i)); - assert.ok(!c); - }, - }, - "Setting sub-domain cookie": { - topic: function() { - var cj = new CookieJar(); - var c = Cookie.parse("a=b; Domain=www.example.com; Path=/"); - cj.setCookie(c, 'http://example.com/index.html', this.callback); - }, - "fails": function(err,c) { - assert.ok(err.message.match(/domain/i)); - assert.ok(!c); - }, - }, - "Setting super-domain cookie": { - topic: function() { - var cj = new CookieJar(); - var c = Cookie.parse("a=b; Domain=example.com; Path=/"); - cj.setCookie(c, 'http://www.app.example.com/index.html', this.callback); - }, - "success": function(err,c) { - assert.ok(!err); - assert.equal(c.domain, 'example.com'); - }, - }, - "Setting a sub-path cookie on a super-domain": { - topic: function() { - var cj = new CookieJar(); - var c = Cookie.parse("a=b; Domain=example.com; Path=/subpath"); - assert.strictEqual(c.hostOnly, null); - assert.instanceOf(c.creation, Date); - assert.strictEqual(c.lastAccessed, null); - c.creation = new Date(Date.now()-10000); - cj.setCookie(c, 'http://www.example.com/index.html', this.callback); - }, - "domain is super-domain": function(c) { assert.equal(c.domain, 'example.com') }, - "path is /subpath": function(c) { assert.equal(c.path, '/subpath') }, - "path was NOT derived": function(c) { assert.strictEqual(c.pathIsDefault, null) }, - }, - "Setting HttpOnly cookie over non-HTTP API": { - topic: function() { - var cj = new CookieJar(); - var c = Cookie.parse("a=b; Domain=example.com; Path=/; HttpOnly"); - cj.setCookie(c, 'http://example.com/index.html', {http:false}, this.callback); - }, - "fails": function(err,c) { - assert.match(err.message, /HttpOnly/i); - assert.ok(!c); - }, - }, - }, - "Cookie Jar store eight cookies": { - topic: function() { - var cj = new CookieJar(); - var ex = 'http://example.com/index.html'; - var tasks = []; - tasks.push(function(next) { - cj.setCookie('a=1; Domain=example.com; Path=/',ex,at(0),next); - }); - tasks.push(function(next) { - cj.setCookie('b=2; Domain=example.com; Path=/; HttpOnly',ex,at(1000),next); - }); - tasks.push(function(next) { - cj.setCookie('c=3; Domain=example.com; Path=/; Secure',ex,at(2000),next); - }); - tasks.push(function(next) { // path - cj.setCookie('d=4; Domain=example.com; Path=/foo',ex,at(3000),next); - }); - tasks.push(function(next) { // host only - cj.setCookie('e=5',ex,at(4000),next); - }); - tasks.push(function(next) { // other domain - cj.setCookie('f=6; Domain=nodejs.org; Path=/','http://nodejs.org',at(5000),next); - }); - tasks.push(function(next) { // expired - cj.setCookie('g=7; Domain=example.com; Path=/; Expires=Tue, 18 Oct 2011 00:00:00 GMT',ex,at(6000),next); - }); - tasks.push(function(next) { // expired via Max-Age - cj.setCookie('h=8; Domain=example.com; Path=/; Max-Age=1',ex,next); - }); - var cb = this.callback; - async.parallel(tasks, function(err,results){ - setTimeout(function() { - cb(err,cj,results); - }, 2000); // so that 'h=8' expires - }); - }, - "setup ok": function(err,cj,results) { - assert.ok(!err); - assert.ok(cj); - assert.ok(results); - }, - "then retrieving for http://nodejs.org": { - topic: function(cj,oldResults) { - assert.ok(oldResults); - cj.getCookies('http://nodejs.org',this.callback); - }, - "get a nodejs cookie": function(cookies) { - assert.lengthOf(cookies, 1); - var cookie = cookies[0]; - assert.equal(cookie.domain, 'nodejs.org'); - }, - }, - "then retrieving for https://example.com": { - topic: function(cj,oldResults) { - assert.ok(oldResults); - cj.getCookies('https://example.com',{secure:true},this.callback); - }, - "get a secure example cookie with others": function(cookies) { - var names = cookies.map(function(c) {return c.key}); - assert.deepEqual(names, ['a','b','c','e']); - }, - }, - "then retrieving for https://example.com (missing options)": { - topic: function(cj,oldResults) { - assert.ok(oldResults); - cj.getCookies('https://example.com',this.callback); - }, - "get a secure example cookie with others": function(cookies) { - var names = cookies.map(function(c) {return c.key}); - assert.deepEqual(names, ['a','b','c','e']); - }, - }, - "then retrieving for http://example.com": { - topic: function(cj,oldResults) { - assert.ok(oldResults); - cj.getCookies('http://example.com',this.callback); - }, - "get a bunch of cookies": function(cookies) { - var names = cookies.map(function(c) {return c.key}); - assert.deepEqual(names, ['a','b','e']); - }, - }, - "then retrieving for http://EXAMPlE.com": { - topic: function(cj,oldResults) { - assert.ok(oldResults); - cj.getCookies('http://EXAMPlE.com',this.callback); - }, - "get a bunch of cookies": function(cookies) { - var names = cookies.map(function(c) {return c.key}); - assert.deepEqual(names, ['a','b','e']); - }, - }, - "then retrieving for http://example.com, non-HTTP": { - topic: function(cj,oldResults) { - assert.ok(oldResults); - cj.getCookies('http://example.com',{http:false},this.callback); - }, - "get a bunch of cookies": function(cookies) { - var names = cookies.map(function(c) {return c.key}); - assert.deepEqual(names, ['a','e']); - }, - }, - "then retrieving for http://example.com/foo/bar": { - topic: function(cj,oldResults) { - assert.ok(oldResults); - cj.getCookies('http://example.com/foo/bar',this.callback); - }, - "get a bunch of cookies": function(cookies) { - var names = cookies.map(function(c) {return c.key}); - assert.deepEqual(names, ['d','a','b','e']); - }, - }, - "then retrieving for http://example.com as a string": { - topic: function(cj,oldResults) { - assert.ok(oldResults); - cj.getCookieString('http://example.com',this.callback); - }, - "get a single string": function(cookieHeader) { - assert.equal(cookieHeader, "a=1; b=2; e=5"); - }, - }, - "then retrieving for http://example.com as a set-cookie header": { - topic: function(cj,oldResults) { - assert.ok(oldResults); - cj.getSetCookieStrings('http://example.com',this.callback); - }, - "get a single string": function(cookieHeaders) { - assert.lengthOf(cookieHeaders, 3); - assert.equal(cookieHeaders[0], "a=1; Domain=example.com; Path=/"); - assert.equal(cookieHeaders[1], "b=2; Domain=example.com; Path=/; HttpOnly"); - assert.equal(cookieHeaders[2], "e=5; Path=/"); - }, - }, - "then retrieving for http://www.example.com/": { - topic: function(cj,oldResults) { - assert.ok(oldResults); - cj.getCookies('http://www.example.com/foo/bar',this.callback); - }, - "get a bunch of cookies": function(cookies) { - var names = cookies.map(function(c) {return c.key}); - assert.deepEqual(names, ['d','a','b']); // note lack of 'e' - }, - }, - }, - "Repeated names": { - topic: function() { - var cb = this.callback; - var cj = new CookieJar(); - var ex = 'http://www.example.com/'; - var sc = cj.setCookie; - var tasks = []; - var now = Date.now(); - tasks.push(sc.bind(cj,'aaaa=xxxx',ex,at(0))); - tasks.push(sc.bind(cj,'aaaa=1111; Domain=www.example.com',ex,at(1000))); - tasks.push(sc.bind(cj,'aaaa=2222; Domain=example.com',ex,at(2000))); - tasks.push(sc.bind(cj,'aaaa=3333; Domain=www.example.com; Path=/pathA',ex,at(3000))); - async.series(tasks,function(err,results) { - results = results.filter(function(e) {return e !== undefined}); - cb(err,{cj:cj, cookies:results, now:now}); - }); - }, - "all got set": function(err,t) { - assert.lengthOf(t.cookies,4); - }, - "then getting 'em back": { - topic: function(t) { - var cj = t.cj; - cj.getCookies('http://www.example.com/pathA',this.callback); - }, - "there's just three": function (err,cookies) { - var vals = cookies.map(function(c) {return c.value}); - // may break with sorting; sorting should put 3333 first due to longest path: - assert.deepEqual(vals, ['3333','1111','2222']); - } - }, - }, - "CookieJar setCookie errors": { - "public-suffix domain": { - topic: function() { - var cj = new CookieJar(); - cj.setCookie('i=9; Domain=kyoto.jp; Path=/','kyoto.jp',this.callback); - }, - "errors": function(err,cookie) { - assert.ok(err); - assert.ok(!cookie); - assert.match(err.message, /public suffix/i); - }, - }, - "wrong domain": { - topic: function() { - var cj = new CookieJar(); - cj.setCookie('j=10; Domain=google.com; Path=/','google.ca',this.callback); - }, - "errors": function(err,cookie) { - assert.ok(err); - assert.ok(!cookie); - assert.match(err.message, /not in this host's domain/i); - }, - }, - "old cookie is HttpOnly": { - topic: function() { - var cb = this.callback; - var next = function (err,c) { - c = null; - return cb(err,cj); - }; - var cj = new CookieJar(); - cj.setCookie('k=11; Domain=example.ca; Path=/; HttpOnly','http://example.ca',{http:true},next); - }, - "initial cookie is set": function(err,cj) { - assert.ok(!err); - assert.ok(cj); - }, - "but when trying to overwrite": { - topic: function(cj) { - var cb = this.callback; - var next = function(err,c) { - c = null; - cb(null,err); - }; - cj.setCookie('k=12; Domain=example.ca; Path=/','http://example.ca',{http:false},next); - }, - "it's an error": function(err) { - assert.ok(err); - }, - "then, checking the original": { - topic: function(ignored,cj) { - assert.ok(cj instanceof CookieJar); - cj.getCookies('http://example.ca',{http:true},this.callback); - }, - "cookie has original value": function(err,cookies) { - assert.equal(err,null); - assert.lengthOf(cookies, 1); - assert.equal(cookies[0].value,11); - }, - }, - }, - }, - }, -}) -.addBatch({ - "JSON": { - "serialization": { - topic: function() { - var c = Cookie.parse('alpha=beta; Domain=example.com; Path=/foo; Expires=Tue, 19 Jan 2038 03:14:07 GMT; HttpOnly'); - return JSON.stringify(c); - }, - "gives a string": function(str) { - assert.equal(typeof str, "string"); - }, - "date is in ISO format": function(str) { - assert.match(str, /"expires":"2038-01-19T03:14:07\.000Z"/, 'expires is in ISO format'); - }, - }, - "deserialization": { - topic: function() { - var json = '{"key":"alpha","value":"beta","domain":"example.com","path":"/foo","expires":"2038-01-19T03:14:07.000Z","httpOnly":true,"lastAccessed":2000000000123}'; - return Cookie.fromJSON(json); - }, - "works": function(c) { - assert.ok(c); - }, - "key": function(c) { assert.equal(c.key, "alpha") }, - "value": function(c) { assert.equal(c.value, "beta") }, - "domain": function(c) { assert.equal(c.domain, "example.com") }, - "path": function(c) { assert.equal(c.path, "/foo") }, - "httpOnly": function(c) { assert.strictEqual(c.httpOnly, true) }, - "secure": function(c) { assert.strictEqual(c.secure, false) }, - "hostOnly": function(c) { assert.strictEqual(c.hostOnly, null) }, - "expires is a date object": function(c) { - assert.equal(c.expires.getTime(), 2147483647000); - }, - "lastAccessed is a date object": function(c) { - assert.equal(c.lastAccessed.getTime(), 2000000000123); - }, - "creation defaulted": function(c) { - assert.ok(c.creation.getTime()); - } - }, - "null deserialization": { - topic: function() { - return Cookie.fromJSON(null); - }, - "is null": function(cookie) { - assert.equal(cookie,null); - }, - }, - }, - "expiry deserialization": { - "Infinity": { - topic: Cookie.fromJSON.bind(null, '{"expires":"Infinity"}'), - "is infinite": function(c) { - assert.strictEqual(c.expires, "Infinity"); - assert.equal(c.expires, Infinity); - }, - }, - }, - "maxAge serialization": { - topic: function() { - return function(toSet) { - var c = new Cookie(); - c.key = 'foo'; c.value = 'bar'; - c.setMaxAge(toSet); - return JSON.stringify(c); - }; - }, - "zero": { - topic: function(f) { return f(0) }, - "looks good": function(str) { - assert.match(str, /"maxAge":0/); - }, - }, - "Infinity": { - topic: function(f) { return f(Infinity) }, - "looks good": function(str) { - assert.match(str, /"maxAge":"Infinity"/); - }, - }, - "-Infinity": { - topic: function(f) { return f(-Infinity) }, - "looks good": function(str) { - assert.match(str, /"maxAge":"-Infinity"/); - }, - }, - "null": { - topic: function(f) { return f(null) }, - "looks good": function(str) { - assert.match(str, /"maxAge":null/); - }, - }, - }, - "maxAge deserialization": { - "number": { - topic: Cookie.fromJSON.bind(null,'{"key":"foo","value":"bar","maxAge":123}'), - "is the number": function(c) { - assert.strictEqual(c.maxAge, 123); - }, - }, - "null": { - topic: Cookie.fromJSON.bind(null,'{"key":"foo","value":"bar","maxAge":null}'), - "is null": function(c) { - assert.strictEqual(c.maxAge, null); - }, - }, - "less than zero": { - topic: Cookie.fromJSON.bind(null,'{"key":"foo","value":"bar","maxAge":-123}'), - "is -123": function(c) { - assert.strictEqual(c.maxAge, -123); - }, - }, - "Infinity": { - topic: Cookie.fromJSON.bind(null,'{"key":"foo","value":"bar","maxAge":"Infinity"}'), - "is inf-as-string": function(c) { - assert.strictEqual(c.maxAge, "Infinity"); - }, - }, - "-Infinity": { - topic: Cookie.fromJSON.bind(null,'{"key":"foo","value":"bar","maxAge":"-Infinity"}'), - "is inf-as-string": function(c) { - assert.strictEqual(c.maxAge, "-Infinity"); - }, - }, - } -}) -.addBatch({ - "permuteDomain": { - "base case": { - topic: tough.permuteDomain.bind(null,'example.com'), - "got the domain": function(list) { - assert.deepEqual(list, ['example.com']); - }, - }, - "two levels": { - topic: tough.permuteDomain.bind(null,'foo.bar.example.com'), - "got three things": function(list) { - assert.deepEqual(list, ['example.com','bar.example.com','foo.bar.example.com']); - }, - }, - "invalid domain": { - topic: tough.permuteDomain.bind(null,'foo.bar.example.localduhmain'), - "got three things": function(list) { - assert.equal(list, null); - }, - }, - }, - "permutePath": { - "base case": { - topic: tough.permutePath.bind(null,'/'), - "just slash": function(list) { - assert.deepEqual(list,['/']); - }, - }, - "single case": { - topic: tough.permutePath.bind(null,'/foo'), - "two things": function(list) { - assert.deepEqual(list,['/foo','/']); - }, - "path matching": function(list) { - list.forEach(function(e) { - assert.ok(tough.pathMatch('/foo',e)); - }); - }, - }, - "double case": { - topic: tough.permutePath.bind(null,'/foo/bar'), - "four things": function(list) { - assert.deepEqual(list,['/foo/bar','/foo','/']); - }, - "path matching": function(list) { - list.forEach(function(e) { - assert.ok(tough.pathMatch('/foo/bar',e)); - }); - }, - }, - "trailing slash": { - topic: tough.permutePath.bind(null,'/foo/bar/'), - "three things": function(list) { - assert.deepEqual(list,['/foo/bar','/foo','/']); - }, - "path matching": function(list) { - list.forEach(function(e) { - assert.ok(tough.pathMatch('/foo/bar/',e)); - }); - }, - }, - } -}) -.addBatch({ - "Issue 1": { - topic: function() { - var cj = new CookieJar(); - cj.setCookie('hello=world; path=/some/path/', 'http://domain/some/path/file', function(err,cookie) { - this.callback(err,{cj:cj, cookie:cookie}); - }.bind(this)); - }, - "stored a cookie": function(t) { - assert.ok(t.cookie); - }, - "cookie's path was modified to remove unnecessary slash": function(t) { - assert.equal(t.cookie.path, '/some/path'); - }, - "getting it back": { - topic: function(t) { - t.cj.getCookies('http://domain/some/path/file', function(err,cookies) { - this.callback(err, {cj:t.cj, cookies:cookies||[]}); - }.bind(this)); - }, - "got one cookie": function(t) { - assert.lengthOf(t.cookies, 1); - }, - "it's the right one": function(t) { - var c = t.cookies[0]; - assert.equal(c.key, 'hello'); - assert.equal(c.value, 'world'); - }, - } - } -}) -.addBatch({ - "expiry option": { - topic: function() { - var cb = this.callback; - var cj = new CookieJar(); - cj.setCookie('near=expiry; Domain=example.com; Path=/; Max-Age=1','http://www.example.com',at(-1), function(err,cookie) { - - cb(err, {cj:cj, cookie:cookie}); - }); - }, - "set the cookie": function(t) { - assert.ok(t.cookie, "didn't set?!"); - assert.equal(t.cookie.key, 'near'); - }, - "then, retrieving": { - topic: function(t) { - var cb = this.callback; - setTimeout(function() { - t.cj.getCookies('http://www.example.com', {http:true, expire:false}, function(err,cookies) { - t.cookies = cookies; - cb(err,t); - }); - },2000); - }, - "got the cookie": function(t) { - assert.lengthOf(t.cookies, 1); - assert.equal(t.cookies[0].key, 'near'); - }, - } - } -}) -.addBatch({ - "trailing semi-colon set into cj": { - topic: function () { - var cb = this.callback; - var cj = new CookieJar(); - var ex = 'http://www.example.com'; - var tasks = []; - tasks.push(function(next) { - cj.setCookie('broken_path=testme; path=/;',ex,at(-1),next); - }); - tasks.push(function(next) { - cj.setCookie('b=2; Path=/;;;;',ex,at(-1),next); - }); - async.parallel(tasks, function (err, cookies) { - cb(null, { - cj: cj, - cookies: cookies - }); - }); - }, - "check number of cookies": function (t) { - assert.lengthOf(t.cookies, 2, "didn't set"); - }, - "check *broken_path* was set properly": function (t) { - assert.equal(t.cookies[0].key, "broken_path"); - assert.equal(t.cookies[0].value, "testme"); - assert.equal(t.cookies[0].path, "/"); - }, - "check *b* was set properly": function (t) { - assert.equal(t.cookies[1].key, "b"); - assert.equal(t.cookies[1].value, "2"); - assert.equal(t.cookies[1].path, "/"); - }, - "retrieve the cookie": { - topic: function (t) { - var cb = this.callback; - t.cj.getCookies('http://www.example.com', {}, function (err, cookies) { - t.cookies = cookies; - cb(err, t); - }); - }, - "get the cookie": function(t) { - assert.lengthOf(t.cookies, 2); - assert.equal(t.cookies[0].key, 'broken_path'); - assert.equal(t.cookies[0].value, 'testme'); - assert.equal(t.cookies[1].key, "b"); - assert.equal(t.cookies[1].value, "2"); - assert.equal(t.cookies[1].path, "/"); - }, - }, - } -}) -.addBatch({ - "Constructor":{ - topic: function () { - return new Cookie({ - key: 'test', - value: 'b', - maxAge: 60 - }); - }, - 'check for key property': function (c) { - assert.ok(c); - assert.equal(c.key, 'test'); - }, - 'check for value property': function (c) { - assert.equal(c.value, 'b'); - }, - 'check for maxAge': function (c) { - assert.equal(c.maxAge, 60); - }, - 'check for default values for unspecified properties': function (c) { - assert.equal(c.expires, "Infinity"); - assert.equal(c.secure, false); - assert.equal(c.httpOnly, false); - } - } -}) -.addBatch({ - "allPaths option": { - topic: function() { - var cj = new CookieJar(); - var tasks = []; - tasks.push(cj.setCookie.bind(cj, 'nopath_dom=qq; Path=/; Domain=example.com', 'http://example.com', {})); - tasks.push(cj.setCookie.bind(cj, 'path_dom=qq; Path=/foo; Domain=example.com', 'http://example.com', {})); - tasks.push(cj.setCookie.bind(cj, 'nopath_host=qq; Path=/', 'http://www.example.com', {})); - tasks.push(cj.setCookie.bind(cj, 'path_host=qq; Path=/foo', 'http://www.example.com', {})); - tasks.push(cj.setCookie.bind(cj, 'other=qq; Path=/', 'http://other.example.com/', {})); - tasks.push(cj.setCookie.bind(cj, 'other2=qq; Path=/foo', 'http://other.example.com/foo', {})); - var cb = this.callback; - async.parallel(tasks, function(err,results) { - cb(err, {cj:cj, cookies: results}); - }); - }, - "all set": function(t) { - assert.equal(t.cookies.length, 6); - assert.ok(t.cookies.every(function(c) { return !!c })); - }, - "getting without allPaths": { - topic: function(t) { - var cb = this.callback; - var cj = t.cj; - cj.getCookies('http://www.example.com/', {}, function(err,cookies) { - cb(err, {cj:cj, cookies:cookies}); - }); - }, - "found just two cookies": function(t) { - assert.equal(t.cookies.length, 2); - }, - "all are path=/": function(t) { - assert.ok(t.cookies.every(function(c) { return c.path === '/' })); - }, - "no 'other' cookies": function(t) { - assert.ok(!t.cookies.some(function(c) { return (/^other/).test(c.name) })); - }, - }, - "getting without allPaths for /foo": { - topic: function(t) { - var cb = this.callback; - var cj = t.cj; - cj.getCookies('http://www.example.com/foo', {}, function(err,cookies) { - cb(err, {cj:cj, cookies:cookies}); - }); - }, - "found four cookies": function(t) { - assert.equal(t.cookies.length, 4); - }, - "no 'other' cookies": function(t) { - assert.ok(!t.cookies.some(function(c) { return (/^other/).test(c.name) })); - }, - }, - "getting with allPaths:true": { - topic: function(t) { - var cb = this.callback; - var cj = t.cj; - cj.getCookies('http://www.example.com/', {allPaths:true}, function(err,cookies) { - cb(err, {cj:cj, cookies:cookies}); - }); - }, - "found four cookies": function(t) { - assert.equal(t.cookies.length, 4); - }, - "no 'other' cookies": function(t) { - assert.ok(!t.cookies.some(function(c) { return (/^other/).test(c.name) })); - }, - }, - } -}) -.addBatch({ - "remove cookies": { - topic: function() { - var jar = new CookieJar(); - var cookie = Cookie.parse("a=b; Domain=example.com; Path=/"); - var cookie2 = Cookie.parse("a=b; Domain=foo.com; Path=/"); - var cookie3 = Cookie.parse("foo=bar; Domain=foo.com; Path=/"); - jar.setCookie(cookie, 'http://example.com/index.html', function(){}); - jar.setCookie(cookie2, 'http://foo.com/index.html', function(){}); - jar.setCookie(cookie3, 'http://foo.com/index.html', function(){}); - return jar; - }, - "all from matching domain": function(jar){ - jar.store.removeCookies('example.com',null, function(err) { - assert(err == null); - - jar.store.findCookies('example.com', null, function(err, cookies){ - assert(err == null); - assert(cookies != null); - assert(cookies.length === 0, 'cookie was not removed'); - }); - - jar.store.findCookies('foo.com', null, function(err, cookies){ - assert(err == null); - assert(cookies != null); - assert(cookies.length === 2, 'cookies should not have been removed'); - }); - }); - }, - "from cookie store matching domain and key": function(jar){ - jar.store.removeCookie('foo.com', '/', 'foo', function(err) { - assert(err == null); - - jar.store.findCookies('foo.com', null, function(err, cookies){ - assert(err == null); - assert(cookies != null); - assert(cookies.length === 1, 'cookie was not removed correctly'); - assert(cookies[0].key === 'a', 'wrong cookie was removed'); - }); - }); - } - } -}) -.addBatch({ - "Synchronous CookieJar": { - "setCookieSync": { - topic: function() { - var jar = new CookieJar(); - var cookie = Cookie.parse("a=b; Domain=example.com; Path=/"); - cookie = jar.setCookieSync(cookie, 'http://example.com/index.html'); - return cookie; - }, - "returns a copy of the cookie": function(cookie) { - assert.instanceOf(cookie, Cookie); - } - }, - - "setCookieSync strict parse error": { - topic: function() { - var jar = new CookieJar(); - var opts = { strict: true }; - try { - jar.setCookieSync("farbe=weiß", 'http://example.com/index.html', opts); - return false; - } catch (e) { - return e; - } - }, - "throws the error": function(err) { - assert.instanceOf(err, Error); - assert.equal(err.message, "Cookie failed to parse"); - } - }, - - "getCookiesSync": { - topic: function() { - var jar = new CookieJar(); - var url = 'http://example.com/index.html'; - jar.setCookieSync("a=b; Domain=example.com; Path=/", url); - jar.setCookieSync("c=d; Domain=example.com; Path=/", url); - return jar.getCookiesSync(url); - }, - "returns the cookie array": function(err, cookies) { - assert.ok(!err); - assert.ok(Array.isArray(cookies)); - assert.lengthOf(cookies, 2); - cookies.forEach(function(cookie) { - assert.instanceOf(cookie, Cookie); - }); - } - }, - - "getCookieStringSync": { - topic: function() { - var jar = new CookieJar(); - var url = 'http://example.com/index.html'; - jar.setCookieSync("a=b; Domain=example.com; Path=/", url); - jar.setCookieSync("c=d; Domain=example.com; Path=/", url); - return jar.getCookieStringSync(url); - }, - "returns the cookie header string": function(err, str) { - assert.ok(!err); - assert.typeOf(str, 'string'); - } - }, - - "getSetCookieStringsSync": { - topic: function() { - var jar = new CookieJar(); - var url = 'http://example.com/index.html'; - jar.setCookieSync("a=b; Domain=example.com; Path=/", url); - jar.setCookieSync("c=d; Domain=example.com; Path=/", url); - return jar.getSetCookieStringsSync(url); - }, - "returns the cookie header string": function(err, headers) { - assert.ok(!err); - assert.ok(Array.isArray(headers)); - assert.lengthOf(headers, 2); - headers.forEach(function(header) { - assert.typeOf(header, 'string'); - }); - } - }, - } -}) -.addBatch({ - "Synchronous API on async CookieJar": { - topic: function() { - return new tough.Store(); - }, - "setCookieSync": { - topic: function(store) { - var jar = new CookieJar(store); - try { - jar.setCookieSync("a=b", 'http://example.com/index.html'); - return false; - } catch(e) { - return e; - } - }, - "fails": function(err) { - assert.instanceOf(err, Error); - assert.equal(err.message, - 'CookieJar store is not synchronous; use async API instead.'); - } - }, - "getCookiesSync": { - topic: function(store) { - var jar = new CookieJar(store); - try { - jar.getCookiesSync('http://example.com/index.html'); - return false; - } catch(e) { - return e; - } - }, - "fails": function(err) { - assert.instanceOf(err, Error); - assert.equal(err.message, - 'CookieJar store is not synchronous; use async API instead.'); - } - }, - "getCookieStringSync": { - topic: function(store) { - var jar = new CookieJar(store); - try { - jar.getCookieStringSync('http://example.com/index.html'); - return false; - } catch(e) { - return e; - } - }, - "fails": function(err) { - assert.instanceOf(err, Error); - assert.equal(err.message, - 'CookieJar store is not synchronous; use async API instead.'); - } - }, - "getSetCookieStringsSync": { - topic: function(store) { - var jar = new CookieJar(store); - try { - jar.getSetCookieStringsSync('http://example.com/index.html'); - return false; - } catch(e) { - return e; - } - }, - "fails": function(err) { - assert.instanceOf(err, Error); - assert.equal(err.message, - 'CookieJar store is not synchronous; use async API instead.'); - } - }, - } -}) -.export(module); diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/tunnel-agent/.jshintrc b/update_nation/node_modules/nano/node_modules/request/node_modules/tunnel-agent/.jshintrc deleted file mode 100644 index 4c1c8d497..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/tunnel-agent/.jshintrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "node": true, - "asi": true, - "laxcomma": true -} diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/tunnel-agent/LICENSE b/update_nation/node_modules/nano/node_modules/request/node_modules/tunnel-agent/LICENSE deleted file mode 100644 index a4a9aee0c..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/tunnel-agent/LICENSE +++ /dev/null @@ -1,55 +0,0 @@ -Apache License - -Version 2.0, January 2004 - -http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - -"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. - -"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. - -"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. - -"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. - -"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. - -"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. - -"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). - -"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. - -"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." - -"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: - -You must give any other recipients of the Work or Derivative Works a copy of this License; and - -You must cause any modified files to carry prominent notices stating that You changed the files; and - -You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and - -If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/tunnel-agent/README.md b/update_nation/node_modules/nano/node_modules/request/node_modules/tunnel-agent/README.md deleted file mode 100644 index bb533d56b..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/tunnel-agent/README.md +++ /dev/null @@ -1,4 +0,0 @@ -tunnel-agent -============ - -HTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module. diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/tunnel-agent/index.js b/update_nation/node_modules/nano/node_modules/request/node_modules/tunnel-agent/index.js deleted file mode 100644 index 13c04272d..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/tunnel-agent/index.js +++ /dev/null @@ -1,236 +0,0 @@ -'use strict' - -var net = require('net') - , tls = require('tls') - , http = require('http') - , https = require('https') - , events = require('events') - , assert = require('assert') - , util = require('util') - ; - -exports.httpOverHttp = httpOverHttp -exports.httpsOverHttp = httpsOverHttp -exports.httpOverHttps = httpOverHttps -exports.httpsOverHttps = httpsOverHttps - - -function httpOverHttp(options) { - var agent = new TunnelingAgent(options) - agent.request = http.request - return agent -} - -function httpsOverHttp(options) { - var agent = new TunnelingAgent(options) - agent.request = http.request - agent.createSocket = createSecureSocket - return agent -} - -function httpOverHttps(options) { - var agent = new TunnelingAgent(options) - agent.request = https.request - return agent -} - -function httpsOverHttps(options) { - var agent = new TunnelingAgent(options) - agent.request = https.request - agent.createSocket = createSecureSocket - return agent -} - - -function TunnelingAgent(options) { - var self = this - self.options = options || {} - self.proxyOptions = self.options.proxy || {} - self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets - self.requests = [] - self.sockets = [] - - self.on('free', function onFree(socket, host, port) { - for (var i = 0, len = self.requests.length; i < len; ++i) { - var pending = self.requests[i] - if (pending.host === host && pending.port === port) { - // Detect the request to connect same origin server, - // reuse the connection. - self.requests.splice(i, 1) - pending.request.onSocket(socket) - return - } - } - socket.destroy() - self.removeSocket(socket) - }) -} -util.inherits(TunnelingAgent, events.EventEmitter) - -TunnelingAgent.prototype.addRequest = function addRequest(req, options) { - var self = this - - // Legacy API: addRequest(req, host, port, path) - if (typeof options === 'string') { - options = { - host: options, - port: arguments[2], - path: arguments[3] - }; - } - - if (self.sockets.length >= this.maxSockets) { - // We are over limit so we'll add it to the queue. - self.requests.push({host: host, port: port, request: req}) - return - } - - // If we are under maxSockets create a new one. - self.createSocket({host: options.host, port: options.port, request: req}, function(socket) { - socket.on('free', onFree) - socket.on('close', onCloseOrRemove) - socket.on('agentRemove', onCloseOrRemove) - req.onSocket(socket) - - function onFree() { - self.emit('free', socket, options.host, options.port) - } - - function onCloseOrRemove(err) { - self.removeSocket() - socket.removeListener('free', onFree) - socket.removeListener('close', onCloseOrRemove) - socket.removeListener('agentRemove', onCloseOrRemove) - } - }) -} - -TunnelingAgent.prototype.createSocket = function createSocket(options, cb) { - var self = this - var placeholder = {} - self.sockets.push(placeholder) - - var connectOptions = mergeOptions({}, self.proxyOptions, - { method: 'CONNECT' - , path: options.host + ':' + options.port - , agent: false - } - ) - if (connectOptions.proxyAuth) { - connectOptions.headers = connectOptions.headers || {} - connectOptions.headers['Proxy-Authorization'] = 'Basic ' + - new Buffer(connectOptions.proxyAuth).toString('base64') - } - - debug('making CONNECT request') - var connectReq = self.request(connectOptions) - connectReq.useChunkedEncodingByDefault = false // for v0.6 - connectReq.once('response', onResponse) // for v0.6 - connectReq.once('upgrade', onUpgrade) // for v0.6 - connectReq.once('connect', onConnect) // for v0.7 or later - connectReq.once('error', onError) - connectReq.end() - - function onResponse(res) { - // Very hacky. This is necessary to avoid http-parser leaks. - res.upgrade = true - } - - function onUpgrade(res, socket, head) { - // Hacky. - process.nextTick(function() { - onConnect(res, socket, head) - }) - } - - function onConnect(res, socket, head) { - connectReq.removeAllListeners() - socket.removeAllListeners() - - if (res.statusCode === 200) { - assert.equal(head.length, 0) - debug('tunneling connection has established') - self.sockets[self.sockets.indexOf(placeholder)] = socket - cb(socket) - } else { - debug('tunneling socket could not be established, statusCode=%d', res.statusCode) - var error = new Error('tunneling socket could not be established, ' + 'statusCode=' + res.statusCode) - error.code = 'ECONNRESET' - options.request.emit('error', error) - self.removeSocket(placeholder) - } - } - - function onError(cause) { - connectReq.removeAllListeners() - - debug('tunneling socket could not be established, cause=%s\n', cause.message, cause.stack) - var error = new Error('tunneling socket could not be established, ' + 'cause=' + cause.message) - error.code = 'ECONNRESET' - options.request.emit('error', error) - self.removeSocket(placeholder) - } -} - -TunnelingAgent.prototype.removeSocket = function removeSocket(socket) { - var pos = this.sockets.indexOf(socket) - if (pos === -1) return - - this.sockets.splice(pos, 1) - - var pending = this.requests.shift() - if (pending) { - // If we have pending requests and a socket gets closed a new one - // needs to be created to take over in the pool for the one that closed. - this.createSocket(pending, function(socket) { - pending.request.onSocket(socket) - }) - } -} - -function createSecureSocket(options, cb) { - var self = this - TunnelingAgent.prototype.createSocket.call(self, options, function(socket) { - // 0 is dummy port for v0.6 - var secureSocket = tls.connect(0, mergeOptions({}, self.options, - { servername: options.host - , socket: socket - } - )) - cb(secureSocket) - }) -} - - -function mergeOptions(target) { - for (var i = 1, len = arguments.length; i < len; ++i) { - var overrides = arguments[i] - if (typeof overrides === 'object') { - var keys = Object.keys(overrides) - for (var j = 0, keyLen = keys.length; j < keyLen; ++j) { - var k = keys[j] - if (overrides[k] !== undefined) { - target[k] = overrides[k] - } - } - } - } - return target -} - - -var debug -if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { - debug = function() { - var args = Array.prototype.slice.call(arguments) - if (typeof args[0] === 'string') { - args[0] = 'TUNNEL: ' + args[0] - } else { - args.unshift('TUNNEL:') - } - console.error.apply(console, args) - } -} else { - debug = function() {} -} -exports.debug = debug // for test diff --git a/update_nation/node_modules/nano/node_modules/request/node_modules/tunnel-agent/package.json b/update_nation/node_modules/nano/node_modules/request/node_modules/tunnel-agent/package.json deleted file mode 100644 index 0b00d7e02..000000000 --- a/update_nation/node_modules/nano/node_modules/request/node_modules/tunnel-agent/package.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "author": { - "name": "Mikeal Rogers", - "email": "mikeal.rogers@gmail.com", - "url": "http://www.futurealoof.com" - }, - "name": "tunnel-agent", - "description": "HTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module.", - "version": "0.4.0", - "repository": { - "url": "https://github.com/mikeal/tunnel-agent" - }, - "main": "index.js", - "dependencies": {}, - "devDependencies": {}, - "optionalDependencies": {}, - "engines": { - "node": "*" - }, - "bugs": { - "url": "https://github.com/mikeal/tunnel-agent/issues" - }, - "homepage": "https://github.com/mikeal/tunnel-agent", - "_id": "tunnel-agent@0.4.0", - "dist": { - "shasum": "b1184e312ffbcf70b3b4c78e8c219de7ebb1c550", - "tarball": "http://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.0.tgz" - }, - "_from": "tunnel-agent@~0.4.0", - "_npmVersion": "1.3.21", - "_npmUser": { - "name": "mikeal", - "email": "mikeal.rogers@gmail.com" - }, - "maintainers": [ - { - "name": "mikeal", - "email": "mikeal.rogers@gmail.com" - } - ], - "directories": {}, - "_shasum": "b1184e312ffbcf70b3b4c78e8c219de7ebb1c550", - "_resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.0.tgz", - "readme": "ERROR: No README data found!", - "scripts": {} -} diff --git a/update_nation/node_modules/nano/node_modules/request/package.json b/update_nation/node_modules/nano/node_modules/request/package.json deleted file mode 100644 index a2729ecef..000000000 --- a/update_nation/node_modules/nano/node_modules/request/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "request", - "description": "Simplified HTTP request client.", - "tags": [ - "http", - "simple", - "util", - "utility" - ], - "version": "2.46.0", - "author": { - "name": "Mikeal Rogers", - "email": "mikeal.rogers@gmail.com" - }, - "repository": { - "type": "git", - "url": "https://github.com/mikeal/request.git" - }, - "bugs": { - "url": "http://github.com/mikeal/request/issues" - }, - "license": "Apache-2.0", - "engines": { - "node": ">=0.8.0" - }, - "main": "index.js", - "dependencies": { - "bl": "~0.9.0", - "caseless": "~0.6.0", - "forever-agent": "~0.5.0", - "form-data": "~0.1.0", - "json-stringify-safe": "~5.0.0", - "mime-types": "~1.0.1", - "node-uuid": "~1.4.0", - "qs": "~1.2.0", - "tunnel-agent": "~0.4.0", - "tough-cookie": ">=0.12.0", - "http-signature": "~0.10.0", - "oauth-sign": "~0.4.0", - "hawk": "1.1.1", - "aws-sign2": "~0.5.0", - "stringstream": "~0.0.4" - }, - "scripts": { - "test": "npm run lint && node node_modules/.bin/taper tests/test-*.js", - "lint": "node node_modules/.bin/eslint lib/ *.js tests/ && echo Lint passed." - }, - "devDependencies": { - "eslint": "0.5.1", - "rimraf": "~2.2.8", - "tape": "~3.0.0", - "taper": "~0.3.0" - }, - "readme": "# Request — Simplified HTTP client\n[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/mikeal/request?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n\n[![NPM](https://nodei.co/npm/request.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/request/)\n\n## Super simple to use\n\nRequest is designed to be the simplest way possible to make http calls. It supports HTTPS and follows redirects by default.\n\n```javascript\nvar request = require('request');\nrequest('http://www.google.com', function (error, response, body) {\n if (!error && response.statusCode == 200) {\n console.log(body) // Print the google web page.\n }\n})\n```\n\n## Streaming\n\nYou can stream any response to a file stream.\n\n```javascript\nrequest('http://google.com/doodle.png').pipe(fs.createWriteStream('doodle.png'))\n```\n\nYou can also stream a file to a PUT or POST request. This method will also check the file extension against a mapping of file extensions to content-types (in this case `application/json`) and use the proper `content-type` in the PUT request (if the headers don’t already provide one).\n\n```javascript\nfs.createReadStream('file.json').pipe(request.put('http://mysite.com/obj.json'))\n```\n\nRequest can also `pipe` to itself. When doing so, `content-type` and `content-length` are preserved in the PUT headers.\n\n```javascript\nrequest.get('http://google.com/img.png').pipe(request.put('http://mysite.com/img.png'))\n```\n\nRequest emits a \"response\" event when a response is received. The `response` argument will be an instance of [http.IncomingMessage](http://nodejs.org/api/http.html#http_http_incomingmessage).\n\n```javascript\nrequest\n .get('http://google.com/img.png')\n .on('response', function(response) {\n console.log(response.statusCode) // 200\n console.log(response.headers['content-type']) // 'image/png'\n })\n .pipe(request.put('http://mysite.com/img.png'))\n```\n\nNow let’s get fancy.\n\n```javascript\nhttp.createServer(function (req, resp) {\n if (req.url === '/doodle.png') {\n if (req.method === 'PUT') {\n req.pipe(request.put('http://mysite.com/doodle.png'))\n } else if (req.method === 'GET' || req.method === 'HEAD') {\n request.get('http://mysite.com/doodle.png').pipe(resp)\n }\n }\n})\n```\n\nYou can also `pipe()` from `http.ServerRequest` instances, as well as to `http.ServerResponse` instances. The HTTP method, headers, and entity-body data will be sent. Which means that, if you don't really care about security, you can do:\n\n```javascript\nhttp.createServer(function (req, resp) {\n if (req.url === '/doodle.png') {\n var x = request('http://mysite.com/doodle.png')\n req.pipe(x)\n x.pipe(resp)\n }\n})\n```\n\nAnd since `pipe()` returns the destination stream in ≥ Node 0.5.x you can do one line proxying. :)\n\n```javascript\nreq.pipe(request('http://mysite.com/doodle.png')).pipe(resp)\n```\n\nAlso, none of this new functionality conflicts with requests previous features, it just expands them.\n\n```javascript\nvar r = request.defaults({'proxy':'http://localproxy.com'})\n\nhttp.createServer(function (req, resp) {\n if (req.url === '/doodle.png') {\n r.get('http://google.com/doodle.png').pipe(resp)\n }\n})\n```\n\nYou can still use intermediate proxies, the requests will still follow HTTP forwards, etc.\n\n## Proxies\n\nIf you specify a `proxy` option, then the request (and any subsequent\nredirects) will be sent via a connection to the proxy server.\n\nIf your endpoint is an `https` url, and you are using a proxy, then\nrequest will send a `CONNECT` request to the proxy server *first*, and\nthen use the supplied connection to connect to the endpoint.\n\nThat is, first it will make a request like:\n\n```\nHTTP/1.1 CONNECT endpoint-server.com:80\nHost: proxy-server.com\nUser-Agent: whatever user agent you specify\n```\n\nand then the proxy server make a TCP connection to `endpoint-server`\non port `80`, and return a response that looks like:\n\n```\nHTTP/1.1 200 OK\n```\n\nAt this point, the connection is left open, and the client is\ncommunicating directly with the `endpoint-server.com` machine.\n\nSee [the wikipedia page on HTTP Tunneling](http://en.wikipedia.org/wiki/HTTP_tunnel)\nfor more information.\n\nBy default, when proxying `http` traffic, request will simply make a\nstandard proxied `http` request. This is done by making the `url`\nsection of the initial line of the request a fully qualified url to\nthe endpoint.\n\nFor example, it will make a single request that looks like:\n\n```\nHTTP/1.1 GET http://endpoint-server.com/some-url\nHost: proxy-server.com\nOther-Headers: all go here\n\nrequest body or whatever\n```\n\nBecause a pure \"http over http\" tunnel offers no additional security\nor other features, it is generally simpler to go with a\nstraightforward HTTP proxy in this case. However, if you would like\nto force a tunneling proxy, you may set the `tunnel` option to `true`.\n\nIf you are using a tunneling proxy, you may set the\n`proxyHeaderWhiteList` to share certain headers with the proxy.\n\nBy default, this set is:\n\n```\naccept\naccept-charset\naccept-encoding\naccept-language\naccept-ranges\ncache-control\ncontent-encoding\ncontent-language\ncontent-length\ncontent-location\ncontent-md5\ncontent-range\ncontent-type\nconnection\ndate\nexpect\nmax-forwards\npragma\nproxy-authorization\nreferer\nte\ntransfer-encoding\nuser-agent\nvia\n```\n\nNote that, when using a tunneling proxy, the `proxy-authorization`\nheader is *never* sent to the endpoint server, but only to the proxy\nserver. All other headers are sent as-is over the established\nconnection.\n\n### Controlling proxy behaviour using environment variables\n\nThe following environment variables are respected by `request`:\n\n * `HTTP_PROXY` / `http_proxy`\n * `HTTPS_PROXY` / `https_proxy`\n * `NO_PROXY` / `no_proxy`\n\nWhen `HTTP_PROXY` / `http_proxy` are set, they will be used to proxy non-SSL requests that do not have an explicit `proxy` configuration option present. Similarly, `HTTPS_PROXY` / `https_proxy` will be respected for SSL requests that do not have an explicit `proxy` configuration option. It is valid to define a proxy in one of the environment variables, but then override it for a specific request, using the `proxy` configuration option. Furthermore, the `proxy` configuration option can be explicitly set to false / null to opt out of proxying altogether for that request.\n\n`request` is also aware of the `NO_PROXY`/`no_proxy` environment variables. These variables provide a granular way to opt out of proxying, on a per-host basis. It should contain a comma separated list of hosts to opt out of proxying. It is also possible to opt of proxying when a particular destination port is used. Finally, the variable may be set to `*` to opt out of the implicit proxy configuration of the other environment variables.\n\nHere's some examples of valid `no_proxy` values:\n\n * `google.com` - don't proxy HTTP/HTTPS requests to Google.\n * `google.com:443` - don't proxy HTTPS requests to Google, but *do* proxy HTTP requests to Google.\n * `google.com:443, yahoo.com:80` - don't proxy HTTPS requests to Google, and don't proxy HTTP requests to Yahoo!\n * `*` - ignore `https_proxy`/`http_proxy` environment variables altogether.\n\n## UNIX Socket\n\n`request` supports making requests to [UNIX Domain Sockets](http://en.wikipedia.org/wiki/Unix_domain_socket). To make one, use the following URL scheme:\n\n```javascript\n/* Pattern */ 'http://unix:SOCKET:PATH'\n/* Example */ request.get('http://unix:/absolute/path/to/unix.socket:/request/path')\n```\n\nNote: The `SOCKET` path is assumed to be absolute to the root of the host file system.\n\n\n## Forms\n\n`request` supports `application/x-www-form-urlencoded` and `multipart/form-data` form uploads. For `multipart/related` refer to the `multipart` API.\n\n#### application/x-www-form-urlencoded (URL-Encoded Forms)\n\nURL-encoded forms are simple.\n\n```javascript\nrequest.post('http://service.com/upload', {form:{key:'value'}})\n// or\nrequest.post('http://service.com/upload').form({key:'value'})\n// or\nrequest.post({url:'http://service.com/upload', form: {key:'value'}}, function(err,httpResponse,body){ /* ... */ })\n```\n\n#### multipart/form-data (Multipart Form Uploads)\n\nFor `multipart/form-data` we use the [form-data](https://github.com/felixge/node-form-data) library by [@felixge](https://github.com/felixge). For the most cases, you can pass your upload form data via the `formData` option.\n\n\n```javascript\nvar formData = {\n // Pass a simple key-value pair\n my_field: 'my_value',\n // Pass data via Buffers\n my_buffer: new Buffer([1, 2, 3]),\n // Pass data via Streams\n my_file: fs.createReadStream(__dirname + '/unicycle.jpg'),\n // Pass multiple values /w an Array\n attachments: [\n fs.createReadStream(__dirname + '/attacment1.jpg')\n fs.createReadStream(__dirname + '/attachment2.jpg')\n ],\n // Pass optional meta-data with an 'options' object with style: {value: DATA, options: OPTIONS}\n // See the `form-data` README for more information about options: https://github.com/felixge/node-form-data\n custom_file: {\n value: fs.createReadStream('/dev/urandom'),\n options: {\n filename: 'topsecret.jpg',\n contentType: 'image/jpg'\n }\n }\n};\nrequest.post({url:'http://service.com/upload', formData: formData}, function optionalCallback(err, httpResponse, body) {\n if (err) {\n return console.error('upload failed:', err);\n }\n console.log('Upload successful! Server responded with:', body);\n});\n```\n\nFor advanced cases, you can the form-data object itself via `r.form()`. This can be modified until the request is fired on the next cycle of the event-loop. (Note that this calling `form()` will clear the currently set form data for that request.)\n\n```javascript\n// NOTE: Advanced use-case, for normal use see 'formData' usage above\nvar r = request.post('http://service.com/upload', function optionalCallback(err, httpResponse, body) { // ...\n\nvar form = r.form();\nform.append('my_field', 'my_value');\nform.append('my_buffer', new Buffer([1, 2, 3]));\nform.append('custom_file', fs.createReadStream(__dirname + '/unicycle.jpg'), {filename: 'unicycle.jpg'});\n```\nSee the [form-data README](https://github.com/felixge/node-form-data) for more information & examples.\n\n#### multipart/related\n\nSome variations in different HTTP implementations require a newline/CRLF before, after, or both before and after the boundary of a `multipart/related` request (using the multipart option). This has been observed in the .NET WebAPI version 4.0. You can turn on a boundary preambleCRLF or postamble by passing them as `true` to your request options.\n\n```javascript\n request(\n { method: 'PUT'\n , preambleCRLF: true\n , postambleCRLF: true\n , uri: 'http://service.com/upload'\n , multipart:\n [ { 'content-type': 'application/json'\n , body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}})\n }\n , { body: 'I am an attachment' }\n ]\n }\n , function (error, response, body) {\n if (err) {\n return console.error('upload failed:', err);\n }\n console.log('Upload successful! Server responded with:', body);\n }\n )\n```\n\n\n## HTTP Authentication\n\n```javascript\nrequest.get('http://some.server.com/').auth('username', 'password', false);\n// or\nrequest.get('http://some.server.com/', {\n 'auth': {\n 'user': 'username',\n 'pass': 'password',\n 'sendImmediately': false\n }\n});\n// or\nrequest.get('http://some.server.com/').auth(null, null, true, 'bearerToken');\n// or\nrequest.get('http://some.server.com/', {\n 'auth': {\n 'bearer': 'bearerToken'\n }\n});\n```\n\nIf passed as an option, `auth` should be a hash containing values `user` || `username`, `pass` || `password`, and `sendImmediately` (optional). The method form takes parameters `auth(username, password, sendImmediately)`.\n\n`sendImmediately` defaults to `true`, which causes a basic authentication header to be sent. If `sendImmediately` is `false`, then `request` will retry with a proper authentication header after receiving a `401` response from the server (which must contain a `WWW-Authenticate` header indicating the required authentication method).\n\nNote that you can also use for basic authentication a trick using the URL itself, as specified in [RFC 1738](http://www.ietf.org/rfc/rfc1738.txt).\nSimply pass the `user:password` before the host with an `@` sign.\n\n```javascript\nvar username = 'username',\n password = 'password',\n url = 'http://' + username + ':' + password + '@some.server.com';\n\nrequest({url: url}, function (error, response, body) {\n // Do more stuff with 'body' here\n});\n```\n\nDigest authentication is supported, but it only works with `sendImmediately` set to `false`; otherwise `request` will send basic authentication on the initial request, which will probably cause the request to fail.\n\nBearer authentication is supported, and is activated when the `bearer` value is available. The value may be either a `String` or a `Function` returning a `String`. Using a function to supply the bearer token is particularly useful if used in conjuction with `defaults` to allow a single function to supply the last known token at the time or sending a request or to compute one on the fly.\n\n## OAuth Signing\n\n```javascript\n// Twitter OAuth\nvar qs = require('querystring')\n , oauth =\n { callback: 'http://mysite.com/callback/'\n , consumer_key: CONSUMER_KEY\n , consumer_secret: CONSUMER_SECRET\n }\n , url = 'https://api.twitter.com/oauth/request_token'\n ;\nrequest.post({url:url, oauth:oauth}, function (e, r, body) {\n // Ideally, you would take the body in the response\n // and construct a URL that a user clicks on (like a sign in button).\n // The verifier is only available in the response after a user has\n // verified with twitter that they are authorizing your app.\n var access_token = qs.parse(body)\n , oauth =\n { consumer_key: CONSUMER_KEY\n , consumer_secret: CONSUMER_SECRET\n , token: access_token.oauth_token\n , verifier: access_token.oauth_verifier\n }\n , url = 'https://api.twitter.com/oauth/access_token'\n ;\n request.post({url:url, oauth:oauth}, function (e, r, body) {\n var perm_token = qs.parse(body)\n , oauth =\n { consumer_key: CONSUMER_KEY\n , consumer_secret: CONSUMER_SECRET\n , token: perm_token.oauth_token\n , token_secret: perm_token.oauth_token_secret\n }\n , url = 'https://api.twitter.com/1.1/users/show.json?'\n , params =\n { screen_name: perm_token.screen_name\n , user_id: perm_token.user_id\n }\n ;\n url += qs.stringify(params)\n request.get({url:url, oauth:oauth, json:true}, function (e, r, user) {\n console.log(user)\n })\n })\n})\n```\n\n## Custom HTTP Headers\n\nHTTP Headers, such as `User-Agent`, can be set in the `options` object.\nIn the example below, we call the github API to find out the number\nof stars and forks for the request repository. This requires a\ncustom `User-Agent` header as well as https.\n\n```javascript\nvar request = require('request');\n\nvar options = {\n\turl: 'https://api.github.com/repos/mikeal/request',\n\theaders: {\n\t\t'User-Agent': 'request'\n\t}\n};\n\nfunction callback(error, response, body) {\n\tif (!error && response.statusCode == 200) {\n\t\tvar info = JSON.parse(body);\n\t\tconsole.log(info.stargazers_count + \" Stars\");\n\t\tconsole.log(info.forks_count + \" Forks\");\n\t}\n}\n\nrequest(options, callback);\n```\n\n## TLS/SSL Protocol\n\nTLS/SSL Protocol options, such as `cert`, `key` and `passphrase`, can be\nset in the `agentOptions` property of the `options` object.\nIn the example below, we call an API requires client side SSL certificate\n(in PEM format) with passphrase protected private key (in PEM format) and disable the SSLv3 protocol:\n\n```javascript\nvar fs = require('fs')\n , path = require('path')\n , certFile = path.resolve(__dirname, 'ssl/client.crt')\n , keyFile = path.resolve(__dirname, 'ssl/client.key')\n , request = require('request');\n\nvar options = {\n url: 'https://api.some-server.com/',\n agentOptions: {\n 'cert': fs.readFileSync(certFile),\n 'key': fs.readFileSync(keyFile),\n // Or use `pfx` property replacing `cert` and `key` when using private key, certificate and CA certs in PFX or PKCS12 format:\n // 'pfx': fs.readFileSync(pfxFilePath),\n 'passphrase': 'password',\n 'securityOptions': 'SSL_OP_NO_SSLv3'\n }\n};\n\nrequest.get(options);\n```\n\nIt is able to force using SSLv3 only by specifying `secureProtocol`:\n\n```javascript\n\nrequest.get({\n url: 'https://api.some-server.com/',\n agentOptions: {\n 'secureProtocol': 'SSLv3_method'\n }\n});\n```\n\n## request(options, callback)\n\nThe first argument can be either a `url` or an `options` object. The only required option is `uri`; all others are optional.\n\n* `uri` || `url` - fully qualified uri or a parsed url object from `url.parse()`\n* `qs` - object containing querystring values to be appended to the `uri`\n* `useQuerystring` - If true, use `querystring` to stringify and parse\n querystrings, otherwise use `qs` (default: `false`). Set this option to\n `true` if you need arrays to be serialized as `foo=bar&foo=baz` instead of the\n default `foo[0]=bar&foo[1]=baz`.\n* `method` - http method (default: `\"GET\"`)\n* `headers` - http headers (default: `{}`)\n* `body` - entity body for PATCH, POST and PUT requests. Must be a `Buffer` or `String`, unless `json` is `true`. If `json` is `true`, then `body` must be a JSON-serializable object.\n* `form` - when passed an object or a querystring, this sets `body` to a querystring representation of value, and adds `Content-type: application/x-www-form-urlencoded` header. When passed no options, a `FormData` instance is returned (and is piped to request). See \"Forms\" section above.\n* `formData` - Data to pass for a `multipart/form-data` request. See \"Forms\" section above.\n* `multipart` - (experimental) Data to pass for a `multipart/related` request. See \"Forms\" section above\n* `auth` - A hash containing values `user` || `username`, `pass` || `password`, and `sendImmediately` (optional). See documentation above.\n* `json` - sets `body` but to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as JSON.\n* `multipart` - (experimental) array of objects which contains their own headers and `body` attribute. Sends `multipart/related` request. See example below.\n* `preambleCRLF` - append a newline/CRLF before the boundary of your `multipart/form-data` request.\n* `postambleCRLF` - append a newline/CRLF at the end of the boundary of your `multipart/form-data` request.\n* `followRedirect` - follow HTTP 3xx responses as redirects (default: `true`). This property can also be implemented as function which gets `response` object as a single argument and should return `true` if redirects should continue or `false` otherwise.\n* `followAllRedirects` - follow non-GET HTTP 3xx responses as redirects (default: `false`)\n* `maxRedirects` - the maximum number of redirects to follow (default: `10`)\n* `encoding` - Encoding to be used on `setEncoding` of response data. If `null`, the `body` is returned as a `Buffer`. Anything else **(including the default value of `undefined`)** will be passed as the [encoding](http://nodejs.org/api/buffer.html#buffer_buffer) parameter to `toString()` (meaning this is effectively `utf8` by default).\n* `pool` - An object describing which agents to use for the request. If this option is omitted the request will use the global agent (as long as [your options allow for it](request.js#L747)). Otherwise, request will search the pool for your custom agent. If no custom agent is found, a new agent will be created and added to the pool.\n * A `maxSockets` property can also be provided on the `pool` object to set the max number of sockets for all agents created (ex: `pool: {maxSockets: Infinity}`).\n* `timeout` - Integer containing the number of milliseconds to wait for a request to respond before aborting the request\n* `proxy` - An HTTP proxy to be used. Supports proxy Auth with Basic Auth, identical to support for the `url` parameter (by embedding the auth info in the `uri`)\n* `oauth` - Options for OAuth HMAC-SHA1 signing. See documentation above.\n* `hawk` - Options for [Hawk signing](https://github.com/hueniverse/hawk). The `credentials` key must contain the necessary signing info, [see hawk docs for details](https://github.com/hueniverse/hawk#usage-example).\n* `strictSSL` - If `true`, requires SSL certificates be valid. **Note:** to use your own certificate authority, you need to specify an agent that was created with that CA as an option.\n* `agentOptions` - Object containing user agent options. See documentation above. **Note:** [see tls API doc for TLS/SSL options](http://nodejs.org/api/tls.html#tls_tls_connect_options_callback).\n\n* `jar` - If `true` and `tough-cookie` is installed, remember cookies for future use (or define your custom cookie jar; see examples section)\n* `aws` - `object` containing AWS signing information. Should have the properties `key`, `secret`. Also requires the property `bucket`, unless you’re specifying your `bucket` as part of the path, or the request doesn’t use a bucket (i.e. GET Services)\n* `httpSignature` - Options for the [HTTP Signature Scheme](https://github.com/joyent/node-http-signature/blob/master/http_signing.md) using [Joyent's library](https://github.com/joyent/node-http-signature). The `keyId` and `key` properties must be specified. See the docs for other options.\n* `localAddress` - Local interface to bind for network connections.\n* `gzip` - If `true`, add an `Accept-Encoding` header to request compressed content encodings from the server (if not already present) and decode supported content encodings in the response. **Note:** Automatic decoding of the response content is performed on the body data returned through `request` (both through the `request` stream and passed to the callback function) but is not performed on the `response` stream (available from the `response` event) which is the unmodified `http.IncomingMessage` object which may contain compressed data. See example below.\n* `tunnel` - If `true`, then *always* use a tunneling proxy. If\n `false` (default), then tunneling will only be used if the\n destination is `https`, or if a previous request in the redirect\n chain used a tunneling proxy.\n* `proxyHeaderWhiteList` - A whitelist of headers to send to a\n tunneling proxy.\n\n\nThe callback argument gets 3 arguments:\n\n1. An `error` when applicable (usually from [`http.ClientRequest`](http://nodejs.org/api/http.html#http_class_http_clientrequest) object)\n2. An [`http.IncomingMessage`](http://nodejs.org/api/http.html#http_http_incomingmessage) object\n3. The third is the `response` body (`String` or `Buffer`, or JSON object if the `json` option is supplied)\n\n## Convenience methods\n\nThere are also shorthand methods for different HTTP METHODs and some other conveniences.\n\n### request.defaults(options)\n\nThis method returns a wrapper around the normal request API that defaults to whatever options you pass in to it.\n\n**Note:** You can call `.defaults()` on the wrapper that is returned from `request.defaults` to add/override defaults that were previously defaulted.\n\nFor example:\n```javascript\n//requests using baseRequest() will set the 'x-token' header\nvar baseRequest = request.defaults({\n headers: {x-token: 'my-token'}\n})\n\n//requests using specialRequest() will include the 'x-token' header set in\n//baseRequest and will also include the 'special' header\nvar specialRequest = baseRequest.defaults({\n headers: {special: 'special value'}\n})\n```\n\n### request.put\n\nSame as `request()`, but defaults to `method: \"PUT\"`.\n\n```javascript\nrequest.put(url)\n```\n\n### request.patch\n\nSame as `request()`, but defaults to `method: \"PATCH\"`.\n\n```javascript\nrequest.patch(url)\n```\n\n### request.post\n\nSame as `request()`, but defaults to `method: \"POST\"`.\n\n```javascript\nrequest.post(url)\n```\n\n### request.head\n\nSame as request() but defaults to `method: \"HEAD\"`.\n\n```javascript\nrequest.head(url)\n```\n\n### request.del\n\nSame as `request()`, but defaults to `method: \"DELETE\"`.\n\n```javascript\nrequest.del(url)\n```\n\n### request.get\n\nSame as `request()` (for uniformity).\n\n```javascript\nrequest.get(url)\n```\n### request.cookie\n\nFunction that creates a new cookie.\n\n```javascript\nrequest.cookie('key1=value1')\n```\n### request.jar\n\nFunction that creates a new cookie jar.\n\n```javascript\nrequest.jar()\n```\n\n\n## Examples:\n\n```javascript\n var request = require('request')\n , rand = Math.floor(Math.random()*100000000).toString()\n ;\n request(\n { method: 'PUT'\n , uri: 'http://mikeal.iriscouch.com/testjs/' + rand\n , multipart:\n [ { 'content-type': 'application/json'\n , body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}})\n }\n , { body: 'I am an attachment' }\n ]\n }\n , function (error, response, body) {\n if(response.statusCode == 201){\n console.log('document saved as: http://mikeal.iriscouch.com/testjs/'+ rand)\n } else {\n console.log('error: '+ response.statusCode)\n console.log(body)\n }\n }\n )\n```\n\nFor backwards-compatibility, response compression is not supported by default.\nTo accept gzip-compressed responses, set the `gzip` option to `true`. Note\nthat the body data passed through `request` is automatically decompressed\nwhile the response object is unmodified and will contain compressed data if\nthe server sent a compressed response.\n\n```javascript\n var request = require('request')\n request(\n { method: 'GET'\n , uri: 'http://www.google.com'\n , gzip: true\n }\n , function (error, response, body) {\n // body is the decompressed response body\n console.log('server encoded the data as: ' + (response.headers['content-encoding'] || 'identity'))\n console.log('the decoded data is: ' + body)\n }\n ).on('data', function(data) {\n // decompressed data as it is received\n console.log('decoded chunk: ' + data)\n })\n .on('response', function(response) {\n // unmodified http.IncomingMessage object\n response.on('data', function(data) {\n // compressed data as it is received\n console.log('received ' + data.length + ' bytes of compressed data')\n })\n })\n```\n\nCookies are disabled by default (else, they would be used in subsequent requests). To enable cookies, set `jar` to `true` (either in `defaults` or `options`) and install `tough-cookie`.\n\n```javascript\nvar request = request.defaults({jar: true})\nrequest('http://www.google.com', function () {\n request('http://images.google.com')\n})\n```\n\nTo use a custom cookie jar (instead of `request`’s global cookie jar), set `jar` to an instance of `request.jar()` (either in `defaults` or `options`)\n\n```javascript\nvar j = request.jar()\nvar request = request.defaults({jar:j})\nrequest('http://www.google.com', function () {\n request('http://images.google.com')\n})\n```\n\nOR\n\n```javascript\n// `npm install --save tough-cookie` before this works\nvar j = request.jar();\nvar cookie = request.cookie('key1=value1');\nvar url = 'http://www.google.com';\nj.setCookie(cookie, url);\nrequest({url: url, jar: j}, function () {\n request('http://images.google.com')\n})\n```\n\nTo inspect your cookie jar after a request\n\n```javascript\nvar j = request.jar()\nrequest({url: 'http://www.google.com', jar: j}, function () {\n var cookie_string = j.getCookieString(uri); // \"key1=value1; key2=value2; ...\"\n var cookies = j.getCookies(uri);\n // [{key: 'key1', value: 'value1', domain: \"www.google.com\", ...}, ...]\n})\n```\n\n## Debugging\n\nThere are at least three ways to debug the operation of `request`:\n\n1. Launch the node process like `NODE_DEBUG=request node script.js`\n (`lib,request,otherlib` works too).\n\n2. Set `require('request').debug = true` at any time (this does the same thing\n as #1).\n\n3. Use the [request-debug module](https://github.com/nylen/request-debug) to\n view request and response headers and bodies.\n", - "readmeFilename": "README.md", - "homepage": "https://github.com/mikeal/request", - "_id": "request@2.46.0", - "dist": { - "shasum": "fdb35c80945da87eb7615f0385ba22dae67461e8" - }, - "_from": "request@2.46.0", - "_resolved": "https://registry.npmjs.org/request/-/request-2.46.0.tgz" -} diff --git a/update_nation/node_modules/nano/node_modules/request/release.sh b/update_nation/node_modules/nano/node_modules/request/release.sh deleted file mode 100644 index 05e7767fc..000000000 --- a/update_nation/node_modules/nano/node_modules/request/release.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -npm version minor && npm publish && npm version patch && git push --tags && git push origin master diff --git a/update_nation/node_modules/nano/node_modules/request/request.js b/update_nation/node_modules/nano/node_modules/request/request.js deleted file mode 100644 index 466d91655..000000000 --- a/update_nation/node_modules/nano/node_modules/request/request.js +++ /dev/null @@ -1,1742 +0,0 @@ -'use strict' - -var http = require('http') - , https = require('https') - , url = require('url') - , util = require('util') - , stream = require('stream') - , qs = require('qs') - , querystring = require('querystring') - , zlib = require('zlib') - , helpers = require('./lib/helpers') - , bl = require('bl') - , oauth = require('oauth-sign') - , hawk = require('hawk') - , aws = require('aws-sign2') - , httpSignature = require('http-signature') - , uuid = require('node-uuid') - , mime = require('mime-types') - , tunnel = require('tunnel-agent') - , stringstream = require('stringstream') - , caseless = require('caseless') - , ForeverAgent = require('forever-agent') - , FormData = require('form-data') - , cookies = require('./lib/cookies') - , copy = require('./lib/copy') - , debug = require('./lib/debug') - , net = require('net') - -var safeStringify = helpers.safeStringify - , md5 = helpers.md5 - , isReadStream = helpers.isReadStream - , toBase64 = helpers.toBase64 - , defer = helpers.defer - , globalCookieJar = cookies.jar() - - -var globalPool = {} - , isUrl = /^https?:/ - -var defaultProxyHeaderWhiteList = [ - 'accept', - 'accept-charset', - 'accept-encoding', - 'accept-language', - 'accept-ranges', - 'cache-control', - 'content-encoding', - 'content-language', - 'content-length', - 'content-location', - 'content-md5', - 'content-range', - 'content-type', - 'connection', - 'date', - 'expect', - 'max-forwards', - 'pragma', - 'proxy-authorization', - 'referer', - 'te', - 'transfer-encoding', - 'user-agent', - 'via' -] - -function filterForNonReserved(reserved, options) { - // Filter out properties that are not reserved. - // Reserved values are passed in at call site. - - var object = {} - for (var i in options) { - var notReserved = (reserved.indexOf(i) === -1) - if (notReserved) { - object[i] = options[i] - } - } - return object -} - -function filterOutReservedFunctions(reserved, options) { - // Filter out properties that are functions and are reserved. - // Reserved values are passed in at call site. - - var object = {} - for (var i in options) { - var isReserved = !(reserved.indexOf(i) === -1) - var isFunction = (typeof options[i] === 'function') - if (!(isReserved && isFunction)) { - object[i] = options[i] - } - } - return object - -} - -function constructProxyHost(uriObject) { - var port = uriObject.portA - , protocol = uriObject.protocol - , proxyHost = uriObject.hostname + ':' - - if (port) { - proxyHost += port - } else if (protocol === 'https:') { - proxyHost += '443' - } else { - proxyHost += '80' - } - - return proxyHost -} - -function constructProxyHeaderWhiteList(headers, proxyHeaderWhiteList) { - return Object.keys(headers) - .filter(function (header) { - return proxyHeaderWhiteList.indexOf(header.toLowerCase()) !== -1 - }) - .reduce(function (set, header) { - set[header] = headers[header] - return set - }, {}) -} - -function construcTunnelOptions(request) { - var proxy = request.proxy - var proxyHeaders = request.proxyHeaders - var proxyAuth - - if (proxy.auth) { - proxyAuth = proxy.auth - } - - if (!proxy.auth && request.proxyAuthorization) { - proxyHeaders['Proxy-Authorization'] = request.proxyAuthorization - } - - var tunnelOptions = { - proxy: { - host: proxy.hostname, - port: +proxy.port, - proxyAuth: proxyAuth, - headers: proxyHeaders - }, - rejectUnauthorized: request.rejectUnauthorized, - headers: request.headers, - ca: request.ca, - cert: request.cert, - key: request.key - } - - return tunnelOptions -} - -function constructTunnelFnName(uri, proxy) { - var uriProtocol = (uri.protocol === 'https:' ? 'https' : 'http') - var proxyProtocol = (proxy.protocol === 'https:' ? 'Https' : 'Http') - return [uriProtocol, proxyProtocol].join('Over') -} - -function getTunnelFn(request) { - var uri = request.uri - var proxy = request.proxy - var tunnelFnName = constructTunnelFnName(uri, proxy) - return tunnel[tunnelFnName] -} - -// Decide the proper request proxy to use based on the request URI object and the -// environmental variables (NO_PROXY, HTTP_PROXY, etc.) -function getProxyFromURI(uri) { - // respect NO_PROXY environment variables (see: http://lynx.isc.org/current/breakout/lynx_help/keystrokes/environments.html) - var noProxy = process.env.NO_PROXY || process.env.no_proxy || null - - // easy case first - if NO_PROXY is '*' - if (noProxy === '*') { - return null - } - - // otherwise, parse the noProxy value to see if it applies to the URL - if (noProxy !== null) { - var noProxyItem, hostname, port, noProxyItemParts, noProxyHost, noProxyPort, noProxyList - - // canonicalize the hostname, so that 'oogle.com' won't match 'google.com' - hostname = uri.hostname.replace(/^\.*/, '.').toLowerCase() - noProxyList = noProxy.split(',') - - for (var i = 0, len = noProxyList.length; i < len; i++) { - noProxyItem = noProxyList[i].trim().toLowerCase() - - // no_proxy can be granular at the port level, which complicates things a bit. - if (noProxyItem.indexOf(':') > -1) { - noProxyItemParts = noProxyItem.split(':', 2) - noProxyHost = noProxyItemParts[0].replace(/^\.*/, '.') - noProxyPort = noProxyItemParts[1] - port = uri.port || (uri.protocol === 'https:' ? '443' : '80') - - // we've found a match - ports are same and host ends with no_proxy entry. - if (port === noProxyPort && hostname.indexOf(noProxyHost) === hostname.length - noProxyHost.length) { - return null - } - } else { - noProxyItem = noProxyItem.replace(/^\.*/, '.') - if (hostname.indexOf(noProxyItem) === hostname.length - noProxyItem.length) { - return null - } - } - } - } - - // check for HTTP(S)_PROXY environment variables - if (uri.protocol === 'http:') { - return process.env.HTTP_PROXY || process.env.http_proxy || null - } else if (uri.protocol === 'https:') { - return process.env.HTTPS_PROXY || process.env.https_proxy || process.env.HTTP_PROXY || process.env.http_proxy || null - } - - // return null if all else fails (What uri protocol are you using then?) - return null -} - -// Function for properly handling a connection error -function connectionErrorHandler(error) { - var socket = this - if (socket.res) { - if (socket.res.request) { - socket.res.request.emit('error', error) - } else { - socket.res.emit('error', error) - } - } else { - socket._httpMessage.emit('error', error) - } -} - -// Return a simpler request object to allow serialization -function requestToJSON() { - var self = this - return { - uri: self.uri, - method: self.method, - headers: self.headers - } -} - -// Return a simpler response object to allow serialization -function responseToJSON() { - var self = this - return { - statusCode: self.statusCode, - body: self.body, - headers: self.headers, - request: requestToJSON.call(self.request) - } -} - -function Request (options) { - // if tunnel property of options was not given default to false - // if given the method property in options, set property explicitMethod to true - - // extend the Request instance with any non-reserved properties - // remove any reserved functions from the options object - // set Request instance to be readable and writable - // call init - - var self = this - stream.Stream.call(self) - var reserved = Object.keys(Request.prototype) - var nonReserved = filterForNonReserved(reserved, options) - - stream.Stream.call(self) - util._extend(self, nonReserved) - options = filterOutReservedFunctions(reserved, options) - - self.readable = true - self.writable = true - if (typeof options.tunnel === 'undefined') { - options.tunnel = false - } - if (options.method) { - self.explicitMethod = true - } - self.canTunnel = options.tunnel !== false && tunnel - self.init(options) -} - -util.inherits(Request, stream.Stream) - -Request.prototype.setupTunnel = function () { - // Set up the tunneling agent if necessary - // Only send the proxy whitelisted header names. - // Turn on tunneling for the rest of request. - - var self = this - - if (typeof self.proxy === 'string') { - self.proxy = url.parse(self.proxy) - } - - if (!self.proxy) { - return false - } - - if (!self.tunnel && self.uri.protocol !== 'https:') { - return false - } - - if (!self.proxyHeaderWhiteList) { - self.proxyHeaderWhiteList = defaultProxyHeaderWhiteList - } - - var proxyHost = constructProxyHost(self.uri) - self.proxyHeaders = constructProxyHeaderWhiteList(self.headers, self.proxyHeaderWhiteList) - self.proxyHeaders.host = proxyHost - - var tunnelFn = getTunnelFn(self) - var tunnelOptions = construcTunnelOptions(self) - - self.agent = tunnelFn(tunnelOptions) - self.tunnel = true - return true -} - -Request.prototype.init = function (options) { - // init() contains all the code to setup the request object. - // the actual outgoing request is not started until start() is called - // this function is called from both the constructor and on redirect. - var self = this - if (!options) { - options = {} - } - self.headers = self.headers ? copy(self.headers) : {} - - caseless.httpify(self, self.headers) - - // Never send proxy-auth to the endpoint! - if (self.hasHeader('proxy-authorization')) { - self.proxyAuthorization = self.getHeader('proxy-authorization') - self.removeHeader('proxy-authorization') - } - - if (!self.method) { - self.method = options.method || 'GET' - } - self.localAddress = options.localAddress - - if (!self.qsLib) { - self.qsLib = (options.useQuerystring ? querystring : qs) - } - - debug(options) - if (!self.pool && self.pool !== false) { - self.pool = globalPool - } - self.dests = self.dests || [] - self.__isRequestRequest = true - - // Protect against double callback - if (!self._callback && self.callback) { - self._callback = self.callback - self.callback = function () { - if (self._callbackCalled) { - return // Print a warning maybe? - } - self._callbackCalled = true - self._callback.apply(self, arguments) - } - self.on('error', self.callback.bind()) - self.on('complete', self.callback.bind(self, null)) - } - - // People use this property instead all the time, so support it - if (!self.uri && self.url) { - self.uri = self.url - delete self.url - } - - // A URI is needed by this point, throw if we haven't been able to get one - if (!self.uri) { - return self.emit('error', new Error('options.uri is a required argument')) - } - - // If a string URI/URL was given, parse it into a URL object - if(typeof self.uri === 'string') { - self.uri = url.parse(self.uri) - } - - // DEPRECATED: Warning for users of the old Unix Sockets URL Scheme - if (self.uri.protocol === 'unix:') { - return self.emit('error', new Error('`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`')) - } - - // Support Unix Sockets - if(self.uri.host === 'unix') { - // Get the socket & request paths from the URL - var unixParts = self.uri.path.split(':') - , host = unixParts[0] - , path = unixParts[1] - // Apply unix properties to request - self.socketPath = host - self.uri.pathname = path - self.uri.path = path - self.uri.host = host - self.uri.hostname = host - self.uri.isUnix = true - } - - if (self.strictSSL === false) { - self.rejectUnauthorized = false - } - - if(!self.hasOwnProperty('proxy')) { - self.proxy = getProxyFromURI(self.uri) - } - - // Pass in `tunnel:true` to *always* tunnel through proxies - self.tunnel = !!options.tunnel - if (self.proxy) { - self.setupTunnel() - } - - if (!self.uri.pathname) {self.uri.pathname = '/'} - - if (!(self.uri.host || (self.uri.hostname && self.uri.port)) && !self.uri.isUnix) { - // Invalid URI: it may generate lot of bad errors, like 'TypeError: Cannot call method `indexOf` of undefined' in CookieJar - // Detect and reject it as soon as possible - var faultyUri = url.format(self.uri) - var message = 'Invalid URI "' + faultyUri + '"' - if (Object.keys(options).length === 0) { - // No option ? This can be the sign of a redirect - // As this is a case where the user cannot do anything (they didn't call request directly with this URL) - // they should be warned that it can be caused by a redirection (can save some hair) - message += '. This can be caused by a crappy redirection.' - } - // This error was fatal - return self.emit('error', new Error(message)) - } - - self._redirectsFollowed = self._redirectsFollowed || 0 - self.maxRedirects = (self.maxRedirects !== undefined) ? self.maxRedirects : 10 - self.allowRedirect = (typeof self.followRedirect === 'function') ? self.followRedirect : function(response) { - return true - } - self.followRedirects = (self.followRedirect !== undefined) ? !!self.followRedirect : true - self.followAllRedirects = (self.followAllRedirects !== undefined) ? self.followAllRedirects : false - if (self.followRedirects || self.followAllRedirects) { - self.redirects = self.redirects || [] - } - - self.setHost = false - if (!self.hasHeader('host')) { - self.setHeader('host', self.uri.hostname) - if (self.uri.port) { - if ( !(self.uri.port === 80 && self.uri.protocol === 'http:') && - !(self.uri.port === 443 && self.uri.protocol === 'https:') ) { - self.setHeader('host', self.getHeader('host') + (':' + self.uri.port) ) - } - } - self.setHost = true - } - - self.jar(self._jar || options.jar) - - if (!self.uri.port) { - if (self.uri.protocol === 'http:') {self.uri.port = 80} - else if (self.uri.protocol === 'https:') {self.uri.port = 443} - } - - if (self.proxy && !self.tunnel) { - self.port = self.proxy.port - self.host = self.proxy.hostname - } else { - self.port = self.uri.port - self.host = self.uri.hostname - } - - if (options.form) { - self.form(options.form) - } - - if (options.formData) { - var formData = options.formData - var requestForm = self.form() - var appendFormValue = function (key, value) { - if (value.hasOwnProperty('value') && value.hasOwnProperty('options')) { - requestForm.append(key, value.value, value.options) - } else { - requestForm.append(key, value) - } - } - for (var formKey in formData) { - if (formData.hasOwnProperty(formKey)) { - var formValue = formData[formKey] - if (formValue instanceof Array) { - for (var j = 0; j < formValue.length; j++) { - appendFormValue(formKey, formValue[j]) - } - } else { - appendFormValue(formKey, formValue) - } - } - } - } - - if (options.qs) { - self.qs(options.qs) - } - - if (self.uri.path) { - self.path = self.uri.path - } else { - self.path = self.uri.pathname + (self.uri.search || '') - } - - if (self.path.length === 0) { - self.path = '/' - } - - // Auth must happen last in case signing is dependent on other headers - if (options.oauth) { - self.oauth(options.oauth) - } - - if (options.aws) { - self.aws(options.aws) - } - - if (options.hawk) { - self.hawk(options.hawk) - } - - if (options.httpSignature) { - self.httpSignature(options.httpSignature) - } - - if (options.auth) { - if (Object.prototype.hasOwnProperty.call(options.auth, 'username')) { - options.auth.user = options.auth.username - } - if (Object.prototype.hasOwnProperty.call(options.auth, 'password')) { - options.auth.pass = options.auth.password - } - - self.auth( - options.auth.user, - options.auth.pass, - options.auth.sendImmediately, - options.auth.bearer - ) - } - - if (self.gzip && !self.hasHeader('accept-encoding')) { - self.setHeader('accept-encoding', 'gzip') - } - - if (self.uri.auth && !self.hasHeader('authorization')) { - var uriAuthPieces = self.uri.auth.split(':').map(function(item){ return querystring.unescape(item) }) - self.auth(uriAuthPieces[0], uriAuthPieces.slice(1).join(':'), true) - } - - if (self.proxy && !self.tunnel) { - if (self.proxy.auth && !self.proxyAuthorization) { - var proxyAuthPieces = self.proxy.auth.split(':').map(function(item){ - return querystring.unescape(item) - }) - var authHeader = 'Basic ' + toBase64(proxyAuthPieces.join(':')) - self.proxyAuthorization = authHeader - } - if (self.proxyAuthorization) { - self.setHeader('proxy-authorization', self.proxyAuthorization) - } - } - - if (self.proxy && !self.tunnel) { - self.path = (self.uri.protocol + '//' + self.uri.host + self.path) - } - - if (options.json) { - self.json(options.json) - } else if (options.multipart) { - self.boundary = uuid() - self.multipart(options.multipart) - } - - if (self.body) { - var length = 0 - if (!Buffer.isBuffer(self.body)) { - if (Array.isArray(self.body)) { - for (var i = 0; i < self.body.length; i++) { - length += self.body[i].length - } - } else { - self.body = new Buffer(self.body) - length = self.body.length - } - } else { - length = self.body.length - } - if (length) { - if (!self.hasHeader('content-length')) { - self.setHeader('content-length', length) - } - } else { - throw new Error('Argument error, options.body.') - } - } - - var protocol = self.proxy && !self.tunnel ? self.proxy.protocol : self.uri.protocol - , defaultModules = {'http:':http, 'https:':https} - , httpModules = self.httpModules || {} - - self.httpModule = httpModules[protocol] || defaultModules[protocol] - - if (!self.httpModule) { - return self.emit('error', new Error('Invalid protocol: ' + protocol)) - } - - if (options.ca) { - self.ca = options.ca - } - - if (!self.agent) { - if (options.agentOptions) { - self.agentOptions = options.agentOptions - } - - if (options.agentClass) { - self.agentClass = options.agentClass - } else if (options.forever) { - self.agentClass = protocol === 'http:' ? ForeverAgent : ForeverAgent.SSL - } else { - self.agentClass = self.httpModule.Agent - } - } - - if (self.pool === false) { - self.agent = false - } else { - self.agent = self.agent || self.getAgent() - if (self.maxSockets) { - // Don't use our pooling if node has the refactored client - self.agent.maxSockets = self.maxSockets - } - if (self.pool.maxSockets) { - // Don't use our pooling if node has the refactored client - self.agent.maxSockets = self.pool.maxSockets - } - } - - self.on('pipe', function (src) { - if (self.ntick && self._started) { - throw new Error('You cannot pipe to this stream after the outbound request has started.') - } - self.src = src - if (isReadStream(src)) { - if (!self.hasHeader('content-type')) { - self.setHeader('content-type', mime.lookup(src.path)) - } - } else { - if (src.headers) { - for (var i in src.headers) { - if (!self.hasHeader(i)) { - self.setHeader(i, src.headers[i]) - } - } - } - if (self._json && !self.hasHeader('content-type')) { - self.setHeader('content-type', 'application/json') - } - if (src.method && !self.explicitMethod) { - self.method = src.method - } - } - - // self.on('pipe', function () { - // console.error('You have already piped to this stream. Pipeing twice is likely to break the request.') - // }) - }) - - defer(function () { - if (self._aborted) { - return - } - - var end = function () { - if (self._form) { - self._form.pipe(self) - } - if (self.body) { - if (Array.isArray(self.body)) { - self.body.forEach(function (part) { - self.write(part) - }) - } else { - self.write(self.body) - } - self.end() - } else if (self.requestBodyStream) { - console.warn('options.requestBodyStream is deprecated, please pass the request object to stream.pipe.') - self.requestBodyStream.pipe(self) - } else if (!self.src) { - if (self.method !== 'GET' && typeof self.method !== 'undefined') { - self.setHeader('content-length', 0) - } - self.end() - } - } - - if (self._form && !self.hasHeader('content-length')) { - // Before ending the request, we had to compute the length of the whole form, asyncly - self.setHeader(self._form.getHeaders()) - self._form.getLength(function (err, length) { - if (!err) { - self.setHeader('content-length', length) - } - end() - }) - } else { - end() - } - - self.ntick = true - }) - -} - -// Must call this when following a redirect from https to http or vice versa -// Attempts to keep everything as identical as possible, but update the -// httpModule, Tunneling agent, and/or Forever Agent in use. -Request.prototype._updateProtocol = function () { - var self = this - var protocol = self.uri.protocol - - if (protocol === 'https:' || self.tunnel) { - // previously was doing http, now doing https - // if it's https, then we might need to tunnel now. - if (self.proxy) { - if (self.setupTunnel()) { - return - } - } - - self.httpModule = https - switch (self.agentClass) { - case ForeverAgent: - self.agentClass = ForeverAgent.SSL - break - case http.Agent: - self.agentClass = https.Agent - break - default: - // nothing we can do. Just hope for the best. - return - } - - // if there's an agent, we need to get a new one. - if (self.agent) { - self.agent = self.getAgent() - } - - } else { - // previously was doing https, now doing http - self.httpModule = http - switch (self.agentClass) { - case ForeverAgent.SSL: - self.agentClass = ForeverAgent - break - case https.Agent: - self.agentClass = http.Agent - break - default: - // nothing we can do. just hope for the best - return - } - - // if there's an agent, then get a new one. - if (self.agent) { - self.agent = null - self.agent = self.getAgent() - } - } -} - -Request.prototype.getAgent = function () { - var self = this - var Agent = self.agentClass - var options = {} - if (self.agentOptions) { - for (var i in self.agentOptions) { - options[i] = self.agentOptions[i] - } - } - if (self.ca) { - options.ca = self.ca - } - if (self.ciphers) { - options.ciphers = self.ciphers - } - if (self.secureProtocol) { - options.secureProtocol = self.secureProtocol - } - if (self.secureOptions) { - options.secureOptions = self.secureOptions - } - if (typeof self.rejectUnauthorized !== 'undefined') { - options.rejectUnauthorized = self.rejectUnauthorized - } - - if (self.cert && self.key) { - options.key = self.key - options.cert = self.cert - } - - var poolKey = '' - - // different types of agents are in different pools - if (Agent !== self.httpModule.Agent) { - poolKey += Agent.name - } - - if (!self.httpModule.globalAgent) { - // node 0.4.x - options.host = self.host - options.port = self.port - if (poolKey) { - poolKey += ':' - } - poolKey += self.host + ':' + self.port - } - - // ca option is only relevant if proxy or destination are https - var proxy = self.proxy - if (typeof proxy === 'string') { - proxy = url.parse(proxy) - } - var isHttps = (proxy && proxy.protocol === 'https:') || this.uri.protocol === 'https:' - - if (isHttps) { - if (options.ca) { - if (poolKey) { - poolKey += ':' - } - poolKey += options.ca - } - - if (typeof options.rejectUnauthorized !== 'undefined') { - if (poolKey) { - poolKey += ':' - } - poolKey += options.rejectUnauthorized - } - - if (options.cert) { - poolKey += options.cert.toString('ascii') + options.key.toString('ascii') - } - - if (options.ciphers) { - if (poolKey) { - poolKey += ':' - } - poolKey += options.ciphers - } - - if (options.secureProtocol) { - if (poolKey) { - poolKey += ':' - } - poolKey += options.secureProtocol - } - - if (options.secureOptions) { - if (poolKey) { - poolKey += ':' - } - poolKey += options.secureOptions - } - } - - if (self.pool === globalPool && !poolKey && Object.keys(options).length === 0 && self.httpModule.globalAgent) { - // not doing anything special. Use the globalAgent - return self.httpModule.globalAgent - } - - // we're using a stored agent. Make sure it's protocol-specific - poolKey = self.uri.protocol + poolKey - - // generate a new agent for this setting if none yet exists - if (!self.pool[poolKey]) { - self.pool[poolKey] = new Agent(options) - } - - return self.pool[poolKey] -} - -Request.prototype.start = function () { - // start() is called once we are ready to send the outgoing HTTP request. - // this is usually called on the first write(), end() or on nextTick() - var self = this - - if (self._aborted) { - return - } - - self._started = true - self.method = self.method || 'GET' - self.href = self.uri.href - - if (self.src && self.src.stat && self.src.stat.size && !self.hasHeader('content-length')) { - self.setHeader('content-length', self.src.stat.size) - } - if (self._aws) { - self.aws(self._aws, true) - } - - // We have a method named auth, which is completely different from the http.request - // auth option. If we don't remove it, we're gonna have a bad time. - var reqOptions = copy(self) - delete reqOptions.auth - - debug('make request', self.uri.href) - self.req = self.httpModule.request(reqOptions) - - if (self.timeout && !self.timeoutTimer) { - self.timeoutTimer = setTimeout(function () { - self.abort() - var e = new Error('ETIMEDOUT') - e.code = 'ETIMEDOUT' - self.emit('error', e) - }, self.timeout) - - // Set additional timeout on socket - in case if remote - // server freeze after sending headers - if (self.req.setTimeout) { // only works on node 0.6+ - self.req.setTimeout(self.timeout, function () { - if (self.req) { - self.req.abort() - var e = new Error('ESOCKETTIMEDOUT') - e.code = 'ESOCKETTIMEDOUT' - self.emit('error', e) - } - }) - } - } - - self.req.on('response', self.onRequestResponse.bind(self)) - self.req.on('error', self.onRequestError.bind(self)) - self.req.on('drain', function() { - self.emit('drain') - }) - self.req.on('socket', function(socket) { - self.emit('socket', socket) - }) - - self.on('end', function() { - if ( self.req.connection ) { - self.req.connection.removeListener('error', connectionErrorHandler) - } - }) - self.emit('request', self.req) -} - -Request.prototype.onRequestError = function (error) { - var self = this - if (self._aborted) { - return - } - if (self.req && self.req._reusedSocket && error.code === 'ECONNRESET' - && self.agent.addRequestNoreuse) { - self.agent = { addRequest: self.agent.addRequestNoreuse.bind(self.agent) } - self.start() - self.req.end() - return - } - if (self.timeout && self.timeoutTimer) { - clearTimeout(self.timeoutTimer) - self.timeoutTimer = null - } - self.emit('error', error) -} - -Request.prototype.onRequestResponse = function (response) { - var self = this - debug('onRequestResponse', self.uri.href, response.statusCode, response.headers) - response.on('end', function() { - debug('response end', self.uri.href, response.statusCode, response.headers) - }) - - // The check on response.connection is a workaround for browserify. - if (response.connection && response.connection.listeners('error').indexOf(connectionErrorHandler) === -1) { - response.connection.setMaxListeners(0) - response.connection.once('error', connectionErrorHandler) - } - if (self._aborted) { - debug('aborted', self.uri.href) - response.resume() - return - } - if (self._paused) { - response.pause() - } else if (response.resume) { - // response.resume should be defined, but check anyway before calling. Workaround for browserify. - response.resume() - } - - self.response = response - response.request = self - response.toJSON = responseToJSON - - // XXX This is different on 0.10, because SSL is strict by default - if (self.httpModule === https && - self.strictSSL && (!response.hasOwnProperty('client') || - !response.client.authorized)) { - debug('strict ssl error', self.uri.href) - var sslErr = response.hasOwnProperty('client') ? response.client.authorizationError : self.uri.href + ' does not support SSL' - self.emit('error', new Error('SSL Error: ' + sslErr)) - return - } - - // Save the original host before any redirect (if it changes, we need to - // remove any authorization headers) - self.originalHost = self.headers.host - if (self.setHost) { - self.removeHeader('host') - } - if (self.timeout && self.timeoutTimer) { - clearTimeout(self.timeoutTimer) - self.timeoutTimer = null - } - - var targetCookieJar = (self._jar && self._jar.setCookie) ? self._jar : globalCookieJar - var addCookie = function (cookie) { - //set the cookie if it's domain in the href's domain. - try { - targetCookieJar.setCookie(cookie, self.uri.href, {ignoreError: true}) - } catch (e) { - self.emit('error', e) - } - } - - response.caseless = caseless(response.headers) - - if (response.caseless.has('set-cookie') && (!self._disableCookies)) { - var headerName = response.caseless.has('set-cookie') - if (Array.isArray(response.headers[headerName])) { - response.headers[headerName].forEach(addCookie) - } else { - addCookie(response.headers[headerName]) - } - } - - var redirectTo = null - if (response.statusCode >= 300 && response.statusCode < 400 && response.caseless.has('location')) { - var location = response.caseless.get('location') - debug('redirect', location) - - if (self.followAllRedirects) { - redirectTo = location - } else if (self.followRedirects) { - switch (self.method) { - case 'PATCH': - case 'PUT': - case 'POST': - case 'DELETE': - // Do not follow redirects - break - default: - redirectTo = location - break - } - } - } else if (response.statusCode === 401 && self._hasAuth && !self._sentAuth) { - var authHeader = response.caseless.get('www-authenticate') - var authVerb = authHeader && authHeader.split(' ')[0].toLowerCase() - debug('reauth', authVerb) - - switch (authVerb) { - case 'basic': - self.auth(self._user, self._pass, true) - redirectTo = self.uri - break - - case 'bearer': - self.auth(null, null, true, self._bearer) - redirectTo = self.uri - break - - case 'digest': - // TODO: More complete implementation of RFC 2617. - // - check challenge.algorithm - // - support algorithm="MD5-sess" - // - handle challenge.domain - // - support qop="auth-int" only - // - handle Authentication-Info (not necessarily?) - // - check challenge.stale (not necessarily?) - // - increase nc (not necessarily?) - // For reference: - // http://tools.ietf.org/html/rfc2617#section-3 - // https://github.com/bagder/curl/blob/master/lib/http_digest.c - - var challenge = {} - var re = /([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi - for (;;) { - var match = re.exec(authHeader) - if (!match) { - break - } - challenge[match[1]] = match[2] || match[3] - } - - var ha1 = md5(self._user + ':' + challenge.realm + ':' + self._pass) - var ha2 = md5(self.method + ':' + self.uri.path) - var qop = /(^|,)\s*auth\s*($|,)/.test(challenge.qop) && 'auth' - var nc = qop && '00000001' - var cnonce = qop && uuid().replace(/-/g, '') - var digestResponse = qop ? md5(ha1 + ':' + challenge.nonce + ':' + nc + ':' + cnonce + ':' + qop + ':' + ha2) : md5(ha1 + ':' + challenge.nonce + ':' + ha2) - var authValues = { - username: self._user, - realm: challenge.realm, - nonce: challenge.nonce, - uri: self.uri.path, - qop: qop, - response: digestResponse, - nc: nc, - cnonce: cnonce, - algorithm: challenge.algorithm, - opaque: challenge.opaque - } - - authHeader = [] - for (var k in authValues) { - if (authValues[k]) { - if (k === 'qop' || k === 'nc' || k === 'algorithm') { - authHeader.push(k + '=' + authValues[k]) - } else { - authHeader.push(k + '="' + authValues[k] + '"') - } - } - } - authHeader = 'Digest ' + authHeader.join(', ') - self.setHeader('authorization', authHeader) - self._sentAuth = true - - redirectTo = self.uri - break - } - } - - if (redirectTo && self.allowRedirect.call(self, response)) { - debug('redirect to', redirectTo) - - // ignore any potential response body. it cannot possibly be useful - // to us at this point. - if (self._paused) { - response.resume() - } - - if (self._redirectsFollowed >= self.maxRedirects) { - self.emit('error', new Error('Exceeded maxRedirects. Probably stuck in a redirect loop ' + self.uri.href)) - return - } - self._redirectsFollowed += 1 - - if (!isUrl.test(redirectTo)) { - redirectTo = url.resolve(self.uri.href, redirectTo) - } - - var uriPrev = self.uri - self.uri = url.parse(redirectTo) - - // handle the case where we change protocol from https to http or vice versa - if (self.uri.protocol !== uriPrev.protocol) { - self._updateProtocol() - } - - self.redirects.push( - { statusCode : response.statusCode - , redirectUri: redirectTo - } - ) - if (self.followAllRedirects && response.statusCode !== 401 && response.statusCode !== 307) { - self.method = 'GET' - } - // self.method = 'GET' // Force all redirects to use GET || commented out fixes #215 - delete self.src - delete self.req - delete self.agent - delete self._started - if (response.statusCode !== 401 && response.statusCode !== 307) { - // Remove parameters from the previous response, unless this is the second request - // for a server that requires digest authentication. - delete self.body - delete self._form - if (self.headers) { - self.removeHeader('host') - self.removeHeader('content-type') - self.removeHeader('content-length') - if (self.uri.hostname !== self.originalHost.split(':')[0]) { - // Remove authorization if changing hostnames (but not if just - // changing ports or protocols). This matches the behavior of curl: - // https://github.com/bagder/curl/blob/6beb0eee/lib/http.c#L710 - self.removeHeader('authorization') - } - } - } - - self.emit('redirect') - - self.init() - return // Ignore the rest of the response - } else { - self._redirectsFollowed = self._redirectsFollowed || 0 - // Be a good stream and emit end when the response is finished. - // Hack to emit end on close because of a core bug that never fires end - response.on('close', function () { - if (!self._ended) { - self.response.emit('end') - } - }) - - response.on('end', function () { - self._ended = true - }) - - var dataStream - if (self.gzip) { - var contentEncoding = response.headers['content-encoding'] || 'identity' - contentEncoding = contentEncoding.trim().toLowerCase() - - if (contentEncoding === 'gzip') { - dataStream = zlib.createGunzip() - response.pipe(dataStream) - } else { - // Since previous versions didn't check for Content-Encoding header, - // ignore any invalid values to preserve backwards-compatibility - if (contentEncoding !== 'identity') { - debug('ignoring unrecognized Content-Encoding ' + contentEncoding) - } - dataStream = response - } - } else { - dataStream = response - } - - if (self.encoding) { - if (self.dests.length !== 0) { - console.error('Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid.') - } else if (dataStream.setEncoding) { - dataStream.setEncoding(self.encoding) - } else { - // Should only occur on node pre-v0.9.4 (joyent/node@9b5abe5) with - // zlib streams. - // If/When support for 0.9.4 is dropped, this should be unnecessary. - dataStream = dataStream.pipe(stringstream(self.encoding)) - } - } - - self.emit('response', response) - - self.dests.forEach(function (dest) { - self.pipeDest(dest) - }) - - dataStream.on('data', function (chunk) { - self._destdata = true - self.emit('data', chunk) - }) - dataStream.on('end', function (chunk) { - self.emit('end', chunk) - }) - dataStream.on('error', function (error) { - self.emit('error', error) - }) - dataStream.on('close', function () {self.emit('close')}) - - if (self.callback) { - var buffer = bl() - , strings = [] - - self.on('data', function (chunk) { - if (Buffer.isBuffer(chunk)) { - buffer.append(chunk) - } else { - strings.push(chunk) - } - }) - self.on('end', function () { - debug('end event', self.uri.href) - if (self._aborted) { - debug('aborted', self.uri.href) - return - } - - if (buffer.length) { - debug('has body', self.uri.href, buffer.length) - if (self.encoding === null) { - // response.body = buffer - // can't move to this until https://github.com/rvagg/bl/issues/13 - response.body = buffer.slice() - } else { - response.body = buffer.toString(self.encoding) - } - } else if (strings.length) { - // The UTF8 BOM [0xEF,0xBB,0xBF] is converted to [0xFE,0xFF] in the JS UTC16/UCS2 representation. - // Strip this value out when the encoding is set to 'utf8', as upstream consumers won't expect it and it breaks JSON.parse(). - if (self.encoding === 'utf8' && strings[0].length > 0 && strings[0][0] === '\uFEFF') { - strings[0] = strings[0].substring(1) - } - response.body = strings.join('') - } - - if (self._json) { - try { - response.body = JSON.parse(response.body) - } catch (e) {} - } - debug('emitting complete', self.uri.href) - if(typeof response.body === 'undefined' && !self._json) { - response.body = '' - } - self.emit('complete', response, response.body) - }) - } - //if no callback - else{ - self.on('end', function () { - if (self._aborted) { - debug('aborted', self.uri.href) - return - } - self.emit('complete', response) - }) - } - } - debug('finish init function', self.uri.href) -} - -Request.prototype.abort = function () { - var self = this - self._aborted = true - - if (self.req) { - self.req.abort() - } - else if (self.response) { - self.response.abort() - } - - self.emit('abort') -} - -Request.prototype.pipeDest = function (dest) { - var self = this - var response = self.response - // Called after the response is received - if (dest.headers && !dest.headersSent) { - if (response.caseless.has('content-type')) { - var ctname = response.caseless.has('content-type') - if (dest.setHeader) { - dest.setHeader(ctname, response.headers[ctname]) - } - else { - dest.headers[ctname] = response.headers[ctname] - } - } - - if (response.caseless.has('content-length')) { - var clname = response.caseless.has('content-length') - if (dest.setHeader) { - dest.setHeader(clname, response.headers[clname]) - } else { - dest.headers[clname] = response.headers[clname] - } - } - } - if (dest.setHeader && !dest.headersSent) { - for (var i in response.headers) { - // If the response content is being decoded, the Content-Encoding header - // of the response doesn't represent the piped content, so don't pass it. - if (!self.gzip || i !== 'content-encoding') { - dest.setHeader(i, response.headers[i]) - } - } - dest.statusCode = response.statusCode - } - if (self.pipefilter) { - self.pipefilter(response, dest) - } -} - -Request.prototype.qs = function (q, clobber) { - var self = this - var base - if (!clobber && self.uri.query) { - base = self.qsLib.parse(self.uri.query) - } else { - base = {} - } - - for (var i in q) { - base[i] = q[i] - } - - if (self.qsLib.stringify(base) === ''){ - return self - } - - self.uri = url.parse(self.uri.href.split('?')[0] + '?' + self.qsLib.stringify(base)) - self.url = self.uri - self.path = self.uri.path - - return self -} -Request.prototype.form = function (form) { - var self = this - if (form) { - self.setHeader('content-type', 'application/x-www-form-urlencoded') - self.body = (typeof form === 'string') ? form.toString('utf8') : self.qsLib.stringify(form).toString('utf8') - return self - } - // create form-data object - self._form = new FormData() - return self._form -} -Request.prototype.multipart = function (multipart) { - var self = this - self.body = [] - - if (!self.hasHeader('content-type')) { - self.setHeader('content-type', 'multipart/related; boundary=' + self.boundary) - } else { - var headerName = self.hasHeader('content-type') - self.setHeader(headerName, self.headers[headerName].split(';')[0] + '; boundary=' + self.boundary) - } - - if (!multipart.forEach) { - throw new Error('Argument error, options.multipart.') - } - - if (self.preambleCRLF) { - self.body.push(new Buffer('\r\n')) - } - - multipart.forEach(function (part) { - var body = part.body - if(typeof body === 'undefined') { - throw new Error('Body attribute missing in multipart.') - } - delete part.body - var preamble = '--' + self.boundary + '\r\n' - Object.keys(part).forEach(function (key) { - preamble += key + ': ' + part[key] + '\r\n' - }) - preamble += '\r\n' - self.body.push(new Buffer(preamble)) - self.body.push(new Buffer(body)) - self.body.push(new Buffer('\r\n')) - }) - self.body.push(new Buffer('--' + self.boundary + '--')) - - if (self.postambleCRLF) { - self.body.push(new Buffer('\r\n')) - } - - return self -} -Request.prototype.json = function (val) { - var self = this - - if (!self.hasHeader('accept')) { - self.setHeader('accept', 'application/json') - } - - self._json = true - if (typeof val === 'boolean') { - if (typeof self.body === 'object') { - self.body = safeStringify(self.body) - if (!self.hasHeader('content-type')) { - self.setHeader('content-type', 'application/json') - } - } - } else { - self.body = safeStringify(val) - if (!self.hasHeader('content-type')) { - self.setHeader('content-type', 'application/json') - } - } - - return self -} -Request.prototype.getHeader = function (name, headers) { - var self = this - var result, re, match - if (!headers) { - headers = self.headers - } - Object.keys(headers).forEach(function (key) { - if (key.length !== name.length) { - return - } - re = new RegExp(name, 'i') - match = key.match(re) - if (match) { - result = headers[key] - } - }) - return result -} -var getHeader = Request.prototype.getHeader - -Request.prototype.auth = function (user, pass, sendImmediately, bearer) { - var self = this - if (bearer !== undefined) { - self._bearer = bearer - self._hasAuth = true - if (sendImmediately || typeof sendImmediately === 'undefined') { - if (typeof bearer === 'function') { - bearer = bearer() - } - self.setHeader('authorization', 'Bearer ' + bearer) - self._sentAuth = true - } - return self - } - if (typeof user !== 'string' || (pass !== undefined && typeof pass !== 'string')) { - throw new Error('auth() received invalid user or password') - } - self._user = user - self._pass = pass - self._hasAuth = true - var header = typeof pass !== 'undefined' ? user + ':' + pass : user - if (sendImmediately || typeof sendImmediately === 'undefined') { - self.setHeader('authorization', 'Basic ' + toBase64(header)) - self._sentAuth = true - } - return self -} - -Request.prototype.aws = function (opts, now) { - var self = this - - if (!now) { - self._aws = opts - return self - } - var date = new Date() - self.setHeader('date', date.toUTCString()) - var auth = - { key: opts.key - , secret: opts.secret - , verb: self.method.toUpperCase() - , date: date - , contentType: self.getHeader('content-type') || '' - , md5: self.getHeader('content-md5') || '' - , amazonHeaders: aws.canonicalizeHeaders(self.headers) - } - var path = self.uri.path - if (opts.bucket && path) { - auth.resource = '/' + opts.bucket + path - } else if (opts.bucket && !path) { - auth.resource = '/' + opts.bucket - } else if (!opts.bucket && path) { - auth.resource = path - } else if (!opts.bucket && !path) { - auth.resource = '/' - } - auth.resource = aws.canonicalizeResource(auth.resource) - self.setHeader('authorization', aws.authorization(auth)) - - return self -} -Request.prototype.httpSignature = function (opts) { - var self = this - httpSignature.signRequest({ - getHeader: function(header) { - return getHeader(header, self.headers) - }, - setHeader: function(header, value) { - self.setHeader(header, value) - }, - method: self.method, - path: self.path - }, opts) - debug('httpSignature authorization', self.getHeader('authorization')) - - return self -} - -Request.prototype.hawk = function (opts) { - var self = this - self.setHeader('Authorization', hawk.client.header(self.uri, self.method, opts).field) -} - -Request.prototype.oauth = function (_oauth) { - var self = this - var form, query - if (self.hasHeader('content-type') && - self.getHeader('content-type').slice(0, 'application/x-www-form-urlencoded'.length) === - 'application/x-www-form-urlencoded' - ) { - form = self.body - } - if (self.uri.query) { - query = self.uri.query - } - - var oa = {} - for (var i in _oauth) { - oa['oauth_' + i] = _oauth[i] - } - if ('oauth_realm' in oa) { - delete oa.oauth_realm - } - if (!oa.oauth_version) { - oa.oauth_version = '1.0' - } - if (!oa.oauth_timestamp) { - oa.oauth_timestamp = Math.floor( Date.now() / 1000 ).toString() - } - if (!oa.oauth_nonce) { - oa.oauth_nonce = uuid().replace(/-/g, '') - } - - oa.oauth_signature_method = 'HMAC-SHA1' - - var consumer_secret = oa.oauth_consumer_secret - delete oa.oauth_consumer_secret - var token_secret = oa.oauth_token_secret - delete oa.oauth_token_secret - - var baseurl = self.uri.protocol + '//' + self.uri.host + self.uri.pathname - var params = self.qsLib.parse([].concat(query, form, self.qsLib.stringify(oa)).join('&')) - var signature = oauth.hmacsign(self.method, baseurl, params, consumer_secret, token_secret) - - var realm = _oauth.realm ? 'realm="' + _oauth.realm + '",' : '' - var authHeader = 'OAuth ' + realm + - Object.keys(oa).sort().map(function (i) {return i + '="' + oauth.rfc3986(oa[i]) + '"'}).join(',') - authHeader += ',oauth_signature="' + oauth.rfc3986(signature) + '"' - self.setHeader('Authorization', authHeader) - return self -} -Request.prototype.jar = function (jar) { - var self = this - var cookies - - if (self._redirectsFollowed === 0) { - self.originalCookieHeader = self.getHeader('cookie') - } - - if (!jar) { - // disable cookies - cookies = false - self._disableCookies = true - } else { - var targetCookieJar = (jar && jar.getCookieString) ? jar : globalCookieJar - var urihref = self.uri.href - //fetch cookie in the Specified host - if (targetCookieJar) { - cookies = targetCookieJar.getCookieString(urihref) - } - } - - //if need cookie and cookie is not empty - if (cookies && cookies.length) { - if (self.originalCookieHeader) { - // Don't overwrite existing Cookie header - self.setHeader('cookie', self.originalCookieHeader + '; ' + cookies) - } else { - self.setHeader('cookie', cookies) - } - } - self._jar = jar - return self -} - - -// Stream API -Request.prototype.pipe = function (dest, opts) { - var self = this - - if (self.response) { - if (self._destdata) { - throw new Error('You cannot pipe after data has been emitted from the response.') - } else if (self._ended) { - throw new Error('You cannot pipe after the response has been ended.') - } else { - stream.Stream.prototype.pipe.call(self, dest, opts) - self.pipeDest(dest) - return dest - } - } else { - self.dests.push(dest) - stream.Stream.prototype.pipe.call(self, dest, opts) - return dest - } -} -Request.prototype.write = function () { - var self = this - if (!self._started) { - self.start() - } - return self.req.write.apply(self.req, arguments) -} -Request.prototype.end = function (chunk) { - var self = this - if (chunk) { - self.write(chunk) - } - if (!self._started) { - self.start() - } - self.req.end() -} -Request.prototype.pause = function () { - var self = this - if (!self.response) { - self._paused = true - } else { - self.response.pause.apply(self.response, arguments) - } -} -Request.prototype.resume = function () { - var self = this - if (!self.response) { - self._paused = false - } else { - self.response.resume.apply(self.response, arguments) - } -} -Request.prototype.destroy = function () { - var self = this - if (!self._ended) { - self.end() - } else if (self.response) { - self.response.destroy() - } -} - -Request.defaultProxyHeaderWhiteList = - defaultProxyHeaderWhiteList.slice() - -// Exports - -Request.prototype.toJSON = requestToJSON -module.exports = Request diff --git a/update_nation/node_modules/nano/node_modules/underscore/LICENSE b/update_nation/node_modules/nano/node_modules/underscore/LICENSE deleted file mode 100644 index ad0e71bc4..000000000 --- a/update_nation/node_modules/nano/node_modules/underscore/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative -Reporters & Editors - -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/update_nation/node_modules/nano/node_modules/underscore/README.md b/update_nation/node_modules/nano/node_modules/underscore/README.md deleted file mode 100644 index c2ba2590c..000000000 --- a/update_nation/node_modules/nano/node_modules/underscore/README.md +++ /dev/null @@ -1,22 +0,0 @@ - __ - /\ \ __ - __ __ ___ \_\ \ __ _ __ ____ ___ ___ _ __ __ /\_\ ____ - /\ \/\ \ /' _ `\ /'_ \ /'__`\/\ __\/ ,__\ / ___\ / __`\/\ __\/'__`\ \/\ \ /',__\ - \ \ \_\ \/\ \/\ \/\ \ \ \/\ __/\ \ \//\__, `\/\ \__//\ \ \ \ \ \//\ __/ __ \ \ \/\__, `\ - \ \____/\ \_\ \_\ \___,_\ \____\\ \_\\/\____/\ \____\ \____/\ \_\\ \____\/\_\ _\ \ \/\____/ - \/___/ \/_/\/_/\/__,_ /\/____/ \/_/ \/___/ \/____/\/___/ \/_/ \/____/\/_//\ \_\ \/___/ - \ \____/ - \/___/ - -Underscore.js is a utility-belt library for JavaScript that provides -support for the usual functional suspects (each, map, reduce, filter...) -without extending any core JavaScript objects. - -For Docs, License, Tests, and pre-packed downloads, see: -http://underscorejs.org - -Underscore is an open-sourced component of DocumentCloud: -https://github.com/documentcloud - -Many thanks to our contributors: -https://github.com/jashkenas/underscore/contributors diff --git a/update_nation/node_modules/nano/node_modules/underscore/package.json b/update_nation/node_modules/nano/node_modules/underscore/package.json deleted file mode 100644 index 2676be3f2..000000000 --- a/update_nation/node_modules/nano/node_modules/underscore/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "name": "underscore", - "description": "JavaScript's functional programming helper library.", - "homepage": "http://underscorejs.org", - "keywords": [ - "util", - "functional", - "server", - "client", - "browser" - ], - "author": { - "name": "Jeremy Ashkenas", - "email": "jeremy@documentcloud.org" - }, - "repository": { - "type": "git", - "url": "git://github.com/jashkenas/underscore.git" - }, - "main": "underscore.js", - "version": "1.8.2", - "devDependencies": { - "docco": "*", - "eslint": "0.6.x", - "karma": "~0.12.31", - "karma-qunit": "~0.1.4", - "qunit-cli": "~0.2.0", - "uglify-js": "2.4.x" - }, - "scripts": { - "test": "npm run test-node && npm run lint", - "lint": "eslint underscore.js test/*.js", - "test-node": "qunit-cli test/*.js", - "test-browser": "npm i karma-phantomjs-launcher && ./node_modules/karma/bin/karma start", - "build": "uglifyjs underscore.js -c \"evaluate=false\" --comments \"/ .*/\" -m --source-map underscore-min.map -o underscore-min.js", - "doc": "docco underscore.js" - }, - "license": "MIT", - "files": [ - "underscore.js", - "underscore-min.js", - "underscore-min.map", - "LICENSE" - ], - "gitHead": "19db749b190a7cb5a8b7ab1aab42c0e9dc517250", - "bugs": { - "url": "https://github.com/jashkenas/underscore/issues" - }, - "_id": "underscore@1.8.2", - "_shasum": "64df2eb590899de950782f3735190ba42ebf311d", - "_from": "underscore@^1.7.0", - "_npmVersion": "1.4.28", - "_npmUser": { - "name": "jashkenas", - "email": "jashkenas@gmail.com" - }, - "maintainers": [ - { - "name": "jashkenas", - "email": "jashkenas@gmail.com" - } - ], - "dist": { - "shasum": "64df2eb590899de950782f3735190ba42ebf311d", - "tarball": "http://registry.npmjs.org/underscore/-/underscore-1.8.2.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.2.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/update_nation/node_modules/nano/node_modules/underscore/underscore-min.js b/update_nation/node_modules/nano/node_modules/underscore/underscore-min.js deleted file mode 100644 index bc5431403..000000000 --- a/update_nation/node_modules/nano/node_modules/underscore/underscore-min.js +++ /dev/null @@ -1,6 +0,0 @@ -// Underscore.js 1.8.2 -// http://underscorejs.org -// (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors -// Underscore may be freely distributed under the MIT license. -(function(){function n(n){function t(t,r,e,u,i,o){for(;i>=0&&o>i;i+=n){var a=u?u[i]:i;e=r(e,t[a],a,t)}return e}return function(r,e,u,i){e=d(e,i,4);var o=!w(r)&&m.keys(r),a=(o||r).length,c=n>0?0:a-1;return arguments.length<3&&(u=r[o?o[c]:c],c+=n),t(r,e,u,o,c,a)}}function t(n){return function(t,r,e){r=b(r,e);for(var u=null!=t&&t.length,i=n>0?0:u-1;i>=0&&u>i;i+=n)if(r(t[i],i,t))return i;return-1}}function r(n,t){var r=S.length,e=n.constructor,u=m.isFunction(e)&&e.prototype||o,i="constructor";for(m.has(n,i)&&!m.contains(t,i)&&t.push(i);r--;)i=S[r],i in n&&n[i]!==u[i]&&!m.contains(t,i)&&t.push(i)}var e=this,u=e._,i=Array.prototype,o=Object.prototype,a=Function.prototype,c=i.push,l=i.slice,f=o.toString,s=o.hasOwnProperty,p=Array.isArray,h=Object.keys,v=a.bind,g=Object.create,y=function(){},m=function(n){return n instanceof m?n:this instanceof m?void(this._wrapped=n):new m(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=m),exports._=m):e._=m,m.VERSION="1.8.2";var d=function(n,t,r){if(t===void 0)return n;switch(null==r?3:r){case 1:return function(r){return n.call(t,r)};case 2:return function(r,e){return n.call(t,r,e)};case 3:return function(r,e,u){return n.call(t,r,e,u)};case 4:return function(r,e,u,i){return n.call(t,r,e,u,i)}}return function(){return n.apply(t,arguments)}},b=function(n,t,r){return null==n?m.identity:m.isFunction(n)?d(n,t,r):m.isObject(n)?m.matcher(n):m.property(n)};m.iteratee=function(n,t){return b(n,t,1/0)};var x=function(n,t){return function(r){var e=arguments.length;if(2>e||null==r)return r;for(var u=1;e>u;u++)for(var i=arguments[u],o=n(i),a=o.length,c=0;a>c;c++){var l=o[c];t&&r[l]!==void 0||(r[l]=i[l])}return r}},_=function(n){if(!m.isObject(n))return{};if(g)return g(n);y.prototype=n;var t=new y;return y.prototype=null,t},j=Math.pow(2,53)-1,w=function(n){var t=n&&n.length;return"number"==typeof t&&t>=0&&j>=t};m.each=m.forEach=function(n,t,r){t=d(t,r);var e,u;if(w(n))for(e=0,u=n.length;u>e;e++)t(n[e],e,n);else{var i=m.keys(n);for(e=0,u=i.length;u>e;e++)t(n[i[e]],i[e],n)}return n},m.map=m.collect=function(n,t,r){t=b(t,r);for(var e=!w(n)&&m.keys(n),u=(e||n).length,i=Array(u),o=0;u>o;o++){var a=e?e[o]:o;i[o]=t(n[a],a,n)}return i},m.reduce=m.foldl=m.inject=n(1),m.reduceRight=m.foldr=n(-1),m.find=m.detect=function(n,t,r){var e;return e=w(n)?m.findIndex(n,t,r):m.findKey(n,t,r),e!==void 0&&e!==-1?n[e]:void 0},m.filter=m.select=function(n,t,r){var e=[];return t=b(t,r),m.each(n,function(n,r,u){t(n,r,u)&&e.push(n)}),e},m.reject=function(n,t,r){return m.filter(n,m.negate(b(t)),r)},m.every=m.all=function(n,t,r){t=b(t,r);for(var e=!w(n)&&m.keys(n),u=(e||n).length,i=0;u>i;i++){var o=e?e[i]:i;if(!t(n[o],o,n))return!1}return!0},m.some=m.any=function(n,t,r){t=b(t,r);for(var e=!w(n)&&m.keys(n),u=(e||n).length,i=0;u>i;i++){var o=e?e[i]:i;if(t(n[o],o,n))return!0}return!1},m.contains=m.includes=m.include=function(n,t,r){return w(n)||(n=m.values(n)),m.indexOf(n,t,"number"==typeof r&&r)>=0},m.invoke=function(n,t){var r=l.call(arguments,2),e=m.isFunction(t);return m.map(n,function(n){var u=e?t:n[t];return null==u?u:u.apply(n,r)})},m.pluck=function(n,t){return m.map(n,m.property(t))},m.where=function(n,t){return m.filter(n,m.matcher(t))},m.findWhere=function(n,t){return m.find(n,m.matcher(t))},m.max=function(n,t,r){var e,u,i=-1/0,o=-1/0;if(null==t&&null!=n){n=w(n)?n:m.values(n);for(var a=0,c=n.length;c>a;a++)e=n[a],e>i&&(i=e)}else t=b(t,r),m.each(n,function(n,r,e){u=t(n,r,e),(u>o||u===-1/0&&i===-1/0)&&(i=n,o=u)});return i},m.min=function(n,t,r){var e,u,i=1/0,o=1/0;if(null==t&&null!=n){n=w(n)?n:m.values(n);for(var a=0,c=n.length;c>a;a++)e=n[a],i>e&&(i=e)}else t=b(t,r),m.each(n,function(n,r,e){u=t(n,r,e),(o>u||1/0===u&&1/0===i)&&(i=n,o=u)});return i},m.shuffle=function(n){for(var t,r=w(n)?n:m.values(n),e=r.length,u=Array(e),i=0;e>i;i++)t=m.random(0,i),t!==i&&(u[i]=u[t]),u[t]=r[i];return u},m.sample=function(n,t,r){return null==t||r?(w(n)||(n=m.values(n)),n[m.random(n.length-1)]):m.shuffle(n).slice(0,Math.max(0,t))},m.sortBy=function(n,t,r){return t=b(t,r),m.pluck(m.map(n,function(n,r,e){return{value:n,index:r,criteria:t(n,r,e)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var A=function(n){return function(t,r,e){var u={};return r=b(r,e),m.each(t,function(e,i){var o=r(e,i,t);n(u,e,o)}),u}};m.groupBy=A(function(n,t,r){m.has(n,r)?n[r].push(t):n[r]=[t]}),m.indexBy=A(function(n,t,r){n[r]=t}),m.countBy=A(function(n,t,r){m.has(n,r)?n[r]++:n[r]=1}),m.toArray=function(n){return n?m.isArray(n)?l.call(n):w(n)?m.map(n,m.identity):m.values(n):[]},m.size=function(n){return null==n?0:w(n)?n.length:m.keys(n).length},m.partition=function(n,t,r){t=b(t,r);var e=[],u=[];return m.each(n,function(n,r,i){(t(n,r,i)?e:u).push(n)}),[e,u]},m.first=m.head=m.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:m.initial(n,n.length-t)},m.initial=function(n,t,r){return l.call(n,0,Math.max(0,n.length-(null==t||r?1:t)))},m.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:m.rest(n,Math.max(0,n.length-t))},m.rest=m.tail=m.drop=function(n,t,r){return l.call(n,null==t||r?1:t)},m.compact=function(n){return m.filter(n,m.identity)};var k=function(n,t,r,e){for(var u=[],i=0,o=e||0,a=n&&n.length;a>o;o++){var c=n[o];if(w(c)&&(m.isArray(c)||m.isArguments(c))){t||(c=k(c,t,r));var l=0,f=c.length;for(u.length+=f;f>l;)u[i++]=c[l++]}else r||(u[i++]=c)}return u};m.flatten=function(n,t){return k(n,t,!1)},m.without=function(n){return m.difference(n,l.call(arguments,1))},m.uniq=m.unique=function(n,t,r,e){if(null==n)return[];m.isBoolean(t)||(e=r,r=t,t=!1),null!=r&&(r=b(r,e));for(var u=[],i=[],o=0,a=n.length;a>o;o++){var c=n[o],l=r?r(c,o,n):c;t?(o&&i===l||u.push(c),i=l):r?m.contains(i,l)||(i.push(l),u.push(c)):m.contains(u,c)||u.push(c)}return u},m.union=function(){return m.uniq(k(arguments,!0,!0))},m.intersection=function(n){if(null==n)return[];for(var t=[],r=arguments.length,e=0,u=n.length;u>e;e++){var i=n[e];if(!m.contains(t,i)){for(var o=1;r>o&&m.contains(arguments[o],i);o++);o===r&&t.push(i)}}return t},m.difference=function(n){var t=k(arguments,!0,!0,1);return m.filter(n,function(n){return!m.contains(t,n)})},m.zip=function(){return m.unzip(arguments)},m.unzip=function(n){for(var t=n&&m.max(n,"length").length||0,r=Array(t),e=0;t>e;e++)r[e]=m.pluck(n,e);return r},m.object=function(n,t){for(var r={},e=0,u=n&&n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},m.indexOf=function(n,t,r){var e=0,u=n&&n.length;if("number"==typeof r)e=0>r?Math.max(0,u+r):r;else if(r&&u)return e=m.sortedIndex(n,t),n[e]===t?e:-1;if(t!==t)return m.findIndex(l.call(n,e),m.isNaN);for(;u>e;e++)if(n[e]===t)return e;return-1},m.lastIndexOf=function(n,t,r){var e=n?n.length:0;if("number"==typeof r&&(e=0>r?e+r+1:Math.min(e,r+1)),t!==t)return m.findLastIndex(l.call(n,0,e),m.isNaN);for(;--e>=0;)if(n[e]===t)return e;return-1},m.findIndex=t(1),m.findLastIndex=t(-1),m.sortedIndex=function(n,t,r,e){r=b(r,e,1);for(var u=r(t),i=0,o=n.length;o>i;){var a=Math.floor((i+o)/2);r(n[a])i;i++,n+=r)u[i]=n;return u};var O=function(n,t,r,e,u){if(!(e instanceof t))return n.apply(r,u);var i=_(n.prototype),o=n.apply(i,u);return m.isObject(o)?o:i};m.bind=function(n,t){if(v&&n.bind===v)return v.apply(n,l.call(arguments,1));if(!m.isFunction(n))throw new TypeError("Bind must be called on a function");var r=l.call(arguments,2),e=function(){return O(n,e,t,this,r.concat(l.call(arguments)))};return e},m.partial=function(n){var t=l.call(arguments,1),r=function(){for(var e=0,u=t.length,i=Array(u),o=0;u>o;o++)i[o]=t[o]===m?arguments[e++]:t[o];for(;e=e)throw new Error("bindAll must be passed function names");for(t=1;e>t;t++)r=arguments[t],n[r]=m.bind(n[r],n);return n},m.memoize=function(n,t){var r=function(e){var u=r.cache,i=""+(t?t.apply(this,arguments):e);return m.has(u,i)||(u[i]=n.apply(this,arguments)),u[i]};return r.cache={},r},m.delay=function(n,t){var r=l.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},m.defer=m.partial(m.delay,m,1),m.throttle=function(n,t,r){var e,u,i,o=null,a=0;r||(r={});var c=function(){a=r.leading===!1?0:m.now(),o=null,i=n.apply(e,u),o||(e=u=null)};return function(){var l=m.now();a||r.leading!==!1||(a=l);var f=t-(l-a);return e=this,u=arguments,0>=f||f>t?(o&&(clearTimeout(o),o=null),a=l,i=n.apply(e,u),o||(e=u=null)):o||r.trailing===!1||(o=setTimeout(c,f)),i}},m.debounce=function(n,t,r){var e,u,i,o,a,c=function(){var l=m.now()-o;t>l&&l>=0?e=setTimeout(c,t-l):(e=null,r||(a=n.apply(i,u),e||(i=u=null)))};return function(){i=this,u=arguments,o=m.now();var l=r&&!e;return e||(e=setTimeout(c,t)),l&&(a=n.apply(i,u),i=u=null),a}},m.wrap=function(n,t){return m.partial(t,n)},m.negate=function(n){return function(){return!n.apply(this,arguments)}},m.compose=function(){var n=arguments,t=n.length-1;return function(){for(var r=t,e=n[t].apply(this,arguments);r--;)e=n[r].call(this,e);return e}},m.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},m.before=function(n,t){var r;return function(){return--n>0&&(r=t.apply(this,arguments)),1>=n&&(t=null),r}},m.once=m.partial(m.before,2);var F=!{toString:null}.propertyIsEnumerable("toString"),S=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];m.keys=function(n){if(!m.isObject(n))return[];if(h)return h(n);var t=[];for(var e in n)m.has(n,e)&&t.push(e);return F&&r(n,t),t},m.allKeys=function(n){if(!m.isObject(n))return[];var t=[];for(var e in n)t.push(e);return F&&r(n,t),t},m.values=function(n){for(var t=m.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},m.mapObject=function(n,t,r){t=b(t,r);for(var e,u=m.keys(n),i=u.length,o={},a=0;i>a;a++)e=u[a],o[e]=t(n[e],e,n);return o},m.pairs=function(n){for(var t=m.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},m.invert=function(n){for(var t={},r=m.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},m.functions=m.methods=function(n){var t=[];for(var r in n)m.isFunction(n[r])&&t.push(r);return t.sort()},m.extend=x(m.allKeys),m.extendOwn=m.assign=x(m.keys),m.findKey=function(n,t,r){t=b(t,r);for(var e,u=m.keys(n),i=0,o=u.length;o>i;i++)if(e=u[i],t(n[e],e,n))return e},m.pick=function(n,t,r){var e,u,i={},o=n;if(null==o)return i;m.isFunction(t)?(u=m.allKeys(o),e=d(t,r)):(u=k(arguments,!1,!1,1),e=function(n,t,r){return t in r},o=Object(o));for(var a=0,c=u.length;c>a;a++){var l=u[a],f=o[l];e(f,l,o)&&(i[l]=f)}return i},m.omit=function(n,t,r){if(m.isFunction(t))t=m.negate(t);else{var e=m.map(k(arguments,!1,!1,1),String);t=function(n,t){return!m.contains(e,t)}}return m.pick(n,t,r)},m.defaults=x(m.allKeys,!0),m.clone=function(n){return m.isObject(n)?m.isArray(n)?n.slice():m.extend({},n):n},m.tap=function(n,t){return t(n),n},m.isMatch=function(n,t){var r=m.keys(t),e=r.length;if(null==n)return!e;for(var u=Object(n),i=0;e>i;i++){var o=r[i];if(t[o]!==u[o]||!(o in u))return!1}return!0};var E=function(n,t,r,e){if(n===t)return 0!==n||1/n===1/t;if(null==n||null==t)return n===t;n instanceof m&&(n=n._wrapped),t instanceof m&&(t=t._wrapped);var u=f.call(n);if(u!==f.call(t))return!1;switch(u){case"[object RegExp]":case"[object String]":return""+n==""+t;case"[object Number]":return+n!==+n?+t!==+t:0===+n?1/+n===1/t:+n===+t;case"[object Date]":case"[object Boolean]":return+n===+t}var i="[object Array]"===u;if(!i){if("object"!=typeof n||"object"!=typeof t)return!1;var o=n.constructor,a=t.constructor;if(o!==a&&!(m.isFunction(o)&&o instanceof o&&m.isFunction(a)&&a instanceof a)&&"constructor"in n&&"constructor"in t)return!1}r=r||[],e=e||[];for(var c=r.length;c--;)if(r[c]===n)return e[c]===t;if(r.push(n),e.push(t),i){if(c=n.length,c!==t.length)return!1;for(;c--;)if(!E(n[c],t[c],r,e))return!1}else{var l,s=m.keys(n);if(c=s.length,m.keys(t).length!==c)return!1;for(;c--;)if(l=s[c],!m.has(t,l)||!E(n[l],t[l],r,e))return!1}return r.pop(),e.pop(),!0};m.isEqual=function(n,t){return E(n,t)},m.isEmpty=function(n){return null==n?!0:w(n)&&(m.isArray(n)||m.isString(n)||m.isArguments(n))?0===n.length:0===m.keys(n).length},m.isElement=function(n){return!(!n||1!==n.nodeType)},m.isArray=p||function(n){return"[object Array]"===f.call(n)},m.isObject=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n},m.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(n){m["is"+n]=function(t){return f.call(t)==="[object "+n+"]"}}),m.isArguments(arguments)||(m.isArguments=function(n){return m.has(n,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(m.isFunction=function(n){return"function"==typeof n||!1}),m.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},m.isNaN=function(n){return m.isNumber(n)&&n!==+n},m.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"===f.call(n)},m.isNull=function(n){return null===n},m.isUndefined=function(n){return n===void 0},m.has=function(n,t){return null!=n&&s.call(n,t)},m.noConflict=function(){return e._=u,this},m.identity=function(n){return n},m.constant=function(n){return function(){return n}},m.noop=function(){},m.property=function(n){return function(t){return null==t?void 0:t[n]}},m.propertyOf=function(n){return null==n?function(){}:function(t){return n[t]}},m.matcher=m.matches=function(n){return n=m.extendOwn({},n),function(t){return m.isMatch(t,n)}},m.times=function(n,t,r){var e=Array(Math.max(0,n));t=d(t,r,1);for(var u=0;n>u;u++)e[u]=t(u);return e},m.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},m.now=Date.now||function(){return(new Date).getTime()};var M={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},N=m.invert(M),I=function(n){var t=function(t){return n[t]},r="(?:"+m.keys(n).join("|")+")",e=RegExp(r),u=RegExp(r,"g");return function(n){return n=null==n?"":""+n,e.test(n)?n.replace(u,t):n}};m.escape=I(M),m.unescape=I(N),m.result=function(n,t,r){var e=null==n?void 0:n[t];return e===void 0&&(e=r),m.isFunction(e)?e.call(n):e};var B=0;m.uniqueId=function(n){var t=++B+"";return n?n+t:t},m.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var T=/(.)^/,R={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},q=/\\|'|\r|\n|\u2028|\u2029/g,K=function(n){return"\\"+R[n]};m.template=function(n,t,r){!t&&r&&(t=r),t=m.defaults({},t,m.templateSettings);var e=RegExp([(t.escape||T).source,(t.interpolate||T).source,(t.evaluate||T).source].join("|")+"|$","g"),u=0,i="__p+='";n.replace(e,function(t,r,e,o,a){return i+=n.slice(u,a).replace(q,K),u=a+t.length,r?i+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":e?i+="'+\n((__t=("+e+"))==null?'':__t)+\n'":o&&(i+="';\n"+o+"\n__p+='"),t}),i+="';\n",t.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var o=new Function(t.variable||"obj","_",i)}catch(a){throw a.source=i,a}var c=function(n){return o.call(this,n,m)},l=t.variable||"obj";return c.source="function("+l+"){\n"+i+"}",c},m.chain=function(n){var t=m(n);return t._chain=!0,t};var z=function(n,t){return n._chain?m(t).chain():t};m.mixin=function(n){m.each(m.functions(n),function(t){var r=m[t]=n[t];m.prototype[t]=function(){var n=[this._wrapped];return c.apply(n,arguments),z(this,r.apply(m,n))}})},m.mixin(m),m.each(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=i[n];m.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!==n&&"splice"!==n||0!==r.length||delete r[0],z(this,r)}}),m.each(["concat","join","slice"],function(n){var t=i[n];m.prototype[n]=function(){return z(this,t.apply(this._wrapped,arguments))}}),m.prototype.value=function(){return this._wrapped},m.prototype.valueOf=m.prototype.toJSON=m.prototype.value,m.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return m})}).call(this); -//# sourceMappingURL=underscore-min.map \ No newline at end of file diff --git a/update_nation/node_modules/nano/node_modules/underscore/underscore-min.map b/update_nation/node_modules/nano/node_modules/underscore/underscore-min.map deleted file mode 100644 index b31e43590..000000000 --- a/update_nation/node_modules/nano/node_modules/underscore/underscore-min.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"underscore-min.js","sources":["underscore.js"],"names":["createReduce","dir","iterator","obj","iteratee","memo","keys","index","length","currentKey","context","optimizeCb","isArrayLike","_","arguments","createIndexFinder","array","predicate","cb","collectNonEnumProps","nonEnumIdx","nonEnumerableProps","constructor","proto","isFunction","prototype","ObjProto","prop","has","contains","push","root","this","previousUnderscore","ArrayProto","Array","Object","FuncProto","Function","slice","toString","hasOwnProperty","nativeIsArray","isArray","nativeKeys","nativeBind","bind","nativeCreate","create","Ctor","_wrapped","exports","module","VERSION","func","argCount","value","call","other","collection","accumulator","apply","identity","isObject","matcher","property","Infinity","createAssigner","keysFunc","undefinedOnly","source","l","i","key","baseCreate","result","MAX_ARRAY_INDEX","Math","pow","each","forEach","map","collect","results","reduce","foldl","inject","reduceRight","foldr","find","detect","findIndex","findKey","filter","select","list","reject","negate","every","all","some","any","includes","include","target","fromIndex","values","indexOf","invoke","method","args","isFunc","pluck","where","attrs","findWhere","max","computed","lastComputed","min","shuffle","rand","set","shuffled","random","sample","n","guard","sortBy","criteria","sort","left","right","a","b","group","behavior","groupBy","indexBy","countBy","toArray","size","partition","pass","fail","first","head","take","initial","last","rest","tail","drop","compact","flatten","input","shallow","strict","startIndex","output","idx","isArguments","j","len","without","difference","uniq","unique","isSorted","isBoolean","seen","union","intersection","argsLength","item","zip","unzip","object","sortedIndex","isNaN","lastIndexOf","from","findLastIndex","low","high","mid","floor","range","start","stop","step","ceil","executeBound","sourceFunc","boundFunc","callingContext","self","TypeError","bound","concat","partial","boundArgs","position","bindAll","Error","memoize","hasher","cache","address","delay","wait","setTimeout","defer","throttle","options","timeout","previous","later","leading","now","remaining","clearTimeout","trailing","debounce","immediate","timestamp","callNow","wrap","wrapper","compose","after","times","before","once","hasEnumBug","propertyIsEnumerable","allKeys","mapObject","pairs","invert","functions","methods","names","extend","extendOwn","assign","pick","oiteratee","omit","String","defaults","clone","tap","interceptor","isMatch","eq","aStack","bStack","className","areArrays","aCtor","bCtor","pop","isEqual","isEmpty","isString","isElement","nodeType","type","name","Int8Array","isFinite","parseFloat","isNumber","isNull","isUndefined","noConflict","constant","noop","propertyOf","matches","accum","Date","getTime","escapeMap","&","<",">","\"","'","`","unescapeMap","createEscaper","escaper","match","join","testRegexp","RegExp","replaceRegexp","string","test","replace","escape","unescape","fallback","idCounter","uniqueId","prefix","id","templateSettings","evaluate","interpolate","noMatch","escapes","\\","\r","\n","
","
","escapeChar","template","text","settings","oldSettings","offset","variable","render","e","data","argument","chain","instance","_chain","mixin","valueOf","toJSON","define","amd"],"mappings":";;;;CAKC,WAoKC,QAASA,GAAaC,GAGpB,QAASC,GAASC,EAAKC,EAAUC,EAAMC,EAAMC,EAAOC,GAClD,KAAOD,GAAS,GAAaC,EAARD,EAAgBA,GAASN,EAAK,CACjD,GAAIQ,GAAaH,EAAOA,EAAKC,GAASA,CACtCF,GAAOD,EAASC,EAAMF,EAAIM,GAAaA,EAAYN,GAErD,MAAOE,GAGT,MAAO,UAASF,EAAKC,EAAUC,EAAMK,GACnCN,EAAWO,EAAWP,EAAUM,EAAS,EACzC,IAAIJ,IAAQM,EAAYT,IAAQU,EAAEP,KAAKH,GACnCK,GAAUF,GAAQH,GAAKK,OACvBD,EAAQN,EAAM,EAAI,EAAIO,EAAS,CAMnC,OAJIM,WAAUN,OAAS,IACrBH,EAAOF,EAAIG,EAAOA,EAAKC,GAASA,GAChCA,GAASN,GAEJC,EAASC,EAAKC,EAAUC,EAAMC,EAAMC,EAAOC,IA+btD,QAASO,GAAkBd,GACzB,MAAO,UAASe,EAAOC,EAAWP,GAChCO,EAAYC,EAAGD,EAAWP,EAG1B,KAFA,GAAIF,GAAkB,MAATQ,GAAiBA,EAAMR,OAChCD,EAAQN,EAAM,EAAI,EAAIO,EAAS,EAC5BD,GAAS,GAAaC,EAARD,EAAgBA,GAASN,EAC5C,GAAIgB,EAAUD,EAAMT,GAAQA,EAAOS,GAAQ,MAAOT,EAEpD,QAAQ,GAgQZ,QAASY,GAAoBhB,EAAKG,GAChC,GAAIc,GAAaC,EAAmBb,OAChCc,EAAcnB,EAAImB,YAClBC,EAASV,EAAEW,WAAWF,IAAgBA,EAAYG,WAAcC,EAGhEC,EAAO,aAGX,KAFId,EAAEe,IAAIzB,EAAKwB,KAAUd,EAAEgB,SAASvB,EAAMqB,IAAOrB,EAAKwB,KAAKH,GAEpDP,KACLO,EAAON,EAAmBD,GACtBO,IAAQxB,IAAOA,EAAIwB,KAAUJ,EAAMI,KAAUd,EAAEgB,SAASvB,EAAMqB,IAChErB,EAAKwB,KAAKH,GAt4BhB,GAAII,GAAOC,KAGPC,EAAqBF,EAAKlB,EAG1BqB,EAAaC,MAAMV,UAAWC,EAAWU,OAAOX,UAAWY,EAAYC,SAASb,UAIlFK,EAAmBI,EAAWJ,KAC9BS,EAAmBL,EAAWK,MAC9BC,EAAmBd,EAASc,SAC5BC,EAAmBf,EAASe,eAK5BC,EAAqBP,MAAMQ,QAC3BC,EAAqBR,OAAO9B,KAC5BuC,EAAqBR,EAAUS,KAC/BC,EAAqBX,OAAOY,OAG1BC,EAAO,aAGPpC,EAAI,SAASV,GACf,MAAIA,aAAeU,GAAUV,EACvB6B,eAAgBnB,QACtBmB,KAAKkB,SAAW/C,GADiB,GAAIU,GAAEV,GAOlB,oBAAZgD,UACa,mBAAXC,SAA0BA,OAAOD,UAC1CA,QAAUC,OAAOD,QAAUtC,GAE7BsC,QAAQtC,EAAIA,GAEZkB,EAAKlB,EAAIA,EAIXA,EAAEwC,QAAU,OAKZ,IAAI1C,GAAa,SAAS2C,EAAM5C,EAAS6C,GACvC,GAAI7C,QAAiB,GAAG,MAAO4C,EAC/B,QAAoB,MAAZC,EAAmB,EAAIA,GAC7B,IAAK,GAAG,MAAO,UAASC,GACtB,MAAOF,GAAKG,KAAK/C,EAAS8C,GAE5B,KAAK,GAAG,MAAO,UAASA,EAAOE,GAC7B,MAAOJ,GAAKG,KAAK/C,EAAS8C,EAAOE,GAEnC,KAAK,GAAG,MAAO,UAASF,EAAOjD,EAAOoD,GACpC,MAAOL,GAAKG,KAAK/C,EAAS8C,EAAOjD,EAAOoD,GAE1C,KAAK,GAAG,MAAO,UAASC,EAAaJ,EAAOjD,EAAOoD,GACjD,MAAOL,GAAKG,KAAK/C,EAASkD,EAAaJ,EAAOjD,EAAOoD,IAGzD,MAAO,YACL,MAAOL,GAAKO,MAAMnD,EAASI,aAO3BI,EAAK,SAASsC,EAAO9C,EAAS6C,GAChC,MAAa,OAATC,EAAsB3C,EAAEiD,SACxBjD,EAAEW,WAAWgC,GAAe7C,EAAW6C,EAAO9C,EAAS6C,GACvD1C,EAAEkD,SAASP,GAAe3C,EAAEmD,QAAQR,GACjC3C,EAAEoD,SAAST,GAEpB3C,GAAET,SAAW,SAASoD,EAAO9C,GAC3B,MAAOQ,GAAGsC,EAAO9C,EAASwD,KAI5B,IAAIC,GAAiB,SAASC,EAAUC,GACtC,MAAO,UAASlE,GACd,GAAIK,GAASM,UAAUN,MACvB,IAAa,EAATA,GAAqB,MAAPL,EAAa,MAAOA,EACtC,KAAK,GAAII,GAAQ,EAAWC,EAARD,EAAgBA,IAIlC,IAAK,GAHD+D,GAASxD,UAAUP,GACnBD,EAAO8D,EAASE,GAChBC,EAAIjE,EAAKE,OACJgE,EAAI,EAAOD,EAAJC,EAAOA,IAAK,CAC1B,GAAIC,GAAMnE,EAAKkE,EACVH,IAAiBlE,EAAIsE,SAAc,KAAGtE,EAAIsE,GAAOH,EAAOG,IAGjE,MAAOtE,KAKPuE,EAAa,SAASjD,GACxB,IAAKZ,EAAEkD,SAAStC,GAAY,QAC5B,IAAIsB,EAAc,MAAOA,GAAatB,EACtCwB,GAAKxB,UAAYA,CACjB,IAAIkD,GAAS,GAAI1B,EAEjB,OADAA,GAAKxB,UAAY,KACVkD,GAMLC,EAAkBC,KAAKC,IAAI,EAAG,IAAM,EACpClE,EAAc,SAAS+C,GACzB,GAAInD,GAASmD,GAAcA,EAAWnD,MACtC,OAAwB,gBAAVA,IAAsBA,GAAU,GAAeoE,GAAVpE,EASrDK,GAAEkE,KAAOlE,EAAEmE,QAAU,SAAS7E,EAAKC,EAAUM,GAC3CN,EAAWO,EAAWP,EAAUM,EAChC,IAAI8D,GAAGhE,CACP,IAAII,EAAYT,GACd,IAAKqE,EAAI,EAAGhE,EAASL,EAAIK,OAAYA,EAAJgE,EAAYA,IAC3CpE,EAASD,EAAIqE,GAAIA,EAAGrE,OAEjB,CACL,GAAIG,GAAOO,EAAEP,KAAKH,EAClB,KAAKqE,EAAI,EAAGhE,EAASF,EAAKE,OAAYA,EAAJgE,EAAYA,IAC5CpE,EAASD,EAAIG,EAAKkE,IAAKlE,EAAKkE,GAAIrE,GAGpC,MAAOA,IAITU,EAAEoE,IAAMpE,EAAEqE,QAAU,SAAS/E,EAAKC,EAAUM,GAC1CN,EAAWc,EAAGd,EAAUM,EAIxB,KAAK,GAHDJ,IAAQM,EAAYT,IAAQU,EAAEP,KAAKH,GACnCK,GAAUF,GAAQH,GAAKK,OACvB2E,EAAUhD,MAAM3B,GACXD,EAAQ,EAAWC,EAARD,EAAgBA,IAAS,CAC3C,GAAIE,GAAaH,EAAOA,EAAKC,GAASA,CACtC4E,GAAQ5E,GAASH,EAASD,EAAIM,GAAaA,EAAYN,GAEzD,MAAOgF,IA+BTtE,EAAEuE,OAASvE,EAAEwE,MAAQxE,EAAEyE,OAAStF,EAAa,GAG7Ca,EAAE0E,YAAc1E,EAAE2E,MAAQxF,GAAc,GAGxCa,EAAE4E,KAAO5E,EAAE6E,OAAS,SAASvF,EAAKc,EAAWP,GAC3C,GAAI+D,EAMJ,OAJEA,GADE7D,EAAYT,GACRU,EAAE8E,UAAUxF,EAAKc,EAAWP,GAE5BG,EAAE+E,QAAQzF,EAAKc,EAAWP,GAE9B+D,QAAa,IAAKA,KAAS,EAAUtE,EAAIsE,GAA7C,QAKF5D,EAAEgF,OAAShF,EAAEiF,OAAS,SAAS3F,EAAKc,EAAWP,GAC7C,GAAIyE,KAKJ,OAJAlE,GAAYC,EAAGD,EAAWP,GAC1BG,EAAEkE,KAAK5E,EAAK,SAASqD,EAAOjD,EAAOwF,GAC7B9E,EAAUuC,EAAOjD,EAAOwF,IAAOZ,EAAQrD,KAAK0B,KAE3C2B,GAITtE,EAAEmF,OAAS,SAAS7F,EAAKc,EAAWP,GAClC,MAAOG,GAAEgF,OAAO1F,EAAKU,EAAEoF,OAAO/E,EAAGD,IAAaP,IAKhDG,EAAEqF,MAAQrF,EAAEsF,IAAM,SAAShG,EAAKc,EAAWP,GACzCO,EAAYC,EAAGD,EAAWP,EAG1B,KAAK,GAFDJ,IAAQM,EAAYT,IAAQU,EAAEP,KAAKH,GACnCK,GAAUF,GAAQH,GAAKK,OAClBD,EAAQ,EAAWC,EAARD,EAAgBA,IAAS,CAC3C,GAAIE,GAAaH,EAAOA,EAAKC,GAASA,CACtC,KAAKU,EAAUd,EAAIM,GAAaA,EAAYN,GAAM,OAAO,EAE3D,OAAO,GAKTU,EAAEuF,KAAOvF,EAAEwF,IAAM,SAASlG,EAAKc,EAAWP,GACxCO,EAAYC,EAAGD,EAAWP,EAG1B,KAAK,GAFDJ,IAAQM,EAAYT,IAAQU,EAAEP,KAAKH,GACnCK,GAAUF,GAAQH,GAAKK,OAClBD,EAAQ,EAAWC,EAARD,EAAgBA,IAAS,CAC3C,GAAIE,GAAaH,EAAOA,EAAKC,GAASA,CACtC,IAAIU,EAAUd,EAAIM,GAAaA,EAAYN,GAAM,OAAO,EAE1D,OAAO,GAKTU,EAAEgB,SAAWhB,EAAEyF,SAAWzF,EAAE0F,QAAU,SAASpG,EAAKqG,EAAQC,GAE1D,MADK7F,GAAYT,KAAMA,EAAMU,EAAE6F,OAAOvG,IAC/BU,EAAE8F,QAAQxG,EAAKqG,EAA4B,gBAAbC,IAAyBA,IAAc,GAI9E5F,EAAE+F,OAAS,SAASzG,EAAK0G,GACvB,GAAIC,GAAOvE,EAAMkB,KAAK3C,UAAW,GAC7BiG,EAASlG,EAAEW,WAAWqF,EAC1B,OAAOhG,GAAEoE,IAAI9E,EAAK,SAASqD,GACzB,GAAIF,GAAOyD,EAASF,EAASrD,EAAMqD,EACnC,OAAe,OAARvD,EAAeA,EAAOA,EAAKO,MAAML,EAAOsD,MAKnDjG,EAAEmG,MAAQ,SAAS7G,EAAKsE,GACtB,MAAO5D,GAAEoE,IAAI9E,EAAKU,EAAEoD,SAASQ,KAK/B5D,EAAEoG,MAAQ,SAAS9G,EAAK+G,GACtB,MAAOrG,GAAEgF,OAAO1F,EAAKU,EAAEmD,QAAQkD,KAKjCrG,EAAEsG,UAAY,SAAShH,EAAK+G,GAC1B,MAAOrG,GAAE4E,KAAKtF,EAAKU,EAAEmD,QAAQkD,KAI/BrG,EAAEuG,IAAM,SAASjH,EAAKC,EAAUM,GAC9B,GACI8C,GAAO6D,EADP1C,GAAUT,IAAUoD,GAAgBpD,GAExC,IAAgB,MAAZ9D,GAA2B,MAAPD,EAAa,CACnCA,EAAMS,EAAYT,GAAOA,EAAMU,EAAE6F,OAAOvG,EACxC,KAAK,GAAIqE,GAAI,EAAGhE,EAASL,EAAIK,OAAYA,EAAJgE,EAAYA,IAC/ChB,EAAQrD,EAAIqE,GACRhB,EAAQmB,IACVA,EAASnB,OAIbpD,GAAWc,EAAGd,EAAUM,GACxBG,EAAEkE,KAAK5E,EAAK,SAASqD,EAAOjD,EAAOwF,GACjCsB,EAAWjH,EAASoD,EAAOjD,EAAOwF,IAC9BsB,EAAWC,GAAgBD,KAAcnD,KAAYS,KAAYT,OACnES,EAASnB,EACT8D,EAAeD,IAIrB,OAAO1C,IAIT9D,EAAE0G,IAAM,SAASpH,EAAKC,EAAUM,GAC9B,GACI8C,GAAO6D,EADP1C,EAAST,IAAUoD,EAAepD,GAEtC,IAAgB,MAAZ9D,GAA2B,MAAPD,EAAa,CACnCA,EAAMS,EAAYT,GAAOA,EAAMU,EAAE6F,OAAOvG,EACxC,KAAK,GAAIqE,GAAI,EAAGhE,EAASL,EAAIK,OAAYA,EAAJgE,EAAYA,IAC/ChB,EAAQrD,EAAIqE,GACAG,EAARnB,IACFmB,EAASnB,OAIbpD,GAAWc,EAAGd,EAAUM,GACxBG,EAAEkE,KAAK5E,EAAK,SAASqD,EAAOjD,EAAOwF,GACjCsB,EAAWjH,EAASoD,EAAOjD,EAAOwF,IACnBuB,EAAXD,GAAwCnD,MAAbmD,GAAoCnD,MAAXS,KACtDA,EAASnB,EACT8D,EAAeD,IAIrB,OAAO1C,IAKT9D,EAAE2G,QAAU,SAASrH,GAInB,IAAK,GAAesH,GAHhBC,EAAM9G,EAAYT,GAAOA,EAAMU,EAAE6F,OAAOvG,GACxCK,EAASkH,EAAIlH,OACbmH,EAAWxF,MAAM3B,GACZD,EAAQ,EAAiBC,EAARD,EAAgBA,IACxCkH,EAAO5G,EAAE+G,OAAO,EAAGrH,GACfkH,IAASlH,IAAOoH,EAASpH,GAASoH,EAASF,IAC/CE,EAASF,GAAQC,EAAInH,EAEvB,OAAOoH,IAMT9G,EAAEgH,OAAS,SAAS1H,EAAK2H,EAAGC,GAC1B,MAAS,OAALD,GAAaC,GACVnH,EAAYT,KAAMA,EAAMU,EAAE6F,OAAOvG,IAC/BA,EAAIU,EAAE+G,OAAOzH,EAAIK,OAAS,KAE5BK,EAAE2G,QAAQrH,GAAKoC,MAAM,EAAGsC,KAAKuC,IAAI,EAAGU,KAI7CjH,EAAEmH,OAAS,SAAS7H,EAAKC,EAAUM,GAEjC,MADAN,GAAWc,EAAGd,EAAUM,GACjBG,EAAEmG,MAAMnG,EAAEoE,IAAI9E,EAAK,SAASqD,EAAOjD,EAAOwF,GAC/C,OACEvC,MAAOA,EACPjD,MAAOA,EACP0H,SAAU7H,EAASoD,EAAOjD,EAAOwF,MAElCmC,KAAK,SAASC,EAAMC,GACrB,GAAIC,GAAIF,EAAKF,SACTK,EAAIF,EAAMH,QACd,IAAII,IAAMC,EAAG,CACX,GAAID,EAAIC,GAAKD,QAAW,GAAG,MAAO,EAClC,IAAQC,EAAJD,GAASC,QAAW,GAAG,OAAQ,EAErC,MAAOH,GAAK5H,MAAQ6H,EAAM7H,QACxB,SAIN,IAAIgI,GAAQ,SAASC,GACnB,MAAO,UAASrI,EAAKC,EAAUM,GAC7B,GAAIiE,KAMJ,OALAvE,GAAWc,EAAGd,EAAUM,GACxBG,EAAEkE,KAAK5E,EAAK,SAASqD,EAAOjD,GAC1B,GAAIkE,GAAMrE,EAASoD,EAAOjD,EAAOJ,EACjCqI,GAAS7D,EAAQnB,EAAOiB,KAEnBE,GAMX9D,GAAE4H,QAAUF,EAAM,SAAS5D,EAAQnB,EAAOiB,GACpC5D,EAAEe,IAAI+C,EAAQF,GAAME,EAAOF,GAAK3C,KAAK0B,GAAamB,EAAOF,IAAQjB,KAKvE3C,EAAE6H,QAAUH,EAAM,SAAS5D,EAAQnB,EAAOiB,GACxCE,EAAOF,GAAOjB,IAMhB3C,EAAE8H,QAAUJ,EAAM,SAAS5D,EAAQnB,EAAOiB,GACpC5D,EAAEe,IAAI+C,EAAQF,GAAME,EAAOF,KAAaE,EAAOF,GAAO,IAI5D5D,EAAE+H,QAAU,SAASzI,GACnB,MAAKA,GACDU,EAAE8B,QAAQxC,GAAaoC,EAAMkB,KAAKtD,GAClCS,EAAYT,GAAaU,EAAEoE,IAAI9E,EAAKU,EAAEiD,UACnCjD,EAAE6F,OAAOvG,OAIlBU,EAAEgI,KAAO,SAAS1I,GAChB,MAAW,OAAPA,EAAoB,EACjBS,EAAYT,GAAOA,EAAIK,OAASK,EAAEP,KAAKH,GAAKK,QAKrDK,EAAEiI,UAAY,SAAS3I,EAAKc,EAAWP,GACrCO,EAAYC,EAAGD,EAAWP,EAC1B,IAAIqI,MAAWC,IAIf,OAHAnI,GAAEkE,KAAK5E,EAAK,SAASqD,EAAOiB,EAAKtE,IAC9Bc,EAAUuC,EAAOiB,EAAKtE,GAAO4I,EAAOC,GAAMlH,KAAK0B,MAE1CuF,EAAMC,IAShBnI,EAAEoI,MAAQpI,EAAEqI,KAAOrI,EAAEsI,KAAO,SAASnI,EAAO8G,EAAGC,GAC7C,MAAa,OAAT/G,MAA2B,GACtB,MAAL8G,GAAaC,EAAc/G,EAAM,GAC9BH,EAAEuI,QAAQpI,EAAOA,EAAMR,OAASsH,IAMzCjH,EAAEuI,QAAU,SAASpI,EAAO8G,EAAGC,GAC7B,MAAOxF,GAAMkB,KAAKzC,EAAO,EAAG6D,KAAKuC,IAAI,EAAGpG,EAAMR,QAAe,MAALsH,GAAaC,EAAQ,EAAID,MAKnFjH,EAAEwI,KAAO,SAASrI,EAAO8G,EAAGC,GAC1B,MAAa,OAAT/G,MAA2B,GACtB,MAAL8G,GAAaC,EAAc/G,EAAMA,EAAMR,OAAS,GAC7CK,EAAEyI,KAAKtI,EAAO6D,KAAKuC,IAAI,EAAGpG,EAAMR,OAASsH,KAMlDjH,EAAEyI,KAAOzI,EAAE0I,KAAO1I,EAAE2I,KAAO,SAASxI,EAAO8G,EAAGC,GAC5C,MAAOxF,GAAMkB,KAAKzC,EAAY,MAAL8G,GAAaC,EAAQ,EAAID,IAIpDjH,EAAE4I,QAAU,SAASzI,GACnB,MAAOH,GAAEgF,OAAO7E,EAAOH,EAAEiD,UAI3B,IAAI4F,GAAU,SAASC,EAAOC,EAASC,EAAQC,GAE7C,IAAK,GADDC,MAAaC,EAAM,EACdxF,EAAIsF,GAAc,EAAGtJ,EAASmJ,GAASA,EAAMnJ,OAAYA,EAAJgE,EAAYA,IAAK,CAC7E,GAAIhB,GAAQmG,EAAMnF,EAClB,IAAI5D,EAAY4C,KAAW3C,EAAE8B,QAAQa,IAAU3C,EAAEoJ,YAAYzG,IAAS,CAE/DoG,IAASpG,EAAQkG,EAAQlG,EAAOoG,EAASC,GAC9C,IAAIK,GAAI,EAAGC,EAAM3G,EAAMhD,MAEvB,KADAuJ,EAAOvJ,QAAU2J,EACNA,EAAJD,GACLH,EAAOC,KAASxG,EAAM0G,SAEdL,KACVE,EAAOC,KAASxG,GAGpB,MAAOuG,GAITlJ,GAAE6I,QAAU,SAAS1I,EAAO4I,GAC1B,MAAOF,GAAQ1I,EAAO4I,GAAS,IAIjC/I,EAAEuJ,QAAU,SAASpJ,GACnB,MAAOH,GAAEwJ,WAAWrJ,EAAOuB,EAAMkB,KAAK3C,UAAW,KAMnDD,EAAEyJ,KAAOzJ,EAAE0J,OAAS,SAASvJ,EAAOwJ,EAAUpK,EAAUM,GACtD,GAAa,MAATM,EAAe,QACdH,GAAE4J,UAAUD,KACf9J,EAAUN,EACVA,EAAWoK,EACXA,GAAW,GAEG,MAAZpK,IAAkBA,EAAWc,EAAGd,EAAUM,GAG9C,KAAK,GAFDiE,MACA+F,KACKlG,EAAI,EAAGhE,EAASQ,EAAMR,OAAYA,EAAJgE,EAAYA,IAAK,CACtD,GAAIhB,GAAQxC,EAAMwD,GACd6C,EAAWjH,EAAWA,EAASoD,EAAOgB,EAAGxD,GAASwC,CAClDgH,IACGhG,GAAKkG,IAASrD,GAAU1C,EAAO7C,KAAK0B,GACzCkH,EAAOrD,GACEjH,EACJS,EAAEgB,SAAS6I,EAAMrD,KACpBqD,EAAK5I,KAAKuF,GACV1C,EAAO7C,KAAK0B,IAEJ3C,EAAEgB,SAAS8C,EAAQnB,IAC7BmB,EAAO7C,KAAK0B,GAGhB,MAAOmB,IAKT9D,EAAE8J,MAAQ,WACR,MAAO9J,GAAEyJ,KAAKZ,EAAQ5I,WAAW,GAAM,KAKzCD,EAAE+J,aAAe,SAAS5J,GACxB,GAAa,MAATA,EAAe,QAGnB,KAAK,GAFD2D,MACAkG,EAAa/J,UAAUN,OAClBgE,EAAI,EAAGhE,EAASQ,EAAMR,OAAYA,EAAJgE,EAAYA,IAAK,CACtD,GAAIsG,GAAO9J,EAAMwD,EACjB,KAAI3D,EAAEgB,SAAS8C,EAAQmG,GAAvB,CACA,IAAK,GAAIZ,GAAI,EAAOW,EAAJX,GACTrJ,EAAEgB,SAASf,UAAUoJ,GAAIY,GADAZ,KAG5BA,IAAMW,GAAYlG,EAAO7C,KAAKgJ,IAEpC,MAAOnG,IAKT9D,EAAEwJ,WAAa,SAASrJ,GACtB,GAAIsI,GAAOI,EAAQ5I,WAAW,GAAM,EAAM,EAC1C,OAAOD,GAAEgF,OAAO7E,EAAO,SAASwC,GAC9B,OAAQ3C,EAAEgB,SAASyH,EAAM9F,MAM7B3C,EAAEkK,IAAM,WACN,MAAOlK,GAAEmK,MAAMlK,YAKjBD,EAAEmK,MAAQ,SAAShK,GAIjB,IAAK,GAHDR,GAASQ,GAASH,EAAEuG,IAAIpG,EAAO,UAAUR,QAAU,EACnDmE,EAASxC,MAAM3B,GAEVD,EAAQ,EAAWC,EAARD,EAAgBA,IAClCoE,EAAOpE,GAASM,EAAEmG,MAAMhG,EAAOT,EAEjC,OAAOoE,IAMT9D,EAAEoK,OAAS,SAASlF,EAAMW,GAExB,IAAK,GADD/B,MACKH,EAAI,EAAGhE,EAASuF,GAAQA,EAAKvF,OAAYA,EAAJgE,EAAYA,IACpDkC,EACF/B,EAAOoB,EAAKvB,IAAMkC,EAAOlC,GAEzBG,EAAOoB,EAAKvB,GAAG,IAAMuB,EAAKvB,GAAG,EAGjC,OAAOG,IAOT9D,EAAE8F,QAAU,SAAS3F,EAAO8J,EAAMN,GAChC,GAAIhG,GAAI,EAAGhE,EAASQ,GAASA,EAAMR,MACnC,IAAuB,gBAAZgK,GACThG,EAAe,EAAXgG,EAAe3F,KAAKuC,IAAI,EAAG5G,EAASgK,GAAYA,MAC/C,IAAIA,GAAYhK,EAErB,MADAgE,GAAI3D,EAAEqK,YAAYlK,EAAO8J,GAClB9J,EAAMwD,KAAOsG,EAAOtG,GAAK,CAElC,IAAIsG,IAASA,EACX,MAAOjK,GAAE8E,UAAUpD,EAAMkB,KAAKzC,EAAOwD,GAAI3D,EAAEsK,MAE7C,MAAW3K,EAAJgE,EAAYA,IAAK,GAAIxD,EAAMwD,KAAOsG,EAAM,MAAOtG,EACtD,QAAQ,GAGV3D,EAAEuK,YAAc,SAASpK,EAAO8J,EAAMO,GACpC,GAAIrB,GAAMhJ,EAAQA,EAAMR,OAAS,CAIjC,IAHmB,gBAAR6K,KACTrB,EAAa,EAAPqB,EAAWrB,EAAMqB,EAAO,EAAIxG,KAAK0C,IAAIyC,EAAKqB,EAAO,IAErDP,IAASA,EACX,MAAOjK,GAAEyK,cAAc/I,EAAMkB,KAAKzC,EAAO,EAAGgJ,GAAMnJ,EAAEsK,MAEtD,QAASnB,GAAO,GAAG,GAAIhJ,EAAMgJ,KAASc,EAAM,MAAOd,EACnD,QAAQ,GAiBVnJ,EAAE8E,UAAY5E,EAAkB,GAEhCF,EAAEyK,cAAgBvK,GAAmB,GAIrCF,EAAEqK,YAAc,SAASlK,EAAOb,EAAKC,EAAUM,GAC7CN,EAAWc,EAAGd,EAAUM,EAAS,EAGjC,KAFA,GAAI8C,GAAQpD,EAASD,GACjBoL,EAAM,EAAGC,EAAOxK,EAAMR,OACbgL,EAAND,GAAY,CACjB,GAAIE,GAAM5G,KAAK6G,OAAOH,EAAMC,GAAQ,EAChCpL,GAASY,EAAMyK,IAAQjI,EAAO+H,EAAME,EAAM,EAAQD,EAAOC,EAE/D,MAAOF,IAMT1K,EAAE8K,MAAQ,SAASC,EAAOC,EAAMC,GAC1BhL,UAAUN,QAAU,IACtBqL,EAAOD,GAAS,EAChBA,EAAQ,GAEVE,EAAOA,GAAQ,CAKf,KAAK,GAHDtL,GAASqE,KAAKuC,IAAIvC,KAAKkH,MAAMF,EAAOD,GAASE,GAAO,GACpDH,EAAQxJ,MAAM3B,GAETwJ,EAAM,EAASxJ,EAANwJ,EAAcA,IAAO4B,GAASE,EAC9CH,EAAM3B,GAAO4B,CAGf,OAAOD,GAQT,IAAIK,GAAe,SAASC,EAAYC,EAAWxL,EAASyL,EAAgBrF,GAC1E,KAAMqF,YAA0BD,IAAY,MAAOD,GAAWpI,MAAMnD,EAASoG,EAC7E,IAAIsF,GAAO1H,EAAWuH,EAAWxK,WAC7BkD,EAASsH,EAAWpI,MAAMuI,EAAMtF,EACpC,OAAIjG,GAAEkD,SAASY,GAAgBA,EACxByH,EAMTvL,GAAEiC,KAAO,SAASQ,EAAM5C,GACtB,GAAImC,GAAcS,EAAKR,OAASD,EAAY,MAAOA,GAAWgB,MAAMP,EAAMf,EAAMkB,KAAK3C,UAAW,GAChG,KAAKD,EAAEW,WAAW8B,GAAO,KAAM,IAAI+I,WAAU,oCAC7C,IAAIvF,GAAOvE,EAAMkB,KAAK3C,UAAW,GAC7BwL,EAAQ,WACV,MAAON,GAAa1I,EAAMgJ,EAAO5L,EAASsB,KAAM8E,EAAKyF,OAAOhK,EAAMkB,KAAK3C,aAEzE,OAAOwL,IAMTzL,EAAE2L,QAAU,SAASlJ,GACnB,GAAImJ,GAAYlK,EAAMkB,KAAK3C,UAAW,GAClCwL,EAAQ,WAGV,IAAK,GAFDI,GAAW,EAAGlM,EAASiM,EAAUjM,OACjCsG,EAAO3E,MAAM3B,GACRgE,EAAI,EAAOhE,EAAJgE,EAAYA,IAC1BsC,EAAKtC,GAAKiI,EAAUjI,KAAO3D,EAAIC,UAAU4L,KAAcD,EAAUjI,EAEnE,MAAOkI,EAAW5L,UAAUN,QAAQsG,EAAKhF,KAAKhB,UAAU4L,KACxD,OAAOV,GAAa1I,EAAMgJ,EAAOtK,KAAMA,KAAM8E,GAE/C,OAAOwF,IAMTzL,EAAE8L,QAAU,SAASxM,GACnB,GAAIqE,GAA8BC,EAA3BjE,EAASM,UAAUN,MAC1B,IAAc,GAAVA,EAAa,KAAM,IAAIoM,OAAM,wCACjC,KAAKpI,EAAI,EAAOhE,EAAJgE,EAAYA,IACtBC,EAAM3D,UAAU0D,GAChBrE,EAAIsE,GAAO5D,EAAEiC,KAAK3C,EAAIsE,GAAMtE,EAE9B,OAAOA,IAITU,EAAEgM,QAAU,SAASvJ,EAAMwJ,GACzB,GAAID,GAAU,SAASpI,GACrB,GAAIsI,GAAQF,EAAQE,MAChBC,EAAU,IAAMF,EAASA,EAAOjJ,MAAM7B,KAAMlB,WAAa2D,EAE7D,OADK5D,GAAEe,IAAImL,EAAOC,KAAUD,EAAMC,GAAW1J,EAAKO,MAAM7B,KAAMlB,YACvDiM,EAAMC,GAGf,OADAH,GAAQE,SACDF,GAKThM,EAAEoM,MAAQ,SAAS3J,EAAM4J,GACvB,GAAIpG,GAAOvE,EAAMkB,KAAK3C,UAAW,EACjC,OAAOqM,YAAW,WAChB,MAAO7J,GAAKO,MAAM,KAAMiD,IACvBoG,IAKLrM,EAAEuM,MAAQvM,EAAE2L,QAAQ3L,EAAEoM,MAAOpM,EAAG,GAOhCA,EAAEwM,SAAW,SAAS/J,EAAM4J,EAAMI,GAChC,GAAI5M,GAASoG,EAAMnC,EACf4I,EAAU,KACVC,EAAW,CACVF,KAASA,KACd,IAAIG,GAAQ,WACVD,EAAWF,EAAQI,WAAY,EAAQ,EAAI7M,EAAE8M,MAC7CJ,EAAU,KACV5I,EAASrB,EAAKO,MAAMnD,EAASoG,GACxByG,IAAS7M,EAAUoG,EAAO,MAEjC,OAAO,YACL,GAAI6G,GAAM9M,EAAE8M,KACPH,IAAYF,EAAQI,WAAY,IAAOF,EAAWG,EACvD,IAAIC,GAAYV,GAAQS,EAAMH,EAc9B,OAbA9M,GAAUsB,KACV8E,EAAOhG,UACU,GAAb8M,GAAkBA,EAAYV,GAC5BK,IACFM,aAAaN,GACbA,EAAU,MAEZC,EAAWG,EACXhJ,EAASrB,EAAKO,MAAMnD,EAASoG,GACxByG,IAAS7M,EAAUoG,EAAO,OACrByG,GAAWD,EAAQQ,YAAa,IAC1CP,EAAUJ,WAAWM,EAAOG,IAEvBjJ,IAQX9D,EAAEkN,SAAW,SAASzK,EAAM4J,EAAMc,GAChC,GAAIT,GAASzG,EAAMpG,EAASuN,EAAWtJ,EAEnC8I,EAAQ,WACV,GAAIpE,GAAOxI,EAAE8M,MAAQM,CAEVf,GAAP7D,GAAeA,GAAQ,EACzBkE,EAAUJ,WAAWM,EAAOP,EAAO7D,IAEnCkE,EAAU,KACLS,IACHrJ,EAASrB,EAAKO,MAAMnD,EAASoG,GACxByG,IAAS7M,EAAUoG,EAAO,QAKrC,OAAO,YACLpG,EAAUsB,KACV8E,EAAOhG,UACPmN,EAAYpN,EAAE8M,KACd,IAAIO,GAAUF,IAAcT,CAO5B,OANKA,KAASA,EAAUJ,WAAWM,EAAOP,IACtCgB,IACFvJ,EAASrB,EAAKO,MAAMnD,EAASoG,GAC7BpG,EAAUoG,EAAO,MAGZnC,IAOX9D,EAAEsN,KAAO,SAAS7K,EAAM8K,GACtB,MAAOvN,GAAE2L,QAAQ4B,EAAS9K,IAI5BzC,EAAEoF,OAAS,SAAShF,GAClB,MAAO,YACL,OAAQA,EAAU4C,MAAM7B,KAAMlB,aAMlCD,EAAEwN,QAAU,WACV,GAAIvH,GAAOhG,UACP8K,EAAQ9E,EAAKtG,OAAS,CAC1B,OAAO,YAGL,IAFA,GAAIgE,GAAIoH,EACJjH,EAASmC,EAAK8E,GAAO/H,MAAM7B,KAAMlB,WAC9B0D,KAAKG,EAASmC,EAAKtC,GAAGf,KAAKzB,KAAM2C,EACxC,OAAOA,KAKX9D,EAAEyN,MAAQ,SAASC,EAAOjL,GACxB,MAAO,YACL,QAAMiL,EAAQ,EACLjL,EAAKO,MAAM7B,KAAMlB,WAD1B,SAOJD,EAAE2N,OAAS,SAASD,EAAOjL,GACzB,GAAIjD,EACJ,OAAO,YAKL,QAJMkO,EAAQ,IACZlO,EAAOiD,EAAKO,MAAM7B,KAAMlB,YAEb,GAATyN,IAAYjL,EAAO,MAChBjD,IAMXQ,EAAE4N,KAAO5N,EAAE2L,QAAQ3L,EAAE2N,OAAQ,EAM7B,IAAIE,KAAelM,SAAU,MAAMmM,qBAAqB,YACpDtN,GAAsB,UAAW,gBAAiB,WAClC,uBAAwB,iBAAkB,iBAqB9DR,GAAEP,KAAO,SAASH,GAChB,IAAKU,EAAEkD,SAAS5D,GAAM,QACtB,IAAIyC,EAAY,MAAOA,GAAWzC,EAClC,IAAIG,KACJ,KAAK,GAAImE,KAAOtE,GAASU,EAAEe,IAAIzB,EAAKsE,IAAMnE,EAAKwB,KAAK2C,EAGpD,OADIiK,IAAYvN,EAAoBhB,EAAKG,GAClCA,GAITO,EAAE+N,QAAU,SAASzO,GACnB,IAAKU,EAAEkD,SAAS5D,GAAM,QACtB,IAAIG,KACJ,KAAK,GAAImE,KAAOtE,GAAKG,EAAKwB,KAAK2C,EAG/B,OADIiK,IAAYvN,EAAoBhB,EAAKG,GAClCA,GAITO,EAAE6F,OAAS,SAASvG,GAIlB,IAAK,GAHDG,GAAOO,EAAEP,KAAKH,GACdK,EAASF,EAAKE,OACdkG,EAASvE,MAAM3B,GACVgE,EAAI,EAAOhE,EAAJgE,EAAYA,IAC1BkC,EAAOlC,GAAKrE,EAAIG,EAAKkE,GAEvB,OAAOkC,IAKT7F,EAAEgO,UAAY,SAAS1O,EAAKC,EAAUM,GACpCN,EAAWc,EAAGd,EAAUM,EAKtB,KAAK,GADDD,GAHFH,EAAQO,EAAEP,KAAKH,GACbK,EAASF,EAAKE,OACd2E,KAEK5E,EAAQ,EAAWC,EAARD,EAAgBA,IAClCE,EAAaH,EAAKC,GAClB4E,EAAQ1E,GAAcL,EAASD,EAAIM,GAAaA,EAAYN,EAE9D,OAAOgF,IAIXtE,EAAEiO,MAAQ,SAAS3O,GAIjB,IAAK,GAHDG,GAAOO,EAAEP,KAAKH,GACdK,EAASF,EAAKE,OACdsO,EAAQ3M,MAAM3B,GACTgE,EAAI,EAAOhE,EAAJgE,EAAYA,IAC1BsK,EAAMtK,IAAMlE,EAAKkE,GAAIrE,EAAIG,EAAKkE,IAEhC,OAAOsK,IAITjO,EAAEkO,OAAS,SAAS5O,GAGlB,IAAK,GAFDwE,MACArE,EAAOO,EAAEP,KAAKH,GACTqE,EAAI,EAAGhE,EAASF,EAAKE,OAAYA,EAAJgE,EAAYA,IAChDG,EAAOxE,EAAIG,EAAKkE,KAAOlE,EAAKkE,EAE9B,OAAOG,IAKT9D,EAAEmO,UAAYnO,EAAEoO,QAAU,SAAS9O,GACjC,GAAI+O,KACJ,KAAK,GAAIzK,KAAOtE,GACVU,EAAEW,WAAWrB,EAAIsE,KAAOyK,EAAMpN,KAAK2C,EAEzC,OAAOyK,GAAMhH,QAIfrH,EAAEsO,OAAShL,EAAetD,EAAE+N,SAI5B/N,EAAEuO,UAAYvO,EAAEwO,OAASlL,EAAetD,EAAEP,MAG1CO,EAAE+E,QAAU,SAASzF,EAAKc,EAAWP,GACnCO,EAAYC,EAAGD,EAAWP,EAE1B,KAAK,GADmB+D,GAApBnE,EAAOO,EAAEP,KAAKH,GACTqE,EAAI,EAAGhE,EAASF,EAAKE,OAAYA,EAAJgE,EAAYA,IAEhD,GADAC,EAAMnE,EAAKkE,GACPvD,EAAUd,EAAIsE,GAAMA,EAAKtE,GAAM,MAAOsE,IAK9C5D,EAAEyO,KAAO,SAASrE,EAAQsE,EAAW7O,GACnC,GAA+BN,GAAUE,EAArCqE,KAAaxE,EAAM8K,CACvB,IAAW,MAAP9K,EAAa,MAAOwE,EACpB9D,GAAEW,WAAW+N,IACfjP,EAAOO,EAAE+N,QAAQzO,GACjBC,EAAWO,EAAW4O,EAAW7O,KAEjCJ,EAAOoJ,EAAQ5I,WAAW,GAAO,EAAO,GACxCV,EAAW,SAASoD,EAAOiB,EAAKtE,GAAO,MAAOsE,KAAOtE,IACrDA,EAAMiC,OAAOjC,GAEf,KAAK,GAAIqE,GAAI,EAAGhE,EAASF,EAAKE,OAAYA,EAAJgE,EAAYA,IAAK,CACrD,GAAIC,GAAMnE,EAAKkE,GACXhB,EAAQrD,EAAIsE,EACZrE,GAASoD,EAAOiB,EAAKtE,KAAMwE,EAAOF,GAAOjB,GAE/C,MAAOmB,IAIT9D,EAAE2O,KAAO,SAASrP,EAAKC,EAAUM,GAC/B,GAAIG,EAAEW,WAAWpB,GACfA,EAAWS,EAAEoF,OAAO7F,OACf,CACL,GAAIE,GAAOO,EAAEoE,IAAIyE,EAAQ5I,WAAW,GAAO,EAAO,GAAI2O,OACtDrP,GAAW,SAASoD,EAAOiB,GACzB,OAAQ5D,EAAEgB,SAASvB,EAAMmE,IAG7B,MAAO5D,GAAEyO,KAAKnP,EAAKC,EAAUM,IAI/BG,EAAE6O,SAAWvL,EAAetD,EAAE+N,SAAS,GAGvC/N,EAAE8O,MAAQ,SAASxP,GACjB,MAAKU,GAAEkD,SAAS5D,GACTU,EAAE8B,QAAQxC,GAAOA,EAAIoC,QAAU1B,EAAEsO,UAAWhP,GADtBA,GAO/BU,EAAE+O,IAAM,SAASzP,EAAK0P,GAEpB,MADAA,GAAY1P,GACLA,GAITU,EAAEiP,QAAU,SAAS7E,EAAQ/D,GAC3B,GAAI5G,GAAOO,EAAEP,KAAK4G,GAAQ1G,EAASF,EAAKE,MACxC,IAAc,MAAVyK,EAAgB,OAAQzK,CAE5B,KAAK,GADDL,GAAMiC,OAAO6I,GACRzG,EAAI,EAAOhE,EAAJgE,EAAYA,IAAK,CAC/B,GAAIC,GAAMnE,EAAKkE,EACf,IAAI0C,EAAMzC,KAAStE,EAAIsE,MAAUA,IAAOtE,IAAM,OAAO,EAEvD,OAAO,EAKT,IAAI4P,GAAK,SAAS1H,EAAGC,EAAG0H,EAAQC,GAG9B,GAAI5H,IAAMC,EAAG,MAAa,KAAND,GAAW,EAAIA,IAAM,EAAIC,CAE7C,IAAS,MAALD,GAAkB,MAALC,EAAW,MAAOD,KAAMC,CAErCD,aAAaxH,KAAGwH,EAAIA,EAAEnF,UACtBoF,YAAazH,KAAGyH,EAAIA,EAAEpF,SAE1B,IAAIgN,GAAY1N,EAASiB,KAAK4E,EAC9B,IAAI6H,IAAc1N,EAASiB,KAAK6E,GAAI,OAAO,CAC3C,QAAQ4H,GAEN,IAAK,kBAEL,IAAK,kBAGH,MAAO,GAAK7H,GAAM,GAAKC,CACzB,KAAK,kBAGH,OAAKD,KAAOA,GAAWC,KAAOA,EAEhB,KAAND,EAAU,GAAKA,IAAM,EAAIC,GAAKD,KAAOC,CAC/C,KAAK,gBACL,IAAK,mBAIH,OAAQD,KAAOC,EAGnB,GAAI6H,GAA0B,mBAAdD,CAChB,KAAKC,EAAW,CACd,GAAgB,gBAAL9H,IAA6B,gBAALC,GAAe,OAAO,CAIzD,IAAI8H,GAAQ/H,EAAE/G,YAAa+O,EAAQ/H,EAAEhH,WACrC,IAAI8O,IAAUC,KAAWxP,EAAEW,WAAW4O,IAAUA,YAAiBA,IACxCvP,EAAEW,WAAW6O,IAAUA,YAAiBA,KACzC,eAAiBhI,IAAK,eAAiBC,GAC7D,OAAO,EAQX0H,EAASA,MACTC,EAASA,KAET,KADA,GAAIzP,GAASwP,EAAOxP,OACbA,KAGL,GAAIwP,EAAOxP,KAAY6H,EAAG,MAAO4H,GAAOzP,KAAY8H,CAQtD,IAJA0H,EAAOlO,KAAKuG,GACZ4H,EAAOnO,KAAKwG,GAGR6H,EAAW,CAGb,GADA3P,EAAS6H,EAAE7H,OACPA,IAAW8H,EAAE9H,OAAQ,OAAO,CAEhC,MAAOA,KACL,IAAKuP,EAAG1H,EAAE7H,GAAS8H,EAAE9H,GAASwP,EAAQC,GAAS,OAAO,MAEnD,CAEL,GAAsBxL,GAAlBnE,EAAOO,EAAEP,KAAK+H,EAGlB,IAFA7H,EAASF,EAAKE,OAEVK,EAAEP,KAAKgI,GAAG9H,SAAWA,EAAQ,OAAO,CACxC,MAAOA,KAGL,GADAiE,EAAMnE,EAAKE,IACLK,EAAEe,IAAI0G,EAAG7D,KAAQsL,EAAG1H,EAAE5D,GAAM6D,EAAE7D,GAAMuL,EAAQC,GAAU,OAAO,EAMvE,MAFAD,GAAOM,MACPL,EAAOK,OACA,EAITzP,GAAE0P,QAAU,SAASlI,EAAGC,GACtB,MAAOyH,GAAG1H,EAAGC,IAKfzH,EAAE2P,QAAU,SAASrQ,GACnB,MAAW,OAAPA,GAAoB,EACpBS,EAAYT,KAASU,EAAE8B,QAAQxC,IAAQU,EAAE4P,SAAStQ,IAAQU,EAAEoJ,YAAY9J,IAA6B,IAAfA,EAAIK,OAChE,IAAvBK,EAAEP,KAAKH,GAAKK,QAIrBK,EAAE6P,UAAY,SAASvQ,GACrB,SAAUA,GAAwB,IAAjBA,EAAIwQ,WAKvB9P,EAAE8B,QAAUD,GAAiB,SAASvC,GACpC,MAA8B,mBAAvBqC,EAASiB,KAAKtD,IAIvBU,EAAEkD,SAAW,SAAS5D,GACpB,GAAIyQ,SAAczQ,EAClB,OAAgB,aAATyQ,GAAgC,WAATA,KAAuBzQ,GAIvDU,EAAEkE,MAAM,YAAa,WAAY,SAAU,SAAU,OAAQ,SAAU,SAAU,SAAS8L,GACxFhQ,EAAE,KAAOgQ,GAAQ,SAAS1Q,GACxB,MAAOqC,GAASiB,KAAKtD,KAAS,WAAa0Q,EAAO,OAMjDhQ,EAAEoJ,YAAYnJ,aACjBD,EAAEoJ,YAAc,SAAS9J,GACvB,MAAOU,GAAEe,IAAIzB,EAAK,YAMJ,kBAAP,KAAyC,gBAAb2Q,aACrCjQ,EAAEW,WAAa,SAASrB,GACtB,MAAqB,kBAAPA,KAAqB,IAKvCU,EAAEkQ,SAAW,SAAS5Q,GACpB,MAAO4Q,UAAS5Q,KAASgL,MAAM6F,WAAW7Q,KAI5CU,EAAEsK,MAAQ,SAAShL,GACjB,MAAOU,GAAEoQ,SAAS9Q,IAAQA,KAASA,GAIrCU,EAAE4J,UAAY,SAAStK,GACrB,MAAOA,MAAQ,GAAQA,KAAQ,GAAgC,qBAAvBqC,EAASiB,KAAKtD,IAIxDU,EAAEqQ,OAAS,SAAS/Q,GAClB,MAAe,QAARA,GAITU,EAAEsQ,YAAc,SAAShR,GACvB,MAAOA,SAAa,IAKtBU,EAAEe,IAAM,SAASzB,EAAKsE,GACpB,MAAc,OAAPtE,GAAesC,EAAegB,KAAKtD,EAAKsE,IAQjD5D,EAAEuQ,WAAa,WAEb,MADArP,GAAKlB,EAAIoB,EACFD,MAITnB,EAAEiD,SAAW,SAASN,GACpB,MAAOA,IAIT3C,EAAEwQ,SAAW,SAAS7N,GACpB,MAAO,YACL,MAAOA,KAIX3C,EAAEyQ,KAAO,aAETzQ,EAAEoD,SAAW,SAASQ,GACpB,MAAO,UAAStE,GACd,MAAc,OAAPA,MAAmB,GAAIA,EAAIsE,KAKtC5D,EAAE0Q,WAAa,SAASpR,GACtB,MAAc,OAAPA,EAAc,aAAe,SAASsE,GAC3C,MAAOtE,GAAIsE,KAMf5D,EAAEmD,QAAUnD,EAAE2Q,QAAU,SAAStK,GAE/B,MADAA,GAAQrG,EAAEuO,aAAclI,GACjB,SAAS/G,GACd,MAAOU,GAAEiP,QAAQ3P,EAAK+G,KAK1BrG,EAAE0N,MAAQ,SAASzG,EAAG1H,EAAUM,GAC9B,GAAI+Q,GAAQtP,MAAM0C,KAAKuC,IAAI,EAAGU,GAC9B1H,GAAWO,EAAWP,EAAUM,EAAS,EACzC,KAAK,GAAI8D,GAAI,EAAOsD,EAAJtD,EAAOA,IAAKiN,EAAMjN,GAAKpE,EAASoE,EAChD,OAAOiN,IAIT5Q,EAAE+G,OAAS,SAASL,EAAKH,GAKvB,MAJW,OAAPA,IACFA,EAAMG,EACNA,EAAM,GAEDA,EAAM1C,KAAK6G,MAAM7G,KAAK+C,UAAYR,EAAMG,EAAM,KAIvD1G,EAAE8M,IAAM+D,KAAK/D,KAAO,WAClB,OAAO,GAAI+D,OAAOC,UAIpB,IAAIC,IACFC,IAAK,QACLC,IAAK,OACLC,IAAK,OACLC,IAAK,SACLC,IAAK,SACLC,IAAK,UAEHC,EAActR,EAAEkO,OAAO6C,GAGvBQ,EAAgB,SAASnN,GAC3B,GAAIoN,GAAU,SAASC,GACrB,MAAOrN,GAAIqN,IAGThO,EAAS,MAAQzD,EAAEP,KAAK2E,GAAKsN,KAAK,KAAO,IACzCC,EAAaC,OAAOnO,GACpBoO,EAAgBD,OAAOnO,EAAQ,IACnC,OAAO,UAASqO,GAEd,MADAA,GAAmB,MAAVA,EAAiB,GAAK,GAAKA,EAC7BH,EAAWI,KAAKD,GAAUA,EAAOE,QAAQH,EAAeL,GAAWM,GAG9E9R,GAAEiS,OAASV,EAAcR,GACzB/Q,EAAEkS,SAAWX,EAAcD,GAI3BtR,EAAE8D,OAAS,SAASsG,EAAQhH,EAAU+O,GACpC,GAAIxP,GAAkB,MAAVyH,MAAsB,GAAIA,EAAOhH,EAI7C,OAHIT,SAAe,KACjBA,EAAQwP,GAEHnS,EAAEW,WAAWgC,GAASA,EAAMC,KAAKwH,GAAUzH,EAKpD,IAAIyP,GAAY,CAChBpS,GAAEqS,SAAW,SAASC,GACpB,GAAIC,KAAOH,EAAY,EACvB,OAAOE,GAASA,EAASC,EAAKA,GAKhCvS,EAAEwS,kBACAC,SAAc,kBACdC,YAAc,mBACdT,OAAc,mBAMhB,IAAIU,GAAU,OAIVC,GACFxB,IAAU,IACVyB,KAAU,KACVC,KAAU,IACVC,KAAU,IACVC,SAAU,QACVC,SAAU,SAGRzB,EAAU,4BAEV0B,EAAa,SAASzB,GACxB,MAAO,KAAOmB,EAAQnB,GAOxBzR,GAAEmT,SAAW,SAASC,EAAMC,EAAUC,IAC/BD,GAAYC,IAAaD,EAAWC,GACzCD,EAAWrT,EAAE6O,YAAawE,EAAUrT,EAAEwS,iBAGtC,IAAIrP,GAAUyO,SACXyB,EAASpB,QAAUU,GAASlP,QAC5B4P,EAASX,aAAeC,GAASlP,QACjC4P,EAASZ,UAAYE,GAASlP,QAC/BiO,KAAK,KAAO,KAAM,KAGhBhS,EAAQ,EACR+D,EAAS,QACb2P,GAAKpB,QAAQ7O,EAAS,SAASsO,EAAOQ,EAAQS,EAAaD,EAAUc,GAanE,MAZA9P,IAAU2P,EAAK1R,MAAMhC,EAAO6T,GAAQvB,QAAQR,EAAS0B,GACrDxT,EAAQ6T,EAAS9B,EAAM9R,OAEnBsS,EACFxO,GAAU,cAAgBwO,EAAS,iCAC1BS,EACTjP,GAAU,cAAgBiP,EAAc,uBAC/BD,IACThP,GAAU,OAASgP,EAAW,YAIzBhB,IAEThO,GAAU,OAGL4P,EAASG,WAAU/P,EAAS,mBAAqBA,EAAS,OAE/DA,EAAS,2CACP,oDACAA,EAAS,eAEX,KACE,GAAIgQ,GAAS,GAAIhS,UAAS4R,EAASG,UAAY,MAAO,IAAK/P,GAC3D,MAAOiQ,GAEP,KADAA,GAAEjQ,OAASA,EACLiQ,EAGR,GAAIP,GAAW,SAASQ,GACtB,MAAOF,GAAO7Q,KAAKzB,KAAMwS,EAAM3T,IAI7B4T,EAAWP,EAASG,UAAY,KAGpC,OAFAL,GAAS1P,OAAS,YAAcmQ,EAAW,OAASnQ,EAAS,IAEtD0P,GAITnT,EAAE6T,MAAQ,SAASvU,GACjB,GAAIwU,GAAW9T,EAAEV,EAEjB,OADAwU,GAASC,QAAS,EACXD,EAUT,IAAIhQ,GAAS,SAASgQ,EAAUxU,GAC9B,MAAOwU,GAASC,OAAS/T,EAAEV,GAAKuU,QAAUvU,EAI5CU,GAAEgU,MAAQ,SAAS1U,GACjBU,EAAEkE,KAAKlE,EAAEmO,UAAU7O,GAAM,SAAS0Q,GAChC,GAAIvN,GAAOzC,EAAEgQ,GAAQ1Q,EAAI0Q,EACzBhQ,GAAEY,UAAUoP,GAAQ,WAClB,GAAI/J,IAAQ9E,KAAKkB,SAEjB,OADApB,GAAK+B,MAAMiD,EAAMhG,WACV6D,EAAO3C,KAAMsB,EAAKO,MAAMhD,EAAGiG,QAMxCjG,EAAEgU,MAAMhU,GAGRA,EAAEkE,MAAM,MAAO,OAAQ,UAAW,QAAS,OAAQ,SAAU,WAAY,SAAS8L,GAChF,GAAIhK,GAAS3E,EAAW2O,EACxBhQ,GAAEY,UAAUoP,GAAQ,WAClB,GAAI1Q,GAAM6B,KAAKkB,QAGf,OAFA2D,GAAOhD,MAAM1D,EAAKW,WACJ,UAAT+P,GAA6B,WAATA,GAAqC,IAAf1Q,EAAIK,cAAqBL,GAAI,GACrEwE,EAAO3C,KAAM7B,MAKxBU,EAAEkE,MAAM,SAAU,OAAQ,SAAU,SAAS8L,GAC3C,GAAIhK,GAAS3E,EAAW2O,EACxBhQ,GAAEY,UAAUoP,GAAQ,WAClB,MAAOlM,GAAO3C,KAAM6E,EAAOhD,MAAM7B,KAAKkB,SAAUpC,eAKpDD,EAAEY,UAAU+B,MAAQ,WAClB,MAAOxB,MAAKkB,UAKdrC,EAAEY,UAAUqT,QAAUjU,EAAEY,UAAUsT,OAASlU,EAAEY,UAAU+B,MAEvD3C,EAAEY,UAAUe,SAAW,WACrB,MAAO,GAAKR,KAAKkB,UAUG,kBAAX8R,SAAyBA,OAAOC,KACzCD,OAAO,gBAAkB,WACvB,MAAOnU,OAGX4C,KAAKzB"} \ No newline at end of file diff --git a/update_nation/node_modules/nano/node_modules/underscore/underscore.js b/update_nation/node_modules/nano/node_modules/underscore/underscore.js deleted file mode 100644 index 04cdc067a..000000000 --- a/update_nation/node_modules/nano/node_modules/underscore/underscore.js +++ /dev/null @@ -1,1536 +0,0 @@ -// Underscore.js 1.8.2 -// http://underscorejs.org -// (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors -// Underscore may be freely distributed under the MIT license. - -(function() { - - // Baseline setup - // -------------- - - // Establish the root object, `window` in the browser, or `exports` on the server. - var root = this; - - // Save the previous value of the `_` variable. - var previousUnderscore = root._; - - // Save bytes in the minified (but not gzipped) version: - var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; - - // Create quick reference variables for speed access to core prototypes. - var - push = ArrayProto.push, - slice = ArrayProto.slice, - toString = ObjProto.toString, - hasOwnProperty = ObjProto.hasOwnProperty; - - // All **ECMAScript 5** native function implementations that we hope to use - // are declared here. - var - nativeIsArray = Array.isArray, - nativeKeys = Object.keys, - nativeBind = FuncProto.bind, - nativeCreate = Object.create; - - // Naked function reference for surrogate-prototype-swapping. - var Ctor = function(){}; - - // Create a safe reference to the Underscore object for use below. - var _ = function(obj) { - if (obj instanceof _) return obj; - if (!(this instanceof _)) return new _(obj); - this._wrapped = obj; - }; - - // Export the Underscore object for **Node.js**, with - // backwards-compatibility for the old `require()` API. If we're in - // the browser, add `_` as a global object. - if (typeof exports !== 'undefined') { - if (typeof module !== 'undefined' && module.exports) { - exports = module.exports = _; - } - exports._ = _; - } else { - root._ = _; - } - - // Current version. - _.VERSION = '1.8.2'; - - // Internal function that returns an efficient (for current engines) version - // of the passed-in callback, to be repeatedly applied in other Underscore - // functions. - var optimizeCb = function(func, context, argCount) { - if (context === void 0) return func; - switch (argCount == null ? 3 : argCount) { - case 1: return function(value) { - return func.call(context, value); - }; - case 2: return function(value, other) { - return func.call(context, value, other); - }; - case 3: return function(value, index, collection) { - return func.call(context, value, index, collection); - }; - case 4: return function(accumulator, value, index, collection) { - return func.call(context, accumulator, value, index, collection); - }; - } - return function() { - return func.apply(context, arguments); - }; - }; - - // A mostly-internal function to generate callbacks that can be applied - // to each element in a collection, returning the desired result — either - // identity, an arbitrary callback, a property matcher, or a property accessor. - var cb = function(value, context, argCount) { - if (value == null) return _.identity; - if (_.isFunction(value)) return optimizeCb(value, context, argCount); - if (_.isObject(value)) return _.matcher(value); - return _.property(value); - }; - _.iteratee = function(value, context) { - return cb(value, context, Infinity); - }; - - // An internal function for creating assigner functions. - var createAssigner = function(keysFunc, undefinedOnly) { - return function(obj) { - var length = arguments.length; - if (length < 2 || obj == null) return obj; - for (var index = 1; index < length; index++) { - var source = arguments[index], - keys = keysFunc(source), - l = keys.length; - for (var i = 0; i < l; i++) { - var key = keys[i]; - if (!undefinedOnly || obj[key] === void 0) obj[key] = source[key]; - } - } - return obj; - }; - }; - - // An internal function for creating a new object that inherits from another. - var baseCreate = function(prototype) { - if (!_.isObject(prototype)) return {}; - if (nativeCreate) return nativeCreate(prototype); - Ctor.prototype = prototype; - var result = new Ctor; - Ctor.prototype = null; - return result; - }; - - // Helper for collection methods to determine whether a collection - // should be iterated as an array or as an object - // Related: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength - var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1; - var isArrayLike = function(collection) { - var length = collection && collection.length; - return typeof length == 'number' && length >= 0 && length <= MAX_ARRAY_INDEX; - }; - - // Collection Functions - // -------------------- - - // The cornerstone, an `each` implementation, aka `forEach`. - // Handles raw objects in addition to array-likes. Treats all - // sparse array-likes as if they were dense. - _.each = _.forEach = function(obj, iteratee, context) { - iteratee = optimizeCb(iteratee, context); - var i, length; - if (isArrayLike(obj)) { - for (i = 0, length = obj.length; i < length; i++) { - iteratee(obj[i], i, obj); - } - } else { - var keys = _.keys(obj); - for (i = 0, length = keys.length; i < length; i++) { - iteratee(obj[keys[i]], keys[i], obj); - } - } - return obj; - }; - - // Return the results of applying the iteratee to each element. - _.map = _.collect = function(obj, iteratee, context) { - iteratee = cb(iteratee, context); - var keys = !isArrayLike(obj) && _.keys(obj), - length = (keys || obj).length, - results = Array(length); - for (var index = 0; index < length; index++) { - var currentKey = keys ? keys[index] : index; - results[index] = iteratee(obj[currentKey], currentKey, obj); - } - return results; - }; - - // Create a reducing function iterating left or right. - function createReduce(dir) { - // Optimized iterator function as using arguments.length - // in the main function will deoptimize the, see #1991. - function iterator(obj, iteratee, memo, keys, index, length) { - for (; index >= 0 && index < length; index += dir) { - var currentKey = keys ? keys[index] : index; - memo = iteratee(memo, obj[currentKey], currentKey, obj); - } - return memo; - } - - return function(obj, iteratee, memo, context) { - iteratee = optimizeCb(iteratee, context, 4); - var keys = !isArrayLike(obj) && _.keys(obj), - length = (keys || obj).length, - index = dir > 0 ? 0 : length - 1; - // Determine the initial value if none is provided. - if (arguments.length < 3) { - memo = obj[keys ? keys[index] : index]; - index += dir; - } - return iterator(obj, iteratee, memo, keys, index, length); - }; - } - - // **Reduce** builds up a single result from a list of values, aka `inject`, - // or `foldl`. - _.reduce = _.foldl = _.inject = createReduce(1); - - // The right-associative version of reduce, also known as `foldr`. - _.reduceRight = _.foldr = createReduce(-1); - - // Return the first value which passes a truth test. Aliased as `detect`. - _.find = _.detect = function(obj, predicate, context) { - var key; - if (isArrayLike(obj)) { - key = _.findIndex(obj, predicate, context); - } else { - key = _.findKey(obj, predicate, context); - } - if (key !== void 0 && key !== -1) return obj[key]; - }; - - // Return all the elements that pass a truth test. - // Aliased as `select`. - _.filter = _.select = function(obj, predicate, context) { - var results = []; - predicate = cb(predicate, context); - _.each(obj, function(value, index, list) { - if (predicate(value, index, list)) results.push(value); - }); - return results; - }; - - // Return all the elements for which a truth test fails. - _.reject = function(obj, predicate, context) { - return _.filter(obj, _.negate(cb(predicate)), context); - }; - - // Determine whether all of the elements match a truth test. - // Aliased as `all`. - _.every = _.all = function(obj, predicate, context) { - predicate = cb(predicate, context); - var keys = !isArrayLike(obj) && _.keys(obj), - length = (keys || obj).length; - for (var index = 0; index < length; index++) { - var currentKey = keys ? keys[index] : index; - if (!predicate(obj[currentKey], currentKey, obj)) return false; - } - return true; - }; - - // Determine if at least one element in the object matches a truth test. - // Aliased as `any`. - _.some = _.any = function(obj, predicate, context) { - predicate = cb(predicate, context); - var keys = !isArrayLike(obj) && _.keys(obj), - length = (keys || obj).length; - for (var index = 0; index < length; index++) { - var currentKey = keys ? keys[index] : index; - if (predicate(obj[currentKey], currentKey, obj)) return true; - } - return false; - }; - - // Determine if the array or object contains a given value (using `===`). - // Aliased as `includes` and `include`. - _.contains = _.includes = _.include = function(obj, target, fromIndex) { - if (!isArrayLike(obj)) obj = _.values(obj); - return _.indexOf(obj, target, typeof fromIndex == 'number' && fromIndex) >= 0; - }; - - // Invoke a method (with arguments) on every item in a collection. - _.invoke = function(obj, method) { - var args = slice.call(arguments, 2); - var isFunc = _.isFunction(method); - return _.map(obj, function(value) { - var func = isFunc ? method : value[method]; - return func == null ? func : func.apply(value, args); - }); - }; - - // Convenience version of a common use case of `map`: fetching a property. - _.pluck = function(obj, key) { - return _.map(obj, _.property(key)); - }; - - // Convenience version of a common use case of `filter`: selecting only objects - // containing specific `key:value` pairs. - _.where = function(obj, attrs) { - return _.filter(obj, _.matcher(attrs)); - }; - - // Convenience version of a common use case of `find`: getting the first object - // containing specific `key:value` pairs. - _.findWhere = function(obj, attrs) { - return _.find(obj, _.matcher(attrs)); - }; - - // Return the maximum element (or element-based computation). - _.max = function(obj, iteratee, context) { - var result = -Infinity, lastComputed = -Infinity, - value, computed; - if (iteratee == null && obj != null) { - obj = isArrayLike(obj) ? obj : _.values(obj); - for (var i = 0, length = obj.length; i < length; i++) { - value = obj[i]; - if (value > result) { - result = value; - } - } - } else { - iteratee = cb(iteratee, context); - _.each(obj, function(value, index, list) { - computed = iteratee(value, index, list); - if (computed > lastComputed || computed === -Infinity && result === -Infinity) { - result = value; - lastComputed = computed; - } - }); - } - return result; - }; - - // Return the minimum element (or element-based computation). - _.min = function(obj, iteratee, context) { - var result = Infinity, lastComputed = Infinity, - value, computed; - if (iteratee == null && obj != null) { - obj = isArrayLike(obj) ? obj : _.values(obj); - for (var i = 0, length = obj.length; i < length; i++) { - value = obj[i]; - if (value < result) { - result = value; - } - } - } else { - iteratee = cb(iteratee, context); - _.each(obj, function(value, index, list) { - computed = iteratee(value, index, list); - if (computed < lastComputed || computed === Infinity && result === Infinity) { - result = value; - lastComputed = computed; - } - }); - } - return result; - }; - - // Shuffle a collection, using the modern version of the - // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle). - _.shuffle = function(obj) { - var set = isArrayLike(obj) ? obj : _.values(obj); - var length = set.length; - var shuffled = Array(length); - for (var index = 0, rand; index < length; index++) { - rand = _.random(0, index); - if (rand !== index) shuffled[index] = shuffled[rand]; - shuffled[rand] = set[index]; - } - return shuffled; - }; - - // Sample **n** random values from a collection. - // If **n** is not specified, returns a single random element. - // The internal `guard` argument allows it to work with `map`. - _.sample = function(obj, n, guard) { - if (n == null || guard) { - if (!isArrayLike(obj)) obj = _.values(obj); - return obj[_.random(obj.length - 1)]; - } - return _.shuffle(obj).slice(0, Math.max(0, n)); - }; - - // Sort the object's values by a criterion produced by an iteratee. - _.sortBy = function(obj, iteratee, context) { - iteratee = cb(iteratee, context); - return _.pluck(_.map(obj, function(value, index, list) { - return { - value: value, - index: index, - criteria: iteratee(value, index, list) - }; - }).sort(function(left, right) { - var a = left.criteria; - var b = right.criteria; - if (a !== b) { - if (a > b || a === void 0) return 1; - if (a < b || b === void 0) return -1; - } - return left.index - right.index; - }), 'value'); - }; - - // An internal function used for aggregate "group by" operations. - var group = function(behavior) { - return function(obj, iteratee, context) { - var result = {}; - iteratee = cb(iteratee, context); - _.each(obj, function(value, index) { - var key = iteratee(value, index, obj); - behavior(result, value, key); - }); - return result; - }; - }; - - // Groups the object's values by a criterion. Pass either a string attribute - // to group by, or a function that returns the criterion. - _.groupBy = group(function(result, value, key) { - if (_.has(result, key)) result[key].push(value); else result[key] = [value]; - }); - - // Indexes the object's values by a criterion, similar to `groupBy`, but for - // when you know that your index values will be unique. - _.indexBy = group(function(result, value, key) { - result[key] = value; - }); - - // Counts instances of an object that group by a certain criterion. Pass - // either a string attribute to count by, or a function that returns the - // criterion. - _.countBy = group(function(result, value, key) { - if (_.has(result, key)) result[key]++; else result[key] = 1; - }); - - // Safely create a real, live array from anything iterable. - _.toArray = function(obj) { - if (!obj) return []; - if (_.isArray(obj)) return slice.call(obj); - if (isArrayLike(obj)) return _.map(obj, _.identity); - return _.values(obj); - }; - - // Return the number of elements in an object. - _.size = function(obj) { - if (obj == null) return 0; - return isArrayLike(obj) ? obj.length : _.keys(obj).length; - }; - - // Split a collection into two arrays: one whose elements all satisfy the given - // predicate, and one whose elements all do not satisfy the predicate. - _.partition = function(obj, predicate, context) { - predicate = cb(predicate, context); - var pass = [], fail = []; - _.each(obj, function(value, key, obj) { - (predicate(value, key, obj) ? pass : fail).push(value); - }); - return [pass, fail]; - }; - - // Array Functions - // --------------- - - // Get the first element of an array. Passing **n** will return the first N - // values in the array. Aliased as `head` and `take`. The **guard** check - // allows it to work with `_.map`. - _.first = _.head = _.take = function(array, n, guard) { - if (array == null) return void 0; - if (n == null || guard) return array[0]; - return _.initial(array, array.length - n); - }; - - // Returns everything but the last entry of the array. Especially useful on - // the arguments object. Passing **n** will return all the values in - // the array, excluding the last N. - _.initial = function(array, n, guard) { - return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n))); - }; - - // Get the last element of an array. Passing **n** will return the last N - // values in the array. - _.last = function(array, n, guard) { - if (array == null) return void 0; - if (n == null || guard) return array[array.length - 1]; - return _.rest(array, Math.max(0, array.length - n)); - }; - - // Returns everything but the first entry of the array. Aliased as `tail` and `drop`. - // Especially useful on the arguments object. Passing an **n** will return - // the rest N values in the array. - _.rest = _.tail = _.drop = function(array, n, guard) { - return slice.call(array, n == null || guard ? 1 : n); - }; - - // Trim out all falsy values from an array. - _.compact = function(array) { - return _.filter(array, _.identity); - }; - - // Internal implementation of a recursive `flatten` function. - var flatten = function(input, shallow, strict, startIndex) { - var output = [], idx = 0; - for (var i = startIndex || 0, length = input && input.length; i < length; i++) { - var value = input[i]; - if (isArrayLike(value) && (_.isArray(value) || _.isArguments(value))) { - //flatten current level of array or arguments object - if (!shallow) value = flatten(value, shallow, strict); - var j = 0, len = value.length; - output.length += len; - while (j < len) { - output[idx++] = value[j++]; - } - } else if (!strict) { - output[idx++] = value; - } - } - return output; - }; - - // Flatten out an array, either recursively (by default), or just one level. - _.flatten = function(array, shallow) { - return flatten(array, shallow, false); - }; - - // Return a version of the array that does not contain the specified value(s). - _.without = function(array) { - return _.difference(array, slice.call(arguments, 1)); - }; - - // Produce a duplicate-free version of the array. If the array has already - // been sorted, you have the option of using a faster algorithm. - // Aliased as `unique`. - _.uniq = _.unique = function(array, isSorted, iteratee, context) { - if (array == null) return []; - if (!_.isBoolean(isSorted)) { - context = iteratee; - iteratee = isSorted; - isSorted = false; - } - if (iteratee != null) iteratee = cb(iteratee, context); - var result = []; - var seen = []; - for (var i = 0, length = array.length; i < length; i++) { - var value = array[i], - computed = iteratee ? iteratee(value, i, array) : value; - if (isSorted) { - if (!i || seen !== computed) result.push(value); - seen = computed; - } else if (iteratee) { - if (!_.contains(seen, computed)) { - seen.push(computed); - result.push(value); - } - } else if (!_.contains(result, value)) { - result.push(value); - } - } - return result; - }; - - // Produce an array that contains the union: each distinct element from all of - // the passed-in arrays. - _.union = function() { - return _.uniq(flatten(arguments, true, true)); - }; - - // Produce an array that contains every item shared between all the - // passed-in arrays. - _.intersection = function(array) { - if (array == null) return []; - var result = []; - var argsLength = arguments.length; - for (var i = 0, length = array.length; i < length; i++) { - var item = array[i]; - if (_.contains(result, item)) continue; - for (var j = 1; j < argsLength; j++) { - if (!_.contains(arguments[j], item)) break; - } - if (j === argsLength) result.push(item); - } - return result; - }; - - // Take the difference between one array and a number of other arrays. - // Only the elements present in just the first array will remain. - _.difference = function(array) { - var rest = flatten(arguments, true, true, 1); - return _.filter(array, function(value){ - return !_.contains(rest, value); - }); - }; - - // Zip together multiple lists into a single array -- elements that share - // an index go together. - _.zip = function() { - return _.unzip(arguments); - }; - - // Complement of _.zip. Unzip accepts an array of arrays and groups - // each array's elements on shared indices - _.unzip = function(array) { - var length = array && _.max(array, 'length').length || 0; - var result = Array(length); - - for (var index = 0; index < length; index++) { - result[index] = _.pluck(array, index); - } - return result; - }; - - // Converts lists into objects. Pass either a single array of `[key, value]` - // pairs, or two parallel arrays of the same length -- one of keys, and one of - // the corresponding values. - _.object = function(list, values) { - var result = {}; - for (var i = 0, length = list && list.length; i < length; i++) { - if (values) { - result[list[i]] = values[i]; - } else { - result[list[i][0]] = list[i][1]; - } - } - return result; - }; - - // Return the position of the first occurrence of an item in an array, - // or -1 if the item is not included in the array. - // If the array is large and already in sort order, pass `true` - // for **isSorted** to use binary search. - _.indexOf = function(array, item, isSorted) { - var i = 0, length = array && array.length; - if (typeof isSorted == 'number') { - i = isSorted < 0 ? Math.max(0, length + isSorted) : isSorted; - } else if (isSorted && length) { - i = _.sortedIndex(array, item); - return array[i] === item ? i : -1; - } - if (item !== item) { - return _.findIndex(slice.call(array, i), _.isNaN); - } - for (; i < length; i++) if (array[i] === item) return i; - return -1; - }; - - _.lastIndexOf = function(array, item, from) { - var idx = array ? array.length : 0; - if (typeof from == 'number') { - idx = from < 0 ? idx + from + 1 : Math.min(idx, from + 1); - } - if (item !== item) { - return _.findLastIndex(slice.call(array, 0, idx), _.isNaN); - } - while (--idx >= 0) if (array[idx] === item) return idx; - return -1; - }; - - // Generator function to create the findIndex and findLastIndex functions - function createIndexFinder(dir) { - return function(array, predicate, context) { - predicate = cb(predicate, context); - var length = array != null && array.length; - var index = dir > 0 ? 0 : length - 1; - for (; index >= 0 && index < length; index += dir) { - if (predicate(array[index], index, array)) return index; - } - return -1; - }; - } - - // Returns the first index on an array-like that passes a predicate test - _.findIndex = createIndexFinder(1); - - _.findLastIndex = createIndexFinder(-1); - - // Use a comparator function to figure out the smallest index at which - // an object should be inserted so as to maintain order. Uses binary search. - _.sortedIndex = function(array, obj, iteratee, context) { - iteratee = cb(iteratee, context, 1); - var value = iteratee(obj); - var low = 0, high = array.length; - while (low < high) { - var mid = Math.floor((low + high) / 2); - if (iteratee(array[mid]) < value) low = mid + 1; else high = mid; - } - return low; - }; - - // Generate an integer Array containing an arithmetic progression. A port of - // the native Python `range()` function. See - // [the Python documentation](http://docs.python.org/library/functions.html#range). - _.range = function(start, stop, step) { - if (arguments.length <= 1) { - stop = start || 0; - start = 0; - } - step = step || 1; - - var length = Math.max(Math.ceil((stop - start) / step), 0); - var range = Array(length); - - for (var idx = 0; idx < length; idx++, start += step) { - range[idx] = start; - } - - return range; - }; - - // Function (ahem) Functions - // ------------------ - - // Determines whether to execute a function as a constructor - // or a normal function with the provided arguments - var executeBound = function(sourceFunc, boundFunc, context, callingContext, args) { - if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args); - var self = baseCreate(sourceFunc.prototype); - var result = sourceFunc.apply(self, args); - if (_.isObject(result)) return result; - return self; - }; - - // Create a function bound to a given object (assigning `this`, and arguments, - // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if - // available. - _.bind = function(func, context) { - if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); - if (!_.isFunction(func)) throw new TypeError('Bind must be called on a function'); - var args = slice.call(arguments, 2); - var bound = function() { - return executeBound(func, bound, context, this, args.concat(slice.call(arguments))); - }; - return bound; - }; - - // Partially apply a function by creating a version that has had some of its - // arguments pre-filled, without changing its dynamic `this` context. _ acts - // as a placeholder, allowing any combination of arguments to be pre-filled. - _.partial = function(func) { - var boundArgs = slice.call(arguments, 1); - var bound = function() { - var position = 0, length = boundArgs.length; - var args = Array(length); - for (var i = 0; i < length; i++) { - args[i] = boundArgs[i] === _ ? arguments[position++] : boundArgs[i]; - } - while (position < arguments.length) args.push(arguments[position++]); - return executeBound(func, bound, this, this, args); - }; - return bound; - }; - - // Bind a number of an object's methods to that object. Remaining arguments - // are the method names to be bound. Useful for ensuring that all callbacks - // defined on an object belong to it. - _.bindAll = function(obj) { - var i, length = arguments.length, key; - if (length <= 1) throw new Error('bindAll must be passed function names'); - for (i = 1; i < length; i++) { - key = arguments[i]; - obj[key] = _.bind(obj[key], obj); - } - return obj; - }; - - // Memoize an expensive function by storing its results. - _.memoize = function(func, hasher) { - var memoize = function(key) { - var cache = memoize.cache; - var address = '' + (hasher ? hasher.apply(this, arguments) : key); - if (!_.has(cache, address)) cache[address] = func.apply(this, arguments); - return cache[address]; - }; - memoize.cache = {}; - return memoize; - }; - - // Delays a function for the given number of milliseconds, and then calls - // it with the arguments supplied. - _.delay = function(func, wait) { - var args = slice.call(arguments, 2); - return setTimeout(function(){ - return func.apply(null, args); - }, wait); - }; - - // Defers a function, scheduling it to run after the current call stack has - // cleared. - _.defer = _.partial(_.delay, _, 1); - - // Returns a function, that, when invoked, will only be triggered at most once - // during a given window of time. Normally, the throttled function will run - // as much as it can, without ever going more than once per `wait` duration; - // but if you'd like to disable the execution on the leading edge, pass - // `{leading: false}`. To disable execution on the trailing edge, ditto. - _.throttle = function(func, wait, options) { - var context, args, result; - var timeout = null; - var previous = 0; - if (!options) options = {}; - var later = function() { - previous = options.leading === false ? 0 : _.now(); - timeout = null; - result = func.apply(context, args); - if (!timeout) context = args = null; - }; - return function() { - var now = _.now(); - if (!previous && options.leading === false) previous = now; - var remaining = wait - (now - previous); - context = this; - args = arguments; - if (remaining <= 0 || remaining > wait) { - if (timeout) { - clearTimeout(timeout); - timeout = null; - } - previous = now; - result = func.apply(context, args); - if (!timeout) context = args = null; - } else if (!timeout && options.trailing !== false) { - timeout = setTimeout(later, remaining); - } - return result; - }; - }; - - // Returns a function, that, as long as it continues to be invoked, will not - // be triggered. The function will be called after it stops being called for - // N milliseconds. If `immediate` is passed, trigger the function on the - // leading edge, instead of the trailing. - _.debounce = function(func, wait, immediate) { - var timeout, args, context, timestamp, result; - - var later = function() { - var last = _.now() - timestamp; - - if (last < wait && last >= 0) { - timeout = setTimeout(later, wait - last); - } else { - timeout = null; - if (!immediate) { - result = func.apply(context, args); - if (!timeout) context = args = null; - } - } - }; - - return function() { - context = this; - args = arguments; - timestamp = _.now(); - var callNow = immediate && !timeout; - if (!timeout) timeout = setTimeout(later, wait); - if (callNow) { - result = func.apply(context, args); - context = args = null; - } - - return result; - }; - }; - - // Returns the first function passed as an argument to the second, - // allowing you to adjust arguments, run code before and after, and - // conditionally execute the original function. - _.wrap = function(func, wrapper) { - return _.partial(wrapper, func); - }; - - // Returns a negated version of the passed-in predicate. - _.negate = function(predicate) { - return function() { - return !predicate.apply(this, arguments); - }; - }; - - // Returns a function that is the composition of a list of functions, each - // consuming the return value of the function that follows. - _.compose = function() { - var args = arguments; - var start = args.length - 1; - return function() { - var i = start; - var result = args[start].apply(this, arguments); - while (i--) result = args[i].call(this, result); - return result; - }; - }; - - // Returns a function that will only be executed on and after the Nth call. - _.after = function(times, func) { - return function() { - if (--times < 1) { - return func.apply(this, arguments); - } - }; - }; - - // Returns a function that will only be executed up to (but not including) the Nth call. - _.before = function(times, func) { - var memo; - return function() { - if (--times > 0) { - memo = func.apply(this, arguments); - } - if (times <= 1) func = null; - return memo; - }; - }; - - // Returns a function that will be executed at most one time, no matter how - // often you call it. Useful for lazy initialization. - _.once = _.partial(_.before, 2); - - // Object Functions - // ---------------- - - // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed. - var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString'); - var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString', - 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString']; - - function collectNonEnumProps(obj, keys) { - var nonEnumIdx = nonEnumerableProps.length; - var constructor = obj.constructor; - var proto = (_.isFunction(constructor) && constructor.prototype) || ObjProto; - - // Constructor is a special case. - var prop = 'constructor'; - if (_.has(obj, prop) && !_.contains(keys, prop)) keys.push(prop); - - while (nonEnumIdx--) { - prop = nonEnumerableProps[nonEnumIdx]; - if (prop in obj && obj[prop] !== proto[prop] && !_.contains(keys, prop)) { - keys.push(prop); - } - } - } - - // Retrieve the names of an object's own properties. - // Delegates to **ECMAScript 5**'s native `Object.keys` - _.keys = function(obj) { - if (!_.isObject(obj)) return []; - if (nativeKeys) return nativeKeys(obj); - var keys = []; - for (var key in obj) if (_.has(obj, key)) keys.push(key); - // Ahem, IE < 9. - if (hasEnumBug) collectNonEnumProps(obj, keys); - return keys; - }; - - // Retrieve all the property names of an object. - _.allKeys = function(obj) { - if (!_.isObject(obj)) return []; - var keys = []; - for (var key in obj) keys.push(key); - // Ahem, IE < 9. - if (hasEnumBug) collectNonEnumProps(obj, keys); - return keys; - }; - - // Retrieve the values of an object's properties. - _.values = function(obj) { - var keys = _.keys(obj); - var length = keys.length; - var values = Array(length); - for (var i = 0; i < length; i++) { - values[i] = obj[keys[i]]; - } - return values; - }; - - // Returns the results of applying the iteratee to each element of the object - // In contrast to _.map it returns an object - _.mapObject = function(obj, iteratee, context) { - iteratee = cb(iteratee, context); - var keys = _.keys(obj), - length = keys.length, - results = {}, - currentKey; - for (var index = 0; index < length; index++) { - currentKey = keys[index]; - results[currentKey] = iteratee(obj[currentKey], currentKey, obj); - } - return results; - }; - - // Convert an object into a list of `[key, value]` pairs. - _.pairs = function(obj) { - var keys = _.keys(obj); - var length = keys.length; - var pairs = Array(length); - for (var i = 0; i < length; i++) { - pairs[i] = [keys[i], obj[keys[i]]]; - } - return pairs; - }; - - // Invert the keys and values of an object. The values must be serializable. - _.invert = function(obj) { - var result = {}; - var keys = _.keys(obj); - for (var i = 0, length = keys.length; i < length; i++) { - result[obj[keys[i]]] = keys[i]; - } - return result; - }; - - // Return a sorted list of the function names available on the object. - // Aliased as `methods` - _.functions = _.methods = function(obj) { - var names = []; - for (var key in obj) { - if (_.isFunction(obj[key])) names.push(key); - } - return names.sort(); - }; - - // Extend a given object with all the properties in passed-in object(s). - _.extend = createAssigner(_.allKeys); - - // Assigns a given object with all the own properties in the passed-in object(s) - // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) - _.extendOwn = _.assign = createAssigner(_.keys); - - // Returns the first key on an object that passes a predicate test - _.findKey = function(obj, predicate, context) { - predicate = cb(predicate, context); - var keys = _.keys(obj), key; - for (var i = 0, length = keys.length; i < length; i++) { - key = keys[i]; - if (predicate(obj[key], key, obj)) return key; - } - }; - - // Return a copy of the object only containing the whitelisted properties. - _.pick = function(object, oiteratee, context) { - var result = {}, obj = object, iteratee, keys; - if (obj == null) return result; - if (_.isFunction(oiteratee)) { - keys = _.allKeys(obj); - iteratee = optimizeCb(oiteratee, context); - } else { - keys = flatten(arguments, false, false, 1); - iteratee = function(value, key, obj) { return key in obj; }; - obj = Object(obj); - } - for (var i = 0, length = keys.length; i < length; i++) { - var key = keys[i]; - var value = obj[key]; - if (iteratee(value, key, obj)) result[key] = value; - } - return result; - }; - - // Return a copy of the object without the blacklisted properties. - _.omit = function(obj, iteratee, context) { - if (_.isFunction(iteratee)) { - iteratee = _.negate(iteratee); - } else { - var keys = _.map(flatten(arguments, false, false, 1), String); - iteratee = function(value, key) { - return !_.contains(keys, key); - }; - } - return _.pick(obj, iteratee, context); - }; - - // Fill in a given object with default properties. - _.defaults = createAssigner(_.allKeys, true); - - // Create a (shallow-cloned) duplicate of an object. - _.clone = function(obj) { - if (!_.isObject(obj)) return obj; - return _.isArray(obj) ? obj.slice() : _.extend({}, obj); - }; - - // Invokes interceptor with the obj, and then returns obj. - // The primary purpose of this method is to "tap into" a method chain, in - // order to perform operations on intermediate results within the chain. - _.tap = function(obj, interceptor) { - interceptor(obj); - return obj; - }; - - // Returns whether an object has a given set of `key:value` pairs. - _.isMatch = function(object, attrs) { - var keys = _.keys(attrs), length = keys.length; - if (object == null) return !length; - var obj = Object(object); - for (var i = 0; i < length; i++) { - var key = keys[i]; - if (attrs[key] !== obj[key] || !(key in obj)) return false; - } - return true; - }; - - - // Internal recursive comparison function for `isEqual`. - var eq = function(a, b, aStack, bStack) { - // Identical objects are equal. `0 === -0`, but they aren't identical. - // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). - if (a === b) return a !== 0 || 1 / a === 1 / b; - // A strict comparison is necessary because `null == undefined`. - if (a == null || b == null) return a === b; - // Unwrap any wrapped objects. - if (a instanceof _) a = a._wrapped; - if (b instanceof _) b = b._wrapped; - // Compare `[[Class]]` names. - var className = toString.call(a); - if (className !== toString.call(b)) return false; - switch (className) { - // Strings, numbers, regular expressions, dates, and booleans are compared by value. - case '[object RegExp]': - // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i') - case '[object String]': - // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is - // equivalent to `new String("5")`. - return '' + a === '' + b; - case '[object Number]': - // `NaN`s are equivalent, but non-reflexive. - // Object(NaN) is equivalent to NaN - if (+a !== +a) return +b !== +b; - // An `egal` comparison is performed for other numeric values. - return +a === 0 ? 1 / +a === 1 / b : +a === +b; - case '[object Date]': - case '[object Boolean]': - // Coerce dates and booleans to numeric primitive values. Dates are compared by their - // millisecond representations. Note that invalid dates with millisecond representations - // of `NaN` are not equivalent. - return +a === +b; - } - - var areArrays = className === '[object Array]'; - if (!areArrays) { - if (typeof a != 'object' || typeof b != 'object') return false; - - // Objects with different constructors are not equivalent, but `Object`s or `Array`s - // from different frames are. - var aCtor = a.constructor, bCtor = b.constructor; - if (aCtor !== bCtor && !(_.isFunction(aCtor) && aCtor instanceof aCtor && - _.isFunction(bCtor) && bCtor instanceof bCtor) - && ('constructor' in a && 'constructor' in b)) { - return false; - } - } - // Assume equality for cyclic structures. The algorithm for detecting cyclic - // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. - - // Initializing stack of traversed objects. - // It's done here since we only need them for objects and arrays comparison. - aStack = aStack || []; - bStack = bStack || []; - var length = aStack.length; - while (length--) { - // Linear search. Performance is inversely proportional to the number of - // unique nested structures. - if (aStack[length] === a) return bStack[length] === b; - } - - // Add the first object to the stack of traversed objects. - aStack.push(a); - bStack.push(b); - - // Recursively compare objects and arrays. - if (areArrays) { - // Compare array lengths to determine if a deep comparison is necessary. - length = a.length; - if (length !== b.length) return false; - // Deep compare the contents, ignoring non-numeric properties. - while (length--) { - if (!eq(a[length], b[length], aStack, bStack)) return false; - } - } else { - // Deep compare objects. - var keys = _.keys(a), key; - length = keys.length; - // Ensure that both objects contain the same number of properties before comparing deep equality. - if (_.keys(b).length !== length) return false; - while (length--) { - // Deep compare each member - key = keys[length]; - if (!(_.has(b, key) && eq(a[key], b[key], aStack, bStack))) return false; - } - } - // Remove the first object from the stack of traversed objects. - aStack.pop(); - bStack.pop(); - return true; - }; - - // Perform a deep comparison to check if two objects are equal. - _.isEqual = function(a, b) { - return eq(a, b); - }; - - // Is a given array, string, or object empty? - // An "empty" object has no enumerable own-properties. - _.isEmpty = function(obj) { - if (obj == null) return true; - if (isArrayLike(obj) && (_.isArray(obj) || _.isString(obj) || _.isArguments(obj))) return obj.length === 0; - return _.keys(obj).length === 0; - }; - - // Is a given value a DOM element? - _.isElement = function(obj) { - return !!(obj && obj.nodeType === 1); - }; - - // Is a given value an array? - // Delegates to ECMA5's native Array.isArray - _.isArray = nativeIsArray || function(obj) { - return toString.call(obj) === '[object Array]'; - }; - - // Is a given variable an object? - _.isObject = function(obj) { - var type = typeof obj; - return type === 'function' || type === 'object' && !!obj; - }; - - // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp, isError. - _.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp', 'Error'], function(name) { - _['is' + name] = function(obj) { - return toString.call(obj) === '[object ' + name + ']'; - }; - }); - - // Define a fallback version of the method in browsers (ahem, IE < 9), where - // there isn't any inspectable "Arguments" type. - if (!_.isArguments(arguments)) { - _.isArguments = function(obj) { - return _.has(obj, 'callee'); - }; - } - - // Optimize `isFunction` if appropriate. Work around some typeof bugs in old v8, - // IE 11 (#1621), and in Safari 8 (#1929). - if (typeof /./ != 'function' && typeof Int8Array != 'object') { - _.isFunction = function(obj) { - return typeof obj == 'function' || false; - }; - } - - // Is a given object a finite number? - _.isFinite = function(obj) { - return isFinite(obj) && !isNaN(parseFloat(obj)); - }; - - // Is the given value `NaN`? (NaN is the only number which does not equal itself). - _.isNaN = function(obj) { - return _.isNumber(obj) && obj !== +obj; - }; - - // Is a given value a boolean? - _.isBoolean = function(obj) { - return obj === true || obj === false || toString.call(obj) === '[object Boolean]'; - }; - - // Is a given value equal to null? - _.isNull = function(obj) { - return obj === null; - }; - - // Is a given variable undefined? - _.isUndefined = function(obj) { - return obj === void 0; - }; - - // Shortcut function for checking if an object has a given property directly - // on itself (in other words, not on a prototype). - _.has = function(obj, key) { - return obj != null && hasOwnProperty.call(obj, key); - }; - - // Utility Functions - // ----------------- - - // Run Underscore.js in *noConflict* mode, returning the `_` variable to its - // previous owner. Returns a reference to the Underscore object. - _.noConflict = function() { - root._ = previousUnderscore; - return this; - }; - - // Keep the identity function around for default iteratees. - _.identity = function(value) { - return value; - }; - - // Predicate-generating functions. Often useful outside of Underscore. - _.constant = function(value) { - return function() { - return value; - }; - }; - - _.noop = function(){}; - - _.property = function(key) { - return function(obj) { - return obj == null ? void 0 : obj[key]; - }; - }; - - // Generates a function for a given object that returns a given property. - _.propertyOf = function(obj) { - return obj == null ? function(){} : function(key) { - return obj[key]; - }; - }; - - // Returns a predicate for checking whether an object has a given set of - // `key:value` pairs. - _.matcher = _.matches = function(attrs) { - attrs = _.extendOwn({}, attrs); - return function(obj) { - return _.isMatch(obj, attrs); - }; - }; - - // Run a function **n** times. - _.times = function(n, iteratee, context) { - var accum = Array(Math.max(0, n)); - iteratee = optimizeCb(iteratee, context, 1); - for (var i = 0; i < n; i++) accum[i] = iteratee(i); - return accum; - }; - - // Return a random integer between min and max (inclusive). - _.random = function(min, max) { - if (max == null) { - max = min; - min = 0; - } - return min + Math.floor(Math.random() * (max - min + 1)); - }; - - // A (possibly faster) way to get the current timestamp as an integer. - _.now = Date.now || function() { - return new Date().getTime(); - }; - - // List of HTML entities for escaping. - var escapeMap = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '`': '`' - }; - var unescapeMap = _.invert(escapeMap); - - // Functions for escaping and unescaping strings to/from HTML interpolation. - var createEscaper = function(map) { - var escaper = function(match) { - return map[match]; - }; - // Regexes for identifying a key that needs to be escaped - var source = '(?:' + _.keys(map).join('|') + ')'; - var testRegexp = RegExp(source); - var replaceRegexp = RegExp(source, 'g'); - return function(string) { - string = string == null ? '' : '' + string; - return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; - }; - }; - _.escape = createEscaper(escapeMap); - _.unescape = createEscaper(unescapeMap); - - // If the value of the named `property` is a function then invoke it with the - // `object` as context; otherwise, return it. - _.result = function(object, property, fallback) { - var value = object == null ? void 0 : object[property]; - if (value === void 0) { - value = fallback; - } - return _.isFunction(value) ? value.call(object) : value; - }; - - // Generate a unique integer id (unique within the entire client session). - // Useful for temporary DOM ids. - var idCounter = 0; - _.uniqueId = function(prefix) { - var id = ++idCounter + ''; - return prefix ? prefix + id : id; - }; - - // By default, Underscore uses ERB-style template delimiters, change the - // following template settings to use alternative delimiters. - _.templateSettings = { - evaluate : /<%([\s\S]+?)%>/g, - interpolate : /<%=([\s\S]+?)%>/g, - escape : /<%-([\s\S]+?)%>/g - }; - - // When customizing `templateSettings`, if you don't want to define an - // interpolation, evaluation or escaping regex, we need one that is - // guaranteed not to match. - var noMatch = /(.)^/; - - // Certain characters need to be escaped so that they can be put into a - // string literal. - var escapes = { - "'": "'", - '\\': '\\', - '\r': 'r', - '\n': 'n', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; - - var escaper = /\\|'|\r|\n|\u2028|\u2029/g; - - var escapeChar = function(match) { - return '\\' + escapes[match]; - }; - - // JavaScript micro-templating, similar to John Resig's implementation. - // Underscore templating handles arbitrary delimiters, preserves whitespace, - // and correctly escapes quotes within interpolated code. - // NB: `oldSettings` only exists for backwards compatibility. - _.template = function(text, settings, oldSettings) { - if (!settings && oldSettings) settings = oldSettings; - settings = _.defaults({}, settings, _.templateSettings); - - // Combine delimiters into one regular expression via alternation. - var matcher = RegExp([ - (settings.escape || noMatch).source, - (settings.interpolate || noMatch).source, - (settings.evaluate || noMatch).source - ].join('|') + '|$', 'g'); - - // Compile the template source, escaping string literals appropriately. - var index = 0; - var source = "__p+='"; - text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { - source += text.slice(index, offset).replace(escaper, escapeChar); - index = offset + match.length; - - if (escape) { - source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; - } else if (interpolate) { - source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; - } else if (evaluate) { - source += "';\n" + evaluate + "\n__p+='"; - } - - // Adobe VMs need the match returned to produce the correct offest. - return match; - }); - source += "';\n"; - - // If a variable is not specified, place data values in local scope. - if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; - - source = "var __t,__p='',__j=Array.prototype.join," + - "print=function(){__p+=__j.call(arguments,'');};\n" + - source + 'return __p;\n'; - - try { - var render = new Function(settings.variable || 'obj', '_', source); - } catch (e) { - e.source = source; - throw e; - } - - var template = function(data) { - return render.call(this, data, _); - }; - - // Provide the compiled source as a convenience for precompilation. - var argument = settings.variable || 'obj'; - template.source = 'function(' + argument + '){\n' + source + '}'; - - return template; - }; - - // Add a "chain" function. Start chaining a wrapped Underscore object. - _.chain = function(obj) { - var instance = _(obj); - instance._chain = true; - return instance; - }; - - // OOP - // --------------- - // If Underscore is called as a function, it returns a wrapped object that - // can be used OO-style. This wrapper holds altered versions of all the - // underscore functions. Wrapped objects may be chained. - - // Helper function to continue chaining intermediate results. - var result = function(instance, obj) { - return instance._chain ? _(obj).chain() : obj; - }; - - // Add your own custom functions to the Underscore object. - _.mixin = function(obj) { - _.each(_.functions(obj), function(name) { - var func = _[name] = obj[name]; - _.prototype[name] = function() { - var args = [this._wrapped]; - push.apply(args, arguments); - return result(this, func.apply(_, args)); - }; - }); - }; - - // Add all of the Underscore functions to the wrapper object. - _.mixin(_); - - // Add all mutator Array functions to the wrapper. - _.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - var obj = this._wrapped; - method.apply(obj, arguments); - if ((name === 'shift' || name === 'splice') && obj.length === 0) delete obj[0]; - return result(this, obj); - }; - }); - - // Add all accessor Array functions to the wrapper. - _.each(['concat', 'join', 'slice'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - return result(this, method.apply(this._wrapped, arguments)); - }; - }); - - // Extracts the result from a wrapped and chained object. - _.prototype.value = function() { - return this._wrapped; - }; - - // Provide unwrapping proxy for some methods used in engine operations - // such as arithmetic and JSON stringification. - _.prototype.valueOf = _.prototype.toJSON = _.prototype.value; - - _.prototype.toString = function() { - return '' + this._wrapped; - }; - - // AMD registration happens at the end for compatibility with AMD loaders - // that may not enforce next-turn semantics on modules. Even though general - // practice for AMD registration is to be anonymous, underscore registers - // as a named module because, like jQuery, it is a base library that is - // popular enough to be bundled in a third party lib, but not be part of - // an AMD load request. Those cases could generate an error when an - // anonymous define() is called outside of a loader request. - if (typeof define === 'function' && define.amd) { - define('underscore', [], function() { - return _; - }); - } -}.call(this)); diff --git a/update_nation/node_modules/nano/package.json b/update_nation/node_modules/nano/package.json index 11064f912..604b8ce6f 100644 --- a/update_nation/node_modules/nano/package.json +++ b/update_nation/node_modules/nano/package.json @@ -1,59 +1,74 @@ { - "name": "nano", - "description": "minimalistic couchdb driver for node.js", - "license": "apache 2.0", - "homepage": "http://github.com/dscape/nano", - "repository": { - "type": "git", - "url": "git://github.com/dscape/nano" + "_from": "nano@6.0.1", + "_id": "nano@6.0.1", + "_inBundle": false, + "_integrity": "sha1-s67kdKp2tki1aIHljwFy8XNHoyA=", + "_location": "/nano", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "nano@6.0.1", + "name": "nano", + "escapedName": "nano", + "rawSpec": "6.0.1", + "saveSpec": null, + "fetchSpec": "6.0.1" }, - "version": "6.0.1", + "_requiredBy": [ + "/", + "/couchapp" + ], + "_resolved": "https://registry.npmjs.org/nano/-/nano-6.0.1.tgz", + "_shasum": "b3aee474aa76b648b56881e58f0172f17347a320", + "_spec": "nano@6.0.1", + "_where": "/Users/Raju/BeLL-Apps/update_nation", "author": { "name": "Nuno Job", "email": "nunojobpinto@gmail.com", "url": "http://nunojob.com" }, - "keywords": [ - "couchdb", - "data", - "request", - "json", - "nosql", - "micro", - "nano", - "database" - ], + "bugs": { + "url": "https://github.com/dscape/nano/issues" + }, + "bundleDependencies": false, "dependencies": { - "request": "2.46.0", - "follow": "^0.11.3", + "debug": "^2.0.0", "errs": "^0.3.0", - "underscore": "^1.7.0", - "debug": "^2.0.0" + "follow": "^0.11.3", + "request": "2.46.0", + "underscore": "^1.7.0" }, + "deprecated": false, + "description": "minimalistic couchdb driver for node.js", "devDependencies": { "async": "^0.9.0", - "tape": "^3.0.0", + "endswith": "^0.0.0", "istanbul": "^0.3.2", - "jshint": "^2.5.6", "jscs": "^1.7.0", + "jshint": "^2.5.6", "nock": "^0.48.1", - "endswith": "^0.0.0", - "tape-it": "^0.3.1", - "pre-commit": "0.0.9" - }, - "scripts": { - "test": "DEBUG=* NOCK_OFF=true istanbul cover tape tests/*/*/*.js", - "unmocked": "NOCK_OFF=true tape tests/*/*/*.js", - "mocked": "tape tests/*/*/*.js", - "jshint": "jshint tests/*/*/*.js lib/*.js", - "codestyle": "jscs -p google tests/*/*/*.js lib/*.js", - "coverage": "open coverage/lcov-report/index.html", - "checkcoverage": "istanbul check-coverage --statements 100 --functions 100 --lines 100 --branches 100" + "pre-commit": "0.0.9", + "tape": "^3.0.0", + "tape-it": "^0.3.1" }, - "main": "./lib/nano.js", "engines": { "node": ">=0.8.0" }, + "homepage": "http://github.com/dscape/nano", + "keywords": [ + "couchdb", + "data", + "request", + "json", + "nosql", + "micro", + "nano", + "database" + ], + "license": "apache 2.0", + "main": "./lib/nano.js", + "name": "nano", "pre-commit": [ "jshint", "codestyle", @@ -61,11 +76,18 @@ "test", "checkcoverage" ], - "readme": "[![By](https://img.shields.io/badge/made%20by-yld!-32bbee.svg?style=flat-square)](http://yld.io/contact?source=github-nano)[![Chat](https://img.shields.io/badge/help-gitter-eb9348.svg?style=flat-square)](https://gitter.im/dscape/nano)[![Tests](http://img.shields.io/travis/dscape/nano.svg?style=flat-square)](https://travis-ci.org/dscape/nano)![Coverage](https://img.shields.io/badge/coverage-100%-ff69b4.svg?style=flat-square)[![Dependencies](https://img.shields.io/david/dscape/nano.svg?style=flat-square)](https://david-dm.org/dscape/nano)[![NPM](http://img.shields.io/npm/v/nano.svg?style=flat-square)](http://browsenpm.org/package/nano)\n\n# nano\n\nminimalistic couchdb driver for node.js\n\n`nano` features:\n\n* **minimalistic** - there is only a minimum of abstraction between you and\n couchdb\n* **pipes** - proxy requests from couchdb directly to your end user\n* **errors** - errors are proxied directly from couchdb: if you know couchdb\n you already know `nano`.\n\n## installation\n\n1. install [npm][1]\n2. `npm install nano`\n\n## table of contents\n\n- [getting started](#getting-started)\n- [tutorials & screencasts](#tutorials-examples-in-the-wild--screencasts)\n- [configuration](#configuration)\n- [database functions](#database-functions)\n - [nano.db.create(name, [callback])](#nanodbcreatename-callback)\n - [nano.db.get(name, [callback])](#nanodbgetname-callback)\n - [nano.db.destroy(name, [callback])](#nanodbdestroyname-callback)\n - [nano.db.list([callback])](#nanodblistcallback)\n - [nano.db.compact(name, [designname], [callback])](#nanodbcompactname-designname-callback)\n - [nano.db.replicate(source, target, [opts], [callback])](#nanodbreplicatesource-target-opts-callback)\n - [nano.db.changes(name, [params], [callback])](#nanodbchangesname-params-callback)\n - [nano.db.follow(name, [params], [callback])](#nanodbfollowname-params-callback)\n - [nano.use(name)](#nanousename)\n - [nano.request(opts, [callback])](#nanorequestopts-callback)\n - [nano.config](#nanoconfig)\n - [nano.updates([params], [callback])](#nanoupdatesparams-callback)\n - [nano.followUpdates([params], [callback])](#nanofollowUpdatesparams-callback)\n- [document functions](#document-functions)\n - [db.insert(doc, [params], [callback])](#dbinsertdoc-params-callback)\n - [db.destroy(docname, rev, [callback])](#dbdestroydocname-rev-callback)\n - [db.get(docname, [params], [callback])](#dbgetdocname-params-callback)\n - [db.head(docname, [callback])](#dbheaddocname-callback)\n - [db.copy(src_doc, dest_doc, opts, [callback])](#dbcopysrc_doc-dest_doc-opts-callback)\n - [db.bulk(docs, [params], [callback])](#dbbulkdocs-params-callback)\n - [db.list([params], [callback])](#dblistparams-callback)\n - [db.fetch(docnames, [params], [callback])](#dbfetchdocnames-params-callback)\n - [db.fetchRevs(docnames, [params], [callback])](#dbfetchRevsdocnames-params-callback)\n- [multipart functions](#multipart-functions)\n - [db.multipart.insert(doc, attachments, [params], [callback])](#dbmultipartinsertdoc-attachments-params-callback)\n - [db.multipart.get(docname, [params], [callback])](#dbmultipartgetdocname-params-callback)\n- [attachments functions](#attachments-functions)\n - [db.attachment.insert(docname, attname, att, contenttype, [params], [callback])](#dbattachmentinsertdocname-attname-att-contenttype-params-callback)\n - [db.attachment.get(docname, attname, [params], [callback])](#dbattachmentgetdocname-attname-params-callback)\n - [db.attachment.destroy(docname, attname, [params], [callback])](#dbattachmentdestroydocname-attname-rev-callback)\n- [views and design functions](#views-and-design-functions)\n - [db.view(designname, viewname, [params], [callback])](#dbviewdesignname-viewname-params-callback)\n - [db.show(designname, showname, doc_id, [params], [callback])](#dbshowdesignname-showname-doc_id-params-callback)\n - [db.atomic(designname, updatename, docname, [body], [callback])](#dbatomicdesignname-updatename-docname-body-callback)\n - [db.search(designname, viewname, [params], [callback])](#dbsearchdesignname-searchname-params-callback)\n- [using cookie authentication](#using-cookie-authentication)\n- [advanced features](#advanced-features)\n - [extending nano](#extending-nano)\n - [pipes](#pipes)\n- [tests](#tests)\n\n## getting started\n\nto use `nano` you need to connect it to your couchdb install, to do that:\n\n``` js\nvar nano = require('nano')('http://localhost:5984');\n```\n\nto create a new database:\n\n``` js\nnano.db.create('alice');\n```\n\nand to use it:\n\n``` js\nvar alice = nano.db.use('alice');\n```\n\nin this examples we didn't specify a `callback` function, the absence of a\ncallback means _\"do this, ignore what happens\"_.\nin `nano` the callback function receives always three arguments:\n\n* `err` - the error, if any\n* `body` - the http _response body_ from couchdb, if no error.\n json parsed body, binary for non json responses\n* `header` - the http _response header_ from couchdb, if no error\n\n\na simple but complete example using callbacks is:\n\n``` js\nvar nano = require('nano')('http://localhost:5984');\n\n// clean up the database we created previously\nnano.db.destroy('alice', function() {\n // create a new database\n nano.db.create('alice', function() {\n // specify the database we are going to use\n var alice = nano.use('alice');\n // and insert a document in it\n alice.insert({ crazy: true }, 'rabbit', function(err, body, header) {\n if (err) {\n console.log('[alice.insert] ', err.message);\n return;\n }\n console.log('you have inserted the rabbit.')\n console.log(body);\n });\n });\n});\n```\n\nif you run this example(after starting couchdb) you will see:\n\n you have inserted the rabbit.\n { ok: true,\n id: 'rabbit',\n rev: '1-6e4cb465d49c0368ac3946506d26335d' }\n\nyou can also see your document in [futon](http://localhost:5984/_utils).\n\n## configuration\n\nconfiguring nano to use your database server is as simple as:\n\n``` js\nvar nano = require('nano')('http://localhost:5984')\n , db = nano.use('foo')\n ;\n```\n\nhowever if you don't need to instrument database objects you can simply:\n\n``` js\n// nano parses the url and knows this is a database\nvar db = require('nano')('http://localhost:5984/foo');\n```\n\nyou can also pass options to the require:\n\n``` js\n// nano parses the url and knows this is a database\nvar db = require('nano')('http://localhost:5984/foo');\n```\n\nto specify further configuration options you can pass an object literal instead:\n\n``` js\n// nano parses the url and knows this is a database\nvar db = require('nano')(\n { \"url\" : \"http://localhost:5984/foo\"\n , \"request_defaults\" : { \"proxy\" : \"http://someproxy\" }\n , \"log\" : function (id, args) {\n console.log(id, args);\n }\n });\n```\nPlease check [request] for more information on the defaults. They support features like cookie jar, proxies, ssl, etc.\n\n### pool size and open sockets\n\na very important configuration parameter if you have a high traffic website and are using nano is setting up the `pool.size`. by default, the node.js http global agent (client) has a certain size of active connections that can run simultaneously, while others are kept in a queue. pooling can be disabled by setting the `agent` property in `request_defaults` to false, or adjust the global pool size using:\n\n``` js\nhttp.globalAgent.maxSockets = 20;\n```\n\nyou can also increase the size in your calling context using `request_defaults` if this is problematic. refer to the [request] documentation and examples for further clarification.\n\nhere's an example explicitly using the keep alive agent (installed using `npm install agentkeepalive`), especially useful to limit your open sockets when doing high-volume access to couchdb on localhost:\n\n``` js\nvar agentkeepalive = require('agentkeepalive');\nvar myagent = new agentkeepalive({\n maxSockets: 50\n , maxKeepAliveRequests: 0\n , maxKeepAliveTime: 30000\n });\n\nvar db = require('nano')(\n { \"url\" : \"http://localhost:5984/foo\"\n , \"request_defaults\" : { \"agent\" : myagent }\n });\n```\n\n\n## database functions\n\n### nano.db.create(name, [callback])\n\ncreates a couchdb database with the given `name`.\n\n``` js\nnano.db.create('alice', function(err, body) {\n if (!err) {\n console.log('database alice created!');\n }\n});\n```\n\n### nano.db.get(name, [callback])\n\nget informations about `name`.\n\n``` js\nnano.db.get('alice', function(err, body) {\n if (!err) {\n console.log(body);\n }\n});\n```\n\n### nano.db.destroy(name, [callback])\n\ndestroys `name`.\n\n``` js\nnano.db.destroy('alice');\n```\n\neven though this examples looks sync it is an async function.\n\n### nano.db.list([callback])\n\nlists all the databases in couchdb\n\n``` js\nnano.db.list(function(err, body) {\n // body is an array\n body.forEach(function(db) {\n console.log(db);\n });\n});\n```\n\n### nano.db.compact(name, [designname], [callback])\n\ncompacts `name`, if `designname` is specified also compacts its\nviews.\n\n### nano.db.replicate(source, target, [opts], [callback])\n\nreplicates `source` on `target` with options `opts`. `target`\nhas to exist, add `create_target:true` to `opts` to create it prior to\nreplication.\n\n``` js\nnano.db.replicate('alice', 'http://admin:password@otherhost.com:5984/alice',\n { create_target:true }, function(err, body) {\n if (!err)\n console.log(body);\n});\n```\n\n### nano.db.changes(name, [params], [callback])\n\nasks for the changes feed of `name`, `params` contains additions\nto the query string.\n\n``` js\nnano.db.changes('alice', function(err, body) {\n if (!err) {\n console.log(body);\n }\n});\n```\n\n### nano.db.follow(name, [params], [callback])\n\nuses [follow] to create a solid changes feed. please consult follow documentation for more information as this is a very complete api on it's own\n\n``` js\nvar feed = db.follow({since: \"now\"});\nfeed.on('change', function (change) {\n console.log(\"change: \", change);\n});\nfeed.follow();\nprocess.nextTick(function () {\n db.insert({\"bar\": \"baz\"}, \"bar\");\n});\n```\n\n### nano.use(name)\n\ncreates a scope where you operate inside `name`.\n\n``` js\nvar alice = nano.use('alice');\nalice.insert({ crazy: true }, 'rabbit', function(err, body) {\n // do something\n});\n```\n\n### nano.db.use(name)\n\nalias for `nano.use`\n\n### nano.db.scope(name)\n\nalias for `nano.use`\n\n### nano.scope(name)\n\nalias for `nano.use`\n\n### nano.request(opts, [callback])\n\nmakes a request to couchdb, the available `opts` are:\n\n* `opts.db` – the database name\n* `opts.method` – the http method, defaults to `get`\n* `opts.path` – the full path of the request, overrides `opts.doc` and\n `opts.att`\n* `opts.doc` – the document name\n* `opts.att` – the attachment name\n* `opts.params` – query string parameters, appended after any existing `opts.path`, `opts.doc`, or `opts.att`\n* `opts.content_type` – the content type of the request, default to `json`\n* `opts.headers` – additional http headers, overrides existing ones\n* `opts.body` – the document or attachment body\n* `opts.encoding` – the encoding for attachments\n* `opts.multipart` – array of objects for multipart request\n\n### nano.relax(opts, [callback])\n\nalias for `nano.request`\n\n### nano.dinosaur(opts, [callback])\n\nalias for `nano.request`\n\n _\n / '_) WAT U SAY!\n _.----._/ /\n / /\n _/ ( | ( |\n /__.-|_|--|_l\n\n### nano.config\n\nan object containing the nano configurations, possible keys are:\n\n* `url` - the couchdb url\n* `db` - the database name\n\n\n### nano.updates([params], [callback])\n\nlisten to db updates, the available `params` are:\n\n* `params.feed` – Type of feed. Can be one of\n * `longpoll`: Closes the connection after the first event.\n * `continuous`: Send a line of JSON per event. Keeps the socket open until timeout.\n * `eventsource`: Like, continuous, but sends the events in EventSource format.\n* `params.timeout` – Number of seconds until CouchDB closes the connection. Default is 60.\n* `params.heartbeat` – Whether CouchDB will send a newline character (\\n) on timeout. Default is true.\n\n\n### nano.followUpdates([params], [callback])\n\n** changed in version 6 **\n\nuses [follow](https://github.com/iriscouch/follow) to create a solid\n[`_db_updates`](http://docs.couchdb.org/en/latest/api/server/common.html?highlight=db_updates#get--_db_updates) feed.\nplease consult follow documentation for more information as this is a very complete api on it's own\n\n```js\nvar feed = nano.followUpdates({since: \"now\"});\nfeed.on('change', function (change) {\n console.log(\"change: \", change);\n});\nfeed.follow();\nprocess.nextTick(function () {\n nano.db.create('alice');\n});\n```\n\n## document functions\n\n### db.insert(doc, [params], [callback])\n\ninserts `doc` in the database with optional `params`. if params is a string, its assumed as the intended document name. if params is an object, its passed as query string parameters and `doc_name` is checked for defining the document name.\n\n``` js\nvar alice = nano.use('alice');\nalice.insert({ crazy: true }, 'rabbit', function(err, body) {\n if (!err)\n console.log(body);\n});\n```\n\n### db.destroy(docname, rev, [callback])\n\nremoves revision `rev` of `docname` from couchdb.\n\n``` js\nalice.destroy('rabbit', '3-66c01cdf99e84c83a9b3fe65b88db8c0', function(err, body) {\n if (!err)\n console.log(body);\n});\n```\n\n### db.get(docname, [params], [callback])\n\ngets `docname` from the database with optional query string\nadditions `params`.\n\n``` js\nalice.get('rabbit', { revs_info: true }, function(err, body) {\n if (!err)\n console.log(body);\n});\n```\n\n### db.head(docname, [callback])\n\nsame as `get` but lightweight version that returns headers only.\n\n``` js\nalice.head('rabbit', function(err, _, headers) {\n if (!err)\n console.log(headers);\n});\n```\n\n### db.copy(src_doc, dest_doc, opts, [callback])\n\n`copy` the contents (and attachments) of a document\nto a new document, or overwrite an existing target document\n\n``` js\nalice.copy('rabbit', 'rabbit2', { overwrite: true }, function(err, _, headers) {\n if (!err)\n console.log(headers);\n});\n```\n\n\n### db.bulk(docs, [params], [callback])\n\nbulk operations(update/delete/insert) on the database, refer to the\n[couchdb doc](http://wiki.apache.org/couchdb/HTTP_Bulk_Document_API).\n\n### db.list([params], [callback])\n\nlist all the docs in the database with optional query string additions `params`.\n\n``` js\nalice.list(function(err, body) {\n if (!err) {\n body.rows.forEach(function(doc) {\n console.log(doc);\n });\n }\n});\n```\n\n### db.fetch(docnames, [params], [callback])\n\nbulk fetch of the database documents, `docnames` are specified as per\n[couchdb doc](http://wiki.apache.org/couchdb/HTTP_Bulk_Document_API).\nadditional query string `params` can be specified, `include_docs` is always set\nto `true`.\n\n### db.fetchRevs(docnames, [params], [callback])\n\n** changed in version 6 **\n\nbulk fetch of the revisions of the database documents, `docnames` are specified as per\n[couchdb doc](http://wiki.apache.org/couchdb/HTTP_Bulk_Document_API).\nadditional query string `params` can be specified, this is the same method as fetch but\n `include_docs` is not automatically set to `true`.\n\n## multipart functions\n\n### db.multipart.insert(doc, attachments, [params], [callback])\n\ninserts a `doc` together with `attachments` and optional `params`. if params is a string, its assumed as the intended document name. if params is an object, its passed as query string parameters and `doc_name` is checked for defining the document name.\n refer to the [doc](http://wiki.apache.org/couchdb/HTTP_Document_API#Multiple_Attachments) for more details.\n `attachments` must be an array of objects with `name`, `data` and `content_type` properties.\n\n``` js\nvar fs = require('fs');\n\nfs.readFile('rabbit.png', function(err, data) {\n if (!err) {\n alice.multipart.insert({ foo: 'bar' }, [{name: 'rabbit.png', data: data, content_type: 'image/png'}], 'mydoc', function(err, body) {\n if (!err)\n console.log(body);\n });\n }\n});\n```\n\n### db.multipart.get(docname, [params], [callback])\n\nget `docname` together with its attachments via `multipart/related` request with optional query string additions\n`params`. refer to the\n [doc](http://wiki.apache.org/couchdb/HTTP_Document_API#Getting_Attachments_With_a_Document) for more details.\n the multipart response body is a `Buffer`.\n\n``` js\nalice.multipart.get('rabbit', function(err, buffer) {\n if (!err)\n console.log(buffer.toString());\n});\n```\n\n## attachments functions\n\n### db.attachment.insert(docname, attname, att, contenttype, [params], [callback])\n\ninserts an attachment `attname` to `docname`, in most cases\n `params.rev` is required. refer to the\n [doc](http://wiki.apache.org/couchdb/HTTP_Document_API) for more details.\n\n``` js\nvar fs = require('fs');\n\nfs.readFile('rabbit.png', function(err, data) {\n if (!err) {\n alice.attachment.insert('rabbit', 'rabbit.png', data, 'image/png',\n { rev: '12-150985a725ec88be471921a54ce91452' }, function(err, body) {\n if (!err)\n console.log(body);\n });\n }\n});\n```\n\nor using `pipe`:\n\n``` js\nvar fs = require('fs');\n\nfs.createReadStream('rabbit.png').pipe(\n alice.attachment.insert('new', 'rab.png', null, 'image/png')\n);\n```\n\n### db.attachment.get(docname, attname, [params], [callback])\n\nget `docname`'s attachment `attname` with optional query string additions\n`params`.\n\n``` js\nvar fs = require('fs');\n\nalice.attachment.get('rabbit', 'rabbit.png', function(err, body) {\n if (!err) {\n fs.writeFile('rabbit.png', body);\n }\n});\n```\n\nor using `pipe`:\n\n``` js\nvar fs = require('fs');\n\nalice.attachment.get('rabbit', 'rabbit.png').pipe(fs.createWriteStream('rabbit.png'));\n```\n\n### db.attachment.destroy(docname, attname, [params], [callback])\n\n**changed in version 6**\n\ndestroy attachment `attname` of `docname`'s revision `rev`.\n\n``` js\nalice.attachment.destroy('rabbit', 'rabbit.png',\n {rev: '1-4701d73a08ce5c2f2983bf7c9ffd3320'}, function(err, body) {\n if (!err)\n console.log(body);\n});\n```\n\n## views and design functions\n\n### db.view(designname, viewname, [params], [callback])\n\ncalls a view of the specified design with optional query string additions\n`params`. if you're looking to filter the view results by key(s) pass an array of keys, e.g\n`{ keys: ['key1', 'key2', 'key_n'] }`, as `params`.\n\n``` js\nalice.view('characters', 'crazy_ones', function(err, body) {\n if (!err) {\n body.rows.forEach(function(doc) {\n console.log(doc.value);\n });\n }\n});\n```\n\n### db.view_with_list(designname, viewname, listname, [params], [callback])\n\ncalls a list function feeded by the given view of the specified design document.\n\n``` js\nalice.view_with_list('characters', 'crazy_ones', 'my_list', function(err, body) {\n if (!err) {\n console.log(body);\n }\n});\n```\n\n### db.show(designname, showname, doc_id, [params], [callback])\n\ncalls a show function of the specified design for the document specified by doc_id with\noptional query string additions `params`.\n\n``` js\nalice.show('characters', 'format_doc', '3621898430', function(err, doc) {\n if (!err) {\n console.log(doc);\n }\n});\n```\ntake a look at the [couchdb wiki](http://wiki.apache.org/couchdb/Formatting_with_Show_and_List#Showing_Documents)\nfor possible query paramaters and more information on show functions.\n\n### db.atomic(designname, updatename, docname, [body], [callback])\n\ncalls the design's update function with the specified doc in input.\n\n``` js\ndb.atomic(\"update\", \"inplace\", \"foobar\",\n{field: \"foo\", value: \"bar\"}, function (error, response) {\n assert.equal(error, undefined, \"failed to update\");\n assert.equal(response.foo, \"bar\", \"update worked\");\n});\n```\n\nNote that the data is sent in the body of the request.\nAn example update handler follows:\n\n``` js\n\"updates\": {\n \"in-place\" : \"function(doc, req) {\n var field = req.form.field;\n var value = req.form.value;\n var message = 'set '+field+' to '+value;\n doc[field] = value;\n return [doc, message];\n }\"\n```\n\n### db.search(designname, searchname, [params], [callback])\n\ncalls a view of the specified design with optional query string additions `params`.\n\n``` js\nalice.search('characters', 'crazy_ones', { q: 'cat' }, function(err, doc) {\n if (!err) {\n console.log(doc);\n }\n});\n```\n\ncheck out the tests for a fully functioning example.\n\n## using cookie authentication\n\nnano supports making requests using couchdb's [cookie authentication](http://guide.couchdb.org/editions/1/en/security.html#cookies) functionality. there's a [step-by-step guide here](http://codetwizzle.com/articles/couchdb-cookie-authentication-nodejs-nano/), but essentially you just:\n\n``` js\nvar nano = require('nano')('http://localhost:5984')\n , username = 'user'\n , userpass = 'pass'\n , callback = console.log // this would normally be some callback\n , cookies = {} // store cookies, normally redis or something\n ;\n\nnano.auth(username, userpass, function (err, body, headers) {\n if (err) {\n return callback(err);\n }\n\n if (headers && headers['set-cookie']) {\n cookies[user] = headers['set-cookie'];\n }\n\n callback(null, \"it worked\");\n});\n```\n\nreusing a cookie:\n\n``` js\nvar auth = \"some stored cookie\"\n , callback = console.log // this would normally be some callback\n , alice = require('nano')(\n { url : 'http://localhost:5984/alice', cookie: 'AuthSession=' + auth });\n ;\n\nalice.insert(doc, function (err, body, headers) {\n if (err) {\n return callback(err);\n }\n\n // change the cookie if couchdb tells us to\n if (headers && headers['set-cookie']) {\n auth = headers['set-cookie'];\n }\n\n callback(null, \"it worked\");\n});\n```\n\ngetting current session:\n\n```javascript\nvar nano = require('nano')({url: 'http://localhost:5984', cookie: 'AuthSession=' + auth});\n\nnano.session(function(err, session) {\n if (err) {\n return console.log('oh noes!')\n }\n\n console.log('user is %s and has these roles: %j',\n session.userCtx.user, session.userCtx.roles);\n});\n```\n\n\n## advanced features\n\n### extending nano\n\nnano is minimalistic but you can add your own features with\n`nano.request(opts, callback)`\n\nfor example, to create a function to retrieve a specific revision of the\n`rabbit` document:\n\n``` js\nfunction getrabbitrev(rev, callback) {\n nano.request({ db: 'alice',\n doc: 'rabbit',\n method: 'get',\n params: { rev: rev }\n }, callback);\n}\n\ngetrabbitrev('4-2e6cdc4c7e26b745c2881a24e0eeece2', function(err, body) {\n if (!err) {\n console.log(body);\n }\n});\n```\n### pipes\n\nyou can pipe in nano like in any other stream.\nfor example if our `rabbit` document has an attachment with name `picture.png`\n(with a picture of our white rabbit, of course!) you can pipe it to a `writable\nstream`\n\n``` js\nvar fs = require('fs'),\n nano = require('nano')('http://127.0.0.1:5984/');\nvar alice = nano.use('alice');\nalice.attachment.get('rabbit', 'picture.png').pipe(fs.createWriteStream('/tmp/rabbit.png'));\n```\n\nthen open `/tmp/rabbit.png` and you will see the rabbit picture.\n\n\n## tutorials, examples in the wild & screencasts\n\n* article: [nano - a minimalistic couchdb client for nodejs](http://writings.nunojob.com/2011/08/nano-minimalistic-couchdb-client-for-nodejs.html)\n* article: [getting started with node.js and couchdb](http://writings.nunojob.com/2011/09/getting-started-with-nodejs-and-couchdb.html)\n* article: [document update handler support](http://jackhq.tumblr.com/post/16035106690/nano-v1-2-x-document-update-handler-support-v1-2-x)\n* article: [nano 3](http://writings.nunojob.com/2012/05/Nano-3.html)\n* article: [securing a site with couchdb cookie authentication using node.js and nano](http://codetwizzle.com/articles/couchdb-cookie-authentication-nodejs-nano/)\n* article: [adding copy to nano](http://blog.jlank.com/2012/07/04/adding-copy-to-nano/)\n* article: [how to update a document with nano](http://writings.nunojob.com/2012/07/How-To-Update-A-Document-With-Nano-The-CouchDB-Client-for-Node.js.html)\n* article: [thoughts on development using couchdb with node.js](http://tbranyen.com/post/thoughts-on-development-using-couchdb-with-nodejs)\n* example in the wild: [nanoblog](https://github.com/grabbeh/nanoblog)\n\n## roadmap\n\ncheck [issues][2]\n\n## tests\n\nto run (and configure) the test suite simply:\n\n``` sh\ncd nano\nnpm install\nnpm test\n```\n\nafter adding a new test you can run it individually (with verbose output) using:\n\n``` sh\nnano_env=testing node tests/doc/list.js list_doc_params\n```\n\nwhere `list_doc_params` is the test name.\n\n## meta\n\n _\n / _) roar! i'm a vegan!\n .-^^^-/ /\n __/ /\n /__.|_|-|_| cannes est superb\n\n* code: `git clone git://github.com/dscape/nano.git`\n* home: \n* bugs: \n* build: [![build status](https://secure.travis-ci.org/dscape/nano.png)](http://travis-ci.org/dscape/nano)\n* deps: [![deps status](https://david-dm.org/dscape/nano.png)](https://david-dm.org/dscape/nano)\n* chat: \n\n`(oo)--',-` in [caos][3]\n\n[1]: http://npmjs.org\n[2]: http://github.com/dscape/nano/issues\n[3]: http://caos.di.uminho.pt/\n[4]: https://github.com/dscape/nano/blob/master/cfg/couch.example.js\n[follow]: https://github.com/iriscouch/follow\n[request]: https://github.com/mikeal/request\n\n## license\n\ncopyright 2011 nuno job (oo)--',--\n\nlicensed under the apache license, version 2.0 (the \"license\");\nyou may not use this file except in compliance with the license.\nyou may obtain a copy of the license at\n\n http://www.apache.org/licenses/LICENSE-2.0.html\n\nunless required by applicable law or agreed to in writing, software\ndistributed under the license is distributed on an \"as is\" basis,\nwithout warranties or conditions of any kind, either express or implied.\nsee the license for the specific language governing permissions and\nlimitations under the license.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/dscape/nano/issues" + "repository": { + "type": "git", + "url": "git://github.com/dscape/nano.git" }, - "_id": "nano@6.0.1", - "_from": "nano@6.0.1" + "scripts": { + "checkcoverage": "istanbul check-coverage --statements 100 --functions 100 --lines 100 --branches 100", + "codestyle": "jscs -p google tests/*/*/*.js lib/*.js", + "coverage": "open coverage/lcov-report/index.html", + "jshint": "jshint tests/*/*/*.js lib/*.js", + "mocked": "tape tests/*/*/*.js", + "test": "DEBUG=* NOCK_OFF=true istanbul cover tape tests/*/*/*.js", + "unmocked": "NOCK_OFF=true tape tests/*/*/*.js" + }, + "version": "6.0.1" }