How to use hed-validator - 2 common examples

To help you get started, we’ve selected a few hed-validator examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bids-standard / bids-validator / bids-validator / validators / events / hed.js View on Github external
}
          }
        }

        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
    })
  }
}
github bids-standard / bids-validator / bids-validator / validators / events / hed.js View on Github external
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
    })
  }

hed-validator

A JavaScript validator for HED (Hierarchical Event Descriptor) strings.

MIT
Latest version published 23 days ago

Package Health Score

76 / 100
Full package analysis

Similar packages