import _MapCache_default from "./_MapCache.js";
var FUNC_ERROR_TEXT = "Expected a function";
function memoize(r, i) {
	if (typeof r != "function" || i != null && typeof i != "function") throw TypeError(FUNC_ERROR_TEXT);
	var a = function() {
		var e = arguments, t = i ? i.apply(this, e) : e[0], n = a.cache;
		if (n.has(t)) return n.get(t);
		var o = r.apply(this, e);
		return a.cache = n.set(t, o) || n, o;
	};
	return a.cache = new (memoize.Cache || _MapCache_default)(), a;
}
memoize.Cache = _MapCache_default;
var memoize_default = memoize;
export { memoize_default as default };
