text: "use strict";
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports.safeInvoke = exports.unwrapArray = undefined;
  
  var _toConsumableArray2 = require("babel-runtime/helpers/toConsumableArray");
  
  var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  
  /**
   * Takes an argument and if it's an array, returns the first item in the array,
   * otherwise returns the argument. Used for Preact compatibility.
   */
  var unwrapArray = exports.unwrapArray = function unwrapArray(arg) {
    return Array.isArray(arg) ? arg[0] : arg;
  };
  
  /**
   * Takes a maybe-undefined function and arbitrary args and invokes the function
   * only if it is defined.
   */
  var safeInvoke = exports.safeInvoke = function safeInvoke(fn) {
    for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      args[_key - 1] = arguments[_key];
    }
  
    if (typeof fn === "function") {
      return fn.apply(undefined, (0, _toConsumableArray3.default)(args));
    }
  };