MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / renamePeerMetaBlock

Function renamePeerMetaBlock

scripts/publish-packages.ts:178–194  ·  view source on GitHub ↗
(
    block: PeerDependenciesMeta | undefined,
  )

Source from the content-addressed store, hash-verified

176 * so the meta block can't drift out of sync with the deps block.
177 */
178 const renamePeerMetaBlock = (
179 block: PeerDependenciesMeta | undefined,
180 ): PeerDependenciesMeta | undefined => {
181 if (!block) return block;
182 const next: PeerDependenciesMeta = {};
183 let mutated = false;
184 for (const [key, value] of Object.entries(block)) {
185 if (publishable.has(key)) {
186 next[key] = value;
187 } else if (isInternalScope(key)) {
188 mutated = true;
189 } else {
190 next[key] = value;
191 }
192 }
193 return mutated ? next : block;
194 };
195
196 const pkgJsonPath = join(pkgDir, "package.json");
197 const original = await readFile(pkgJsonPath, "utf8");

Callers 1

applyWorkspaceVersionsFunction · 0.85

Calls 1

isInternalScopeFunction · 0.85

Tested by

no test coverage detected