From d8008ba4185ffbc7f70958ed6bfadf75ae10243f Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Tue, 22 Aug 2023 21:35:04 +0300 Subject: [PATCH] fixes --- index.ts | 3 ++- src/MessageBroker.ts | 2 +- src/MongoDB.ts | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/index.ts b/index.ts index e63be83..3a95843 100644 --- a/index.ts +++ b/index.ts @@ -2,4 +2,5 @@ export { MessageBroker, BrokerOptions } from './src/MessageBroker.js'; export { MariaDB, MariaOptions } from './src/MariaDB.js'; export { MongoDB, MongoOptions } from './src/MongoDB.js'; export { ObjectId, Document, DeleteResult, Collection, Filter, UpdateFilter, MongoServerError } from 'mongodb'; -export { FieldInfo, OkPacket, Query, QueryOptions, Connection, PoolConnection, PoolCluster, MysqlError, Types } from 'mysql'; \ No newline at end of file +export { FieldInfo, OkPacket, Query, QueryOptions, Connection, PoolConnection, PoolCluster, MysqlError, Types } from 'mysql'; +export { ConsumeMessage } from 'amqplib'; \ No newline at end of file diff --git a/src/MessageBroker.ts b/src/MessageBroker.ts index a765202..60dd2db 100644 --- a/src/MessageBroker.ts +++ b/src/MessageBroker.ts @@ -362,7 +362,7 @@ class MessageBroker assertQueue (queue: string, opts?: QueueDef) { - if (!this.#channel) + if (!this.#channel) throw new Error('Channel doesn\'t exist'); return this.#channel.assertQueue(queue, opts); } diff --git a/src/MongoDB.ts b/src/MongoDB.ts index e2201ce..7f83b5e 100644 --- a/src/MongoDB.ts +++ b/src/MongoDB.ts @@ -200,7 +200,7 @@ class MongoDB if (typeof db !== 'string') throw new TypeError('Expecting collection name for the first argument'); - if (typeof query._id === 'string' && query._id.length === 12) + if (typeof query._id === 'string') query._id = new ObjectId(query._id); this.#logger.debug(`Incoming findOne query for ${db} with parameters ${inspect(query)}`);