From 5a7ab94eedd81d1ecb172bccf3ae4832bbfa5387 Mon Sep 17 00:00:00 2001 From: Alexander Cerutti Date: Fri, 11 Oct 2024 14:35:50 +0200 Subject: [PATCH] Fixed files cross-reference Semantics --- src/schemas/Semantics.ts | 2 +- src/schemas/index.ts | 6 +----- src/schemas/regexps.ts | 3 +++ 3 files changed, 5 insertions(+), 6 deletions(-) create mode 100644 src/schemas/regexps.ts diff --git a/src/schemas/Semantics.ts b/src/schemas/Semantics.ts index ea8c778..e941973 100644 --- a/src/schemas/Semantics.ts +++ b/src/schemas/Semantics.ts @@ -1,5 +1,5 @@ import Joi from "joi"; -import { RGB_HEX_COLOR_REGEX } from "."; +import { RGB_HEX_COLOR_REGEX } from "./regexps"; /** * For a better description of every single field, diff --git a/src/schemas/index.ts b/src/schemas/index.ts index ecfc581..d451a08 100644 --- a/src/schemas/index.ts +++ b/src/schemas/index.ts @@ -20,11 +20,7 @@ import { Semantics } from "./Semantics"; import { CertificatesSchema } from "./Certificates"; import * as Messages from "../messages"; - -export const RGB_HEX_COLOR_REGEX = - /(#[a-fA-F0-9]{3,6}|rgb\(\s*(?:[01]?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\s*,\s*(?:[01]?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\s*,\s*(?:[01]?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\s*\))/; - -const URL_REGEX = /https?:\/\/(?:[a-z0-9]+\.?)+(?::\d{2,})?(?:\/[\S]+)*/; +import { RGB_HEX_COLOR_REGEX, URL_REGEX } from "./regexps"; export type PreferredStyleSchemes = ("posterEventTicket" | "eventTicket")[]; diff --git a/src/schemas/regexps.ts b/src/schemas/regexps.ts new file mode 100644 index 0000000..b6ac41a --- /dev/null +++ b/src/schemas/regexps.ts @@ -0,0 +1,3 @@ +export const RGB_HEX_COLOR_REGEX = + /(?:\#[a-fA-F0-9]{3,6}|rgb\(\s*(?:[01]?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\s*,\s*(?:[01]?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\s*,\s*(?:[01]?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\s*\))/; +export const URL_REGEX = /https?:\/\/(?:[a-z0-9]+\.?)+(?::\d{2,})?(?:\/[\S]+)*/;