From d9f13d909bd1f7686feca9476206dcf689609b13 Mon Sep 17 00:00:00 2001 From: Nell Hardcastle Date: Thu, 14 Sep 2023 12:20:53 -0700 Subject: [PATCH] fix: loadSchema object should be undefined if unavailable --- bids-validator/src/setup/loadSchema.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bids-validator/src/setup/loadSchema.ts b/bids-validator/src/setup/loadSchema.ts index c8402d138..9959fff86 100644 --- a/bids-validator/src/setup/loadSchema.ts +++ b/bids-validator/src/setup/loadSchema.ts @@ -10,7 +10,8 @@ import * as schemaDefault from 'https://bids-specification.readthedocs.io/en/lat export async function loadSchema(version = 'latest'): Promise { 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)) {