Skip to content

Commit

Permalink
refactor: simplify siblings filtering (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
ignatiusmb committed Jan 15, 2024
1 parent e3e5808 commit 3d4465b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions workspace/marqua/src/fs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ export function traverse(
const path = [...breadcrumb].reverse().join('/');
if (type === 'file') {
if (!files(path)) return [];
const siblings = tree.filter(
({ breadcrumb }) => [...breadcrumb].reverse().join('/') !== path,
);
const siblings = tree.filter(({ breadcrumb: [name] }) => name !== breadcrumb[0]);
return hydrate({ breadcrumb, buffer, marker, parse, siblings }) ?? [];
} else if (level !== 0) {
const depth = level < 0 ? level : level - 1;
Expand Down

1 comment on commit 3d4465b

@vercel
Copy link

@vercel vercel bot commented on 3d4465b Jan 15, 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.