@sinclair/typebox 0.25.4 → 0.25.5
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/conditional/conditional.d.ts +1 -1
- package/conditional/conditional.js +1 -1
- package/errors/errors.d.ts +1 -0
- package/errors/errors.js +1 -0
- package/format/format.d.ts +1 -1
- package/format/format.js +1 -1
- package/guard/guard.d.ts +1 -1
- package/guard/guard.js +1 -1
- package/package.json +1 -1
- package/value/pointer.d.ts +1 -1
- package/value/pointer.js +1 -1
- package/value/value.d.ts +2 -2
- package/value/value.js +7 -2
|
@@ -6,7 +6,7 @@ export interface TExclude<T extends Types.TUnion, U extends Types.TUnion> extend
|
|
|
6
6
|
export interface TExtract<T extends Types.TSchema, U extends Types.TUnion> extends Types.TUnion<any[]> {
|
|
7
7
|
static: Extract<Types.Static<T, this['params']>, Types.Static<U, this['params']>>;
|
|
8
8
|
}
|
|
9
|
-
/** Conditional
|
|
9
|
+
/** Conditional type mapping for TypeBox types */
|
|
10
10
|
export declare namespace Conditional {
|
|
11
11
|
/** (Experimental) Creates a conditional expression type */
|
|
12
12
|
function Extends<L extends Types.TSchema, R extends Types.TSchema, T extends Types.TSchema, U extends Types.TSchema>(left: L, right: R, ok: T, fail: U): TExtends<L, R, T, U>;
|
|
@@ -31,7 +31,7 @@ exports.Conditional = void 0;
|
|
|
31
31
|
const Types = require("../typebox");
|
|
32
32
|
const structural_1 = require("./structural");
|
|
33
33
|
const index_1 = require("../guard/index");
|
|
34
|
-
/** Conditional
|
|
34
|
+
/** Conditional type mapping for TypeBox types */
|
|
35
35
|
var Conditional;
|
|
36
36
|
(function (Conditional) {
|
|
37
37
|
/** (Experimental) Creates a conditional expression type */
|
package/errors/errors.d.ts
CHANGED
|
@@ -60,6 +60,7 @@ export declare class ValueErrorsUnknownTypeError extends Error {
|
|
|
60
60
|
readonly schema: Types.TSchema;
|
|
61
61
|
constructor(schema: Types.TSchema);
|
|
62
62
|
}
|
|
63
|
+
/** Provides functionality to generate a sequence of errors against a TypeBox type. */
|
|
63
64
|
export declare namespace ValueErrors {
|
|
64
65
|
function Errors<T extends Types.TSchema>(schema: T, references: Types.TSchema[], value: any): IterableIterator<ValueError>;
|
|
65
66
|
}
|
package/errors/errors.js
CHANGED
|
@@ -94,6 +94,7 @@ class ValueErrorsUnknownTypeError extends Error {
|
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
exports.ValueErrorsUnknownTypeError = ValueErrorsUnknownTypeError;
|
|
97
|
+
/** Provides functionality to generate a sequence of errors against a TypeBox type. */
|
|
97
98
|
var ValueErrors;
|
|
98
99
|
(function (ValueErrors) {
|
|
99
100
|
function* Any(schema, references, path, value) { }
|
package/format/format.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare type FormatValidationFunction = (value: string) => boolean;
|
|
2
|
-
/**
|
|
2
|
+
/** Provides functions to create custom string formats */
|
|
3
3
|
export declare namespace Format {
|
|
4
4
|
/** Clears all formats */
|
|
5
5
|
function Clear(): void;
|
package/format/format.js
CHANGED
|
@@ -28,7 +28,7 @@ THE SOFTWARE.
|
|
|
28
28
|
---------------------------------------------------------------------------*/
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
30
|
exports.Format = void 0;
|
|
31
|
-
/**
|
|
31
|
+
/** Provides functions to create custom string formats */
|
|
32
32
|
var Format;
|
|
33
33
|
(function (Format) {
|
|
34
34
|
const formats = new Map();
|
package/guard/guard.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export declare class TypeGuardInvalidTypeError extends Error {
|
|
|
3
3
|
readonly schema: unknown;
|
|
4
4
|
constructor(schema: unknown);
|
|
5
5
|
}
|
|
6
|
-
/**
|
|
6
|
+
/** Provides functionality to test if values are TypeBox types */
|
|
7
7
|
export declare namespace TypeGuard {
|
|
8
8
|
/** Returns true if the given schema is TAny */
|
|
9
9
|
function TAny(schema: unknown): schema is Types.TAny;
|
package/guard/guard.js
CHANGED
|
@@ -36,7 +36,7 @@ class TypeGuardInvalidTypeError extends Error {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
exports.TypeGuardInvalidTypeError = TypeGuardInvalidTypeError;
|
|
39
|
-
/**
|
|
39
|
+
/** Provides functionality to test if values are TypeBox types */
|
|
40
40
|
var TypeGuard;
|
|
41
41
|
(function (TypeGuard) {
|
|
42
42
|
function IsObject(value) {
|
package/package.json
CHANGED
package/value/pointer.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare class ValuePointerRootDeleteError extends Error {
|
|
|
9
9
|
readonly path: string;
|
|
10
10
|
constructor(value: unknown, path: string);
|
|
11
11
|
}
|
|
12
|
-
/**
|
|
12
|
+
/** Provides functionality to update values through RFC6901 string pointers */
|
|
13
13
|
export declare namespace ValuePointer {
|
|
14
14
|
/** Formats the given pointer into navigable key components */
|
|
15
15
|
function Format(pointer: string): IterableIterator<string>;
|
package/value/pointer.js
CHANGED
|
@@ -45,7 +45,7 @@ class ValuePointerRootDeleteError extends Error {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
exports.ValuePointerRootDeleteError = ValuePointerRootDeleteError;
|
|
48
|
-
/**
|
|
48
|
+
/** Provides functionality to update values through RFC6901 string pointers */
|
|
49
49
|
var ValuePointer;
|
|
50
50
|
(function (ValuePointer) {
|
|
51
51
|
function Escape(component) {
|
package/value/value.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as Types from '../typebox';
|
|
2
2
|
import { ValueError } from '../errors/index';
|
|
3
3
|
import { Edit } from './delta';
|
|
4
|
-
export
|
|
5
|
-
/**
|
|
4
|
+
export { Edit, Insert, Update, Delete } from './delta';
|
|
5
|
+
/** Provides functions to perform structural updates to JavaScript values */
|
|
6
6
|
export declare namespace Value {
|
|
7
7
|
/** Casts a value into a given type. The return value will retain as much information of the original value as possible. Cast will convert string, number and boolean values if a reasonable conversion is possible. */
|
|
8
8
|
function Cast<T extends Types.TSchema, R extends Types.TSchema[]>(schema: T, references: [...R], value: unknown): Types.Static<T>;
|
package/value/value.js
CHANGED
|
@@ -27,7 +27,7 @@ THE SOFTWARE.
|
|
|
27
27
|
|
|
28
28
|
---------------------------------------------------------------------------*/
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
exports.Value = void 0;
|
|
30
|
+
exports.Value = exports.Delete = exports.Update = exports.Insert = exports.Edit = void 0;
|
|
31
31
|
const index_1 = require("../errors/index");
|
|
32
32
|
const equal_1 = require("./equal");
|
|
33
33
|
const cast_1 = require("./cast");
|
|
@@ -35,7 +35,12 @@ const clone_1 = require("./clone");
|
|
|
35
35
|
const create_1 = require("./create");
|
|
36
36
|
const check_1 = require("./check");
|
|
37
37
|
const delta_1 = require("./delta");
|
|
38
|
-
|
|
38
|
+
var delta_2 = require("./delta");
|
|
39
|
+
Object.defineProperty(exports, "Edit", { enumerable: true, get: function () { return delta_2.Edit; } });
|
|
40
|
+
Object.defineProperty(exports, "Insert", { enumerable: true, get: function () { return delta_2.Insert; } });
|
|
41
|
+
Object.defineProperty(exports, "Update", { enumerable: true, get: function () { return delta_2.Update; } });
|
|
42
|
+
Object.defineProperty(exports, "Delete", { enumerable: true, get: function () { return delta_2.Delete; } });
|
|
43
|
+
/** Provides functions to perform structural updates to JavaScript values */
|
|
39
44
|
var Value;
|
|
40
45
|
(function (Value) {
|
|
41
46
|
function Cast(...args) {
|