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

Function nonEmptyCmp

src/cmap/handshake/client_metadata.ts:14–19  ·  view source on GitHub ↗
(s1: string | undefined, s2: string | undefined)

Source from the content-addressed store, hash-verified

12export function isDriverInfoEqual(info1: DriverInfo, info2: DriverInfo): boolean {
13 /** for equality comparison, we consider "" as unset */
14 const nonEmptyCmp = (s1: string | undefined, s2: string | undefined): boolean => {
15 s1 ||= undefined;
16 s2 ||= undefined;
17
18 return s1 === s2;
19 };
20
21 return (
22 nonEmptyCmp(info1.name, info2.name) &&

Callers 1

isDriverInfoEqualFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected