socket.io
Advanced tools
Comparing version 3.0.0-rc3 to 3.0.0-rc4
@@ -0,1 +1,11 @@ | ||
# [3.0.0-rc4](https://github.com/socketio/socket.io/compare/3.0.0-rc3...3.0.0-rc4) (2020-10-30) | ||
### Features | ||
* emit an Error object upon middleware error ([54bf4a4](https://github.com/socketio/socket.io/commit/54bf4a44e9e896dfb64764ee7bd4e8823eb7dc7b)) | ||
* serve msgpack bundle ([aa7574f](https://github.com/socketio/socket.io/commit/aa7574f88471aa30ae472a5cddf1000a8baa70fd)) | ||
# [3.0.0-rc3](https://github.com/socketio/socket.io/compare/3.0.0-rc2...3.0.0-rc3) (2020-10-26) | ||
@@ -2,0 +12,0 @@ |
@@ -80,3 +80,5 @@ "use strict"; | ||
nsp: name, | ||
data: "Invalid namespace" | ||
data: { | ||
message: "Invalid namespace" | ||
} | ||
}); | ||
@@ -83,0 +85,0 @@ } |
/// <reference types="node" /> | ||
import http from "http"; | ||
import { EventEmitter } from "events"; | ||
import { Namespace } from "./namespace"; | ||
import { ExtendedError, Namespace } from "./namespace"; | ||
import { Room, SocketId } from "socket.io-adapter"; | ||
@@ -289,3 +289,3 @@ import { Encoder } from "socket.io-parser"; | ||
*/ | ||
use(fn: (socket: Socket, next: (err?: Error) => void) => void): Server; | ||
use(fn: (socket: Socket, next: (err?: ExtendedError) => void) => void): Server; | ||
/** | ||
@@ -292,0 +292,0 @@ * Targets a room when emitting. |
@@ -107,3 +107,5 @@ "use strict"; | ||
const escapedPath = this._path.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"); | ||
this.clientPathRegex = new RegExp("^" + escapedPath + "/socket\\.io(\\.min)?\\.js(\\.map)?$"); | ||
this.clientPathRegex = new RegExp("^" + | ||
escapedPath + | ||
"/socket\\.io(\\.min|\\.msgpack\\.min)?\\.js(\\.map)?$"); | ||
return this; | ||
@@ -110,0 +112,0 @@ } |
@@ -7,2 +7,5 @@ /// <reference types="node" /> | ||
import { Adapter, Room, SocketId } from "socket.io-adapter"; | ||
export interface ExtendedError extends Error { | ||
data?: any; | ||
} | ||
export declare class Namespace extends EventEmitter { | ||
@@ -15,3 +18,3 @@ readonly name: string; | ||
/** @private */ | ||
_fns: Array<(socket: Socket, next: (err: Error) => void) => void>; | ||
_fns: Array<(socket: Socket, next: (err: ExtendedError) => void) => void>; | ||
/** @private */ | ||
@@ -44,3 +47,3 @@ _rooms: Set<Room>; | ||
*/ | ||
use(fn: (socket: Socket, next: (err?: Error) => void) => void): Namespace; | ||
use(fn: (socket: Socket, next: (err?: ExtendedError) => void) => void): Namespace; | ||
/** | ||
@@ -47,0 +50,0 @@ * Executes the middleware for an incoming client. |
@@ -114,3 +114,6 @@ "use strict"; | ||
if (err) | ||
return socket._error(err.message); | ||
return socket._error({ | ||
message: err.message, | ||
data: err.data | ||
}); | ||
// track socket | ||
@@ -117,0 +120,0 @@ this.sockets.set(socket.id, socket); |
{ | ||
"name": "socket.io", | ||
"version": "3.0.0-rc3", | ||
"version": "3.0.0-rc4", | ||
"description": "node.js realtime framework server", | ||
@@ -16,2 +16,3 @@ "keywords": [ | ||
"dist/", | ||
"client-dist/", | ||
"wrapper.mjs" | ||
@@ -57,3 +58,3 @@ ], | ||
"prettier": "^1.19.1", | ||
"socket.io-client": "3.0.0-rc3", | ||
"socket.io-client": "3.0.0-rc4", | ||
"superagent": "^3.8.2", | ||
@@ -60,0 +61,0 @@ "supertest": "^3.0.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
985713
21
7896
2