@sinclair/typebox 0.24.13 → 0.24.14
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/guard/guard.d.ts +1 -1
- package/guard/guard.js +1 -1
- package/package.json +1 -1
- package/value/cast.js +4 -3
package/guard/guard.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Types from '../typebox';
|
|
2
|
-
/**
|
|
2
|
+
/** TypeGuard tests that values conform to a known TypeBox type specification */
|
|
3
3
|
export declare namespace TypeGuard {
|
|
4
4
|
/** Returns true if the given schema is TAny */
|
|
5
5
|
function TAny(schema: any): schema is Types.TAny;
|
package/guard/guard.js
CHANGED
|
@@ -29,7 +29,7 @@ THE SOFTWARE.
|
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
30
|
exports.TypeGuard = void 0;
|
|
31
31
|
const Types = require("../typebox");
|
|
32
|
-
/**
|
|
32
|
+
/** TypeGuard tests that values conform to a known TypeBox type specification */
|
|
33
33
|
var TypeGuard;
|
|
34
34
|
(function (TypeGuard) {
|
|
35
35
|
function IsObject(schema) {
|
package/package.json
CHANGED
package/value/cast.js
CHANGED
|
@@ -32,9 +32,10 @@ const Types = require("../typebox");
|
|
|
32
32
|
const create_1 = require("./create");
|
|
33
33
|
const check_1 = require("./check");
|
|
34
34
|
// --------------------------------------------------------------------------
|
|
35
|
-
// Specialized Union
|
|
36
|
-
//
|
|
37
|
-
//
|
|
35
|
+
// Specialized Union Cast. Because a union can be one of many varying types
|
|
36
|
+
// with properties potentially overlapping, we need a strategy to determine
|
|
37
|
+
// which of those types we should cast into. This strategy needs to factor
|
|
38
|
+
// the value provided by the user to make this decision.
|
|
38
39
|
//
|
|
39
40
|
// The following will score each union type found within the types anyOf
|
|
40
41
|
// array. Typically this is executed for objects only, so the score is a
|