decentralised sync engine
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: raw data decoder

serenity c43f0a2f 1304fa46

+11
+11
src/lib/utils/ws/index.ts
··· 1 + import type { RawData } from "ws"; 2 + 3 + export const rawDataToString = (data: RawData): string => { 4 + if (Buffer.isBuffer(data)) { 5 + return data.toString("utf-8"); 6 + } 7 + if (Array.isArray(data)) { 8 + return Buffer.concat(data).toString("utf-8"); 9 + } 10 + return new TextDecoder().decode(data); 11 + };