mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-05 00:40:38 +01:00
9 lines
302 B
TypeScript
9 lines
302 B
TypeScript
import type { MessageFns } from "@blitzkit/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);
|
|
}
|