bump deps version

This commit is contained in:
undefined committed 2022-03-12 23:38:41 +08:00
1 parent e7b4b5de5e
commit f621d26ed7
29 files changed
+75 -63

No files matched your search

+6 -6
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "3.8.7",
"version": "3.9.0",
"bin": "bin/hydrooj.js",
"main": "src/loader",
"module": "src/loader",
@@ -20,12 +20,12 @@
"cac": "^6.7.12",
"cookies": "^0.8.0",
"detect-browser": "^5.3.0",
"emoji-regex": "^10.0.0",
"emoji-regex": "^10.0.1",
"emojis-list": "2.1.0",
"esbuild": "0.14.3",
"fs-extra": "^10.0.1",
"graphql": "^16.3.0",
"graphql-scalars": "1.14.1",
"graphql-scalars": "1.15.0",
"js-yaml": "^4.1.0",
"koa": "^2.13.4",
"koa-body": "^4.2.0",
@@ -34,7 +34,7 @@
"koa-router": "^10.1.1",
"koa-static-cache": "^5.1.4",
"lodash": "^4.17.21",
"lru-cache": "6.0.0",
"lru-cache": "7.4.4",
"mime-types": "^2.1.34",
"minio": "7.0.25",
"moment-timezone": "^0.5.34",
@@ -49,7 +49,7 @@
"serialize-javascript": "^6.0.0",
"sockjs": "^0.3.24",
"source-map-support": "^0.5.21",
"superagent": "^6.1.0",
"superagent": "^7.1.1",
"thirty-two": "^1.0.2",
"tx2": "^1.0.5"
},
@@ -62,7 +62,7 @@
"@types/koa-router": "^7.4.4",
"@types/koa-static-cache": "^5.1.1",
"@types/lodash": "^4.14.179",
"@types/lru-cache": "^5.1.1",
"@types/lru-cache": "^7.4.0",
"@types/mime-types": "^2.1.1",
"@types/minio": "^7.0.12",
"@types/mongodb": "^3.6.20",
+1 -1
View File
@@ -5,7 +5,7 @@ const _CACHE_INFO = {
};
function _LOGP(x: number) {
const sqrtPi = 2.506628274631000502415765284811; // Sqrt[Pi]
const sqrtPi = 2.506628274631; // Sqrt[Pi]
return (2 * Math.exp(-1.0 * (Math.log(x) ** 2) * 2)) / x / sqrtPi;
}
+1 -3
View File
@@ -91,9 +91,7 @@ class DomainModel {
static async inc(domainId: string, field: NumberKeys<DomainDoc>, n: number): Promise<number | null> {
const res = await coll.findOneAndUpdate(
{ _id: domainId },
// FIXME
// @ts-expect-error
{ $inc: { [field]: n } },
{ $inc: { [field]: n } as any },
{ returnDocument: 'after' },
);
return res.value?.[field];
+1 -3
View File
@@ -52,9 +52,7 @@ export async function set(_id: string, value: any, broadcast = true) {
export async function inc<K extends NumberKeys<SystemKeys>>(_id: K) {
const res = await coll.findOneAndUpdate(
{ _id },
// FIXME NumberKeys<>
// @ts-ignore
{ $inc: { value: 1 } },
{ $inc: { value: 1 } as any },
{ upsert: true, returnDocument: 'after' },
);
cache[_id] = res.value.value;
+3 -3
View File
@@ -35,12 +35,12 @@ export function deleteUserCache(udoc: User | Udoc | string | undefined | null, r
}
if (typeof udoc === 'string') {
// is domainId
for (const key of cache.keys().filter((i) => i.endsWith(`/${udoc}`))) cache.del(key);
for (const key of [...cache.keys()].filter((i) => i.endsWith(`/${udoc}`))) cache.delete(key);
return;
}
const id = [`id/${udoc._id.toString()}`, `name/${udoc.uname.toLowerCase()}`, `mail/${udoc.mail.toLowerCase()}`];
for (const key of cache.keys().filter((k) => id.includes(`${k.split('/')[0]}/${k.split('/')[1]}`))) {
cache.del(key);
for (const key of [...cache.keys()].filter((k) => id.includes(`${k.split('/')[0]}/${k.split('/')[1]}`))) {
cache.delete(key);
}
}
bus.on('user/delcache', (content) => deleteUserCache(JSON.parse(content), true));
+2
View File
@@ -25,6 +25,7 @@ function isBailed(value: any) {
export type Disposable = () => void;
export type VoidReturn = Promise<any> | any;
/* eslint-disable @typescript-eslint/naming-convention */
export interface EventMap extends Record<string, any> {
'app/started': () => void
'app/load/lib': () => VoidReturn
@@ -100,6 +101,7 @@ export interface EventMap extends Record<string, any> {
'record/change': (rdoc: RecordDoc, $set?: any, $push?: any) => void
'record/judge': (rdoc: RecordDoc, updated: boolean) => VoidReturn
}
/* eslint-enable @typescript-eslint/naming-convention */
function getHooks<K extends keyof EventMap>(name: K) {
const hooks = _hooks[name] || (_hooks[name] = []);