@sinclair/typebox 0.24.51 → 0.24.52

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.
Files changed (47) hide show
  1. package/compiler/compiler.d.ts +25 -28
  2. package/compiler/compiler.js +408 -409
  3. package/compiler/index.d.ts +2 -2
  4. package/compiler/index.js +47 -47
  5. package/conditional/conditional.d.ts +17 -17
  6. package/conditional/conditional.js +91 -91
  7. package/conditional/index.d.ts +2 -2
  8. package/conditional/index.js +45 -45
  9. package/conditional/structural.d.ts +11 -11
  10. package/conditional/structural.js +657 -657
  11. package/errors/errors.d.ts +60 -60
  12. package/errors/errors.js +398 -398
  13. package/errors/index.d.ts +1 -1
  14. package/errors/index.js +44 -44
  15. package/format/format.d.ts +12 -12
  16. package/format/format.js +55 -55
  17. package/format/index.d.ts +1 -1
  18. package/format/index.js +44 -44
  19. package/guard/guard.d.ts +56 -56
  20. package/guard/guard.js +351 -351
  21. package/guard/index.d.ts +1 -1
  22. package/guard/index.js +44 -44
  23. package/license +22 -22
  24. package/package.json +43 -40
  25. package/readme.md +1152 -1152
  26. package/typebox.d.ts +408 -408
  27. package/typebox.js +383 -383
  28. package/value/cast.d.ts +26 -26
  29. package/value/cast.js +364 -364
  30. package/value/check.d.ts +8 -8
  31. package/value/check.js +331 -331
  32. package/value/clone.d.ts +3 -3
  33. package/value/clone.js +65 -65
  34. package/value/create.d.ts +14 -14
  35. package/value/create.js +357 -357
  36. package/value/delta.d.ts +22 -22
  37. package/value/delta.js +168 -168
  38. package/value/equal.d.ts +3 -3
  39. package/value/equal.js +74 -74
  40. package/value/index.d.ts +3 -3
  41. package/value/index.js +48 -48
  42. package/value/is.d.ts +10 -10
  43. package/value/is.js +49 -49
  44. package/value/pointer.d.ts +24 -24
  45. package/value/pointer.js +142 -142
  46. package/value/value.d.ts +31 -31
  47. package/value/value.js +81 -81
@@ -1,28 +1,25 @@
1
- import { ValueError } from '../errors/index';
2
- import * as Types from '../typebox';
3
- export declare type CheckFunction = (value: unknown) => boolean;
4
- export declare class TypeCheck<T extends Types.TSchema> {
5
- private readonly schema;
6
- private readonly references;
7
- private readonly checkFunc;
8
- private readonly code;
9
- constructor(schema: T, references: Types.TSchema[], checkFunc: CheckFunction, code: string);
10
- /** Returns the generated validation code used to validate this type. */
11
- Code(): string;
12
- /** Returns an iterator for each error in this value. */
13
- Errors(value: unknown): IterableIterator<ValueError>;
14
- /** Returns true if the value matches the given type. */
15
- Check(value: unknown): value is Types.Static<T>;
16
- }
17
- export declare namespace Property {
18
- function Check(propertyName: string): boolean;
19
- }
20
- export declare class TypeCompilerUnknownTypeError extends Error {
21
- readonly schema: Types.TSchema;
22
- constructor(schema: Types.TSchema);
23
- }
24
- /** Compiles Types for Runtime Type Checking */
25
- export declare namespace TypeCompiler {
26
- /** Compiles the given type for runtime type checking. This compiler only accepts known TypeBox types non-inclusive of unsafe types. */
27
- function Compile<T extends Types.TSchema>(schema: T, references?: Types.TSchema[]): TypeCheck<T>;
28
- }
1
+ import { ValueError } from '../errors/index';
2
+ import * as Types from '../typebox';
3
+ export declare type CheckFunction = (value: unknown) => boolean;
4
+ export declare class TypeCheck<T extends Types.TSchema> {
5
+ private readonly schema;
6
+ private readonly references;
7
+ private readonly checkFunc;
8
+ private readonly code;
9
+ constructor(schema: T, references: Types.TSchema[], checkFunc: CheckFunction, code: string);
10
+ /** Returns the generated validation code used to validate this type. */
11
+ Code(): string;
12
+ /** Returns an iterator for each error in this value. */
13
+ Errors(value: unknown): IterableIterator<ValueError>;
14
+ /** Returns true if the value matches the given type. */
15
+ Check(value: unknown): value is Types.Static<T>;
16
+ }
17
+ export declare class TypeCompilerUnknownTypeError extends Error {
18
+ readonly schema: Types.TSchema;
19
+ constructor(schema: Types.TSchema);
20
+ }
21
+ /** Compiles Types for Runtime Type Checking */
22
+ export declare namespace TypeCompiler {
23
+ /** Compiles the given type for runtime type checking. This compiler only accepts known TypeBox types non-inclusive of unsafe types. */
24
+ function Compile<T extends Types.TSchema>(schema: T, references?: Types.TSchema[]): TypeCheck<T>;
25
+ }