stelar-time-real 3.3.4 → 3.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/protocol.js +1 -1
- package/src/protocol.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stelar-time-real",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.5",
|
|
4
4
|
"description": "Zero-dependency production real-time library. Custom binary TCP + manual WebSocket. No ws package. Rate limiting (custom/per-event/per-client), hooks, custom IP tracker, custom health check, runtime config, rooms, ACKs, middleware, TLS/SSL.",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"types": "./src/index.d.ts",
|
package/src/protocol.js
CHANGED
|
@@ -13,7 +13,7 @@ export function validateEventName(event) {
|
|
|
13
13
|
throw new ProtocolError('Event name cannot be empty', 'EMPTY_EVENT');
|
|
14
14
|
if (event.length > MAX_EVENT_LENGTH)
|
|
15
15
|
throw new ProtocolError(`Event name exceeds ${MAX_EVENT_LENGTH} bytes`, 'EVENT_TOO_LONG');
|
|
16
|
-
if (!/^[a-zA-Z0-9\-./:]+$/.test(event))
|
|
16
|
+
if (!/^[a-zA-Z0-9\-./:_]+$/.test(event))
|
|
17
17
|
throw new ProtocolError('Event name contains invalid characters', 'INVALID_EVENT_CHARS');
|
|
18
18
|
if (['ping', 'pong', 'connect', 'disconnect', 'error'].includes(event))
|
|
19
19
|
throw new ProtocolError(`Event "${event}" is reserved`, 'RESERVED_EVENT');
|
package/src/protocol.ts
CHANGED
|
@@ -20,7 +20,7 @@ export function validateEventName(event: string): void {
|
|
|
20
20
|
if (typeof event !== 'string') throw new ProtocolError('Event name must be a string', 'INVALID_EVENT');
|
|
21
21
|
if (!event) throw new ProtocolError('Event name cannot be empty', 'EMPTY_EVENT');
|
|
22
22
|
if (event.length > MAX_EVENT_LENGTH) throw new ProtocolError(`Event name exceeds ${MAX_EVENT_LENGTH} bytes`, 'EVENT_TOO_LONG');
|
|
23
|
-
if (!/^[a-zA-Z0-9\-./:]+$/.test(event)) throw new ProtocolError('Event name contains invalid characters', 'INVALID_EVENT_CHARS');
|
|
23
|
+
if (!/^[a-zA-Z0-9\-./:_]+$/.test(event)) throw new ProtocolError('Event name contains invalid characters', 'INVALID_EVENT_CHARS');
|
|
24
24
|
if (['ping', 'pong', 'connect', 'disconnect', 'error'].includes(event)) throw new ProtocolError(`Event "${event}" is reserved`, 'RESERVED_EVENT');
|
|
25
25
|
}
|
|
26
26
|
|