assertBufferEqual
assertBufferEqual
Section titled “assertBufferEqual”Assert that two buffers (TypedArrays) are equal, comparing element by element.
Supports all TypedArray types: Uint8Array, Int8Array, Uint16Array, Int16Array, Uint32Array, Int32Array, Float32Array, Float64Array, BigInt64Array, BigUint64Array.
import { assertBufferEqual } from "@kensio/smartass";
const value: unknown = Buffer.from("ok");
assertBufferEqual(value, Buffer.from("ok"));
// value is now narrowed to BufferSource
Section titled “Source”Source file: src/assert/buffer-equal/buffer-equal.assert.ts
