Skip to content

Commit 76ad448

Browse files
Merge pull request #282 from ilovepixelart/feature/esm
ESM
2 parents d505bb6 + 939621a commit 76ad448

File tree

5 files changed

+17
-16
lines changed

5 files changed

+17
-16
lines changed

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"vite.config.mts",
4646
"biome.json"
4747
],
48+
"type": "module",
4849
"exports": {
4950
"require": {
5051
"types": "./dist/index.d.cts",
@@ -79,14 +80,14 @@
7980
},
8081
"devDependencies": {
8182
"@biomejs/biome": "1.9.4",
82-
"@types/node": "22.13.5",
83+
"@types/node": "22.13.8",
8384
"@vitest/coverage-v8": "3.0.7",
8485
"bson": "^6.10.3",
8586
"mongodb-memory-server": "10.1.4",
8687
"open-cli": "8.0.0",
8788
"pkgroll": "2.11.2",
8889
"simple-git-hooks": "^2.11.1",
89-
"typescript": "5.7.3",
90+
"typescript": "5.8.2",
9091
"vitest": "3.0.7"
9192
},
9293
"peerDependencies": {

src/extend/aggregate.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ import type { CacheTTL } from '../types'
77
export function extendAggregate(mongoose: Mongoose, cache: Cache): void {
88
const mongooseExec = mongoose.Aggregate.prototype.exec
99

10-
mongoose.Aggregate.prototype.getCacheKey = function () {
10+
mongoose.Aggregate.prototype.getCacheKey = function (): string {
1111
if (this._key != null) return this._key
1212

1313
return getKey({
1414
pipeline: this.pipeline(),
1515
})
1616
}
1717

18-
mongoose.Aggregate.prototype.getCacheTTL = function () {
18+
mongoose.Aggregate.prototype.getCacheTTL = function (): CacheTTL | null {
1919
return this._ttl
2020
}
2121

src/extend/query.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type { CacheTTL } from '../types'
77
export function extendQuery(mongoose: Mongoose, cache: Cache): void {
88
const mongooseExec = mongoose.Query.prototype.exec
99

10-
mongoose.Query.prototype.getCacheKey = function () {
10+
mongoose.Query.prototype.getCacheKey = function (): string {
1111
if (this._key != null) return this._key
1212

1313
const filter = this.getFilter()
@@ -29,7 +29,7 @@ export function extendQuery(mongoose: Mongoose, cache: Cache): void {
2929
})
3030
}
3131

32-
mongoose.Query.prototype.getCacheTTL = function () {
32+
mongoose.Query.prototype.getCacheTTL = function (): CacheTTL | null {
3333
return this._ttl
3434
}
3535

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"target": "ES2021",
55
"lib": ["ES2021"],
66
"types": ["node"],
7-
"module": "CommonJS",
8-
"moduleResolution": "Node",
7+
"module": "Preserve",
8+
"moduleResolution": "bundler",
99
"outDir": "dist",
1010
"strict": true,
1111
"allowSyntheticDefaultImports": true,

0 commit comments

Comments
 (0)