@@ -20,8 +20,6 @@ def __isvalidString(self, value: str) -> bool:
2020 if isinstance (value , str ):
2121 return True
2222
23- return False
24-
2523 def __isvalidNumber (self , value : int )-> bool :
2624 """ check if the number is valid or not """
2725 if value is None :
@@ -30,8 +28,6 @@ def __isvalidNumber(self, value: int)-> bool:
3028 if isinstance (value , (int , float )):
3129 return True
3230
33- return False
34-
3531 def __isvalidBoolean (self , value : bool )-> bool :
3632 """ check if the string is boolean or not """
3733 if value is None :
@@ -40,8 +36,6 @@ def __isvalidBoolean(self, value: bool)-> bool:
4036 if isinstance (value , bool ):
4137 return True
4238
43- return False
44-
4539 def isAadharCard (self , value )-> bool :
4640 """ check if the string is Aadhar card or not """
4741 regex = "^[2-9]{1}[0-9]{3}[0-9]{4}[0-9]{4}$" # need to improve regex for space and hyphen
@@ -55,8 +49,6 @@ def isAadharCard(self, value)-> bool:
5549 if checksum_aadhar (value ):
5650 return True
5751
58- return False
59-
6052 def isPostalCode (self , value , locale : str )-> bool :
6153 """ check if the string is postal code or not """
6254 country_data = all_country [locale ]
@@ -352,7 +344,10 @@ def isPort(self, value: int) -> bool:
352344
353345 def isSlug (self , value : str ) -> bool :
354346 """ check if the string is slug or not """
355- pass
347+ regex = "^[a-z0-9-]+$"
348+ if re .match (regex , value ):
349+ return True
350+ return False
356351
357352 def isStrongPassword (self , value : str ) -> bool :
358353 """ check if the string is strong password or not
0 commit comments