From 3d5b919578e2c7b49440cdf35a60618b67f7281c Mon Sep 17 00:00:00 2001 From: Alexander Jones Date: Tue, 1 Oct 2024 04:52:21 -0500 Subject: [PATCH] Map issues through the Issue constructor The direct use of BidsIssue/BidsHedIssue was causing issues with downstream tools. Converting them to plain Issue objects should fix this problem. Fixes #2142 --- bids-validator/validators/hed.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bids-validator/validators/hed.js b/bids-validator/validators/hed.js index b9c68410c..4dde02b48 100644 --- a/bids-validator/validators/hed.js +++ b/bids-validator/validators/hed.js @@ -3,7 +3,12 @@ import utils from '../utils' const Issue = utils.issues.Issue -export default async function checkHedStrings(tsvs, jsonContents, jsonFiles) { +export default async function returnHedIssues(tsvs, jsonContents, jsonFiles) { + const issues = await checkHedStrings(tsvs, jsonContents, jsonFiles) + return issues.map((issue) => new Issue(issue)) +} + +async function checkHedStrings(tsvs, jsonContents, jsonFiles) { const datasetDescription = jsonContents['/dataset_description.json'] const datasetDescriptionData = new hedValidator.bids.BidsJsonFile( '/dataset_description.json',