function memo(fn, getCacheKey) {
	const cache = new Map();
	return function (...args) {
		const key = getCacheKey ? getCacheKey(...args) : args[0];
		let out = cache.get(key);
		if (out === undefined) {
			out = fn(...args);
			cache.set(key, out);
		}
		return out;
	};
}
Simple single-arity memoize
@template {(...args: any[]) => any} T
@param {T} fn
@param {(...args: Parameters<T>) => string} [getCacheKey]
@returns {(...args: Parameters<T>) => ReturnType<T>}