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

Function importMapReplacements

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

Source from the content-addressed store, hash-verified

94}
95
96const importMapReplacements = (importMapSections: string): ReadonlyMap<string, ReadonlyArray<string>> => {
97 const replacements = new Map<string, Array<string>>()
98 for (const line of importMapSections.split(/\r?\n/)) {
99 const match = /^(\S+) -> (\S+)(?: \(barrel: [^)]+\))?$/.exec(line)
100 if (match === null) {
101 continue
102 }
103 const targets = replacements.get(match[1]!)
104 if (targets === undefined) {
105 replacements.set(match[1]!, [match[2]!])
106 } else if (!targets.includes(match[2]!)) {
107 targets.push(match[2]!)
108 }
109 }
110 return replacements
111}
112
113const removedModules = (diff: ApiDiff): ReadonlyArray<string> =>
114 [

Callers 3

migrationEntriesFunction · 0.85
renderMigrationDocumentFunction · 0.85
unannotatedModuleIdsFunction · 0.85

Calls 5

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

Tested by

no test coverage detected