This commit is contained in:
undefined committed 2024-11-05 09:02:20 +08:00
1 parent 8e31fb5b00
commit 9496f9c379
5 files changed
+7 -7

No files matched your search

+1 -1
View File
@@ -32,5 +32,5 @@ export interface Session {
cacheOpen: (source: string, files: any[], next?: NextFunction) => Promise<string>;
fetchFile: (target: string) => Promise<string>;
postFile: (target: string, filename: string, file: string) => Promise<void>;
config: { detail: boolean, host?: string };
config: { detail: boolean, host?: string, trusted?: boolean };
}
+2 -2
View File
@@ -221,8 +221,8 @@ class SystemUserImportHandler extends SystemHandler {
const users = _users.split('\n');
const udocs: { email: string, username: string, password: string, displayName?: string, [key: string]: any; }[] = [];
const messages = [];
const mapping = {};
const groups: Record<string, string[]> = {};
const mapping = Object.create(null);
const groups: Record<string, string[]> = Object.create(null);
for (const i in users) {
const u = users[i];
if (!u.trim()) continue;
+1 -1
View File
@@ -5,7 +5,7 @@ import { NumberKeys } from '../typeutils';
import { SYSTEM_SETTINGS } from './setting';
const coll = db.collection('system');
const cache: Record<string, any> = {};
const cache: Record<string, any> = Object.create(null);
export function get<K extends keyof SystemKeys>(key: K): SystemKeys[K];
export function get(key: string): any;
+2 -2
View File
@@ -197,8 +197,8 @@ export async function apply(ctx: Context) {
url(name: string, ...kwargsList: Record<string, any>[]) {
if (name === '#') return '#';
let res = '#';
const args: any = {};
const query: any = {};
const args: any = Object.create(null);
const query: any = Object.create(null);
for (const kwargs of kwargsList) {
for (const key in kwargs) {
if (kwargs[key] instanceof ObjectId) args[key] = kwargs[key].toHexString();
+1 -1
View File
@@ -1,5 +1,5 @@
export function buildProjection<T extends string | number = string>(fields: readonly T[]): Record<T, true> {
const o: Record<T, true> = {} as any;
const o: Record<T, true> = Object.create(null);
for (const k of fields) o[k] = true;
return o;
}