MCPcopy Create free account
hub / github.com/SBoudrias/Inquirer.js / workspacePackagePattern

Function workspacePackagePattern

tools/package/src/workspaces.ts:26–34  ·  view source on GitHub ↗
(pattern: string)

Source from the content-addressed store, hash-verified

24}
25
26function workspacePackagePattern(pattern: string) {
27 const isNegated = pattern.startsWith('!');
28 const workspacePattern = isNegated ? pattern.slice(1) : pattern;
29 const packageJsonPattern = workspacePattern.endsWith('/package.json')
30 ? workspacePattern
31 : `${workspacePattern.replace(/\/$/, '')}/package.json`;
32
33 return isNegated ? `!${packageJsonPattern}` : packageJsonPattern;
34}
35
36function packageJsonWorkspacePatterns(rootPackageJson: PackageJson) {
37 const workspaces: unknown = rootPackageJson.workspaces;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected