Skip to main content
Module

x/equal/equal.ts>equalError

TypeScript-first deep equivalence comparison between two values
Latest
variable equalError
import { equalError } from "https://deno.land/x/equal@v1.5.0/equal.ts";

Returns true if its Error arguments are equivalent; otherwise false.

Examples

Example 1

equalError(Error('test'), Error('test')) // true
equalError(AggregateError([TypeError('test')]), AggregateError([TypeError('test')])) // true
equalError(Error('test'), Error('hello')) // false
equalError(Error('test'), TypeError('test')) // false

type

(a: Error, b: Error) => boolean