Skip to content

Commit

Permalink
Merge pull request #1956 from effigies/fix/filetree-contains
Browse files Browse the repository at this point in the history
fix(expressions): Make FileTree.contains() return true for directories
  • Loading branch information
nellh authored May 2, 2024
2 parents de8b1d6 + f227cae commit 95ba32f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bids-validator/src/types/filetree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ export class FileTree {
if (parts.length === 0) {
return false
} else if (parts.length === 1) {
return this.files.some((x) => x.name === parts[0])
return (
this.files.some((x) => x.name === parts[0]) ||
this.directories.some((x) => x.name === parts[0])
)
} else if (parts.length > 1) {
const nextDir = this.directories.find((x) => x.name === parts[0])
if (nextDir) {
Expand Down

0 comments on commit 95ba32f

Please sign in to comment.