Sync with Server

This commit is contained in:
rotimi-best
2021-08-18 19:47:02 +03:00
parent e8c74de9ce
commit 60f06d6ab1
77 changed files with 2989 additions and 7610 deletions
+11
View File
@@ -0,0 +1,11 @@
export function isUUID(uuid) {
let s = '' + uuid;
s = s.match(
'^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$'
);
if (s === null) {
return false;
}
return true;
}
+4 -4
View File
@@ -1,9 +1,9 @@
import { createClient } from '@supabase/supabase-js';
let _supabase;
export let supabase;
export const getSupabase = (config) => {
if (_supabase) return _supabase;
if (supabase) return supabase;
if (!config && process && process.env) {
config = {
@@ -15,10 +15,10 @@ export const getSupabase = (config) => {
};
}
_supabase = createClient(
supabase = createClient(
config.supabaseConfig.url,
config.supabaseConfig.anonKey
);
return _supabase;
return supabase;
};
+5
View File
@@ -0,0 +1,5 @@
export function validateEmail(email) {
const re =
/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(String(email).toLowerCase());
}