This commit is contained in:
2026-03-25 14:14:07 +01:00
parent d6b31e2ef7
commit a0073b4fb1
10368 changed files with 2214340 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
import { pack, Packable, unpack, Unpackable } from "../lib/binarypack";
export const packAndUnpack = <T extends Unpackable>(data: Packable) => {
const encoded = pack(data);
if (encoded instanceof Promise) {
return encoded.then(unpack<T>);
}
return unpack<T>(encoded);
};