mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core&utils: remove outdated code
This commit is contained in:
1 parent
5ae8258b8a
commit
7903d012da
23 files changed
+61
-144
No files matched your search
@@ -1,5 +1,3 @@
|
||||
import type { Logger } from './logger';
|
||||
|
||||
export function buildProjection(fields: string[]): Record<string, 1> {
|
||||
const o = {};
|
||||
for (const k of fields) o[k] = 1;
|
||||
@@ -18,21 +16,4 @@ export function ArgMethod(target: any, funcName: string, obj: any) {
|
||||
return obj;
|
||||
}
|
||||
|
||||
export function logAndReturn(logger: Logger) {
|
||||
return function cb(err: Error) {
|
||||
logger.error(err);
|
||||
return err;
|
||||
};
|
||||
}
|
||||
|
||||
const RE_USER = /(?:^|\s)(@)([^ ]{3,255}?)(?=\s|$)/g;
|
||||
|
||||
export function getRelatedUsers(content: string) {
|
||||
const results = [];
|
||||
let res: string[];
|
||||
// eslint-disable-next-line no-cond-assign
|
||||
while (res = RE_USER.exec(content)) results.push(res[2]);
|
||||
return results;
|
||||
}
|
||||
|
||||
export * from '@hydrooj/utils/lib/utils';
|
||||
Reference in new issue
Block a user