Skip to content

Commit

Permalink
fix: loadSchema object should be undefined if unavailable
Browse files Browse the repository at this point in the history
  • Loading branch information
nellh committed Sep 14, 2023
1 parent 522b95f commit d9f13d9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bids-validator/src/setup/loadSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import * as schemaDefault from 'https://bids-specification.readthedocs.io/en/lat
export async function loadSchema(version = 'latest'): Promise<Schema> {
const versionRegex = /^v\d/
let schemaUrl = version
const bidsSchema = typeof Deno !== 'undefined' && Deno.env.get('BIDS_SCHEMA')
const bidsSchema =
typeof Deno !== 'undefined' ? Deno.env.get('BIDS_SCHEMA') : undefined
if (bidsSchema !== undefined) {
schemaUrl = bidsSchema
} else if (version === 'latest' || versionRegex.test(version)) {
Expand Down

0 comments on commit d9f13d9

Please sign in to comment.