MCPcopy Create free account
hub / github.com/NVIDIA/NeMo-Relay / _package_exports

Function _package_exports

scripts/docs/generate_node_library_reference.py:336–348  ·  view source on GitHub ↗
(package_json: Path)

Source from the content-addressed store, hash-verified

334
335
336def _package_exports(package_json: Path) -> list[tuple[str, Path]]:
337 data = json.loads(package_json.read_text(encoding="utf-8"))
338 package_name = data["name"]
339 exports = data["exports"]
340 modules: list[tuple[str, Path]] = []
341
342 for export_path, export_config in exports.items():
343 if not isinstance(export_config, dict) or "types" not in export_config:
344 continue
345 import_path = package_name if export_path == "." else f"{package_name}/{export_path.removeprefix('./')}"
346 modules.append((import_path, package_json.parent / export_config["types"]))
347
348 return modules
349
350
351def _slug(import_path: str) -> str:

Callers 1

generateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected