We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ea5c9de commit c6763d6Copy full SHA for c6763d6
sbom.py
@@ -92,9 +92,10 @@ class CreationInfo(TypedDict):
92
93
# Cache of values that we've seen already. We use this
94
# to de-duplicate values and their corresponding SPDX ID.
95
-_SPDX_IDS_TO_VALUES = {}
+_SPDX_IDS_TO_VALUES: dict[str, Any] = {}
96
97
98
+@cache
99
def spdx_id(value: LiteralString) -> str:
100
"""Encode a value into characters that are valid in an SPDX ID"""
101
spdx_id = re.sub(r"[^a-zA-Z0-9.\-]+", "-", value)
0 commit comments