mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-27 12:36:14 +01:00
null or whitespace util
This commit is contained in:
parent
f4c4f28026
commit
cb7336c0e8
@ -155,7 +155,7 @@ export abstract class BaseImporter {
|
||||
}
|
||||
|
||||
protected isNullOrWhitespace(str: string): boolean {
|
||||
return str == null || typeof str !== 'string' || str.trim() === '';
|
||||
return Utils.isNullOrWhitespace(str);
|
||||
}
|
||||
|
||||
protected getValueOrDefault(str: string, defaultValue: string = null): string {
|
||||
|
@ -236,6 +236,10 @@ export class Utils {
|
||||
};
|
||||
}
|
||||
|
||||
static isNullOrWhitespace(str: string): boolean {
|
||||
return str == null || typeof str !== 'string' || str.trim() === '';
|
||||
}
|
||||
|
||||
private static validIpAddress(ipString: string): boolean {
|
||||
// tslint:disable-next-line
|
||||
const ipRegex = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
|
||||
|
Loading…
Reference in New Issue
Block a user