Skip to content

Commit

Permalink
chore fix
Browse files Browse the repository at this point in the history
  • Loading branch information
EdamAme-x committed Jan 21, 2025
1 parent 1fe23be commit 03c789d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/validator/response-validator.sandbox.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Hono } from '../preset/quick'
import { responseValidator } from '.'
import { validator, responseValidator } from '.'

Check warning on line 2 in src/validator/response-validator.sandbox.ts

View check run for this annotation

Codecov / codecov/patch

src/validator/response-validator.sandbox.ts#L1-L2

Added lines #L1 - L2 were not covered by tests

const app = new Hono<{

Check warning on line 4 in src/validator/response-validator.sandbox.ts

View check run for this annotation

Codecov / codecov/patch

src/validator/response-validator.sandbox.ts#L4

Added line #L4 was not covered by tests
Bindings: {
Expand All @@ -8,8 +8,11 @@ const app = new Hono<{
}>()

Check warning on line 8 in src/validator/response-validator.sandbox.ts

View check run for this annotation

Codecov / codecov/patch

src/validator/response-validator.sandbox.ts#L8

Added line #L8 was not covered by tests

app
.use(
.get(
'*',
validator('query', (value, c) => {
console.log(value, c)
}),
responseValidator('text', (value, c) => {
console.log(value)
if (!/\d/.test(value)) {
Expand Down
2 changes: 1 addition & 1 deletion src/validator/response-validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ const jsonRegex = /^application\/([a-z-\.]+\+)?json(;\s*[a-zA-Z0-9\-]+\=([^;]+))
const htmlRegex = /^text\/html(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/

export const responseValidator = <
U extends ResponseValidationTargetKeys,
P extends string,
U extends ResponseValidationTargetKeys,
P2 extends string = P,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
E extends Env = any
Expand Down

0 comments on commit 03c789d

Please sign in to comment.