MCPcopy Create free account
hub / github.com/btd/rollup-plugin-visualizer / trimProjectRootId

Method trimProjectRootId

plugin/module-mapper.ts:42–47  ·  view source on GitHub ↗
(moduleId: string)

Source from the content-addressed store, hash-verified

40 constructor(private projectRoot: string | RegExp) {}
41
42 trimProjectRootId(moduleId: string): string {
43 if (typeof this.projectRoot === "string" && moduleId.startsWith(this.projectRoot)) {
44 return moduleId.slice(this.projectRoot.length);
45 }
46 return moduleId.replace(this.projectRoot, "");
47 }
48
49 uniqueId(): ModuleUID {
50 return `${HASH_PLACEHOLDER}-${this.counter++}`;

Callers 3

getModuleUidMethod · 0.95
getBundleModuleUidMethod · 0.95
buildTreeFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected