- 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)
21 lines
888 B
TypeScript
21 lines
888 B
TypeScript
import { Expect } from './assert'
|
|
import { Type } from '@alkdev/typebox'
|
|
|
|
Expect(Type.Awaited(Type.String())).ToStatic<string>()
|
|
|
|
Expect(Type.Awaited(Type.Promise(Type.String()))).ToStatic<string>()
|
|
|
|
Expect(Type.Awaited(Type.Promise(Type.Promise(Type.String())))).ToStatic<string>()
|
|
|
|
// One Level
|
|
|
|
Expect(Type.Awaited(Type.Union([Type.Promise(Type.String()), Type.Number()]))).ToStatic<string | number>()
|
|
|
|
Expect(Type.Awaited(Type.Intersect([Type.Promise(Type.Object({ a: Type.String() })), Type.Object({ b: Type.Number() })]))).ToStatic<{ a: string } & { b: number }>()
|
|
|
|
// Two Levels
|
|
|
|
Expect(Type.Awaited(Type.Union([Type.Promise(Type.Promise(Type.String())), Type.Number()]))).ToStatic<string | number>()
|
|
|
|
Expect(Type.Awaited(Type.Intersect([Type.Promise(Type.Promise(Type.Object({ a: Type.String() }))), Type.Object({ b: Type.Number() })]))).ToStatic<{ a: string } & { b: number }>()
|