This commit is contained in:
undefined committed 2024-11-13 11:31:34 +08:00
1 parent 7c98899987
commit 444adf84e0
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>; cacheOpen: (source: string, files: any[], next?: NextFunction) => Promise<string>;
fetchFile: (target: string) => Promise<string>; fetchFile: (target: string) => Promise<string>;
postFile: (target: string, filename: string, file: string) => Promise<void>; 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 users = _users.split('\n');
const udocs: { email: string, username: string, password: string, displayName?: string, [key: string]: any; }[] = []; const udocs: { email: string, username: string, password: string, displayName?: string, [key: string]: any; }[] = [];
const messages = []; const messages = [];
const mapping = {}; const mapping = Object.create(null);
const groups: Record<string, string[]> = {}; const groups: Record<string, string[]> = Object.create(null);
for (const i in users) { for (const i in users) {
const u = users[i]; const u = users[i];
if (!u.trim()) continue; if (!u.trim()) continue;
+1 -1
View File
@@ -5,7 +5,7 @@ import { NumberKeys } from '../typeutils';
import { SYSTEM_SETTINGS } from './setting'; import { SYSTEM_SETTINGS } from './setting';
const coll = db.collection('system'); 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<K extends keyof SystemKeys>(key: K): SystemKeys[K];
export function get(key: string): any; 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>[]) { url(name: string, ...kwargsList: Record<string, any>[]) {
if (name === '#') return '#'; if (name === '#') return '#';
let res = '#'; let res = '#';
const args: any = {}; const args: any = Object.create(null);
const query: any = {}; const query: any = Object.create(null);
for (const kwargs of kwargsList) { for (const kwargs of kwargsList) {
for (const key in kwargs) { for (const key in kwargs) {
if (kwargs[key] instanceof ObjectId) args[key] = kwargs[key].toHexString(); 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> { 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; for (const k of fields) o[k] = true;
return o; return o;
} }