safeshield 1.0.4__py3-none-any.whl → 1.0.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: safeshield
3
- Version: 1.0.4
3
+ Version: 1.0.6
4
4
  Summary: Library for Help Validation Control
5
5
  Home-page: https://github.com/WunsunTarniho/py-guard
6
6
  Author: Wunsun Tarniho
@@ -37,5 +37,11 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
37
37
  ## v1.0.3 (2024-07-20)
38
38
  - Fixed: Libary deprecated.
39
39
 
40
- ## v1.0.3 (2024-07-20)
40
+ ## v1.0.4 (2024-07-20)
41
+ - Fixed: Libary deprecated.
42
+
43
+ ## v1.0.5 (2024-07-20)
44
+ - Fixed: Libary deprecated.
45
+
46
+ ## v1.0.6 (2024-07-20)
41
47
  - Fixed: Libary deprecated.
@@ -8,7 +8,7 @@ validator/database/detector.py,sha256=mPNZlOgwNBPNwL_XcKSmT6H5Bq370nMkqqMMOqkM9W
8
8
  validator/database/manager.py,sha256=Ezz4NUh22Hz2puh-NJggSGCaw3lAGyp3V88plMeBBVU,6232
9
9
  validator/rules/__init__.py,sha256=s-wmjYcbWlb2Je-3UXVGlZD4OmHSwMbWNH6mZbIn36s,971
10
10
  validator/rules/array.py,sha256=iw-Ya3E0-st37WswPgp0acAKX6sXURF4B8Hdz_Waohw,2824
11
- validator/rules/base.py,sha256=Q7z3DN__LLPay3BghptQ7yuxO6Nt-hzqExbOTXcim2Y,2902
11
+ validator/rules/base.py,sha256=i1CPoBJWhT7VgqdryOF74mvM6AxrFLCYMC9ZmFxjKxc,2887
12
12
  validator/rules/basic.py,sha256=KKoZED9K7guNdBVdUlwKFwGGgoxAZoXguzMAHq6ZT5o,1542
13
13
  validator/rules/comparison.py,sha256=2h2Kpd9YfG6AD9XF6sb412igCWgnpI_XgTo1pnVaPcY,9417
14
14
  validator/rules/conditional.py,sha256=767mfsV6esBr-hARl6FCZrbgVrS1FqSOMby1gfi4hpk,13008
@@ -22,8 +22,10 @@ validator/services/__init__.py,sha256=vcQtKsZhNuxbSnWAIwD1rLAXVG8NQII6QLsOOF8dh8
22
22
  validator/services/rule_conflict.py,sha256=s1RJNUY5d0WtSMHkrKulBCgJ2BZL2GE0Eu5pdAoiIbM,4943
23
23
  validator/services/rule_error_handler.py,sha256=MGvvkP6hbZLpVXxC3xpzg15OmVdPlk7l0M2Srmy5VfM,1729
24
24
  validator/services/rule_preparer.py,sha256=jRcMNjqq2xyZjO64Pim8jWmja5DmTzf0V_uuHG0lJTg,5621
25
- safeshield-1.0.4.dist-info/LICENSE,sha256=qugtRyKckyaks6hd2xyxOFSOYM6au1N80pMXuMTPvC4,1090
26
- safeshield-1.0.4.dist-info/METADATA,sha256=Ppr26XuZzTFUQwEscF5aUFakcHnxdn4kc8pR6I-oSmo,1373
27
- safeshield-1.0.4.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
28
- safeshield-1.0.4.dist-info/top_level.txt,sha256=iUtV3dlHOIiMfLuY4pruY00lFni8JzOkQ3Nh1II19OE,10
29
- safeshield-1.0.4.dist-info/RECORD,,
25
+ validator/utils/__init__.py,sha256=Yzo-xv285Be-a233M4duDdYtscuHiuBbPSX_C8yViJI,20
26
+ validator/utils/string.py,sha256=0YACzeEaWNEOR9_7O9A8D1ItIbtWfOJ8IfrzcB8VMYA,515
27
+ safeshield-1.0.6.dist-info/LICENSE,sha256=qugtRyKckyaks6hd2xyxOFSOYM6au1N80pMXuMTPvC4,1090
28
+ safeshield-1.0.6.dist-info/METADATA,sha256=oHfM08Qj8FiB9Siwc0ddm_UJner9Xp8dgT20cFR2AiQ,1483
29
+ safeshield-1.0.6.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
30
+ safeshield-1.0.6.dist-info/top_level.txt,sha256=iUtV3dlHOIiMfLuY4pruY00lFni8JzOkQ3Nh1II19OE,10
31
+ safeshield-1.0.6.dist-info/RECORD,,
validator/rules/base.py CHANGED
@@ -1,7 +1,7 @@
1
1
  from abc import ABC, abstractmethod
2
2
  from typing import Any, Dict, List, Optional, Set, Union, Tuple, Type
3
3
  from enum import Enum
4
- from validator.utils.string import pascal_to_snake
4
+ from .string import pascal_to_snake
5
5
  import inspect
6
6
 
7
7
  class ValidationRule(ABC):
@@ -0,0 +1 @@
1
+ from . import string
@@ -0,0 +1,17 @@
1
+ import re
2
+
3
+ def pascal_to_snake(name):
4
+ """Convert PascalCase to snake_case"""
5
+ # Handle kasus khusus terlebih dahulu
6
+ special_cases = {
7
+ 'UUIDRule': 'uuid',
8
+ 'IPRule': 'ip',
9
+ 'URLRule': 'url'
10
+ }
11
+ if name in special_cases:
12
+ return special_cases[name]
13
+
14
+ # Konversi regular PascalCase ke snake_case
15
+ s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name)
16
+ result = re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower()
17
+ return result.replace('_rule', '')