From 5e86d7ab9c5200d794c3adb2b422d20a2aefd2ce Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Sat, 13 Aug 2022 02:00:50 +0200 Subject: restructure to single project --- api/src/util/utility/String.ts | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 api/src/util/utility/String.ts (limited to 'api/src/util/utility/String.ts') diff --git a/api/src/util/utility/String.ts b/api/src/util/utility/String.ts deleted file mode 100644 index 982b7e11..00000000 --- a/api/src/util/utility/String.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Request } from "express"; -import { ntob } from "./Base64"; -import { FieldErrors } from "@fosscord/util"; - -export function checkLength(str: string, min: number, max: number, key: string, req: Request) { - if (str.length < min || str.length > max) { - throw FieldErrors({ - [key]: { - code: "BASE_TYPE_BAD_LENGTH", - message: req.t("common:field.BASE_TYPE_BAD_LENGTH", { length: `${min} - ${max}` }) - } - }); - } -} - -export function generateCode() { - return ntob(Date.now() + Math.randomIntBetween(0, 10000)); -} -- cgit 1.5.1