big rework
This commit is contained in:
@@ -13,10 +13,6 @@ from pydantic import field_validator
|
||||
__all__ = ["DocsRegistry"]
|
||||
|
||||
|
||||
def frozen_mapping[K, V](value: Mapping[K, V] | None = None) -> Mapping[K, V]:
|
||||
return MappingProxyType(dict(value) if value is not None else {})
|
||||
|
||||
|
||||
def parse_docs_path(value: str | PurePosixPath) -> PurePosixPath:
|
||||
raw = value.as_posix() if isinstance(value, PurePosixPath) else value
|
||||
if "\\" in raw:
|
||||
@@ -39,6 +35,10 @@ def _empty_docs_mapping() -> Mapping[DocsPath, str]:
|
||||
return frozen_mapping()
|
||||
|
||||
|
||||
def frozen_mapping[K, V](value: Mapping[K, V] | None = None) -> Mapping[K, V]:
|
||||
return MappingProxyType(dict(value) if value is not None else {})
|
||||
|
||||
|
||||
class DocsRegistry(BaseModel):
|
||||
"""In-memory index of documentation content."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user