node-datachannel
Advanced tools
Comparing version 0.23.0 to 0.24.0
@@ -5,3 +5,3 @@ cmake_minimum_required(VERSION 3.15) | ||
project(node_datachannel VERSION 0.23.0) | ||
project(node_datachannel VERSION 0.24.0) | ||
@@ -8,0 +8,0 @@ # -Dnapi_build_version=8 |
@@ -92,3 +92,3 @@ import { LogLevel, SctpSettings, Direction, Channel, DescriptionType, DataChannelInitConfig, RTCPeerConnectionState, RTCIceConnectionState, RTCSignalingState, RTCIceGatheringState, SelectedCandidateInfo, RtcConfig, WebSocketServerConfiguration } from './types.js'; | ||
sendMessage(msg: string): boolean; | ||
sendMessageBinary(buffer: Uint8Array): boolean; | ||
sendMessageBinary(buffer: Buffer | Uint8Array): boolean; | ||
isOpen(): boolean; | ||
@@ -95,0 +95,0 @@ bufferedAmount(): number; |
{ | ||
"name": "node-datachannel", | ||
"version": "0.23.0", | ||
"version": "0.24.0", | ||
"description": "WebRTC For Node.js and Electron. libdatachannel node bindings.", | ||
@@ -79,2 +79,3 @@ "main": "./dist/cjs/lib/index.cjs", | ||
"@rollup/plugin-esm-shim": "^0.1.7", | ||
"@rollup/plugin-replace": "^6.0.1", | ||
"@types/jest": "^29.5.12", | ||
@@ -81,0 +82,0 @@ "@types/node": "^20.6.1", |
@@ -99,3 +99,3 @@ import nodeDataChannel from './node-datachannel'; | ||
sendMessage(msg: string): boolean; | ||
sendMessageBinary(buffer: Uint8Array): boolean; | ||
sendMessageBinary(buffer: Buffer | Uint8Array): boolean; | ||
isOpen(): boolean; | ||
@@ -102,0 +102,0 @@ bufferedAmount(): number; |
@@ -1,18 +0,2 @@ | ||
let nodeDataChannel; | ||
try { | ||
// from dist | ||
nodeDataChannel = require('../../../build/Release/node_datachannel.node'); | ||
} | ||
catch (e) { | ||
// If this is not a module not found error, rethrow it | ||
if (e.code !== 'MODULE_NOT_FOUND') { | ||
throw e; | ||
} | ||
// from src | ||
nodeDataChannel = require('../../build/Release/node_datachannel.node'); | ||
} | ||
let nodeDataChannel = require('../../build/Release/node_datachannel.node'); | ||
export default nodeDataChannel; | ||
@@ -177,6 +177,14 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ | ||
data.arrayBuffer().then((ab) => { | ||
this.#dataChannel.sendMessageBinary(new Uint8Array(ab)); | ||
if (process?.versions?.bun) { | ||
this.#dataChannel.sendMessageBinary(Buffer.from(ab)); | ||
} else { | ||
this.#dataChannel.sendMessageBinary(new Uint8Array(ab)); | ||
} | ||
}); | ||
} else { | ||
this.#dataChannel.sendMessageBinary(new Uint8Array(data)); | ||
if (process?.versions?.bun) { | ||
this.#dataChannel.sendMessageBinary(Buffer.from(data)); | ||
} else { | ||
this.#dataChannel.sendMessageBinary(new Uint8Array(data)); | ||
} | ||
} | ||
@@ -183,0 +191,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
588733
4777
25