@rebasepro/server-mongo 0.29.1 → 0.29.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,7 +19,7 @@ export declare class MongoConditionBuilder {
19
19
  * @param filter - Rebase filter values
20
20
  * @returns Array of MongoDB filter objects
21
21
  */
22
- static buildFilterConditions<M extends Record<string, any>>(filter: FilterValues<Extract<keyof M, string>>): Filter<Document>[];
22
+ static buildFilterConditions<M extends Record<string, any>>(filter: FilterValues<Extract<keyof M, string>> | undefined): Filter<Document>[];
23
23
  /**
24
24
  * One field, one operator, one value.
25
25
  *
package/dist/index.es.js CHANGED
@@ -34,7 +34,9 @@ var MongoDBConnection = class {
34
34
  }
35
35
  get isConnected() {
36
36
  try {
37
- return this.client.topology?.isConnected?.() ?? false;
37
+ const topology = "topology" in this.client ? this.client.topology : void 0;
38
+ if (typeof topology !== "object" || topology === null || !("isConnected" in topology)) return false;
39
+ return typeof topology.isConnected === "function" ? topology.isConnected() === true : false;
38
40
  } catch {
39
41
  return false;
40
42
  }