ieee754
ieee754 copied to clipboard
index.d.tx: buffer can be ArrayLike<number>, and make sure it works in tests
index.d.ts
declares buffer
is Uint8Array
, but in fact it can be Array<number>
or any kind of array-like object (ArrayLike<number>
in TypeScript), so I've tweaked those declarations in index.d.ts
and add tests to use Array
as well as Buffer
.
The type could at least be defined as Uint8Array | Uint8ClampedArray
, at the current moment having to do clampedArray as unknown as Uint8Array
when using TS is not the best