       if isFunction(needle)
         needle(key, val)
 
-      if isObject(val)
+      if isObjectOrArray(val)
         find(val, needle, memo)
 
   return memo


isObject   = require 'is-object'
isFunction = require 'is-function'

###
when passed an object, returns an array of its keys.


find = (haystack, needle, memo = []) ->

  if needle and isObjectOrArray(haystack)

    if needle of haystack
      memo.push haystack[needle]
