packages/@uppy/transloadit/src/AssemblyOptions.js
function validateParams (params) {
  if (!params) {
    throw new Error('Transloadit: The `params` option is required.')
  }

  if (typeof params === 'string') {
    try {
      params = JSON.parse(params)
    } catch (err) {
      // Tell the user that this is not an Uppy bug!
      err.message = 'Transloadit: The `params` option is a malformed JSON string: ' +
        err.message
      throw err
    }
  }

  if (!params.auth || !params.auth.key) {
    throw new Error('Transloadit: The `params.auth.key` option is required. ' +
      'You can find your Transloadit API key at https://transloadit.com/account/api-settings.')
  }
}
function validateParams (params) {
  if (!params) {
    throw new Error('Transloadit: The `params` option is required.')
  }

  if (typeof params === 'string') {
    try {
      params = JSON.parse(params)
    } catch (err) {
      // Tell the user that this is not an Uppy bug!
      err.message = 'Transloadit: The `params` option is a malformed JSON string: ' +
        err.message
      throw err
    }
  }

  if (!params.auth || !params.auth.key) {
    throw new Error('Transloadit: The `params.auth.key` option is required. ' +
      'You can find your Transloadit API key at https://transloadit.com/account/api-settings.')
  }
}
function validateParams ( params ) { if ( ! params ) { throw new Error ( 'Transloadit: The `params` option is required.' ) } if ( typeof params === 'string' ) { try { params = JSON . parse ( params ) } catch ( err ) { // Tell the user that this is not an Uppy bug! err . message = 'Transloadit: The `params` option is a malformed JSON string: ' + err . message throw err } } if ( ! params . auth || ! params . auth . key ) { throw new Error ( 'Transloadit: The `params.auth.key` option is required. ' + 'You can find your Transloadit API key at https://transloadit.com/account/api-settings.' ) } }
Check that Assembly parameters are present and include all required fields.
Check that Assembly parameters are present and include all required fields .