Skip to content

Commit

Permalink
chore: remove redundant root prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
lawvs committed Aug 15, 2024
1 parent 9f2de01 commit 390f4ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/filter-map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const filterYDoc = (
const result = predicate(item);
if (result) {
const path = context.path.join(".");
if (path !== "root") {
if (path.length) {
// Skip the root node
selectedMap[path] = data;
}
Expand Down Expand Up @@ -108,7 +108,7 @@ export const filterYDoc = (
}

traverseYDoc(yDoc, {
path: ["root"],
path: [],
});

return selectedMap;
Expand Down

0 comments on commit 390f4ae

Please sign in to comment.