Skip to content

Commit

Permalink
feat: make traverse throw on nonexistent entry (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
ignatiusmb committed Jan 11, 2024
1 parent 0ae737f commit f09d08a
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions workspace/marqua/src/fs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ export function traverse(
hydrate,
transform = (v) => /** @type {Transformed} */ (v),
) {
if (!fs.existsSync(entry)) {
console.warn(`Skipping "${entry}", path does not exists`);
return transform([]);
}

/** @type {import('../types.js').HydrateChunk['siblings']} */
const tree = fs.readdirSync(entry).map((name) => {
const path = join(entry, name);
Expand Down Expand Up @@ -65,7 +60,7 @@ export function traverse(
return [];
});

return transform(/** @type {Array<Output & import('../types.js').Metadata>} */ (backpack));
return transform(/** @type {any} */ (backpack));
}

/**
Expand Down

1 comment on commit f09d08a

@vercel
Copy link

@vercel vercel bot commented on f09d08a Jan 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.