mirror of
https://github.com/Nezumi-2711/react-training.git
synced 2026-09-22 13:38:51 +00:00
Fix code styled format
This commit is contained in:
@@ -4,9 +4,9 @@ const VALUE = 'value';
|
||||
const ERROR = 'error';
|
||||
const REQUIRED_FIELD_ERROR = 'This is required field';
|
||||
|
||||
function isBool(value: unknown) {
|
||||
const isBool = (value: unknown) => {
|
||||
return typeof value === 'boolean';
|
||||
}
|
||||
};
|
||||
|
||||
const isObject = (value: unknown) => {
|
||||
return typeof value === 'object' && value !== null;
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
const isValidString = (value: string): boolean =>
|
||||
/^[a-zA-Z]{4,}(?: [a-zA-Z]+){0,2}$/gm.test(value);
|
||||
const isValidString = (value: string): boolean => {
|
||||
return /^[a-zA-Z]{4,}(?: [a-zA-Z]+){0,2}$/gm.test(value);
|
||||
};
|
||||
|
||||
const isValidNumber = (value: string): boolean => /^[0-9]*$/.test(value);
|
||||
const isValidNumber = (value: string): boolean => {
|
||||
return /^[0-9]*$/.test(value);
|
||||
};
|
||||
|
||||
const isValidPhoneNumber = (value: string): boolean =>
|
||||
/(84|0[3|5|7|8|9])+([0-9]{8})\b/g.test(value);
|
||||
const isValidPhoneNumber = (value: string): boolean => {
|
||||
return /(84|0[3|5|7|8|9])+([0-9]{8})\b/g.test(value);
|
||||
};
|
||||
|
||||
const isValidAddress = (value: string): boolean => value.trim().length >= 10;
|
||||
const isValidAddress = (value: string): boolean => {
|
||||
return value.trim().length >= 10;
|
||||
};
|
||||
|
||||
export { isValidString, isValidNumber, isValidPhoneNumber, isValidAddress };
|
||||
|
||||
Reference in New Issue
Block a user