function validate(config) {
  let errors = []
  if (!config) {
    errors.push('no config')
    return errors
  }
  let { width, height, scale, components } = config
  if (typeof width !== 'number') {
    errors.push('missing "width"')
  }
  if (typeof height !== 'number') {
    errors.push('missing "height"')
  }
  let scales = ['width', 'height', 'original', 'fullScreen']
  if (scales.indexOf(scale) === -1) {
    errors.push('missing "scale"')
  }
  if (!(components instanceof Array)) {
    errors.push('missing "components"')
  }
  return errors
}

export default validate
