How to use the bids-validator.BIDS function in bids-validator

To help you get started, we’ve selected a few bids-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-web / components / App.jsx View on Github external
_validate(selectedFiles) {
    const dirName = selectedFiles.list[0].webkitRelativePath.split('/')[0]
    const defaultConfig = `${dirName}/.bids-validator-config.json`
    this.setState({
      status: 'validating',
      showIssues: true,
      activeKey: 3,
      dirName,
    })
    return validate.BIDS(
      selectedFiles.list,
      {
        verbose: true,
        ...this.state.options,
        config: defaultConfig,
      },
      (issues, summary) => {
        if (issues === 'Invalid') {
          return this.setState({
            errors: 'Invalid',
            summary,
            status: 'validated',
          })
        } else {
          return this.setState({
            errors: issues.errors ? issues.errors : [],
github OpenNeuroOrg / openneuro / packages / openneuro-cli / src / upload.js View on Github external
return new Promise((resolve, reject) => {
    validate.BIDS(dir, options, ({ errors, warnings }, summary) => {
      if (errors.length + warnings.length === 0) {
        resolve({ summary })
      } else {
        reject({ errors, warnings })
      }
    })
  })
}
github OpenNeuroOrg / openneuro / packages / openneuro-app / src / scripts / workers / validate.worker.js View on Github external
new Promise(resolve => {
    validate.BIDS(files, options, (issues, summary) =>
      resolve({ issues, summary }),
    )
  })
github OpenNeuroOrg / openneuro / packages / openneuro-app / src / scripts / uploader / upload-issues.jsx View on Github external
componentWillMount() {
    const options = {}
    validate.BIDS(this.props.files, options, this.done)
  }
github OpenNeuroOrg / openneuro / server / handlers / validation.js View on Github external
scitran.downloadSymlinkDataset(datasetId, (err, hash) => {
      if (err) {
        return res.status(500).send({ error: generic_failure })
      }
      try {
        validate.BIDS(
          config.location + '/persistent/datasets/' + hash,
          {},
          (validation, summary) => {
            scitran.updateProject(
              datasetId,
              {
                metadata: { validation, summary },
              },
              () => {
                scitran.removeTag('projects', datasetId, 'validating', () => {
                  if (validation.errors && validation.errors.length > 0) {
                    scitran.addTag('projects', datasetId, 'invalid', () => {
                      res.send({ validation, summary })
                    })
                  } else {
                    scitran.removeTag('projects', datasetId, 'invalid', () => {

bids-validator

MIT
Latest version published 29 days ago

Package Health Score

79 / 100
Full package analysis

Similar packages