Skip to content

Commit

Permalink
fix(expressions): Make FileTree.contains() return true for directories
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Apr 25, 2024
1 parent bc348eb commit f227cae
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 f227cae

Please sign in to comment.