Skip to main content

add_path_to_map

No overview available.

def add_path_to_map(
path_map: dict,
file_path: string,
value: any
) - > dict

Adds a file or directory path to a mapping dictionary, ensuring that the path is normalized and associated with its corresponding metadata or identifier.

Parameters

NameTypeDescription
path_mapdictThe existing dictionary where path-to-value mappings are stored and updated.
file_pathstringThe filesystem path string to be normalized and added to the map.
valueanyThe metadata, identifier, or object to associate with the specified file path.

Returns

TypeDescription
dictThe updated mapping dictionary containing the newly added path and its associated value.