Skip to content

Commit

Permalink
fix(utils): read dir recursive
Browse files Browse the repository at this point in the history
  • Loading branch information
carlos-r-l-rodrigues committed Nov 27, 2024
1 parent 9b76d2a commit 9862732
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/clever-singers-vanish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/utils": patch
---

fix(utils): set readonly property on recursive dir read
4 changes: 3 additions & 1 deletion packages/core/utils/src/common/read-dir-recursive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ export async function readDirRecursive(dir: string): Promise<Dirent[]> {

for (const entry of entries) {
const fullPath = join(dir, entry.name)
entry.path = dir
Object.defineProperty(entry, "path", {
value: dir,
})
allEntries.push(entry)

if (entry.isDirectory()) {
Expand Down

0 comments on commit 9862732

Please sign in to comment.