fix(client): wrong usage of Buffer (#37)

This commit is contained in:
Daniel Rochetti 2023-12-14 09:19:06 -08:00 committed by GitHub
parent e5cfd8ee38
commit 6a89dd1ba0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 6 deletions

View File

@ -1,7 +1,7 @@
{ {
"name": "@fal-ai/serverless-client", "name": "@fal-ai/serverless-client",
"description": "The fal serverless JS/TS client", "description": "The fal serverless JS/TS client",
"version": "0.7.1", "version": "0.7.2",
"license": "MIT", "license": "MIT",
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -271,7 +271,6 @@ const DEFAULT_THROTTLE_INTERVAL = 128;
function shouldSendBinary(message: any): boolean { function shouldSendBinary(message: any): boolean {
return Object.values(message).some( return Object.values(message).some(
(value) => (value) =>
value instanceof Buffer ||
value instanceof Blob || value instanceof Blob ||
value instanceof ArrayBuffer || value instanceof ArrayBuffer ||
value instanceof Uint8Array value instanceof Uint8Array
@ -478,10 +477,7 @@ export const realtimeImpl: RealtimeClient = {
onResult(result); onResult(result);
return; return;
} }
if ( if (event.data instanceof Uint8Array) {
event.data instanceof Buffer ||
event.data instanceof Uint8Array
) {
const result = unpack(event.data); const result = unpack(event.data);
onResult(result); onResult(result);
return; return;