Skip to content

Commit

Permalink
fix(deps): update dependency @sinclair/typebox to ^0.32.0 (#977)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com>
  • Loading branch information
3 people committed Dec 22, 2023
1 parent c76f842 commit 5c993ef
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .changeset/fets-977-dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"fets": patch
---
dependencies updates:
- Updated dependency [`@sinclair/typebox@^0.32.0` 鈫楋笌](https://www.npmjs.com/package/@sinclair/typebox/v/0.32.0) (from `^0.31.23`, in `dependencies`)
5 changes: 5 additions & 0 deletions .changeset/soft-readers-hear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"fets": minor
---

Update typebox
2 changes: 1 addition & 1 deletion packages/fets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
},
"typings": "dist/typings/index.d.ts",
"dependencies": {
"@sinclair/typebox": "^0.31.23",
"@sinclair/typebox": "^0.32.0",
"@whatwg-node/cookie-store": "^0.2.0",
"@whatwg-node/fetch": "^0.9.4",
"@whatwg-node/server": "^0.9.15",
Expand Down
12 changes: 6 additions & 6 deletions packages/fets/src/plugins/typebox.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TSchema, TypeGuard } from '@sinclair/typebox';
import { TypeGuard, type TSchema } from '@sinclair/typebox';
import { TypeCompiler, ValueError, ValueErrorIterator } from '@sinclair/typebox/compiler';
import { Value } from '@sinclair/typebox/value';
import { HTTPError } from '@whatwg-node/server';
Expand Down Expand Up @@ -47,7 +47,7 @@ export function useTypeBox<TServerContext, TComponents extends RouterComponentsB
}
return {
onRouteHandle({ route: { schemas }, request }) {
if (schemas?.request?.headers && TypeGuard.TSchema(schemas.request.headers)) {
if (schemas?.request?.headers && TypeGuard.IsSchema(schemas.request.headers)) {
const validateFn = getValidateFn(schemas.request.headers);
const headersObj = getHeadersObj(request.headers as any);
const errors = [...validateFn(headersObj)].map(error => sanitizeError(error, 'headers'));
Expand All @@ -64,7 +64,7 @@ export function useTypeBox<TServerContext, TComponents extends RouterComponentsB
);
}
}
if (schemas?.request?.params && TypeGuard.TSchema(schemas.request.params)) {
if (schemas?.request?.params && TypeGuard.IsSchema(schemas.request.params)) {
const validateFn = getValidateFn(schemas.request.params);
const errors = [...validateFn(request.params)].map(error => sanitizeError(error, 'params'));
if (errors.length) {
Expand All @@ -80,7 +80,7 @@ export function useTypeBox<TServerContext, TComponents extends RouterComponentsB
);
}
}
if (schemas?.request?.query && TypeGuard.TSchema(schemas.request.query)) {
if (schemas?.request?.query && TypeGuard.IsSchema(schemas.request.query)) {
const validateFn = getValidateFn(schemas.request.query);
const errors = [...validateFn(request.query)].map(error => sanitizeError(error, 'query'));
if (errors.length) {
Expand All @@ -96,7 +96,7 @@ export function useTypeBox<TServerContext, TComponents extends RouterComponentsB
);
}
}
if (schemas?.request?.json && TypeGuard.TSchema(schemas.request.json)) {
if (schemas?.request?.json && TypeGuard.IsSchema(schemas.request.json)) {
const validateFn = getValidateFn(schemas.request.json);
const origReqJsonMethod = request.json.bind(request);
Object.defineProperty(request, 'json', {
Expand All @@ -123,7 +123,7 @@ export function useTypeBox<TServerContext, TComponents extends RouterComponentsB
configurable: true,
});
}
if (schemas?.request?.formData && TypeGuard.TSchema(schemas.request.formData)) {
if (schemas?.request?.formData && TypeGuard.IsSchema(schemas.request.formData)) {
const validateFn = getValidateFn(schemas.request.formData);
const origMethod = request.formData.bind(request);
Object.defineProperty(request, 'formData', {
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2766,10 +2766,10 @@
resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e"
integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==

"@sinclair/typebox@^0.31.23":
version "0.31.28"
resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.31.28.tgz#b68831e7bc7d09daac26968ea32f42bedc968ede"
integrity sha512-/s55Jujywdw/Jpan+vsy6JZs1z2ZTGxTmbZTPiuSL2wz9mfzA2gN1zzaqmvfi4pq+uOt7Du85fkiwv5ymW84aQ==
"@sinclair/typebox@^0.32.0":
version "0.32.0"
resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.32.0.tgz#17b6003a99f34686cc28d50c3ee2a68c9b3d6099"
integrity sha512-FdBgO+ib0JCSPtq55cDva/5xd55vfAAyTXWVLCaTAFzNjVPaR5lNRKoEzMHTtArELEaHNs4E6WmdNJIY+gUoZw==

"@sinonjs/commons@^3.0.0":
version "3.0.0"
Expand Down

0 comments on commit 5c993ef

Please sign in to comment.