Skip to content

Commit

Permalink
build: some jsdoc improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Nov 9, 2014
1 parent b84258d commit 2c366f4
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@

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

var debug = require('debug')('cookie-session');
var Cookies = require('cookies');
var onHeaders = require('on-headers');

/**
* Initialize session middleware with options.
*
* See README.md for documentation of options.
* Create a new cookie session middleware.
*
* @param {Object} [opts]
* @return {Function} middleware
* @api public
* @param {object} [opts]
* @param {boolean} [opts.httpOnly]
* @param {array} [opts.keys]
* @param {string} [opts.name=express:sess] Name of the cookie to use
* @param {boolean} [opts.overwrite]
* @param {string} [opts.secret]
* @param {boolean} [opts.signed]
* @return {function} middleware
* @public
*/

module.exports = function(opts){
Expand Down Expand Up @@ -138,7 +144,7 @@ Session.prototype.toJSON = function(){
*
* @param {String} [prev]
* @return {Boolean}
* @api private
* @private
*/

Session.prototype.changed = function(prev){
Expand All @@ -152,7 +158,7 @@ Session.prototype.changed = function(prev){
* Used to see if it's "populated".
*
* @return {Number}
* @api public
* @public
*/

Session.prototype.__defineGetter__('length', function(){
Expand All @@ -163,18 +169,17 @@ Session.prototype.__defineGetter__('length', function(){
* populated flag, which is just a boolean alias of .length.
*
* @return {Boolean}
* @api public
* @public
*/

Session.prototype.__defineGetter__('populated', function(){
return !!this.length;
});

/**
* Save session changes by
* performing a Set-Cookie.
* Save session changes by performing a Set-Cookie.
*
* @api private
* @private
*/

Session.prototype.save = function(){
Expand All @@ -192,7 +197,7 @@ Session.prototype.save = function(){
*
* @param {String} string
* @return {Object}
* @api private
* @private
*/

function decode(string) {
Expand All @@ -205,7 +210,7 @@ function decode(string) {
*
* @param {Object} body
* @return {String}
* @api private
* @private
*/

function encode(body) {
Expand Down

0 comments on commit 2c366f4

Please sign in to comment.