code: function union(schema, defaults, options) {
    if (kindOf(schema) !== 'array') {
      if (process.env.NODE_ENV !== 'production') {
        throw new Error(
          `Union structs must be defined as an array, but you passed: ${schema}`
        )
      } else {
        throw new Error(`Invalid schema: ${schema}`)
      }
    }
  
    const kinds = schema.map(s => any(s, undefined, options))
    const name = 'union'
    const type = kinds.map(k => k.type).join(' | ')
    const validate = (value = resolveDefaults(defaults)) => {
      const errors = []
  
      for (const k of kinds) {
        const [e, r] = k.validate(value)
  
        if (!e) {
          return [undefined, r]
        }
  
        errors.push(e)
      }
      errors[0].type = type
      return errors
    }
  
    return new Kind(name, type, validate)
  }
docs: Union.
  
  @param {Array} schema
  @param {Any} defaults
  @param {Object} options