@sinclair/typebox 0.32.3 → 0.32.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/build/import/errors/index.d.mts +1 -1
- package/build/import/value/clean/clean.d.mts +2 -2
- package/build/import/value/convert/convert.d.mts +2 -2
- package/build/import/value/default/default.d.mts +2 -2
- package/build/import/value/value/value.d.mts +6 -6
- package/build/require/errors/index.d.ts +1 -1
- package/build/require/value/clean/clean.d.ts +2 -2
- package/build/require/value/convert/convert.d.ts +2 -2
- package/build/require/value/default/default.d.ts +2 -2
- package/build/require/value/value/value.d.ts +6 -6
- package/license +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Errors, ValueError, ValueErrorIterator, ValueErrorType, ValueErrorsUnknownTypeError } from './errors.mjs';
|
|
2
|
-
export { DefaultErrorFunction, GetErrorFunction, SetErrorFunction, type ErrorFunction } from './function.mjs';
|
|
2
|
+
export { DefaultErrorFunction, GetErrorFunction, SetErrorFunction, type ErrorFunction, type ErrorFunctionParameter } from './function.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TSchema } from '../../type/schema/index.mjs';
|
|
2
2
|
/** `[Mutable]` Removes excess properties from a value and returns the result. This function does not check the value and returns an unknown type. You should Check the result before use. Clean is a mutable operation. To avoid mutation, Clone the value first. */
|
|
3
|
-
export declare function Clean
|
|
3
|
+
export declare function Clean(schema: TSchema, references: TSchema[], value: unknown): unknown;
|
|
4
4
|
/** `[Mutable]` Removes excess properties from a value and returns the result. This function does not check the value and returns an unknown type. You should Check the result before use. Clean is a mutable operation. To avoid mutation, Clone the value first. */
|
|
5
|
-
export declare function Clean
|
|
5
|
+
export declare function Clean(schema: TSchema, value: unknown): unknown;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TSchema } from '../../type/schema/index.mjs';
|
|
2
2
|
/** Converts any type mismatched values to their target type if a reasonable conversion is possible. */
|
|
3
|
-
export declare function Convert
|
|
3
|
+
export declare function Convert(schema: TSchema, references: TSchema[], value: unknown): unknown;
|
|
4
4
|
/** Converts any type mismatched values to their target type if a reasonable conversion is possible. */
|
|
5
|
-
export declare function Convert
|
|
5
|
+
export declare function Convert(schema: TSchema, value: unknown): unknown;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TSchema } from '../../type/schema/index.mjs';
|
|
2
2
|
/** `[Mutable]` Generates missing properties on a value using default schema annotations if available. This function does not check the value and returns an unknown type. You should Check the result before use. Default is a mutable operation. To avoid mutation, Clone the value first. */
|
|
3
|
-
export declare function Default
|
|
3
|
+
export declare function Default(schema: TSchema, references: TSchema[], value: unknown): unknown;
|
|
4
4
|
/** `[Mutable]` Generates missing properties on a value using default schema annotations if available. This function does not check the value and returns an unknown type. You should Check the result before use. Default is a mutable operation. To avoid mutation, Clone the value first. */
|
|
5
|
-
export declare function Default
|
|
5
|
+
export declare function Default(schema: TSchema, value: unknown): unknown;
|
|
@@ -16,13 +16,13 @@ export declare function Check<T extends TSchema>(schema: T, references: TSchema[
|
|
|
16
16
|
/** Returns true if the value matches the given type */
|
|
17
17
|
export declare function Check<T extends TSchema>(schema: T, value: unknown): value is Static<T>;
|
|
18
18
|
/** `[Mutable]` Removes excess properties from a value and returns the result. This function does not check the value and returns an unknown type. You should Check the result before use. Clean is a mutable operation. To avoid mutation, Clone the value first. */
|
|
19
|
-
export declare function Clean
|
|
19
|
+
export declare function Clean(schema: TSchema, references: TSchema[], value: unknown): unknown;
|
|
20
20
|
/** `[Mutable]` Removes excess properties from a value and returns the result. This function does not check the value and returns an unknown type. You should Check the result before use. Clean is a mutable operation. To avoid mutation, Clone the value first. */
|
|
21
|
-
export declare function Clean
|
|
21
|
+
export declare function Clean(schema: TSchema, value: unknown): unknown;
|
|
22
22
|
/** Converts any type mismatched values to their target type if a reasonable conversion is possible */
|
|
23
|
-
export declare function Convert
|
|
23
|
+
export declare function Convert(schema: TSchema, references: TSchema[], value: unknown): unknown;
|
|
24
24
|
/** Converts any type mismatched values to their target type if a reasonable conversion is possibl. */
|
|
25
|
-
export declare function Convert
|
|
25
|
+
export declare function Convert(schema: TSchema, value: unknown): unknown;
|
|
26
26
|
/** Returns a structural clone of the given value */
|
|
27
27
|
export declare function Clone<T>(value: T): T;
|
|
28
28
|
/** Decodes a value or throws if error */
|
|
@@ -30,9 +30,9 @@ export declare function Decode<T extends TSchema, R = StaticDecode<T>>(schema: T
|
|
|
30
30
|
/** Decodes a value or throws if error */
|
|
31
31
|
export declare function Decode<T extends TSchema, R = StaticDecode<T>>(schema: T, value: unknown): R;
|
|
32
32
|
/** `[Mutable]` Generates missing properties on a value using default schema annotations if available. This function does not check the value and returns an unknown type. You should Check the result before use. Default is a mutable operation. To avoid mutation, Clone the value first. */
|
|
33
|
-
export declare function Default
|
|
33
|
+
export declare function Default(schema: TSchema, references: TSchema[], value: unknown): unknown;
|
|
34
34
|
/** `[Mutable]` Generates missing properties on a value using default schema annotations if available. This function does not check the value and returns an unknown type. You should Check the result before use. Default is a mutable operation. To avoid mutation, Clone the value first. */
|
|
35
|
-
export declare function Default
|
|
35
|
+
export declare function Default(schema: TSchema, value: unknown): unknown;
|
|
36
36
|
/** Encodes a value or throws if error */
|
|
37
37
|
export declare function Encode<T extends TSchema, R = StaticEncode<T>>(schema: T, references: TSchema[], value: unknown): R;
|
|
38
38
|
/** Encodes a value or throws if error */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Errors, ValueError, ValueErrorIterator, ValueErrorType, ValueErrorsUnknownTypeError } from './errors';
|
|
2
|
-
export { DefaultErrorFunction, GetErrorFunction, SetErrorFunction, type ErrorFunction } from './function';
|
|
2
|
+
export { DefaultErrorFunction, GetErrorFunction, SetErrorFunction, type ErrorFunction, type ErrorFunctionParameter } from './function';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TSchema } from '../../type/schema/index';
|
|
2
2
|
/** `[Mutable]` Removes excess properties from a value and returns the result. This function does not check the value and returns an unknown type. You should Check the result before use. Clean is a mutable operation. To avoid mutation, Clone the value first. */
|
|
3
|
-
export declare function Clean
|
|
3
|
+
export declare function Clean(schema: TSchema, references: TSchema[], value: unknown): unknown;
|
|
4
4
|
/** `[Mutable]` Removes excess properties from a value and returns the result. This function does not check the value and returns an unknown type. You should Check the result before use. Clean is a mutable operation. To avoid mutation, Clone the value first. */
|
|
5
|
-
export declare function Clean
|
|
5
|
+
export declare function Clean(schema: TSchema, value: unknown): unknown;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TSchema } from '../../type/schema/index';
|
|
2
2
|
/** Converts any type mismatched values to their target type if a reasonable conversion is possible. */
|
|
3
|
-
export declare function Convert
|
|
3
|
+
export declare function Convert(schema: TSchema, references: TSchema[], value: unknown): unknown;
|
|
4
4
|
/** Converts any type mismatched values to their target type if a reasonable conversion is possible. */
|
|
5
|
-
export declare function Convert
|
|
5
|
+
export declare function Convert(schema: TSchema, value: unknown): unknown;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TSchema } from '../../type/schema/index';
|
|
2
2
|
/** `[Mutable]` Generates missing properties on a value using default schema annotations if available. This function does not check the value and returns an unknown type. You should Check the result before use. Default is a mutable operation. To avoid mutation, Clone the value first. */
|
|
3
|
-
export declare function Default
|
|
3
|
+
export declare function Default(schema: TSchema, references: TSchema[], value: unknown): unknown;
|
|
4
4
|
/** `[Mutable]` Generates missing properties on a value using default schema annotations if available. This function does not check the value and returns an unknown type. You should Check the result before use. Default is a mutable operation. To avoid mutation, Clone the value first. */
|
|
5
|
-
export declare function Default
|
|
5
|
+
export declare function Default(schema: TSchema, value: unknown): unknown;
|
|
@@ -16,13 +16,13 @@ export declare function Check<T extends TSchema>(schema: T, references: TSchema[
|
|
|
16
16
|
/** Returns true if the value matches the given type */
|
|
17
17
|
export declare function Check<T extends TSchema>(schema: T, value: unknown): value is Static<T>;
|
|
18
18
|
/** `[Mutable]` Removes excess properties from a value and returns the result. This function does not check the value and returns an unknown type. You should Check the result before use. Clean is a mutable operation. To avoid mutation, Clone the value first. */
|
|
19
|
-
export declare function Clean
|
|
19
|
+
export declare function Clean(schema: TSchema, references: TSchema[], value: unknown): unknown;
|
|
20
20
|
/** `[Mutable]` Removes excess properties from a value and returns the result. This function does not check the value and returns an unknown type. You should Check the result before use. Clean is a mutable operation. To avoid mutation, Clone the value first. */
|
|
21
|
-
export declare function Clean
|
|
21
|
+
export declare function Clean(schema: TSchema, value: unknown): unknown;
|
|
22
22
|
/** Converts any type mismatched values to their target type if a reasonable conversion is possible */
|
|
23
|
-
export declare function Convert
|
|
23
|
+
export declare function Convert(schema: TSchema, references: TSchema[], value: unknown): unknown;
|
|
24
24
|
/** Converts any type mismatched values to their target type if a reasonable conversion is possibl. */
|
|
25
|
-
export declare function Convert
|
|
25
|
+
export declare function Convert(schema: TSchema, value: unknown): unknown;
|
|
26
26
|
/** Returns a structural clone of the given value */
|
|
27
27
|
export declare function Clone<T>(value: T): T;
|
|
28
28
|
/** Decodes a value or throws if error */
|
|
@@ -30,9 +30,9 @@ export declare function Decode<T extends TSchema, R = StaticDecode<T>>(schema: T
|
|
|
30
30
|
/** Decodes a value or throws if error */
|
|
31
31
|
export declare function Decode<T extends TSchema, R = StaticDecode<T>>(schema: T, value: unknown): R;
|
|
32
32
|
/** `[Mutable]` Generates missing properties on a value using default schema annotations if available. This function does not check the value and returns an unknown type. You should Check the result before use. Default is a mutable operation. To avoid mutation, Clone the value first. */
|
|
33
|
-
export declare function Default
|
|
33
|
+
export declare function Default(schema: TSchema, references: TSchema[], value: unknown): unknown;
|
|
34
34
|
/** `[Mutable]` Generates missing properties on a value using default schema annotations if available. This function does not check the value and returns an unknown type. You should Check the result before use. Default is a mutable operation. To avoid mutation, Clone the value first. */
|
|
35
|
-
export declare function Default
|
|
35
|
+
export declare function Default(schema: TSchema, value: unknown): unknown;
|
|
36
36
|
/** Encodes a value or throws if error */
|
|
37
37
|
export declare function Encode<T extends TSchema, R = StaticEncode<T>>(schema: T, references: TSchema[], value: unknown): R;
|
|
38
38
|
/** Encodes a value or throws if error */
|
package/license
CHANGED
|
@@ -4,7 +4,7 @@ Json Schema Type Builder with Static Type Resolution for TypeScript
|
|
|
4
4
|
|
|
5
5
|
The MIT License (MIT)
|
|
6
6
|
|
|
7
|
-
Copyright (c) 2017-
|
|
7
|
+
Copyright (c) 2017-2024 Haydn Paterson (sinclair) <haydn.developer@gmail.com>
|
|
8
8
|
|
|
9
9
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
10
|
of this software and associated documentation files (the "Software"), to deal
|