mirror of
https://github.com/morluto/rea.git
synced 2026-12-04 14:01:00 +00:00
12 lines
394 B
TypeScript
12 lines
394 B
TypeScript
import type { BinaryReader } from "../../domain/binaryContainer.js";
|
|
|
|
/** An initializer slot with no complete file-backed word has no stored value. */
|
|
export const readInitializerWord = (
|
|
reader: BinaryReader,
|
|
offset: number | null,
|
|
bits: 32 | 64,
|
|
): bigint | null =>
|
|
offset === null || offset < 0 || offset > reader.bytes.length - bits / 8
|
|
? null
|
|
: reader.word(offset, bits);
|