MCPcopy
hub / github.com/originjs/vite-plugin-federation / isSameFilepath

Function isSameFilepath

packages/lib/src/utils/index.ts:199–217  ·  view source on GitHub ↗
(src: string, dest: string)

Source from the content-addressed store, hash-verified

197}
198
199export function isSameFilepath(src: string, dest: string): boolean {
200 if (!src || !dest) {
201 return false
202 }
203 src = normalizePath(src)
204 dest = normalizePath(dest)
205 const srcExt = parse(src).ext
206 const destExt = parse(dest).ext
207 if (srcExt && destExt && srcExt !== destExt) {
208 return false
209 }
210 if (srcExt) {
211 src = src.slice(0, -srcExt.length)
212 }
213 if (destExt) {
214 dest = dest.slice(0, -destExt.length)
215 }
216 return src === dest
217}
218
219export type Remote = { id: string; regexp: RegExp; config: RemotesConfig }
220

Callers 1

utils.spec.tsFile · 0.90

Calls 1

normalizePathFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…