Skip to content

Commit

Permalink
Revert "Whitespace fixes"
Browse files Browse the repository at this point in the history
This reverts commit cd076a8.
  • Loading branch information
tj committed Jun 30, 2010
1 parent 4de0dd3 commit 5bc40c8
Show file tree
Hide file tree
Showing 30 changed files with 134 additions and 134 deletions.
18 changes: 9 additions & 9 deletions lib/connect/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var sys = require('sys'),

/**
* Default env for those who do not use _bin/connect_.
*
* @type Object
*/

Expand Down Expand Up @@ -77,18 +77,18 @@ if (typeof Object.prototype.map !== 'function') {

/**
* Setup the given middleware layer callbacks.
*
* Examples:
*
* connect.createServer(
* connect.log(),
* connect.static(__dirname + '/public')
* );
*
* var server = connect.createServer();
* server.use('/', connect.log());
* server.use('/', connect.static(__dirname + '/public'));
*
* @params {Function} ...
* @return {Server}
* @api public
Expand All @@ -111,7 +111,7 @@ sys.inherits(Server, http.Server);

/**
* Stack the given middleware `handle` to the given `route`.
*
* @param {String} route
* @param {Function} handle
* @return {Server}
Expand Down Expand Up @@ -163,7 +163,7 @@ Server.prototype.use = function(route, handle){
* Listen on the given `port` number,
* defaults to the current environment's port,
* or _3000_ when neither are present.
*
* @param {Number} port
* @return {Server}
* @api public
Expand All @@ -177,7 +177,7 @@ Server.prototype.listen = function(port) {
/**
* Handle server requests, punting them down
* the middleware stack.
*
* @api private
*/

Expand Down Expand Up @@ -265,7 +265,7 @@ Server.prototype.handle = function(req, res, outerNext) {

/**
* Shortcut for `new connect.Server([ ... ])`.
*
* @param {Function} ...
* @param {Object} env
* @return {Server}
Expand Down
8 changes: 4 additions & 4 deletions lib/connect/middleware/bodyDecoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var queryString = require('querystring');
/**
* Extract the mime type from the given request's
* _Content-Type_ header.
*
* @param {IncomingMessage} req
* @return {String}
* @api private
Expand All @@ -27,7 +27,7 @@ function mime(req) {

/**
* Supported decoders.
*
* - application/x-www-form-urlencoded
* - application/json
*/
Expand All @@ -39,7 +39,7 @@ exports.decode = {

/**
* Decode request bodies.
*
* @return {Function}
* @api public
*/
Expand All @@ -66,4 +66,4 @@ module.exports = function bodyDecoder(){
next();
}
}
};
};
4 changes: 2 additions & 2 deletions lib/connect/middleware/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var Buffer = require('buffer').Buffer;

/**
* Cache in memory for the given `cacheDuration`.
*
* @param {Number} cacheDuration
* @return {Function}
* @api public
Expand Down Expand Up @@ -139,4 +139,4 @@ module.exports = function cache(cacheDuration){

next();
};
};
};
4 changes: 2 additions & 2 deletions lib/connect/middleware/cacheManifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var fs = require('fs'),
/**
* Generate cache manifest for the given `root`, `networks`,
* and `fallbacks`.
*
* @param {String} root
* @param {Array} networks
* @param {Array} fallbacks
Expand Down Expand Up @@ -68,4 +68,4 @@ module.exports = function cacheManifest(root, networks, fallbacks) {
}
next();
};
};
};
14 changes: 7 additions & 7 deletions lib/connect/middleware/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var fs = require('fs'),

/**
* Bundled compilers:
*
* - [sass](http://github.com/visionmedia/sass.js) to _css_
* - [less](http://github.com/cloudhead/less.js) to _css_
*/
Expand Down Expand Up @@ -47,18 +47,18 @@ var compilers = exports.compilers = {

/**
* Setup compiler.
*
* Options:
*
* - `src` Source directory, defaults to **CWD**.
* - `dest` Destination directory, defaults `src`.
* - `enable` Array of enabled compilers.
*
* Compilers:
*
* - `sass` Compiles cass to css
* - `less` Compiles less to css
*
* @param {Object} options
* @api public
*/
Expand Down Expand Up @@ -136,4 +136,4 @@ module.exports = function compiler(options){
}
next();
};
};
};
4 changes: 2 additions & 2 deletions lib/connect/middleware/conditionalGet.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/**
* Conditional GET request support.
*
* @return {Function}
* @api public
*/
Expand Down Expand Up @@ -68,4 +68,4 @@ module.exports = function conditionalGet(){

next();
};
};
};
4 changes: 2 additions & 2 deletions lib/connect/middleware/cookieDecoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var utils = require('./../utils');

/**
* Parse _Cookie_ header and populate `req.cookies`.
*
* @return {Function}
* @api public
*/
Expand All @@ -36,4 +36,4 @@ module.exports = function cookieDecoder(){
next();
}
};
};
};
6 changes: 3 additions & 3 deletions lib/connect/middleware/errorHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ var utils = require('./../utils'),

/**
* Setup error handler with the given `options`.
*
* Options:
*
* - `showStack` respond with both the error message and stack trace. Defaults to `false`
* - `showMessage` respond with the exception message only. Defaults to `false`
* - `dumpExceptions` dump exceptions to stderr (without terminating the process). Defaults to `false`
*
* @param {Object} options
* @return {Function}
* @api public
Expand Down
16 changes: 8 additions & 8 deletions lib/connect/middleware/flash.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var utils = require('./../utils');

/**
* Provide `req.flash()`.
*
* @return {Function}
* @api public
*/
Expand All @@ -23,23 +23,23 @@ module.exports = function flash(){

/**
* Queue flash `msg` of the given `type`.
*
* Examples:
*
* req.flash('info', 'email sent');
* req.flash('error', 'email delivery failed');
* req.flash('info', 'email re-sent');
* // => 2
*
* req.flash('info');
* // => ['email sent', 'email re-sent']
*
* req.flash('info');
* // => []
*
* req.flash();
* // => { error: ['email delivery failed'], info: [] }
*
* @param {String} type
* @param {String} msg
* @return {Array|Object|Number}
Expand All @@ -63,4 +63,4 @@ module.exports = function flash(){

next();
};
};
};
8 changes: 4 additions & 4 deletions lib/connect/middleware/format.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ var connect = require('./../index'),
/**
* Extract url "formats" aka extensions from the request
* url, and assigns req.`format`.
*
* Examples:
*
* // curl http://localhost:3000/users.json
* handle: function(req, res, next){
* switch (req.format) {
Expand All @@ -30,7 +30,7 @@ var connect = require('./../index'),
* // respond with your default format
* }
* }
*
* @return {Function}
* @api public
*/
Expand All @@ -43,4 +43,4 @@ module.exports = function format(){
}
next();
};
};
};
4 changes: 2 additions & 2 deletions lib/connect/middleware/gzip.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var child_process = require('child_process'),

/**
* Provides gzip compression via the `gzip` executable.
*
* @return {Function}
* @api public
*/
Expand Down Expand Up @@ -69,4 +69,4 @@ module.exports = function gzip(){

next();
};
};
};
8 changes: 4 additions & 4 deletions lib/connect/middleware/jsonrpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ errorMessages[INTERNAL_ERROR] = 'Internal Error.';

/**
* Accepts any number of objects, exposing their methods.
*
* @param {Object} ...
* @return {Function}
* @api public
Expand All @@ -87,7 +87,7 @@ function jsonrpc(services) {

/**
* Handle JSON-RPC request.
*
* @param {Object} rpc
* @param {Function} respond
*/
Expand Down Expand Up @@ -218,11 +218,11 @@ function jsonrpc(services) {
/**
* Check if the given request is a valid
* JSON remote procedure call.
*
* - "jsonrpc" must match the supported version ('2.0')
* - "id" must be numeric
* - "method" must be a string
*
* @param {Object} rpc
* @return {Boolean}
* @api private
Expand Down
12 changes: 6 additions & 6 deletions lib/connect/middleware/lint.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var connect = require('./../index'),

/**
* Output the given warning message.
*
* @param {String} msg
* @api private
*/
Expand All @@ -25,7 +25,7 @@ function warn(msg) {

/**
* Setup lint for the given `server`.
*
* @return {Function}
* @api public
*/
Expand Down Expand Up @@ -53,7 +53,7 @@ module.exports = function lint(server){

/**
* Validate middleware in the stack.
*
* @param {Array} stack
* @api private
*/
Expand Down Expand Up @@ -113,7 +113,7 @@ function checkStack(stack) {

/**
* Return the function body as a string.
*
* @param {Function} fn
* @return {String}
* @api private
Expand All @@ -125,12 +125,12 @@ function contents(fn){

/**
* Return array of function parameter names.
*
* @param {Function} fn
* @return {String}
* @api private
*/

function params(fn){
return fn.toString().match(/\((.*?)\)/)[1].match(/[\w]+/g) || [];
}
}
Loading

0 comments on commit 5bc40c8

Please sign in to comment.