aboutsummaryrefslogtreecommitdiffstats
path: root/src/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'src/helpers')
-rw-r--r--src/helpers/array-helpers.ts8
-rw-r--r--src/helpers/url-helpers.ts7
-rw-r--r--src/helpers/validation-helpers.ts2
3 files changed, 11 insertions, 6 deletions
diff --git a/src/helpers/array-helpers.ts b/src/helpers/array-helpers.ts
index 5d28af433..33be12fa7 100644
--- a/src/helpers/array-helpers.ts
+++ b/src/helpers/array-helpers.ts
@@ -1,6 +1,6 @@
1export default function shuffleArray(arr: any[]): any[] { 1export default function shuffleArray(arr: any[]): any[] {
2 return arr 2 return arr
3 .map(a => [ Math.random(), a ]) 3 .map(a => [Math.random(), a])
4 .sort((a, b) => a[ 0 ] - b[ 0 ]) 4 .sort((a, b) => a[0] - b[0])
5 .map(a => a[ 1 ]) 5 .map(a => a[1]);
6}; 6}
diff --git a/src/helpers/url-helpers.ts b/src/helpers/url-helpers.ts
index 720f242b4..69a2cc4dc 100644
--- a/src/helpers/url-helpers.ts
+++ b/src/helpers/url-helpers.ts
@@ -24,7 +24,12 @@ export function isValidExternalURL(url: string | URL) {
24} 24}
25 25
26export function fixUrl(url: string | URL) { 26export function fixUrl(url: string | URL) {
27 return url.toString().replaceAll('//', '/').replaceAll('http:/', 'http://').replaceAll('https:/', 'https://').replaceAll('file:/', 'file://'); 27 return url
28 .toString()
29 .replaceAll('//', '/')
30 .replaceAll('http:/', 'http://')
31 .replaceAll('https:/', 'https://')
32 .replaceAll('file:/', 'file://');
28} 33}
29 34
30export function isValidFileUrl(path: string) { 35export function isValidFileUrl(path: string) {
diff --git a/src/helpers/validation-helpers.ts b/src/helpers/validation-helpers.ts
index b2b8823af..4e0af8b08 100644
--- a/src/helpers/validation-helpers.ts
+++ b/src/helpers/validation-helpers.ts
@@ -13,7 +13,7 @@ const messages = defineMessages({
13 }, 13 },
14 url: { 14 url: {
15 id: 'validation.url', 15 id: 'validation.url',
16 defaultMessage: "{field} is not a valid URL", 16 defaultMessage: '{field} is not a valid URL',
17 }, 17 },
18 minLength: { 18 minLength: {
19 id: 'validation.minLength', 19 id: 'validation.minLength',