Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into schema/json_array…
Browse files Browse the repository at this point in the history
…_type_checks
  • Loading branch information
effigies committed Jul 30, 2024
2 parents 1945f1e + 1b17f77 commit 180d4fa
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
3 changes: 1 addition & 2 deletions bids-validator/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@
"singleQuote": true,
"proseWrap": "preserve",
"include": ["src/"]
},
"lock": false
}
}
6 changes: 5 additions & 1 deletion bids-validator/src/schema/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ export class BIDSContext implements Context {
this.associations = {} as ContextAssociations
}

get size(): number {
return this.file.size
}

get path(): string {
return this.file.path
}
Expand Down Expand Up @@ -200,7 +204,7 @@ export class BIDSContext implements Context {
Object.keys(json).map((x) => this.sidecarKeyOrigin[x] = validSidecars[0].path)
}
const nextDir = fileTree.directories.find((directory) => {
return this.file.path.startsWith(directory.path)
return this.file.path.startsWith(`${directory.path}/`)
})
if (nextDir) {
await this.loadSidecar(nextDir)
Expand Down
2 changes: 1 addition & 1 deletion bids-validator/src/summary/summary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export class Summary {
}

if (context.extension === '.json') {
if ('TaskName' in context.json) {
if (typeof context.json === 'object' && 'TaskName' in context.json) {
this.tasks.add(context.json.TaskName as string)
}
}
Expand Down
1 change: 1 addition & 0 deletions bids-validator/src/types/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export interface Context {
dataset: ContextDataset
subject: ContextSubject
path: string
size: number
entities: object
datatype: string
suffix: string
Expand Down
3 changes: 3 additions & 0 deletions deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"lock": false
}

0 comments on commit 180d4fa

Please sign in to comment.