Fix code styled format

This commit is contained in:
2023-10-26 17:13:02 +07:00
parent b0703ffdd3
commit 22091d4994
2 changed files with 14 additions and 8 deletions
+2 -2
View File
@@ -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;
+12 -6
View File
@@ -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 };