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

Function isUnchangedModuleMove

packages/tools/api-diff/src/MigrationDoc.ts:147–172  ·  view source on GitHub ↗
(
  id: string,
  changes: ReadonlyArray<ApiChange>,
  removed: ReadonlySet<string>,
  replacements: ReadonlyMap<string, ReadonlyArray<string>>,
  addedSignatures: ReadonlyMap<string, ReadonlyArray<string>>
)

Source from the content-addressed store, hash-verified

145}
146
147const isUnchangedModuleMove = (
148 id: string,
149 changes: ReadonlyArray<ApiChange>,
150 removed: ReadonlySet<string>,
151 replacements: ReadonlyMap<string, ReadonlyArray<string>>,
152 addedSignatures: ReadonlyMap<string, ReadonlyArray<string>>
153): boolean => {
154 const separator = id.indexOf("#")
155 const module = id.slice(0, separator)
156 const targets = replacements.get(module)
157 if (separator === -1 || !removed.has(module) || targets === undefined) {
158 return false
159 }
160 const before = changes
161 .filter((change) => change.classification === "api-removed" && change.before !== undefined)
162 .map((change) => change.before!)
163 .sort(compareStrings)
164 if (before.length === 0) {
165 return false
166 }
167 const path = id.slice(separator + 1)
168 return targets.some((target) => {
169 const after = addedSignatures.get(`${target}#${path}`)
170 return after !== undefined && sameStrings(before, after)
171 })
172}
173
174const isRemovalCoveredByModule = (
175 id: string,

Callers 1

migrationEntriesFunction · 0.85

Calls 7

sameStringsFunction · 0.85
sliceMethod · 0.80
someMethod · 0.80
getMethod · 0.65
hasMethod · 0.65
mapMethod · 0.45
filterMethod · 0.45

Tested by

no test coverage detected