MCPcopy Create free account
hub / github.com/Effect-TS/effect / importMapReplacements

Function importMapReplacements

packages/tools/api-diff/src/MigrationDoc.ts:88–103  ·  view source on GitHub ↗
(importMapSections: string)

Source from the content-addressed store, hash-verified

86}
87
88const importMapReplacements = (importMapSections: string): ReadonlyMap<string, ReadonlyArray<string>> => {
89 const replacements = new Map<string, Array<string>>()
90 for (const line of importMapSections.split("\n")) {
91 const match = /^(\S+) -> (\S+)(?: \(barrel: [^)]+\))?$/.exec(line)
92 if (match === null) {
93 continue
94 }
95 const targets = replacements.get(match[1]!)
96 if (targets === undefined) {
97 replacements.set(match[1]!, [match[2]!])
98 } else if (!targets.includes(match[2]!)) {
99 targets.push(match[2]!)
100 }
101 }
102 return replacements
103}
104
105const removedModules = (diff: ApiDiff): ReadonlyArray<string> =>
106 [

Callers 3

migrationEntriesFunction · 0.85
renderMigrationDocumentFunction · 0.85
unannotatedModuleIdsFunction · 0.85

Calls 5

execMethod · 0.80
pushMethod · 0.80
getMethod · 0.65
setMethod · 0.65
splitMethod · 0.45

Tested by

no test coverage detected