//#region src/redis.ts
function createRedisBackend(client) {
	return {
		async get(key) {
			return await client.get(key) ?? void 0;
		},
		async set(key, value, ttlSeconds) {
			if (ttlSeconds !== void 0) {
				await client.set(key, value, "EX", ttlSeconds);
				return;
			}
			await client.set(key, value);
		},
		async del(key) {
			await client.del(key);
		}
	};
}
//#endregion
export { createRedisBackend };
