|
|
@ -97,7 +97,9 @@ export const isClient = !isServer |
|
|
|
export const isUrl = (path: string): boolean => { |
|
|
|
const reg = |
|
|
|
/(((^https?:(?:\/\/)?)(?:[-:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&%@.\w_]*)#?(?:[\w]*))?)$/ |
|
|
|
return reg.test(path) |
|
|
|
const urlPattern = /^(https?|ftp|file):\/\/[-\w]+(\.\w[-\w]*)+(:\d+)?(\/\S*)?$/ |
|
|
|
|
|
|
|
return urlPattern.test(path) |
|
|
|
} |
|
|
|
|
|
|
|
export const isDark = (): boolean => { |
|
|
|