This commit is contained in:
sinclair
2025-12-24 15:44:34 +09:00
commit 13d553220c
1047 changed files with 80931 additions and 0 deletions

24
test/static/array.ts Normal file
View File

@@ -0,0 +1,24 @@
import { Expect } from './assert'
import { Type } from '@sinclair/typebox'
Expect(Type.Array(Type.String())).ToStatic<string[]>()
Expect(
Type.Array(
Type.Object({
x: Type.Number(),
y: Type.Boolean(),
z: Type.String(),
}),
),
).ToStatic<
{
x: number
y: boolean
z: string
}[]
>()
Expect(Type.Array(Type.Array(Type.String()))).ToStatic<string[][]>()
Expect(Type.Array(Type.Tuple([Type.String(), Type.Number()]))).ToStatic<[string, number][]>()