mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-13 09:48:27 +03:00
rename util/util to util/misc
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import t from "tap";
|
||||
import { GetMilisecondsSince } from "./util";
|
||||
import { GetMilisecondsSince } from "./misc";
|
||||
|
||||
t.test("#GetMilisecondsSince", (t) => {
|
||||
const time = GetMilisecondsSince(10n);
|
||||
@@ -30,3 +30,10 @@ export function Random20Hex() {
|
||||
export function MStoS(ms: number) {
|
||||
return Math.floor(ms / 1000);
|
||||
}
|
||||
|
||||
/**
|
||||
* Random From Array - Selects a random value from an array.
|
||||
*/
|
||||
export function RFA(arr: unknown[]) {
|
||||
return arr[Math.floor(Math.random() * arr.length)];
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Game, AnySongDocument, integer } from "kamaitachi-common";
|
||||
import { FindOneResult } from "monk";
|
||||
import db from "../../external/mongo/db";
|
||||
import { EscapeStringRegexp } from "../util";
|
||||
import { EscapeStringRegexp } from "../misc";
|
||||
|
||||
/**
|
||||
* Finds a song document for the given game with the given title (or alt-title).
|
||||
|
||||
Reference in New Issue
Block a user