-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Parse Pipeline and TypeCheck Schema and Reference Accessor Functions
- Loading branch information
1 parent
428f906
commit 4da6a67
Showing
6 changed files
with
156 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { TypeCompiler } from '@sinclair/typebox/compiler' | ||
import { Type, TypeGuard, ValueGuard } from '@sinclair/typebox' | ||
import { Assert } from '../assert/index' | ||
|
||
describe('compiler/TypeCheckMembers', () => { | ||
it('Should return Schema', () => { | ||
const A = TypeCompiler.Compile(Type.Number(), [Type.String(), Type.Boolean()]) | ||
Assert.IsTrue(TypeGuard.IsNumber(A.Schema())) | ||
}) | ||
it('Should return References', () => { | ||
const A = TypeCompiler.Compile(Type.Number(), [Type.String(), Type.Boolean()]) | ||
Assert.IsTrue(TypeGuard.IsNumber(A.Schema())) | ||
Assert.IsTrue(TypeGuard.IsString(A.References()[0])) | ||
Assert.IsTrue(TypeGuard.IsBoolean(A.References()[1])) | ||
}) | ||
it('Should return Code', () => { | ||
const A = TypeCompiler.Compile(Type.Number(), [Type.String(), Type.Boolean()]) | ||
Assert.IsTrue(ValueGuard.IsString(A.Code())) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import './__members' | ||
import './any' | ||
import './array' | ||
import './async-iterator' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters