Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
}
}
if (hedStringParts.length === 0) {
continue
}
hedStrings.push([file, hedStringParts.join(',')])
}
}
})
if (hedStrings.length === 0) {
return Promise.resolve(issues)
} else {
return hedValidator.buildSchema().then(hedSchema => {
for (const [file, hedString] of hedStrings) {
const [isHedStringValid, hedIssues] = hedValidator.validateHedString(
hedString,
hedSchema,
true,
)
if (!isHedStringValid) {
const convertedIssues = convertHedIssuesToBidsIssues(hedIssues, file)
issues = issues.concat(convertedIssues)
}
}
return issues
})
}
}
return hedValidator.buildSchema().then(hedSchema => {
for (const [file, hedString] of hedStrings) {
const [isHedStringValid, hedIssues] = hedValidator.validateHedString(
hedString,
hedSchema,
true,
)
if (!isHedStringValid) {
const convertedIssues = convertHedIssuesToBidsIssues(hedIssues, file)
issues = issues.concat(convertedIssues)
}
}
return issues
})
}