Checks if a
starts with the contents of b
.
This requires equality of the element values, where element equality means ===
returning true
.
This allows you to compare the content of a Buffer, Uint8Array or number[], ignoring the specific type.
As a consequence, this returns different results than Jasmine's toEqual
, which ensures elements have the same type.
Checks if input is not undefined in a TypeScript-friendly way.
This is convenient to use in e.g. Array.filter
as it will convert
the type of a Array<Foo | undefined>
to Array<Foo>
.
Checks if data is a non-null object (i.e. matches the TypeScript object type).
Note: this returns true for arrays, which are objects in JavaScript even though array and object are different types in JSON.
Checks if data is an Uint8Array. Note: Buffer is treated as not a Uint8Array
Generated using TypeDoc
Compares the content of two arrays-like objects for equality.
Equality is defined as having equal length and element values, where element equality means
===
returningtrue
.This allows you to compare the content of a Buffer, Uint8Array or number[], ignoring the specific type. As a consequence, this returns different results than Jasmine's
toEqual
, which ensures elements have the same type.