From f227cae07eace6c5854c4d9f471e33a5cf0abb1d Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Thu, 25 Apr 2024 15:27:57 -0400 Subject: [PATCH] fix(expressions): Make FileTree.contains() return true for directories --- bids-validator/src/types/filetree.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bids-validator/src/types/filetree.ts b/bids-validator/src/types/filetree.ts index 82d6d3673..c204551af 100644 --- a/bids-validator/src/types/filetree.ts +++ b/bids-validator/src/types/filetree.ts @@ -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) {