diff --git a/src/lib/format/string.ts b/src/lib/format/string.ts index 9e3698c3..7aceb1bd 100644 --- a/src/lib/format/string.ts +++ b/src/lib/format/string.ts @@ -1,3 +1,20 @@ +/** Matches a URL. */ +export const REGEX_URL = /https?:\/\/[^\s]+$/; + +/** + * Returns whether `string` is a link according to `REGEX_URL`. + * @param string + */ +export const isLink = (string: string): boolean => + Boolean(string.match(REGEX_URL)); + +/** + * Converts "field_name" to "FIELD NAME". + * @param field + */ +export const field2Caption = (field: string): string => + String(field).replaceAll("_", " ").toUpperCase(); + /** * Converts "Some object name" to "some-object-name". * @param input diff --git a/src/lib/format/string.tsx b/src/lib/format/string.tsx deleted file mode 100644 index 66c8c512..00000000 --- a/src/lib/format/string.tsx +++ /dev/null @@ -1,16 +0,0 @@ -/** Matches a URL. */ -export const REGEX_URL = /https?:\/\/[^\s]+$/; - -/** - * Converts "field_name" to "FIELD NAME". - * @param field - */ -export const field2Caption = (field: string): string => - String(field).replaceAll("_", " ").toUpperCase(); - -/** - * Returns whether `string` is a link according to `REGEX_URL`. - * @param string - */ -export const isLink = (string: string): boolean => - Boolean(string.match(REGEX_URL));