Skip to content

Commit

Permalink
fix wrong jsdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
denghongcai committed Dec 14, 2015
1 parent 7b0073c commit 7012ba6
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 28 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -9,3 +9,4 @@ lib-cov
benchmarks/*.png
node_modules
coverage
.idea
8 changes: 4 additions & 4 deletions lib/client.js
Expand Up @@ -16,7 +16,7 @@ module.exports = Client;
* Client constructor.
*
* @param {Server} server instance
* @param {Socket} connection
* @param {Socket} conn
* @api private
*/

Expand Down Expand Up @@ -54,7 +54,7 @@ Client.prototype.setup = function(){
/**
* Connects a client to a namespace.
*
* @param {String} namespace name
* @param {String} name namespace
* @api private
*/

Expand Down Expand Up @@ -133,7 +133,7 @@ Client.prototype.close = function(){
* Writes a packet to the transport.
*
* @param {Object} packet object
* @param {Object} options
* @param {Object} opts
* @api private
*/

Expand Down Expand Up @@ -200,7 +200,7 @@ Client.prototype.ondecoded = function(packet) {
/**
* Handles an error.
*
* @param {Objcet} error object
* @param {Object} err object
* @api private
*/

Expand Down
27 changes: 13 additions & 14 deletions lib/index.js
Expand Up @@ -5,7 +5,6 @@

var http = require('http');
var read = require('fs').readFileSync;
var parse = require('url').parse;
var engine = require('engine.io');
var client = require('socket.io-client');
var clientVersion = require('socket.io-client/package').version;
Expand All @@ -30,8 +29,8 @@ var clientSource = read(require.resolve('socket.io-client/socket.io.js'), 'utf-8
/**
* Server constructor.
*
* @param {http.Server|Number|Object} http server, port or options
* @param {Object} options
* @param {http.Server|Number|Object} srv http server, port or options
* @param {Object} opts
* @api public
*/

Expand All @@ -54,8 +53,8 @@ function Server(srv, opts){
/**
* Server request verification function, that checks for allowed origins
*
* @param {http.IncomingMessage} request
* @param {Function} callback to be called with the result: `fn(err, success)`
* @param {http.IncomingMessage} req request
* @param {Function} fn callback to be called with the result: `fn(err, success)`
*/

Server.prototype.checkRequest = function(req, fn) {
Expand Down Expand Up @@ -87,7 +86,7 @@ Server.prototype.checkRequest = function(req, fn) {
/**
* Sets/gets whether client code is being served.
*
* @param {Boolean} whether to serve client code
* @param {Boolean} v whether to serve client code
* @return {Server|Boolean} self when setting or value when getting
* @api public
*/
Expand Down Expand Up @@ -140,7 +139,7 @@ Server.prototype.set = function(key, val){
/**
* Sets the client serving path.
*
* @param {String} pathname
* @param {String} v pathname
* @return {Server|String} self when setting or value when getting
* @api public
*/
Expand All @@ -154,7 +153,7 @@ Server.prototype.path = function(v){
/**
* Sets the adapter for rooms.
*
* @param {Adapter} pathname
* @param {Adapter} v pathname
* @return {Server|Adapter} self when setting or value when getting
* @api public
*/
Expand All @@ -173,7 +172,7 @@ Server.prototype.adapter = function(v){
/**
* Sets the allowed origins for requests.
*
* @param {String} origins
* @param {String} v origins
* @return {Server|Adapter} self when setting or value when getting
* @api public
*/
Expand Down Expand Up @@ -243,7 +242,7 @@ Server.prototype.attach = function(srv, opts){
/**
* Attaches the static file serving.
*
* @param {Function|http.Server} http server
* @param {Function|http.Server} srv http server
* @api private
*/

Expand Down Expand Up @@ -293,7 +292,7 @@ Server.prototype.serve = function(req, res){
/**
* Binds socket.io to an engine.io instance.
*
* @param {engine.Server} engine.io (or compatible) server
* @param {engine.Server} engine engine.io (or compatible) server
* @return {Server} self
* @api public
*/
Expand All @@ -307,7 +306,7 @@ Server.prototype.bind = function(engine){
/**
* Called with each incoming transport connection.
*
* @param {engine.Socket} socket
* @param {engine.Socket} conn
* @return {Server} self
* @api public
*/
Expand All @@ -322,8 +321,8 @@ Server.prototype.onconnection = function(conn){
/**
* Looks up a namespace.
*
* @param {String} nsp name
* @param {Function} optional, nsp `connection` ev handler
* @param {String} name nsp name
* @param {Function} fn optional, nsp `connection` ev handler
* @api public
*/

Expand Down
4 changes: 2 additions & 2 deletions lib/namespace.js
Expand Up @@ -104,7 +104,7 @@ Namespace.prototype.use = function(fn){
* Executes the middleware for an incoming client.
*
* @param {Socket} socket that will get added
* @param {Function} last fn call in the middleware
* @param {Function} fn last fn call in the middleware
* @api private
*/

Expand Down Expand Up @@ -260,7 +260,7 @@ Namespace.prototype.clients = function(fn){
/**
* Sets the compress flag.
*
* @param {Boolean} if `true`, compresses the sending data
* @param {Boolean} compress if `true`, compresses the sending data
* @return {Socket} self
* @api public
*/
Expand Down
16 changes: 8 additions & 8 deletions lib/socket.js
Expand Up @@ -199,7 +199,7 @@ Socket.prototype.write = function(){
* Writes a packet.
*
* @param {Object} packet object
* @param {Object} options
* @param {Object} opts options
* @api private
*/

Expand All @@ -214,7 +214,7 @@ Socket.prototype.packet = function(packet, opts){
* Joins a room.
*
* @param {String} room
* @param {Function} optional, callback
* @param {Function} fn optional, callback
* @return {Socket} self
* @api private
*/
Expand All @@ -239,7 +239,7 @@ Socket.prototype.join = function(room, fn){
* Leaves a room.
*
* @param {String} room
* @param {Function} optional, callback
* @param {Function} fn optional, callback
* @return {Socket} self
* @api private
*/
Expand Down Expand Up @@ -338,7 +338,7 @@ Socket.prototype.onevent = function(packet){
/**
* Produces an ack callback to emit with an event.
*
* @param {Number} packet id
* @param {Number} id packet id
* @api private
*/

Expand Down Expand Up @@ -409,7 +409,7 @@ Socket.prototype.onerror = function(err){
* Called upon closing. Called by `Client`.
*
* @param {String} reason
* @param {Error} optional error object
* @throw {Error} optional error object
* @api private
*/

Expand All @@ -428,7 +428,7 @@ Socket.prototype.onclose = function(reason){
/**
* Produces an `error` packet.
*
* @param {Object} error object
* @param {Object} err error object
* @api private
*/

Expand All @@ -439,7 +439,7 @@ Socket.prototype.error = function(err){
/**
* Disconnects this client.
*
* @param {Boolean} if `true`, closes the underlying connection
* @param {Boolean} close if `true`, closes the underlying connection
* @return {Socket} self
* @api public
*/
Expand All @@ -458,7 +458,7 @@ Socket.prototype.disconnect = function(close){
/**
* Sets the compress flag.
*
* @param {Boolean} if `true`, compresses the sending data
* @param {Boolean} compress if `true`, compresses the sending data
* @return {Socket} self
* @api public
*/
Expand Down

0 comments on commit 7012ba6

Please sign in to comment.