MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / parsePackageName

Function parsePackageName

src/resolution/frameworks/cargo-workspace.ts:153–158  ·  view source on GitHub ↗
(cargoToml: string)

Source from the content-addressed store, hash-verified

151
152/** A manifest's `[package]` name, wherever the section writes it (after a `categories = [...]` too). */
153export function parsePackageName(cargoToml: string): string | null {
154 const packageSection = getSection(cargoToml, 'package');
155 if (!packageSection) return null;
156 const packageNameMatch = packageSection.match(/name\s*=\s*["']([^"'\n]+)["']/);
157 return packageNameMatch?.[1]?.trim() ?? null;
158}
159
160/**
161 * The target roots a manifest names with a `path` of their own: `[lib] path =

Callers 1

Calls 1

getSectionFunction · 0.85

Tested by

no test coverage detected