@sinclair/typebox 0.30.3 → 0.30.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiler/compiler.js +3 -2
- package/package.json +1 -1
- package/readme.md +4 -4
package/compiler/compiler.js
CHANGED
|
@@ -599,10 +599,11 @@ var TypeCompiler;
|
|
|
599
599
|
function Compile(schema, references = []) {
|
|
600
600
|
const generatedCode = Code(schema, references, { language: 'javascript' });
|
|
601
601
|
const compiledFunction = globalThis.Function('kind', 'format', 'hash', generatedCode);
|
|
602
|
+
const instances = new Map(state.instances);
|
|
602
603
|
function typeRegistryFunction(kind, instance, value) {
|
|
603
|
-
if (!Types.TypeRegistry.Has(kind) || !
|
|
604
|
+
if (!Types.TypeRegistry.Has(kind) || !instances.has(instance))
|
|
604
605
|
return false;
|
|
605
|
-
const schema =
|
|
606
|
+
const schema = instances.get(instance);
|
|
606
607
|
const checkFunc = Types.TypeRegistry.Get(kind);
|
|
607
608
|
return checkFunc(schema, value);
|
|
608
609
|
}
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -110,7 +110,7 @@ License MIT
|
|
|
110
110
|
- [Types](#typesystem-types)
|
|
111
111
|
- [Formats](#typesystem-formats)
|
|
112
112
|
- [Policies](#typesystem-policies)
|
|
113
|
-
- [
|
|
113
|
+
- [Workbench](#workbench)
|
|
114
114
|
- [Ecosystem](#ecosystem)
|
|
115
115
|
- [Benchmark](#benchmark)
|
|
116
116
|
- [Compile](#benchmark-compile)
|
|
@@ -1516,13 +1516,13 @@ TypeSystem.AllowArrayObjects = true
|
|
|
1516
1516
|
TypeSystem.AllowNaN = true
|
|
1517
1517
|
```
|
|
1518
1518
|
|
|
1519
|
-
<a name='
|
|
1519
|
+
<a name='workbench'></a>
|
|
1520
1520
|
|
|
1521
|
-
## TypeBox
|
|
1521
|
+
## TypeBox Workbench
|
|
1522
1522
|
|
|
1523
1523
|
TypeBox offers a small web based code generation tool that can be used to convert TypeScript types into TypeBox types as well as a variety of other runtime type representations.
|
|
1524
1524
|
|
|
1525
|
-
[TypeBox
|
|
1525
|
+
[TypeBox Workbench Link Here](https://sinclairzx81.github.io/typebox-workbench/)
|
|
1526
1526
|
|
|
1527
1527
|
<a name='ecosystem'></a>
|
|
1528
1528
|
|