mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
fix
This commit is contained in:
5 files changed
+7
-7
No files matched your search
@@ -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 };
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user