Skip to content

Commit

Permalink
fix: do not crash on initialization if bigint arrays don't exist
Browse files Browse the repository at this point in the history
Closes: #65
  • Loading branch information
targos committed Jan 30, 2023
1 parent 69a7235 commit 130e7ec
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/IOBuffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ const hostBigEndian = (() => {
type InputData = number | ArrayBufferLike | ArrayBufferView | IOBuffer | Buffer;

const typedArrays = {
int8: Int8Array,
uint8: Uint8Array,
int16: Int16Array,
uint16: Uint16Array,
int32: Int32Array,
uint32: Uint32Array,
uint64: BigUint64Array,
int64: BigInt64Array,
float32: Float32Array,
float64: Float64Array,
int8: globalThis.Int8Array,
uint8: globalThis.Uint8Array,
int16: globalThis.Int16Array,
uint16: globalThis.Uint16Array,
int32: globalThis.Int32Array,
uint32: globalThis.Uint32Array,
uint64: globalThis.BigUint64Array,
int64: globalThis.BigInt64Array,
float32: globalThis.Float32Array,
float64: globalThis.Float64Array,
};

type TypedArrays = typeof typedArrays;
Expand Down

0 comments on commit 130e7ec

Please sign in to comment.