mirror of
https://github.com/jwetzell/psn-js.git
synced 2026-08-22 07:29:13 +00:00
convert to typescript
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import infoPacketChunk, { InfoPacketChunk } from './info/info-packet-chunk';
|
||||
|
||||
import dataPacketChunk, { DataPacketChunk } from './data/data-packet-chunk';
|
||||
|
||||
export default (buffer: Buffer): InfoPacketChunk | DataPacketChunk | undefined => {
|
||||
const chunkId = buffer.readUInt16LE();
|
||||
switch (chunkId) {
|
||||
case 0x6756:
|
||||
return infoPacketChunk(buffer);
|
||||
case 0x6755:
|
||||
return dataPacketChunk(buffer);
|
||||
default:
|
||||
return undefined;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user