13 lines
422 B
Python
13 lines
422 B
Python
"""Article number normalization."""
|
|
|
|
|
|
def normalize_article_number(value: str) -> str:
|
|
"""Trim surrounding whitespace while preserving leading zeros and text content."""
|
|
|
|
if not isinstance(value, str):
|
|
raise TypeError("Article number must be provided as a string.")
|
|
normalized = value.strip()
|
|
if normalized == "":
|
|
raise ValueError("Article number must not be empty.")
|
|
return normalized
|