Skip to content

Commit

Permalink
Make typescript happy
Browse files Browse the repository at this point in the history
  • Loading branch information
goto-bus-stop committed Sep 10, 2024
1 parent 0182c35 commit b6411b7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/plugins/bans.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,14 @@ class Bans {

const total = await User.find().where(queryFilter).countDocuments();

/** @type {(import('../models/User.js').LeanUser & { banned: LeanBanned })[]} */
const bannedUsers = await User.find()
.where(queryFilter)
.skip(offset)
.limit(size)
.populate('banned.moderator')
.lean();
const bannedUsers = /** @type {(import('../models/User.js').LeanUser & { banned: LeanBanned })[]} */ (

Check failure on line 78 in src/plugins/bans.js

View workflow job for this annotation

GitHub Actions / Code style

This line has a length of 106. Maximum allowed is 100
await User.find()
.where(queryFilter)
.skip(offset)
.limit(size)
.populate('banned.moderator')
.lean()
);

const results = bannedUsers.map((user) => ({
...user.banned,
Expand Down
1 change: 1 addition & 0 deletions src/plugins/history.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class HistoryRepository {
/** @type {import('mongoose').PipelineStage[]} */
const aggregate = [];
if (filter != null) {
// @ts-expect-error TS2322: promise
aggregate.push({ $match: filter });
}
aggregate.push(
Expand Down

0 comments on commit b6411b7

Please sign in to comment.