UNPKG

redis-smq

Version:

A high-performance, reliable, and scalable message queue for Node.js.

16 lines 526 B
const LITERAL_TOKEN_RE = /^[A-Za-z][A-Za-z0-9]*(?:[-_][A-Za-z0-9]+)*$/; export function _validateRoutingPattern(p) { if (typeof p !== 'string' || p.length === 0) return false; const tokens = p.split('.'); if (tokens.some((t) => t.length === 0)) return false; for (const tok of tokens) { if (tok === '*' || tok === '#') continue; if (!LITERAL_TOKEN_RE.test(tok)) return false; } return true; } //# sourceMappingURL=_validate-routing-pattern.js.map