Skip to content

Commit

Permalink
fix(web): filter out package.json from file select (#124)
Browse files Browse the repository at this point in the history
fix(web): filter out `package.json` from files list
  • Loading branch information
sripwoud authored Jul 19, 2024
1 parent e2cbec3 commit 8d01195
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/web/src/hooks/useFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ export function useFiles() {
queryFn: async () => fetchFiles(`@zk-kit/${selectedProject}-artifacts@${selectedVersion}`),
select: data => {
const regex = new RegExp(`^packages/${selectedProject}/.*\\.(${artifacts.join('|')})$`)
return data.filter(file => regex.test(file)).map(file => file.replace(`packages/${selectedProject}/`, ''))
return data.filter(file => regex.test(file)).filter(file => !file.endsWith('package.json')).map(file =>
file.replace(`packages/${selectedProject}/`, '')
)
},
})
}

0 comments on commit 8d01195

Please sign in to comment.