text: import { isFunction, __DEV__ } from "./assertion";
  export function runIfFn(valueOrFn) {
    for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      args[_key - 1] = arguments[_key];
    }
  
    return isFunction(valueOrFn) ? valueOrFn(...args) : valueOrFn;
  }
  export function callAllHandlers() {
    for (var _len2 = arguments.length, fns = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
      fns[_key2] = arguments[_key2];
    }
  
    return function func(event) {
      fns.some(fn => {
        fn == null ? void 0 : fn(event);
        return event == null ? void 0 : event.defaultPrevented;
      });
    };
  }
  export function callAll() {
    for (var _len3 = arguments.length, fns = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
      fns[_key3] = arguments[_key3];
    }
  
    return function mergedFn(arg) {
      fns.forEach(fn => {
        fn == null ? void 0 : fn(arg);
      });
    };
  }
  export var compose = function compose(fn1) {
    for (var _len4 = arguments.length, fns = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
      fns[_key4 - 1] = arguments[_key4];
    }
  
    return fns.reduce((f1, f2) => function () {
      return f1(f2(...arguments));
    }, fn1);
  };
  export function once(fn) {
    var result;
    return function func() {
      if (fn) {
        for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
          args[_key5] = arguments[_key5];
        }
  
        result = fn.apply(this, args);
        fn = null;
      }
  
      return result;
    };
  }
  export var noop = () => {};
  export var warn = once(options => {
    var {
      condition,
      message
    } = options;
  
    if (condition && __DEV__) {
      console.warn(message);
    }
  });
  export var error = once(options => {
    var {
      condition,
      message
    } = options;
  
    if (condition && __DEV__) {
      console.error(message);
    }
  });
  //# sourceMappingURL=function.js.map