@standardserver/peer
Advanced tools
+6
-2
@@ -1,2 +0,2 @@ | ||
| import { StandardRequest, EventStreamMessage, StandardResponse, StandardLazyResponse, StandardLazyRequest } from '@standardserver/core'; | ||
| import { StandardRequest, EventMeta, StandardResponse, StandardLazyResponse, StandardLazyRequest } from '@standardserver/core'; | ||
| import { Queue, AsyncCleanupFn, AsyncIteratorClass } from '@standardserver/shared'; | ||
@@ -91,4 +91,8 @@ | ||
| */ | ||
| json: Omit<EventStreamMessage, 'data'> & { | ||
| json: EventMeta & { | ||
| /** | ||
| * Kind of event | ||
| */ | ||
| event: 'message' | 'error' | 'close'; | ||
| /** | ||
| * Event data. | ||
@@ -95,0 +99,0 @@ */ |
+6
-2
@@ -1,2 +0,2 @@ | ||
| import { StandardRequest, EventStreamMessage, StandardResponse, StandardLazyResponse, StandardLazyRequest } from '@standardserver/core'; | ||
| import { StandardRequest, EventMeta, StandardResponse, StandardLazyResponse, StandardLazyRequest } from '@standardserver/core'; | ||
| import { Queue, AsyncCleanupFn, AsyncIteratorClass } from '@standardserver/shared'; | ||
@@ -91,4 +91,8 @@ | ||
| */ | ||
| json: Omit<EventStreamMessage, 'data'> & { | ||
| json: EventMeta & { | ||
| /** | ||
| * Kind of event | ||
| */ | ||
| event: 'message' | 'error' | 'close'; | ||
| /** | ||
| * Event data. | ||
@@ -95,0 +99,0 @@ */ |
+2
-2
@@ -463,3 +463,3 @@ import { AsyncIteratorClass, isTypescriptObject, isAsyncIteratorObject, Queue, SequentialIdGenerator, AbortError, stringifyJSON } from '@standardserver/shared'; | ||
| } | ||
| if (maybe.json.event !== void 0 && typeof maybe.json.event !== "string") { | ||
| if (maybe.json.event !== "message" && maybe.json.event !== "error" && maybe.json.event !== "close") { | ||
| return false; | ||
@@ -476,3 +476,3 @@ } | ||
| function isPeerOctetStreamMessage(maybe) { | ||
| return maybe.kind === "octet-stream" && isTypescriptObject(maybe.json) && typeof maybe.json.close === "boolean"; | ||
| return maybe.kind === "octet-stream" && isTypescriptObject(maybe.json) && (typeof maybe.json.close === "undefined" || typeof maybe.json.close === "boolean"); | ||
| } | ||
@@ -479,0 +479,0 @@ function isPeerStreamCancelMessage(maybe) { |
+3
-3
| { | ||
| "name": "@standardserver/peer", | ||
| "type": "module", | ||
| "version": "0.4.1", | ||
| "version": "0.4.2", | ||
| "license": "MIT", | ||
@@ -25,4 +25,4 @@ "homepage": "https://standardserver.dev", | ||
| "dependencies": { | ||
| "@standardserver/shared": "0.4.1", | ||
| "@standardserver/core": "0.4.1" | ||
| "@standardserver/shared": "0.4.2", | ||
| "@standardserver/core": "0.4.2" | ||
| }, | ||
@@ -29,0 +29,0 @@ "scripts": { |
71723
0.28%972
0.41%+ Added
+ Added
- Removed
- Removed
Updated
Updated