update 30
This commit is contained in:
@@ -6,4 +6,11 @@ export function validateIP(ipAddr: string): boolean {
|
||||
export function validateDomain(domainName: string): boolean {
|
||||
let domainRegex = /[^@ \t\r\n]+.[^@ \t\r\n]+\.[^@ \t\r\n]+/
|
||||
return domainRegex.test(domainName) || domainName === 'localhost'
|
||||
}
|
||||
|
||||
export function ellipsis(str: string, lim: number): string {
|
||||
if (str) {
|
||||
return str.length > lim ? `${str.substr(0, lim)}...` : str
|
||||
}
|
||||
return ''
|
||||
}
|
||||
Reference in New Issue
Block a user