redis-smq
Version:
A high-performance, reliable, and scalable message queue for Node.js.
10 lines • 364 B
JavaScript
import { InvalidRedisKeyError } from '../../../errors/index.js';
export function validateRedisKey(key) {
if (!key?.length)
return new InvalidRedisKeyError();
const valid = /^[a-z][a-z0-9\-_.]*$/.test(key.toLowerCase());
if (!valid)
return new InvalidRedisKeyError();
return key.toLowerCase();
}
//# sourceMappingURL=validator.js.map