Add toDataView

This commit is contained in:
Vanilagy
2025-01-26 12:03:23 +01:00
parent d3566305df
commit b759fd8808
4 changed files with 10 additions and 4 deletions
+4
View File
@@ -54,6 +54,10 @@ export const toUint8Array = (source: AllowSharedBufferSource): Uint8Array => {
}
};
export const toDataView = (bytes: Uint8Array) => {
return new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
};
export const textEncoder = new TextEncoder();
const invertObject = <K extends PropertyKey, V extends PropertyKey>(object: Record<K, V>) => {