index.js
function delegateOptional (self) {
  if (hasOwn(self, 'actual') && hasOwn(self, 'expected')) {
    var kindOf = tryRequire('kind-of-extra', 'kind-error')
    delegate(self, {
      orig: {
        actual: self.actual,
        expected: self.expected
      },
      type: {
        actual: kindOf(self.actual),
        expected: kindOf(self.expected)
      },
      inspect: {
        actual: util.inspect(self.actual),
        expected: util.inspect(self.expected)
      }
    })
    if (typeof self.message === 'function') {
      self.message = self.message.call(self, self.type, self.inspect) // eslint-disable-line no-useless-call
    }
  }
  return self
}
function delegateOptional (self) {
  if (hasOwn(self, 'actual') && hasOwn(self, 'expected')) {
    var kindOf = tryRequire('kind-of-extra', 'kind-error')
    delegate(self, {
      orig: {
        actual: self.actual,
        expected: self.expected
      },
      type: {
        actual: kindOf(self.actual),
        expected: kindOf(self.expected)
      },
      inspect: {
        actual: util.inspect(self.actual),
        expected: util.inspect(self.expected)
      }
    })
    if (typeof self.message === 'function') {
      self.message = self.message.call(self, self.type, self.inspect) // eslint-disable-line no-useless-call
    }
  }
  return self
}
function delegateOptional ( self ) { if ( hasOwn ( self , 'actual' ) && hasOwn ( self , 'expected' ) ) { var kindOf = tryRequire ( 'kind-of-extra' , 'kind-error' ) delegate ( self , { orig : { actual : self . actual , expected : self . expected } , type : { actual : kindOf ( self . actual ) , expected : kindOf ( self . expected ) } , inspect : { actual : util . inspect ( self . actual ) , expected : util . inspect ( self . expected ) } } ) if ( typeof self . message === 'function' ) { self . message = self . message . call ( self , self . type , self . inspect ) // eslint-disable-line no-useless-call } } return self }
> Delegate additional optional properties to the `KindError` class.
If `actual` and `expected` properties given in `options` object.

@param  {Object} `self`
@return {Object}
> Delegate additional optional properties to the KindError class . If actual and expected properties given in options object .