rxprotoplex
Advanced tools
Comparing version 1.0.7 to 1.0.8
@@ -16,4 +16,4 @@ import Protoplex from "@zacharygriffee/protoplex"; | ||
export const asPlex = (stream, config) => { | ||
if (stream instanceof Protoplex) return stream; | ||
if (stream.isProtoplex) return stream; | ||
return Protoplex.from(stream, config); | ||
}; |
{ | ||
"name": "rxprotoplex", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "A utility library for working with Plex-based connections and streams with RxJS operators.", | ||
@@ -11,3 +11,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"@zacharygriffee/protoplex": "^2.2.2", | ||
"@zacharygriffee/protoplex": "^2.2.3", | ||
"b4a": "^1.6.7", | ||
@@ -14,0 +14,0 @@ "compact-encoding": "^2.15.0", |
@@ -28,2 +28,11 @@ import {test} from "brittle"; | ||
test("has isProtoplex", t => { | ||
const [p1,p2] = createPlexPair() | ||
t.is(p1.isProtoplex && p2.isProtoplex, true); | ||
const socket = p1.connect(); | ||
t.absent(socket.isProtoplex); | ||
t.absent(p1.mux.stream.isProtoplex); | ||
socket.destroy(); | ||
}) | ||
test("test listenAndConnect$", async t => { | ||
@@ -30,0 +39,0 @@ t.plan(1); |
33449
623