Skip to content

Commit

Permalink
lint: fmt + lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Sorikairox committed Oct 3, 2024
1 parent 761003b commit 52d0d4d
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 15 deletions.
2 changes: 1 addition & 1 deletion behaviors/phone-number.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ import { parsePhoneNumber } from '../deps.ts';
export function isPhoneNumber(prop: string, locale?: string): boolean {
const pn = parsePhoneNumber(prop, { regionCode: locale });
return pn.valid;
};
}
20 changes: 15 additions & 5 deletions behaviors/string.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
export function lengthGreaterOrEqual(str: string, minLength: number): boolean {return str.length >= minLength; }
export function lengthGreater(str: string, minLength: number): boolean {return str.length > minLength; }
export function lengthLowerOrEqual(str: string, maxLength: number): boolean {return str.length <= maxLength; }
export function lengthLower(str: string, maxLength: number): boolean {return str.length < maxLength; }
export function isRegex(str: string, regex: RegExp): boolean { return regex.test(str) };
export function lengthGreaterOrEqual(str: string, minLength: number): boolean {
return str.length >= minLength;
}
export function lengthGreater(str: string, minLength: number): boolean {
return str.length > minLength;
}
export function lengthLowerOrEqual(str: string, maxLength: number): boolean {
return str.length <= maxLength;
}
export function lengthLower(str: string, maxLength: number): boolean {
return str.length < maxLength;
}
export function isRegex(str: string, regex: RegExp): boolean {
return regex.test(str);
}
2 changes: 1 addition & 1 deletion decorator-function.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export type DecoratorFunction = () => PropertyDecorator;
export type DecoratorFunction = () => PropertyDecorator;
2 changes: 1 addition & 1 deletion validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,4 @@ export function createValidator<T extends Array<any>>(
constraints: [...args],
});
};
};
}
2 changes: 1 addition & 1 deletion validators/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,4 +257,4 @@ export function IsPort(): PropertyDecorator {
errorMessage: 'Property must be a valid port number',
constraints: [],
});
}
}
2 changes: 1 addition & 1 deletion validators/nested.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ export function Nested(expectedClass: Constructor): PropertyDecorator {
constraints: [],
},
);
};
}
8 changes: 4 additions & 4 deletions validators/number.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function GreaterOrEqual(min: number): PropertyDecorator {
constraints: [min],
},
);
};
}
/**
* Checks if a number is greater than to a specified minimum value.
*
Expand All @@ -28,7 +28,7 @@ export function Greater(min: number): PropertyDecorator {
constraints: [min],
},
);
};
}
/**
* Checks if a number is lower than or equal to a specified minimum value.
*
Expand All @@ -42,7 +42,7 @@ export function LowerOrEqual(max: number): PropertyDecorator {
constraints: [max],
},
);
};
}
/**
* Checks if a number is lower than a specified minimum value.
*
Expand All @@ -56,4 +56,4 @@ export function Lower(max: number): PropertyDecorator {
constraints: [max],
},
);
};
}
2 changes: 1 addition & 1 deletion validators/phone-number.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function IsPhoneNumber(locale?: string): PropertyDecorator {
constraints: [locale],
},
);
};
}

/**
* Validates if a string is an international phone number.
Expand Down

0 comments on commit 52d0d4d

Please sign in to comment.