diff --git a/src/main/helpers/index.ts b/src/main/helpers/index.ts index 99393d6c..163fb23a 100644 --- a/src/main/helpers/index.ts +++ b/src/main/helpers/index.ts @@ -32,8 +32,3 @@ export const isPortableVersion = () => { export const normalizePath = (str: string) => path.posix.normalize(str).replace(/\\/g, "/"); - -export const isValidHexColor = (color: string): boolean => { - const hexColorRegex = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/; - return hexColorRegex.test(color); -}; diff --git a/src/types/theme.types.ts b/src/types/theme.types.ts index 6db5eb84..e45b8062 100644 --- a/src/types/theme.types.ts +++ b/src/types/theme.types.ts @@ -1,6 +1,10 @@ -import { isValidHexColor } from "@main/helpers"; import { z } from "zod"; +const isValidHexColor = (color: string): boolean => { + const hexColorRegex = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/; + return hexColorRegex.test(color); +}; + const hexColorSchema = z.string().refine(isValidHexColor); type HexColorType = z.infer;