MCPcopy
hub / github.com/mongodb/node-mongodb-native / errorStrictEqual

Function errorStrictEqual

src/utils.ts:382–404  ·  view source on GitHub ↗
(lhs?: AnyError | null, rhs?: AnyError | null)

Source from the content-addressed store, hash-verified

380
381/** @internal */
382export function errorStrictEqual(lhs?: AnyError | null, rhs?: AnyError | null): boolean {
383 if (lhs === rhs) {
384 return true;
385 }
386
387 if (!lhs || !rhs) {
388 return lhs === rhs;
389 }
390
391 if ((lhs == null && rhs != null) || (lhs != null && rhs == null)) {
392 return false;
393 }
394
395 if (lhs.constructor.name !== rhs.constructor.name) {
396 return false;
397 }
398
399 if (lhs.message !== rhs.message) {
400 return false;
401 }
402
403 return true;
404}
405
406interface StateTable {
407 [key: string]: string[];

Callers 2

equalsMethod · 0.90
serverDescriptionDiffFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected