@norskvideo/moq-pattern
v0.2.2
Published
Exact path patterns for Media over QUIC: grammar, matching, and set algebra.
Downloads
662
Keywords
Readme
@moq/pattern
Exact path patterns for Media over QUIC: grammar, matching, and set algebra.
A pattern describes a set of broadcast paths. This package provides a shared grammar
for tokens, origin scopes, and announce interests. Integrating
patterns into those consumers is separate work.
Literal paths stay coordinates; @moq/net's path module keeps construction, joins, and
prefix operations.
@moq/net and @moq/auth re-export these types. The Rust twin is
moq-pattern.
npm add @moq/patternimport { Pattern, Patterns } from "@moq/pattern";
const grant = Pattern.parse("pid/*/chat");
grant.matches("pid/room1/chat"); // true
grant.contains(Pattern.parse("pid/room1/chat")); // true
const under = Pattern.parse("**/a").rebase("a");
[...under].map((p) => p.text); // ["", "**/a"]See the package docs for the grammar, the CAT/C4M common subset, and the literal-path rollout.
