From f5e6bd19fdbc8770f98218cd884dafa59668beda Mon Sep 17 00:00:00 2001 From: Alexander Jones Date: Thu, 19 Oct 2023 09:55:07 -0500 Subject: [PATCH] Add documentation for new functions --- bids/validate.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/bids/validate.js b/bids/validate.js index 94d72b97..35aab8e7 100644 --- a/bids/validate.js +++ b/bids/validate.js @@ -84,6 +84,13 @@ function validateSidecars(sidecarData, hedSchemas) { return [sidecarErrorsFound, issues] } +/** + * Validate an individual BIDS sidecar. + * + * @param {BidsSidecar} sidecar A BIDS sidecar. + * @param {Schemas} hedSchemas A HED schema collection. + * @returns {BidsHedIssue[]} All issues found. + */ function validateSidecar(sidecar, hedSchemas) { const issues = [] for (const [sidecarKey, hedData] of sidecar.parsedHedData) { @@ -110,6 +117,16 @@ function validateSidecar(sidecar, hedSchemas) { return issues } +/** + * Validate an individual BIDS sidecar string. + * + * @param {string} sidecarKey The sidecar key this string belongs to. + * @param {ParsedHedString} sidecarString The parsed sidecar HED string. + * @param {BidsSidecar} sidecar The BIDS sidecar. + * @param {Object} options Options specific to this validation run to pass to {@link validateHedString}. + * @param {Schemas} hedSchemas The HED schema collection to validate against. + * @returns {BidsHedIssue[]} All issues found. + */ function validateSidecarString(sidecarKey, sidecarString, sidecar, options, hedSchemas) { const [, hedIssues] = validateHedString(sidecarString, hedSchemas, options) return convertHedIssuesToBidsIssues(hedIssues, sidecar.file, { sidecarKey })