MCPcopy Create free account
hub / github.com/Dart-Code/Dart-Code / getPubWorkspaceOrPackageFolderPaths

Function getPubWorkspaceOrPackageFolderPaths

src/shared/vscode/pub.ts:243–245  ·  view source on GitHub ↗

* Returns the paths of "pub roots" for a set of package folders/pubspecs, where "pub root" is * the Pub Workspace root (if the package is part of a workspace) or the package folder. * * If multiple packages belong to the same Pub Workspace, it will only be returned once.

(packageFolderOrPubspecPaths: string[])

Source from the content-addressed store, hash-verified

241 * If multiple packages belong to the same Pub Workspace, it will only be returned once.
242 */
243function getPubWorkspaceOrPackageFolderPaths(packageFolderOrPubspecPaths: string[]): string[] {
244 return uniq(packageFolderOrPubspecPaths.map((p) => getPubWorkspaceFolderOrPackageFolderPath(p))).sort();
245}
246
247/**
248 * Gets the set of packages in `packageFolderOrPubspecPaths`, folding any workspace packages into

Callers 1

Calls 2

uniqFunction · 0.90

Tested by

no test coverage detected