feat: resolved an issue without recursive matching

This commit is contained in:
=
2024-11-29 19:59:34 +05:30
parent b7fe3743db
commit 49133a044f

View File

@@ -365,9 +365,8 @@ export const recursivelyGetSecretPaths = async ({
folderId: p.folderId folderId: p.folderId
})); }));
const pathsInCurrentDirectory = paths.filter((folder) => // path relative will start with ../ if its outside directory
folder.path.startsWith(currentPath === "/" ? "" : currentPath) const pathsInCurrentDirectory = paths.filter((folder) => !path.relative(currentPath, folder.path).startsWith(".."));
);
return pathsInCurrentDirectory; return pathsInCurrentDirectory;
}; };