Skip to content

Commit

Permalink
Revision 0.31.7 (#562)
Browse files Browse the repository at this point in the history
  • Loading branch information
sinclairzx81 authored Aug 29, 2023
1 parent c41d29a commit 233cc22
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sinclair/typebox",
"version": "0.31.6",
"version": "0.31.7",
"description": "JSONSchema Type Builder with Static Type Resolution for TypeScript",
"keywords": [
"typescript",
Expand Down
2 changes: 1 addition & 1 deletion src/typebox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ export type DecodeType<T extends TSchema> = (
T extends TOptional<infer S extends TSchema> ? TOptional<DecodeType<S>> :
T extends TReadonly<infer S extends TSchema> ? TReadonly<DecodeType<S>> :
T extends TTransform<infer _, infer R> ? TUnsafe<R> :
T extends TArray<infer S extends TSchema> ? Array<DecodeType<S>> :
T extends TArray<infer S extends TSchema> ? TArray<DecodeType<S>> :
T extends TAsyncIterator<infer S extends TSchema> ? TAsyncIterator<DecodeType<S>> :
T extends TConstructor<infer P extends TSchema[], infer R extends TSchema> ? TConstructor<P, DecodeType<R>> :
T extends TFunction<infer P extends TSchema[], infer R extends TSchema> ? TFunction<P, DecodeType<R>> :
Expand Down
8 changes: 8 additions & 0 deletions test/static/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,3 +246,11 @@ import { Expect } from './assert'
const E4: E4 = false
const E5: E5 = true
}
{
// should correctly decode array
// https://github.com/sinclairzx81/typebox/issues/561
const T = Type.Object({
x: Type.Array(Type.Object({ y: Type.String() })),
})
Expect(T).ToStaticDecode<{ x: { y: string }[] }>()
}

0 comments on commit 233cc22

Please sign in to comment.