Skip to content

Commit

Permalink
chore: rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs committed Dec 15, 2024
1 parent 866e8f6 commit f54407b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@types/node": "^22.0.0",
"c8": "^10.1.2",
"fastify": "^5.0.0",
"neostandard": "^0.11.9",
"neostandard": "^0.12.0",
"tsd": "^0.31.0"
},
"dependencies": {
Expand Down
3 changes: 1 addition & 2 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { FastifyPluginAsync } from 'fastify'
import type { Db, MongoClient, MongoClientOptions } from 'mongodb'
import mongodb from 'mongodb'
import { ObjectId } from 'mongodb'
import mongodb, { ObjectId } from 'mongodb'

declare module 'fastify' {
interface FastifyInstance {
Expand Down
12 changes: 6 additions & 6 deletions types/index.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ObjectId } from 'bson'
import fastify from 'fastify'
import { expectType } from 'tsd'
import fastifyMongodb, { mongodb, ObjectId as reExportedObjectId } from '..'
import { expectNotType, expectType } from 'tsd'
import fastifyMongodb, { mongodb, ObjectId as ReExportedObjectId } from '..'

const app = fastify()

Expand All @@ -11,13 +11,13 @@ app
name: 'db',
url: 'mongodb://localhost:27017/testdb',
})
.after((err) => {
.after((_err) => {
app.mongo.client.db('test')
app.mongo.db!
expectNotType<undefined>(app.mongo.db)
const ObjectId = app.mongo.ObjectId
expectType<ObjectId>(new reExportedObjectId('aaaa'))
expectType<ObjectId>(new ReExportedObjectId('aaaa'))
expectType<ObjectId>(new ObjectId('aaa'))
})

expectType<typeof reExportedObjectId>(mongodb.ObjectId)
expectType<typeof ReExportedObjectId>(mongodb.ObjectId)
expectType<4>(mongodb.BSONType.array)

0 comments on commit f54407b

Please sign in to comment.