text: /** @license ISC License (c) copyright 2019 original and current authors */
  /** @author Karthik Iyengar (karthikiyengar) */
  /** @author Ian Hofmann-Hicks */
  
  var curry = require('../core/curry')
  var equals = require('../core/equals')
  var isArray = require('../core/isArray')
  var isDefined = require('../core/isDefined')
  var isEmpty  = require('../core/isEmpty')
  var isInteger = require('../core/isInteger')
  var isNil = require('../core/isNil')
  var isString = require('../core/isString')
  
  var err = function (name) { return (name + ": First argument must be an Array of non-empty Strings or Integers"); }
  
  function fn(name) {
    // pathEq :: [ String | Number ] -> a -> Object -> Boolean
    function pathEq(keys, value, target) {
      if(!isArray(keys)) {
        throw new TypeError(err(name))
      }
  
      if(isNil(target)) {
        return false
      }
  
      var acc = target
      for(var i = 0; i < keys.length; i++) {
        var key = keys[i]
  
        if(!(isString(key) && !isEmpty(key) || isInteger(key))) {
          throw new TypeError(err(name))
        }
  
        if(isNil(acc)) {
          return false
        }
  
        acc = acc[key]
  
        if(!isDefined(acc)) {
          return false
        }
      }
  
      return equals(acc, value)
    }
  
    return curry(pathEq)
  }
  
  var pathEq =
    fn('pathEq')
  
  pathEq.origFn =
    fn
  
  module.exports = pathEq
  