@sinclair/typebox 0.25.23 → 0.25.25

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 (61) hide show
  1. package/compiler/compiler.d.ts +25 -28
  2. package/compiler/compiler.js +495 -495
  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 +685 -685
  11. package/custom/custom.d.ts +12 -12
  12. package/custom/custom.js +55 -55
  13. package/custom/index.d.ts +1 -1
  14. package/custom/index.js +44 -44
  15. package/errors/errors.d.ts +67 -67
  16. package/errors/errors.js +472 -468
  17. package/errors/index.d.ts +1 -1
  18. package/errors/index.js +44 -44
  19. package/format/format.d.ts +12 -12
  20. package/format/format.js +55 -55
  21. package/format/index.d.ts +1 -1
  22. package/format/index.js +44 -44
  23. package/guard/extends.d.ts +10 -0
  24. package/guard/extends.js +50 -0
  25. package/guard/guard.d.ts +60 -60
  26. package/guard/guard.js +440 -440
  27. package/guard/index.d.ts +2 -1
  28. package/guard/index.js +45 -44
  29. package/hash/hash.d.ts +8 -8
  30. package/hash/hash.js +183 -183
  31. package/hash/index.d.ts +1 -1
  32. package/hash/index.js +44 -44
  33. package/license +22 -22
  34. package/package.json +55 -52
  35. package/readme.md +1237 -1325
  36. package/system/index.d.ts +1 -1
  37. package/system/index.js +44 -44
  38. package/system/system.d.ts +17 -17
  39. package/system/system.js +69 -69
  40. package/typebox.d.ts +422 -422
  41. package/typebox.js +388 -388
  42. package/value/cast.d.ts +26 -26
  43. package/value/cast.js +415 -420
  44. package/value/check.d.ts +8 -8
  45. package/value/check.js +405 -395
  46. package/value/clone.d.ts +3 -3
  47. package/value/clone.js +71 -71
  48. package/value/create.d.ts +14 -14
  49. package/value/create.js +378 -388
  50. package/value/delta.d.ts +43 -43
  51. package/value/delta.js +204 -204
  52. package/value/equal.d.ts +3 -3
  53. package/value/equal.js +80 -80
  54. package/value/index.d.ts +4 -4
  55. package/value/index.js +53 -53
  56. package/value/is.d.ts +11 -11
  57. package/value/is.js +53 -53
  58. package/value/pointer.d.ts +24 -24
  59. package/value/pointer.js +142 -142
  60. package/value/value.d.ts +32 -32
  61. package/value/value.js +87 -87
@@ -1,28 +1,25 @@
1
- import { ValueError } from '../errors/index';
2
- import * as Types from '../typebox';
3
- export 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 compiled type. */
15
- Check(value: unknown): value is Types.Static<T>;
16
- }
17
- export declare namespace MemberExpression {
18
- function Encode(object: string, key: string): string;
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 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 compiled 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
+ }