Files
blitzkit/packages/core/src/protobuf/decodeProtobuf.ts
T
2024-09-06 23:17:53 -05:00

10 lines
249 B
TypeScript

import { lookupProtobufType, ProtoSource } from './lookupProtobufType';
export function decodeProtobuf<Type>(
source: ProtoSource,
type: string,
data: Uint8Array,
) {
return lookupProtobufType(source, type).decode(data).toJSON() as Type;
}