Skip to content

Commit

Permalink
Revision 0.32.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sinclairzx81 committed Nov 29, 2023
1 parent 67abd89 commit 5020bf7
Show file tree
Hide file tree
Showing 161 changed files with 168 additions and 168 deletions.
7 changes: 1 addition & 6 deletions examples/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
import Type, { JavaScriptTypeBuilder, FormatRegistry, type Static } from '@sinclair/typebox'
import Value from '@sinclair/typebox/value'
import {} from '@sinclair/typebox/value'
import { TypeCompiler } from '@sinclair/typebox/compiler'



export class Foo extends JavaScriptTypeBuilder {}
const foo = new JavaScriptTypeBuilder()
10 changes: 8 additions & 2 deletions src/compiler/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,18 @@ export class TypeCheck<T extends TSchema> {
public Check(value: unknown): value is Static<T> {
return this.checkFunc(value)
}
/** Decodes a value or throws if error */
/**
* Decodes a value or throws if error
* @deprecated Use raw `Decode` from `Value` module
*/
public Decode(value: unknown): StaticDecode<T> {
if (!this.checkFunc(value)) throw new TransformDecodeCheckError(this.schema, value, this.Errors(value).First()!)
return this.hasTransform ? TransformDecode(this.schema, this.references, value) : value
}
/** Encodes a value or throws if error */
/**
* Encodes a value or throws if error
* @deprecated Use raw `Encode` from `Value` module
*/
public Encode(value: unknown): StaticEncode<T> {
const encoded = this.hasTransform ? TransformEncode(this.schema, this.references, value) : value
if (!this.checkFunc(encoded)) throw new TransformEncodeCheckError(this.schema, value, this.Errors(value).First()!)
Expand Down
2 changes: 1 addition & 1 deletion src/type/any/any.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/any/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/array/array.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/array/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/async-iterator/async-iterator.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/async-iterator/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/awaited/awaited.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/awaited/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/bigint/bigint.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/bigint/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/boolean/boolean.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/boolean/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/builder/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/builder/javascript.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/builder/json.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/builder/type.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/clone/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/clone/type.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/clone/value.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/composite/composite.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/composite/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/const/const.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/const/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/constructor-parameters/constructor-parameters.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/constructor-parameters/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/constructor/constructor.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/constructor/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/date/date.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/date/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/deref/deref.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/deref/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/discard/discard.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/discard/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/distinct/distinct.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/distinct/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/enum/enum.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/enum/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/exclude/exclude.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/exclude/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/extends/extends-check.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/extends/extends-undefined.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/extends/extends.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/extends/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/extract/extract.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/extract/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion src/type/function/function.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
@sinclair/typebox
@sinclair/typebox/type
The MIT License (MIT)
Expand Down
Loading

0 comments on commit 5020bf7

Please sign in to comment.