text: "use strict";
  
  exports.__esModule = true;
  exports.getTransformKey = exports.getIsMatchingKey = exports.getIsEqual = exports.createOnCacheOperation = void 0;
  
  var _fastEquals = require("fast-equals");
  
  var _maxArgs = require("./maxArgs");
  
  var _serialize = require("./serialize");
  
  var _utils = require("./utils");
  
  // external dependencies
  // max args
  // serialize
  // utils
  var createOnCacheOperation = function createOnCacheOperation(fn) {
    if (typeof fn === 'function') {
      return function (cache, _microMemoizeOptions, memoized) {
        return (// $FlowIgnore fn is a function if this is hit
          fn(memoized.cache, memoized.options, memoized)
        );
      };
    }
  };
  /**
   * @private
   *
   * @function getIsEqual
   *
   * @description
   * get the isEqual method passed to micro-memoize
   *
   * @param {Options} options the options passed to the moizer
   * @returns {function} the isEqual method to apply
   */
  
  
  exports.createOnCacheOperation = createOnCacheOperation;
  
  var getIsEqual = function getIsEqual(_ref) {
    var equals = _ref.equals,
        isDeepEqual = _ref.isDeepEqual,
        isReact = _ref.isReact;
    return equals || isDeepEqual && _fastEquals.deepEqual || isReact && _fastEquals.shallowEqual || _fastEquals.sameValueZeroEqual;
  };
  /**
   * @private
   *
   * @function getIsMatchingKey
   *
   * @description
   * get the isEqual method passed to micro-memoize
   *
   * @param {Options} options the options passed to the moizer
   * @returns {function} the isEqual method to apply
   */
  
  
  exports.getIsEqual = getIsEqual;
  
  var getIsMatchingKey = function getIsMatchingKey(_ref2) {
    var isSerialized = _ref2.isSerialized,
        matchesKey = _ref2.matchesKey;
    return matchesKey || isSerialized && _serialize.getIsSerializedKeyEqual || undefined;
  };
  /**
   * @private
   *
   * @function getTransformKey
   *
   * @description
   * get the function that will transform the key based on the arguments passed
   *
   * @param {Options} options the options passed to the moizer
   * @returns {function|void} the function to transform the key with
   */
  
  
  exports.getIsMatchingKey = getIsMatchingKey;
  
  var getTransformKey = function getTransformKey(options) {
    var maxArgs = options.maxArgs,
        isReact = options.isReact,
        isSerialized = options.isSerialized,
        transformArgs = options.transformArgs;
    return (0, _utils.compose)(isSerialized && (0, _serialize.getSerializerFunction)(options), typeof transformArgs === 'function' && (0, _utils.compose)(_utils.getArrayKey, transformArgs), isReact && (0, _maxArgs.createGetInitialArgs)(2), typeof maxArgs === 'number' && (0, _maxArgs.createGetInitialArgs)(maxArgs));
  };
  
  exports.getTransformKey = getTransformKey;