typebox 1.0.30 → 1.0.31

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.
@@ -0,0 +1,2 @@
1
+ import type { TProperties, Base } from '../../type/index.mjs';
2
+ export declare function FromBase(context: TProperties, type: Base, value: unknown): unknown;
@@ -0,0 +1,8 @@
1
+ // deno-fmt-ignore-file
2
+ import { FromUnknown } from './from-unknown.mjs';
3
+ // ------------------------------------------------------------------
4
+ // FromBase
5
+ // ------------------------------------------------------------------
6
+ export function FromBase(context, type, value) {
7
+ return FromUnknown(context, type, value);
8
+ }
@@ -2,6 +2,7 @@
2
2
  import { Guard, GlobalsGuard } from '../../guard/index.mjs';
3
3
  import * as T from '../../type/index.mjs';
4
4
  import { FromArray } from './from-array.mjs';
5
+ import { FromBase } from './from-base.mjs';
5
6
  import { FromEnum } from './from-enum.mjs';
6
7
  import { FromIntersect } from './from-intersect.mjs';
7
8
  import { FromObject } from './from-object.mjs';
@@ -44,6 +45,10 @@ function AssertRepairableType(context, type, value) {
44
45
  // FromType
45
46
  // ------------------------------------------------------------------
46
47
  export function FromType(context, type, value) {
48
+ // Intercept Base
49
+ if (T.IsBase(type))
50
+ return FromBase(context, type, value);
51
+ // Standard Repair
47
52
  AssertRepairableValue(context, type, value);
48
53
  AssertRepairableType(context, type, value);
49
54
  return (T.IsArray(type) ? FromArray(context, type, value) :
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "typebox",
3
3
  "description": "A Runtime Type System for JavaScript",
4
- "version": "1.0.30",
4
+ "version": "1.0.31",
5
5
  "keywords": [
6
6
  "typescript",
7
7
  "jsonschema"