//#region ../../node_modules/es-toolkit/dist/compat/function/memoize.mjs
function e(t, n) {
	if (typeof t != "function" || n != null && typeof n != "function") throw TypeError("Expected a function");
	let r = function(...e) {
		let i = n ? n.apply(this, e) : e[0], a = r.cache;
		if (a.has(i)) return a.get(i);
		let o = t.apply(this, e);
		return r.cache = a.set(i, o) || a, o;
	};
	return r.cache = new (e.Cache || Map)(), r;
}
e.Cache = Map;
//#endregion
export { e as memoize };

//# sourceMappingURL=memoize.js.map