mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 02:37:05 +02:00
9 lines
301 B
TypeScript
9 lines
301 B
TypeScript
import type { MessageFns } from '../../../protos/src/blitzkit';
|
|
|
|
export async function fetchPB<Type>(url: string, message: MessageFns<Type>) {
|
|
const response = await fetch(url);
|
|
const buffer = await response.arrayBuffer();
|
|
const array = new Uint8Array(buffer);
|
|
return message.decode(array);
|
|
}
|