MCPcopy Create free account
hub / github.com/code-forge-io/Remix-Forge / getPathDifference

Function getPathDifference

src/utils/dependencies.ts:79–90  ·  view source on GitHub ↗
(rootFolder: string, nestedFolder: string)

Source from the content-addressed store, hash-verified

77 * @returns Returns the path as a string
78 */
79export const getPathDifference = (rootFolder: string, nestedFolder: string) => {
80 const rootParts = rootFolder.split("/");
81 const nestedParts = nestedFolder.split("/");
82
83 let i = 0;
84 while (i < rootParts.length && i < nestedParts.length && rootParts[i] === nestedParts[i]) {
85 i++;
86 }
87
88 const nestedPath = nestedParts.slice(i).join("/");
89 return nestedPath;
90};
91
92export const updateFileDependencies = async (filePath: vscode.Uri, root: string, newFilePath: string) => {
93 // Read the contents of the file

Callers 1

generateTestsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected