// Generated by CoffeeScript 2.3.2
(function() {
  module.exports = function(thing, methods = ['apply', 'transform']) {
    return function(...args) {
      var i, len, method;
      if (typeof thing === "function") {
        return thing.apply(null, args);
      } else if (typeof thing === 'object') {
        for (i = 0, len = methods.length; i < len; i++) {
          method = methods[i];
          if (typeof thing[method] === 'function') {
            return thing[method](...args);
          }
        }
      }
      throw new Error(`don't know how to call this: ${(thing != null ? thing.constructor : void 0)}`);
    };
  };

}).call(this);
