Skip to content

Commit

Permalink
chore: error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowplay1 committed Mar 30, 2024
1 parent 47cc308 commit 599c5b6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/lib/QuickMongoClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import { connect, disconnect } from 'mongoose'
import { MongoClientOptions } from 'mongodb'

import { IQuickMongoEvents } from '../types/Database'

import { Emitter } from './utils/Emitter'
import { typeOf } from './utils/functions/typeOf.function'

import { QuickMongo } from './QuickMongo'
import { QuickMongoError } from './utils/QuickMongoError'
Expand Down Expand Up @@ -118,7 +116,7 @@ export class QuickMongoClient<
}

if (
typeOf(connectionURI) !== 'string' ||
typeof connectionURI !== 'string' ||
(!connectionURI.startsWith('mongodb://') &&
!connectionURI.startsWith('mongodb+srv://'))
) {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils/functions/typeOf.function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ export const typeOf = (input: any): string => {
return input.name
}

return input.constructor.name.toLowerCase()
return input.constructor.name
}

0 comments on commit 599c5b6

Please sign in to comment.