Skip to content

Commit 5d5bc40

Browse files
authored
Version 1.1.21 (#1572)
* Localize JIT Calls to the System.Environment * ChangeLog * Version
1 parent fd319ba commit 5d5bc40

146 files changed

Lines changed: 220 additions & 138 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

changelog/1.1.0.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
---
44

55
### Version Updates
6+
- [Revision 1.1.21](https://github.com/sinclairzx81/typebox/pull/1572)
7+
- Localize JIT Calls to System.Environment
68
- [Revision 1.1.20](https://github.com/sinclairzx81/typebox/pull/1568)
79
- Union Priority Sort for Clean, Encode and Decode
810
- [Revision 1.1.19](https://github.com/sinclairzx81/typebox/pull/1566)

deno.jsonc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"clean": "deno run -A tasks.ts clean", // Clean Build Targets
66
"fast": "deno run -A tasks.ts fast", // Interactive Tests
77
"format": "deno run -A tasks.ts format", // Formats Code
8+
"lint": "deno run -A tasks.ts lint", // Lints Code
89
"local": "deno run -A tasks.ts local", // Build Local Project
910
"metrics": "deno run -A tasks.ts metrics", // Compression Metrics
1011
"native": "deno run -A tasks.ts native", // Build Project With TypeScript Native

src/compile/compile.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ THE SOFTWARE.
2626
2727
---------------------------------------------------------------------------*/
2828

29+
// deno-lint-ignore-file ban-types
2930
// deno-fmt-ignore-file
3031

3132
import { Arguments } from '../system/arguments/index.ts'

src/compile/validator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export class Validator<Context extends TProperties = TProperties, Type extends T
113113
}
114114
/** Inspects a value and returns a detailed list of validation errors. */
115115
public override Errors(value: unknown): TLocalizedValidationError[] {
116-
if (Environment.CanAccelerate() && this.check(value)) return []
116+
if (Environment.CanEvaluate() && this.check(value)) return []
117117
return Errors(this.context, this.type, value)
118118
}
119119
/** Cleans a value using the Validator type. */

src/error/errors.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ THE SOFTWARE.
2626
2727
---------------------------------------------------------------------------*/
2828

29+
// deno-lint-ignore-file ban-types
30+
2931
import { Guard } from '../guard/index.ts'
3032

3133
// ------------------------------------------------------------------

src/format/iri-reference.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ THE SOFTWARE.
2626
2727
---------------------------------------------------------------------------*/
2828

29+
// deno-lint-ignore-file no-control-regex
30+
2931
// deno-coverage-ignore-start
3032
function TryUrl(value: string): boolean {
3133
try {

src/format/uri-reference.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ THE SOFTWARE.
2626
2727
---------------------------------------------------------------------------*/
2828

29+
// deno-lint-ignore-file no-control-regex
30+
2931
const UriReference = /^(?!.*[^\x00-\x7F])(?!.*\\)(?:(?:[a-z][a-z0-9+\-.]*:)?(?:\/\/[^\s[\]{}<>^`|]*)?|[^\s[\]{}<>^`|]*)(?:\?[^\s[\]{}<>^`|]*)?(?:#[^\s[\]{}<>^`|]*)?$/i
3032

3133
/**

src/guard/globals.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ THE SOFTWARE.
2929
// --------------------------------------------------------------------------
3030
// Primitives
3131
// --------------------------------------------------------------------------
32-
export function IsBoolean(value: unknown): value is Boolean {
32+
export function IsBoolean(value: unknown): value is globalThis.Boolean {
3333
return value instanceof Boolean
3434
}
35-
export function IsNumber(value: unknown): value is Number {
35+
export function IsNumber(value: unknown): value is globalThis.Number {
3636
return value instanceof Number
3737
}
38-
export function IsString(value: unknown): value is String {
38+
export function IsString(value: unknown): value is globalThis.String {
3939
return value instanceof String
4040
}
4141
// ------------------------------------------------------------------

src/guard/guard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export function IsConstructor(value: unknown): value is new (...args: never[]) =
5656
return false
5757
}
5858
/** Returns true if this value is a function */
59-
export function IsFunction(value: unknown): value is Function {
59+
export function IsFunction(value: unknown): value is globalThis.Function {
6060
return IsEqual(typeof value, 'function')
6161
}
6262
/** Returns true if this value is integer */

src/schema/build.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function CreateCode(build: BuildResult): string {
5252
// CreateEvaluatedCheck
5353
// ------------------------------------------------------------------
5454
function CreateEvaluatedCheck(build: BuildResult, code: string): CheckFunction {
55-
const factory = new globalThis.Function('CheckContext', 'Guard', 'Format', 'Hashing', build.External().identifier, code)
55+
const factory = Environment.Evaluate('CheckContext', 'Guard', 'Format', 'Hashing', build.External().identifier, code)
5656
return factory(Engine.CheckContext, Guard, Format, Hashing, build.External().variables)
5757
}
5858
// ------------------------------------------------------------------
@@ -67,7 +67,7 @@ function CreateDynamicCheck(build: BuildResult): CheckFunction {
6767
// CreateCheck
6868
// ------------------------------------------------------------------
6969
function CreateCheck(build: BuildResult, code: string): CheckFunction {
70-
return Environment.CanAccelerate()
70+
return Environment.CanEvaluate()
7171
? CreateEvaluatedCheck(build, code)
7272
: CreateDynamicCheck(build)
7373
}
@@ -124,7 +124,7 @@ export class BuildResult {
124124
public Evaluate(): EvaluateResult {
125125
const Code = CreateCode(this)
126126
const Check = CreateCheck(this, Code)
127-
return { IsAccelerated: Environment.CanAccelerate(), Code, Check }
127+
return { IsAccelerated: Environment.CanEvaluate(), Code, Check }
128128
}
129129
}
130130
// ------------------------------------------------------------------

0 commit comments

Comments
 (0)