Skip to content

Commit 522b95f

Browse files
committed
fix: Guard Deno reference in loadSchema to allow for browser usage
1 parent ef044b6 commit 522b95f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bids-validator/src/setup/loadSchema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import * as schemaDefault from 'https://bids-specification.readthedocs.io/en/lat
1010
export async function loadSchema(version = 'latest'): Promise<Schema> {
1111
const versionRegex = /^v\d/
1212
let schemaUrl = version
13-
const bidsSchema = Deno.env.get('BIDS_SCHEMA')
13+
const bidsSchema = typeof Deno !== 'undefined' && Deno.env.get('BIDS_SCHEMA')
1414
if (bidsSchema !== undefined) {
1515
schemaUrl = bidsSchema
1616
} else if (version === 'latest' || versionRegex.test(version)) {

0 commit comments

Comments
 (0)