Skip to content

Commit

Permalink
build: add additional jsdoc annotations
Browse files Browse the repository at this point in the history
closes #36
  • Loading branch information
dougwilson committed Oct 5, 2014
1 parent 402028f commit c82882e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

/**
* Module dependencies.
* @private
*/

var auth = require('basic-auth')
Expand All @@ -17,17 +18,18 @@ var onFinished = require('on-finished')

/**
* Default log buffer duration.
* @private
*/

var defaultBufferDuration = 1000;

/**
* Create a logger middleware.
*
* @public
* @param {String|Function} format
* @param {Object} [options]
* @return {Function} middleware
* @api public
*/

exports = module.exports = function morgan(format, options) {
Expand Down Expand Up @@ -115,9 +117,9 @@ exports = module.exports = function morgan(format, options) {
/**
* Compile `format` into a function.
*
* @private
* @param {Function|String} format
* @return {Function}
* @api private
*/

function compile(format) {
Expand All @@ -142,10 +144,10 @@ function compile(format) {
* Define a token function with the given `name`,
* and callback `fn(req, res)`.
*
* @public
* @param {String} name
* @param {Function} fn
* @return {Object} exports for chaining
* @api public
*/

exports.token = function(name, fn) {
Expand All @@ -156,10 +158,10 @@ exports.token = function(name, fn) {
/**
* Define a `fmt` with the given `name`.
*
* @public
* @param {String} name
* @param {String|Function} fmt
* @return {Object} exports for chaining
* @api public
*/

exports.format = function(name, fmt){
Expand Down Expand Up @@ -316,6 +318,10 @@ exports.token('res', function(req, res, field){

/**
* Get request IP address.
*
* @private
* @param {IncomingMessage} req
* @return {string}
*/

function getip(req) {
Expand Down

0 comments on commit c82882e

Please sign in to comment.