mirror of
https://github.com/jwetzell/psn-js.git
synced 2026-08-19 06:04:11 +00:00
22 lines
470 B
TypeScript
22 lines
470 B
TypeScript
import type {
|
|
InfoSystemNameChunk,
|
|
InfoSystemNameChunkData,
|
|
} from '../../models/info/info-system-name-chunk.js';
|
|
import { Decoders } from '../index.js';
|
|
|
|
const nameDecoder = new TextDecoder();
|
|
export default (buffer: Uint8Array): InfoSystemNameChunk => {
|
|
const chunk = Decoders.Chunk(buffer);
|
|
|
|
const data: InfoSystemNameChunkData = {
|
|
systemName: nameDecoder.decode(
|
|
chunk.chunkData.subarray(0, chunk.header.dataLen)
|
|
),
|
|
};
|
|
|
|
return {
|
|
chunk,
|
|
data,
|
|
};
|
|
};
|