Skip to content

Commit

Permalink
PATCH: fix(tree): allow node.id to be a string (#372)
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasRichel authored Nov 18, 2024
1 parent d934f99 commit 288ef38
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/BIMDataComponents/BIMDataTree/BIMDataTree.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default {
const ids = new Set();
for (const node of value) {
if (!Number.isFinite(node?.id)) return false;
if (!Number.isFinite(node?.id) && typeof node?.id !== "string") return false;
if (node.children && !Array.isArray(node.children)) return false;
ids.add(node.id);
}
Expand Down
2 changes: 1 addition & 1 deletion src/BIMDataComponents/BIMDataTree/Node.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ NodeChildren = {
node: {
type: Object,
required: true,
validator: node => Number.isFinite(node?.id),
validator: node => (Number.isFinite(node?.id) || typeof node?.id === "string"),
},
depth: {
type: Number,
Expand Down

0 comments on commit 288ef38

Please sign in to comment.