storj/web/satellite/src/utils/validation.ts

21 lines
492 B
TypeScript
Raw Normal View History

// Copyright (C) 2018 Storj Labs, Inc.
// See LICENSE for copying information.
export function validateEmail(email: string): boolean {
const rgx = /.*@.*\..*$/;
return rgx.test(email);
}
export function validatePassword(password: string): boolean {
const rgx = /^(?=.*[0-9])(?=.*[a-zA-Z])([a-zA-Z0-9]+){6,}$/;
return rgx.test(password);
}
export function validateProjectName(projectName: string): boolean {
const rgx = /^[^/]+$/;
return rgx.test(projectName);
}