- 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)
51 lines
807 B
TypeScript
51 lines
807 B
TypeScript
import { Expect } from './assert'
|
|
import { Type, Static } from '@alkdev/typebox'
|
|
|
|
{
|
|
const T = Type.Object({
|
|
A: Type.Readonly(Type.String()),
|
|
})
|
|
|
|
type T = Static<typeof T>
|
|
|
|
Expect(T).ToStatic<{
|
|
readonly A: string
|
|
}>()
|
|
}
|
|
// Noop
|
|
// prettier-ignore
|
|
{
|
|
const T = Type.Object({
|
|
A: Type.Readonly(Type.String(), false),
|
|
})
|
|
type T = Static<typeof T>
|
|
|
|
Expect(T).ToStatic<{
|
|
A: string
|
|
}>()
|
|
}
|
|
// Additive
|
|
// prettier-ignore
|
|
{
|
|
const T = Type.Object({
|
|
A: Type.Readonly(Type.String(), true),
|
|
})
|
|
type T = Static<typeof T>
|
|
|
|
Expect(T).ToStatic<{
|
|
readonly A: string
|
|
}>()
|
|
}
|
|
// Subtractive
|
|
// prettier-ignore
|
|
{
|
|
const T = Type.Object({
|
|
A: Type.Readonly(Type.Readonly(Type.String()), false)
|
|
})
|
|
type T = Static<typeof T>
|
|
|
|
Expect(T).ToStatic<{
|
|
A: string
|
|
}>()
|
|
}
|