mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
ui: add node typings
This commit is contained in:
1 parent
fcfc93a40a
commit
aadc8cdde1
4 files changed
+17
-4
No files matched your search
@@ -7,8 +7,9 @@ export { size, formatSeconds } from '@hydrooj/utils/lib/utils';
|
||||
|
||||
const AU = new AnsiUp();
|
||||
|
||||
export function ansiToHtml(str: string) {
|
||||
return AU.ansi_to_html(str);
|
||||
export function ansiToHtml(str: string, whiteToBlack = true) {
|
||||
const res = AU.ansi_to_html(str);
|
||||
return whiteToBlack ? res.replace(/style="color:rgb\(255,255,255\)"/g, 'style="color:black"') : res;
|
||||
}
|
||||
|
||||
export function datetimeSpan(dt: Date | ObjectID, relative = true, format = 'YYYY-M-D H:mm:ss', tz = 'Asia/Shanghai') {
|
||||
|
||||
Reference in new issue
Block a user