mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-27 17:50:53 +01:00
12 lines
326 B
Go
12 lines
326 B
Go
export const isValidUsername = (str: string): boolean => {
|
|
if (!str) return false;
|
|
if (str.length > 100) return false;
|
|
return true;
|
|
// const validMap = ['admin', 'editor']
|
|
// return validMap.indexOf(str.trim()) >= 0
|
|
};
|
|
|
|
export const isExternal = (path: string) => {
|
|
return /^(https?:|mailto:|tel:)/.test(path);
|
|
};
|