move to pkg

This commit is contained in:
2023-06-08 12:45:23 +02:00
parent 2b80109e3b
commit 81ccb95d82
256 changed files with 4856 additions and 529 deletions

View File

@ -0,0 +1,23 @@
import { eventMatchesFilter } from "../src/RequestMatcher";
describe("RequestMatcher", () => {
it("should match simple filter", () => {
const ev = {
id: "test",
kind: 1,
pubkey: "pubkey",
created_at: 99,
tags: [],
content: "test",
sig: "",
};
const filter = {
ids: ["test"],
authors: ["pubkey", "other"],
kinds: [1, 2, 3],
since: 1,
before: 100,
};
expect(eventMatchesFilter(ev, filter)).toBe(true);
});
});