- Rename package from @sinclair/typebox to @alkdev/typebox - Update author, repository, and homepage to alkdev - Remove GitHub workflows, .vscode config, and branding assets - Update all source, test, example, changelog, and task imports - Update tsconfig.json path mappings - Clean up readme header (remove upstream badges/branding)
29 lines
603 B
TypeScript
29 lines
603 B
TypeScript
import { Expect } from './assert'
|
|
import { Type, TSchema, TReadonlyOptional } from '@alkdev/typebox'
|
|
|
|
{
|
|
const T = Type.Object({
|
|
A: Type.ReadonlyOptional(Type.String()),
|
|
})
|
|
Expect(T).ToStatic<{
|
|
readonly A?: string
|
|
}>()
|
|
}
|
|
{
|
|
const T = Type.ReadonlyOptional(Type.String())
|
|
function test(_: TReadonlyOptional<TSchema>) {}
|
|
test(T)
|
|
}
|
|
{
|
|
const T = Type.Readonly(Type.String())
|
|
function test(_: TReadonlyOptional<TSchema>) {}
|
|
// @ts-expect-error
|
|
test(T)
|
|
}
|
|
{
|
|
const T = Type.Optional(Type.String())
|
|
function test(_: TReadonlyOptional<TSchema>) {}
|
|
// @ts-expect-error
|
|
test(T)
|
|
}
|