storj/web/satellite/src/utils/validation.ts
VitaliiShpital 4e5e6c8e5c web/satellite: onboarding tour: create project step
Change-Id: If091fd7f703e61c402a6bbdd80d98b0ce7b2bfd6
2020-04-30 16:50:19 +03:00

20 lines
499 B
TypeScript

// Copyright (C) 2019 Storj Labs, Inc.
// See LICENSE for copying information.
// TODO: move functions to Validator class
export function validateEmail(email: string): boolean {
const rgx = /.*@.*\..*$/;
return rgx.test(email);
}
export function validatePassword(password: string): boolean {
return typeof password !== 'undefined' && password.length >= 6;
}
export function anyCharactersButSlash(string: string): boolean {
const rgx = /^[^\/]+$/;
return rgx.test(string);
}