Skip to content

Commit 57e1aa5

Browse files
committed
Revert "refactor: reuse isGenericTagQuery in filter schema"
This reverts commit 68fa412.
1 parent 68fa412 commit 57e1aa5

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/schemas/filter-schema.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { z } from 'zod'
22

33
import { createdAtSchema, kindSchema, prefixSchema } from './base-schema'
4-
import { isGenericTagQuery } from '../utils/filter'
54

65
const knownFilterKeys = new Set(['ids', 'authors', 'kinds', 'since', 'until', 'limit'])
76

@@ -17,7 +16,7 @@ export const filterSchema = z
1716
.catchall(z.array(z.string().min(1).max(1024)))
1817
.superRefine((data, ctx) => {
1918
for (const key of Object.keys(data)) {
20-
if (!knownFilterKeys.has(key) && !isGenericTagQuery(key)) {
19+
if (!knownFilterKeys.has(key) && !/^#[a-z]$/.test(key)) {
2120
ctx.addIssue({
2221
code: z.ZodIssueCode.custom,
2322
message: `Unknown key: ${key}`,

0 commit comments

Comments
 (0)