@depup/typebox 1.3.22-depup.0 → 1.3.30-depup.0

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 (136) hide show
  1. package/README.md +2 -2
  2. package/build/compile/validator.d.mts +1 -1
  3. package/build/compile/validator.mjs +1 -1
  4. package/build/format/iri.mjs +5 -1
  5. package/build/schema/build.mjs +2 -2
  6. package/build/schema/check.mjs +1 -1
  7. package/build/schema/compile.d.mts +3 -2
  8. package/build/schema/compile.mjs +8 -8
  9. package/build/schema/engine/_context.d.mts +6 -7
  10. package/build/schema/engine/_context.mjs +23 -15
  11. package/build/schema/engine/_functions.d.mts +2 -2
  12. package/build/schema/engine/_functions.mjs +1 -1
  13. package/build/schema/engine/_reducer.d.mts +3 -3
  14. package/build/schema/engine/_refine.d.mts +5 -5
  15. package/build/schema/engine/_refine.mjs +4 -7
  16. package/build/schema/engine/_stack.d.mts +34 -16
  17. package/build/schema/engine/_stack.mjs +148 -104
  18. package/build/schema/engine/additionalItems.d.mts +4 -4
  19. package/build/schema/engine/additionalProperties.d.mts +8 -8
  20. package/build/schema/engine/additionalProperties.mjs +11 -17
  21. package/build/schema/engine/allOf.d.mts +4 -4
  22. package/build/schema/engine/allOf.mjs +3 -3
  23. package/build/schema/engine/anyOf.d.mts +4 -4
  24. package/build/schema/engine/anyOf.mjs +5 -10
  25. package/build/schema/engine/boolean.d.mts +4 -4
  26. package/build/schema/engine/boolean.mjs +2 -6
  27. package/build/schema/engine/const.d.mts +4 -4
  28. package/build/schema/engine/const.mjs +2 -6
  29. package/build/schema/engine/contains.d.mts +4 -4
  30. package/build/schema/engine/contains.mjs +2 -6
  31. package/build/schema/engine/dependencies.d.mts +4 -4
  32. package/build/schema/engine/dependencies.mjs +3 -6
  33. package/build/schema/engine/dependentRequired.d.mts +4 -4
  34. package/build/schema/engine/dependentRequired.mjs +2 -6
  35. package/build/schema/engine/dependentSchemas.d.mts +4 -4
  36. package/build/schema/engine/dynamicRef.d.mts +4 -4
  37. package/build/schema/engine/dynamicRef.mjs +11 -7
  38. package/build/schema/engine/enum.d.mts +4 -4
  39. package/build/schema/engine/enum.mjs +2 -6
  40. package/build/schema/engine/exclusiveMaximum.d.mts +4 -4
  41. package/build/schema/engine/exclusiveMaximum.mjs +2 -6
  42. package/build/schema/engine/exclusiveMinimum.d.mts +4 -4
  43. package/build/schema/engine/exclusiveMinimum.mjs +2 -6
  44. package/build/schema/engine/format.d.mts +4 -4
  45. package/build/schema/engine/format.mjs +2 -6
  46. package/build/schema/engine/if.d.mts +4 -4
  47. package/build/schema/engine/if.mjs +7 -15
  48. package/build/schema/engine/items.d.mts +4 -4
  49. package/build/schema/engine/items.mjs +1 -1
  50. package/build/schema/engine/maxContains.d.mts +4 -4
  51. package/build/schema/engine/maxContains.mjs +2 -6
  52. package/build/schema/engine/maxItems.d.mts +4 -4
  53. package/build/schema/engine/maxItems.mjs +2 -6
  54. package/build/schema/engine/maxLength.d.mts +4 -4
  55. package/build/schema/engine/maxLength.mjs +2 -6
  56. package/build/schema/engine/maxProperties.d.mts +4 -4
  57. package/build/schema/engine/maxProperties.mjs +2 -6
  58. package/build/schema/engine/maximum.d.mts +4 -4
  59. package/build/schema/engine/maximum.mjs +2 -6
  60. package/build/schema/engine/minContains.d.mts +4 -4
  61. package/build/schema/engine/minContains.mjs +2 -6
  62. package/build/schema/engine/minItems.d.mts +5 -5
  63. package/build/schema/engine/minItems.mjs +2 -6
  64. package/build/schema/engine/minLength.d.mts +4 -4
  65. package/build/schema/engine/minLength.mjs +2 -6
  66. package/build/schema/engine/minProperties.d.mts +4 -4
  67. package/build/schema/engine/minProperties.mjs +2 -6
  68. package/build/schema/engine/minimum.d.mts +4 -4
  69. package/build/schema/engine/minimum.mjs +2 -6
  70. package/build/schema/engine/multipleOf.d.mts +4 -4
  71. package/build/schema/engine/multipleOf.mjs +2 -6
  72. package/build/schema/engine/not.d.mts +4 -4
  73. package/build/schema/engine/not.mjs +4 -8
  74. package/build/schema/engine/oneOf.d.mts +4 -4
  75. package/build/schema/engine/oneOf.mjs +6 -11
  76. package/build/schema/engine/pattern.d.mts +4 -4
  77. package/build/schema/engine/pattern.mjs +3 -7
  78. package/build/schema/engine/patternProperties.d.mts +4 -4
  79. package/build/schema/engine/patternProperties.mjs +1 -1
  80. package/build/schema/engine/prefixItems.d.mts +4 -4
  81. package/build/schema/engine/prefixItems.mjs +1 -1
  82. package/build/schema/engine/properties.d.mts +4 -4
  83. package/build/schema/engine/properties.mjs +1 -1
  84. package/build/schema/engine/propertyNames.d.mts +4 -4
  85. package/build/schema/engine/propertyNames.mjs +4 -10
  86. package/build/schema/engine/recursiveRef.d.mts +4 -4
  87. package/build/schema/engine/recursiveRef.mjs +11 -7
  88. package/build/schema/engine/ref.d.mts +4 -4
  89. package/build/schema/engine/ref.mjs +19 -15
  90. package/build/schema/engine/required.d.mts +4 -4
  91. package/build/schema/engine/required.mjs +2 -6
  92. package/build/schema/engine/schema.d.mts +7 -7
  93. package/build/schema/engine/schema.mjs +137 -133
  94. package/build/schema/engine/type.d.mts +4 -4
  95. package/build/schema/engine/type.mjs +2 -6
  96. package/build/schema/engine/unevaluatedItems.d.mts +4 -4
  97. package/build/schema/engine/unevaluatedItems.mjs +5 -9
  98. package/build/schema/engine/unevaluatedProperties.d.mts +4 -4
  99. package/build/schema/engine/unevaluatedProperties.mjs +5 -9
  100. package/build/schema/engine/uniqueItems.d.mts +4 -4
  101. package/build/schema/engine/uniqueItems.mjs +2 -6
  102. package/build/schema/errors.d.mts +2 -2
  103. package/build/schema/errors.mjs +8 -14
  104. package/build/schema/intern/index.d.mts +1 -0
  105. package/build/schema/intern/index.mjs +1 -0
  106. package/build/schema/intern/intern.d.mts +11 -0
  107. package/build/schema/intern/intern.mjs +293 -0
  108. package/build/schema/meta/draft_2019_09.d.mts +2 -0
  109. package/build/schema/meta/draft_2019_09.mjs +288 -0
  110. package/build/schema/meta/draft_2020_12.d.mts +2 -0
  111. package/build/schema/meta/draft_2020_12.mjs +300 -0
  112. package/build/schema/meta/draft_3.d.mts +2 -0
  113. package/build/schema/meta/draft_3.mjs +143 -0
  114. package/build/schema/meta/draft_4.d.mts +2 -0
  115. package/build/schema/meta/draft_4.mjs +149 -0
  116. package/build/schema/meta/draft_6.d.mts +2 -0
  117. package/build/schema/meta/draft_6.mjs +155 -0
  118. package/build/schema/meta/draft_7.d.mts +2 -0
  119. package/build/schema/meta/draft_7.mjs +172 -0
  120. package/build/schema/meta/index.d.mts +2 -0
  121. package/build/schema/meta/index.mjs +2 -0
  122. package/build/schema/meta/meta.d.mts +9 -0
  123. package/build/schema/meta/meta.mjs +15 -0
  124. package/build/schema/meta/schema.d.mts +6 -0
  125. package/build/schema/meta/schema.mjs +1 -0
  126. package/build/schema/parse.d.mts +1 -0
  127. package/build/schema/parse.mjs +10 -5
  128. package/build/schema/resolve/resolve.d.mts +8 -3
  129. package/build/schema/resolve/resolve.mjs +268 -139
  130. package/build/schema/schema.d.mts +2 -0
  131. package/build/schema/schema.mjs +2 -0
  132. package/build/value/errors/errors.d.mts +2 -12
  133. package/build/value/errors/errors.mjs +2 -7
  134. package/changes.json +1 -1
  135. package/package.json +3 -3
  136. package/readme.md +59 -89
@@ -16,10 +16,6 @@ export function CheckMaxItems(_stack, _context, schema, value) {
16
16
  // Error
17
17
  // ------------------------------------------------------------------
18
18
  export function ErrorMaxItems(stack, context, schemaPath, instancePath, schema, value) {
19
- return CheckMaxItems(stack, context, schema, value) || context.AddError({
20
- keyword: 'maxItems',
21
- schemaPath,
22
- instancePath,
23
- params: { limit: schema.maxItems }
24
- });
19
+ return CheckMaxItems(stack, context, schema, value) ||
20
+ context.AddError('maxItems', schemaPath, instancePath, { limit: schema.maxItems });
25
21
  }
@@ -1,6 +1,6 @@
1
1
  import * as Schema from '../types/index.mjs';
2
- import { Stack } from './_stack.mjs';
2
+ import * as Stack from './_stack.mjs';
3
3
  import { BuildContext, CheckContext, ErrorContext } from './_context.mjs';
4
- export declare function BuildMaxLength(_stack: Stack, _context: BuildContext, schema: Schema.XMaxLength, value: string): string;
5
- export declare function CheckMaxLength(_stack: Stack, _context: CheckContext, schema: Schema.XMaxLength, value: string): boolean;
6
- export declare function ErrorMaxLength(stack: Stack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XMaxLength, value: string): boolean;
4
+ export declare function BuildMaxLength(_stack: Stack.XStack, _context: BuildContext, schema: Schema.XMaxLength, value: string): string;
5
+ export declare function CheckMaxLength(_stack: Stack.XStack, _context: CheckContext, schema: Schema.XMaxLength, value: string): boolean;
6
+ export declare function ErrorMaxLength(stack: Stack.XStack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XMaxLength, value: string): boolean;
@@ -16,10 +16,6 @@ export function CheckMaxLength(_stack, _context, schema, value) {
16
16
  // Error
17
17
  // ------------------------------------------------------------------
18
18
  export function ErrorMaxLength(stack, context, schemaPath, instancePath, schema, value) {
19
- return CheckMaxLength(stack, context, schema, value) || context.AddError({
20
- keyword: 'maxLength',
21
- schemaPath,
22
- instancePath,
23
- params: { limit: schema.maxLength }
24
- });
19
+ return CheckMaxLength(stack, context, schema, value) ||
20
+ context.AddError('maxLength', schemaPath, instancePath, { limit: schema.maxLength });
25
21
  }
@@ -1,6 +1,6 @@
1
1
  import * as Schema from '../types/index.mjs';
2
- import { Stack } from './_stack.mjs';
2
+ import * as Stack from './_stack.mjs';
3
3
  import { BuildContext, CheckContext, ErrorContext } from './_context.mjs';
4
- export declare function BuildMaxProperties(_stack: Stack, _context: BuildContext, schema: Schema.XMaxProperties, value: string): string;
5
- export declare function CheckMaxProperties(_stack: Stack, _context: CheckContext, schema: Schema.XMaxProperties, value: Record<PropertyKey, unknown>): boolean;
6
- export declare function ErrorMaxProperties(stack: Stack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XMaxProperties, value: Record<PropertyKey, unknown>): boolean;
4
+ export declare function BuildMaxProperties(_stack: Stack.XStack, _context: BuildContext, schema: Schema.XMaxProperties, value: string): string;
5
+ export declare function CheckMaxProperties(_stack: Stack.XStack, _context: CheckContext, schema: Schema.XMaxProperties, value: Record<PropertyKey, unknown>): boolean;
6
+ export declare function ErrorMaxProperties(stack: Stack.XStack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XMaxProperties, value: Record<PropertyKey, unknown>): boolean;
@@ -16,10 +16,6 @@ export function CheckMaxProperties(_stack, _context, schema, value) {
16
16
  // Check
17
17
  // ------------------------------------------------------------------
18
18
  export function ErrorMaxProperties(stack, context, schemaPath, instancePath, schema, value) {
19
- return CheckMaxProperties(stack, context, schema, value) || context.AddError({
20
- keyword: 'maxProperties',
21
- schemaPath,
22
- instancePath,
23
- params: { limit: schema.maxProperties },
24
- });
19
+ return CheckMaxProperties(stack, context, schema, value) ||
20
+ context.AddError('maxProperties', schemaPath, instancePath, { limit: schema.maxProperties });
25
21
  }
@@ -1,6 +1,6 @@
1
1
  import * as Schema from '../types/index.mjs';
2
- import { Stack } from './_stack.mjs';
2
+ import * as Stack from './_stack.mjs';
3
3
  import { BuildContext, CheckContext, ErrorContext } from './_context.mjs';
4
- export declare function BuildMaximum(_stack: Stack, _context: BuildContext, schema: Schema.XMaximum, value: string): string;
5
- export declare function CheckMaximum(_stack: Stack, _context: CheckContext, schema: Schema.XMaximum, value: number | bigint): boolean;
6
- export declare function ErrorMaximum(stack: Stack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XMaximum, value: number | bigint): boolean;
4
+ export declare function BuildMaximum(_stack: Stack.XStack, _context: BuildContext, schema: Schema.XMaximum, value: string): string;
5
+ export declare function CheckMaximum(_stack: Stack.XStack, _context: CheckContext, schema: Schema.XMaximum, value: number | bigint): boolean;
6
+ export declare function ErrorMaximum(stack: Stack.XStack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XMaximum, value: number | bigint): boolean;
@@ -16,10 +16,6 @@ export function CheckMaximum(_stack, _context, schema, value) {
16
16
  // Error
17
17
  // ------------------------------------------------------------------
18
18
  export function ErrorMaximum(stack, context, schemaPath, instancePath, schema, value) {
19
- return CheckMaximum(stack, context, schema, value) || context.AddError({
20
- keyword: 'maximum',
21
- schemaPath,
22
- instancePath,
23
- params: { comparison: '<=', limit: schema.maximum }
24
- });
19
+ return CheckMaximum(stack, context, schema, value) ||
20
+ context.AddError('maximum', schemaPath, instancePath, { comparison: '<=', limit: schema.maximum });
25
21
  }
@@ -1,6 +1,6 @@
1
1
  import * as Schema from '../types/index.mjs';
2
- import { Stack } from './_stack.mjs';
2
+ import * as Stack from './_stack.mjs';
3
3
  import { BuildContext, CheckContext, ErrorContext } from './_context.mjs';
4
- export declare function BuildMinContains(stack: Stack, context: BuildContext, schema: Schema.XMinContains, value: string): string;
5
- export declare function CheckMinContains(stack: Stack, context: CheckContext, schema: Schema.XMinContains, value: unknown[]): boolean;
6
- export declare function ErrorMinContains(stack: Stack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XMinContains, value: unknown[]): boolean;
4
+ export declare function BuildMinContains(stack: Stack.XStack, context: BuildContext, schema: Schema.XMinContains, value: string): string;
5
+ export declare function CheckMinContains(stack: Stack.XStack, context: CheckContext, schema: Schema.XMinContains, value: unknown[]): boolean;
6
+ export declare function ErrorMinContains(stack: Stack.XStack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XMinContains, value: unknown[]): boolean;
@@ -42,10 +42,6 @@ export function CheckMinContains(stack, context, schema, value) {
42
42
  // Error
43
43
  // ------------------------------------------------------------------
44
44
  export function ErrorMinContains(stack, context, schemaPath, instancePath, schema, value) {
45
- return CheckMinContains(stack, context, schema, value) || context.AddError({
46
- keyword: 'contains',
47
- schemaPath,
48
- instancePath,
49
- params: { minContains: schema.minContains }
50
- });
45
+ return CheckMinContains(stack, context, schema, value) ||
46
+ context.AddError('contains', schemaPath, instancePath, { minContains: schema.minContains });
51
47
  }
@@ -1,6 +1,6 @@
1
- import { Stack } from './_stack.mjs';
2
- import { BuildContext, CheckContext, ErrorContext } from './_context.mjs';
3
1
  import * as Schema from '../types/index.mjs';
4
- export declare function BuildMinItems(_stack: Stack, _context: BuildContext, schema: Schema.XMinItems, value: string): string;
5
- export declare function CheckMinItems(_stack: Stack, _context: CheckContext, schema: Schema.XMinItems, value: unknown[]): boolean;
6
- export declare function ErrorMinItems(stack: Stack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XMinItems, value: unknown[]): boolean;
2
+ import * as Stack from './_stack.mjs';
3
+ import { BuildContext, CheckContext, ErrorContext } from './_context.mjs';
4
+ export declare function BuildMinItems(_stack: Stack.XStack, _context: BuildContext, schema: Schema.XMinItems, value: string): string;
5
+ export declare function CheckMinItems(_stack: Stack.XStack, _context: CheckContext, schema: Schema.XMinItems, value: unknown[]): boolean;
6
+ export declare function ErrorMinItems(stack: Stack.XStack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XMinItems, value: unknown[]): boolean;
@@ -16,10 +16,6 @@ export function CheckMinItems(_stack, _context, schema, value) {
16
16
  // Error
17
17
  // ------------------------------------------------------------------
18
18
  export function ErrorMinItems(stack, context, schemaPath, instancePath, schema, value) {
19
- return CheckMinItems(stack, context, schema, value) || context.AddError({
20
- keyword: 'minItems',
21
- schemaPath,
22
- instancePath,
23
- params: { limit: schema.minItems }
24
- });
19
+ return CheckMinItems(stack, context, schema, value) ||
20
+ context.AddError('minItems', schemaPath, instancePath, { limit: schema.minItems });
25
21
  }
@@ -1,6 +1,6 @@
1
1
  import * as Schema from '../types/index.mjs';
2
- import { Stack } from './_stack.mjs';
2
+ import * as Stack from './_stack.mjs';
3
3
  import { BuildContext, CheckContext, ErrorContext } from './_context.mjs';
4
- export declare function BuildMinLength(_stack: Stack, _context: BuildContext, schema: Schema.XMinLength, value: string): string;
5
- export declare function CheckMinLength(_stack: Stack, _context: CheckContext, schema: Schema.XMinLength, value: string): boolean;
6
- export declare function ErrorMinLength(stack: Stack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XMinLength, value: string): boolean;
4
+ export declare function BuildMinLength(_stack: Stack.XStack, _context: BuildContext, schema: Schema.XMinLength, value: string): string;
5
+ export declare function CheckMinLength(_stack: Stack.XStack, _context: CheckContext, schema: Schema.XMinLength, value: string): boolean;
6
+ export declare function ErrorMinLength(stack: Stack.XStack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XMinLength, value: string): boolean;
@@ -16,10 +16,6 @@ export function CheckMinLength(_stack, _context, schema, value) {
16
16
  // Error
17
17
  // ------------------------------------------------------------------
18
18
  export function ErrorMinLength(stack, context, schemaPath, instancePath, schema, value) {
19
- return CheckMinLength(stack, context, schema, value) || context.AddError({
20
- keyword: 'minLength',
21
- schemaPath,
22
- instancePath,
23
- params: { limit: schema.minLength }
24
- });
19
+ return CheckMinLength(stack, context, schema, value) ||
20
+ context.AddError('minLength', schemaPath, instancePath, { limit: schema.minLength });
25
21
  }
@@ -1,6 +1,6 @@
1
1
  import * as Schema from '../types/index.mjs';
2
- import { Stack } from './_stack.mjs';
2
+ import * as Stack from './_stack.mjs';
3
3
  import { BuildContext, CheckContext, ErrorContext } from './_context.mjs';
4
- export declare function BuildMinProperties(_stack: Stack, _context: BuildContext, schema: Schema.XMinProperties, value: string): string;
5
- export declare function CheckMinProperties(_stack: Stack, _context: CheckContext, schema: Schema.XMinProperties, value: Record<PropertyKey, unknown>): boolean;
6
- export declare function ErrorMinProperties(stack: Stack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XMinProperties, value: Record<PropertyKey, unknown>): boolean;
4
+ export declare function BuildMinProperties(_stack: Stack.XStack, _context: BuildContext, schema: Schema.XMinProperties, value: string): string;
5
+ export declare function CheckMinProperties(_stack: Stack.XStack, _context: CheckContext, schema: Schema.XMinProperties, value: Record<PropertyKey, unknown>): boolean;
6
+ export declare function ErrorMinProperties(stack: Stack.XStack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XMinProperties, value: Record<PropertyKey, unknown>): boolean;
@@ -16,10 +16,6 @@ export function CheckMinProperties(_stack, _context, schema, value) {
16
16
  // Error
17
17
  // ------------------------------------------------------------------
18
18
  export function ErrorMinProperties(stack, context, schemaPath, instancePath, schema, value) {
19
- return CheckMinProperties(stack, context, schema, value) || context.AddError({
20
- keyword: 'minProperties',
21
- schemaPath,
22
- instancePath,
23
- params: { limit: schema.minProperties },
24
- });
19
+ return CheckMinProperties(stack, context, schema, value) ||
20
+ context.AddError('minProperties', schemaPath, instancePath, { limit: schema.minProperties });
25
21
  }
@@ -1,6 +1,6 @@
1
1
  import * as Schema from '../types/index.mjs';
2
- import { Stack } from './_stack.mjs';
2
+ import * as Stack from './_stack.mjs';
3
3
  import { BuildContext, CheckContext, ErrorContext } from './_context.mjs';
4
- export declare function BuildMinimum(_stack: Stack, _context: BuildContext, schema: Schema.XMinimum, value: string): string;
5
- export declare function CheckMinimum(_stack: Stack, _context: CheckContext, schema: Schema.XMinimum, value: number | bigint): boolean;
6
- export declare function ErrorMinimum(stack: Stack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XMinimum, value: number | bigint): boolean;
4
+ export declare function BuildMinimum(_stack: Stack.XStack, _context: BuildContext, schema: Schema.XMinimum, value: string): string;
5
+ export declare function CheckMinimum(_stack: Stack.XStack, _context: CheckContext, schema: Schema.XMinimum, value: number | bigint): boolean;
6
+ export declare function ErrorMinimum(stack: Stack.XStack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XMinimum, value: number | bigint): boolean;
@@ -16,10 +16,6 @@ export function CheckMinimum(_stack, _context, schema, value) {
16
16
  // Error
17
17
  // ------------------------------------------------------------------
18
18
  export function ErrorMinimum(stack, context, schemaPath, instancePath, schema, value) {
19
- return CheckMinimum(stack, context, schema, value) || context.AddError({
20
- keyword: 'minimum',
21
- schemaPath,
22
- instancePath,
23
- params: { comparison: '>=', limit: schema.minimum }
24
- });
19
+ return CheckMinimum(stack, context, schema, value) ||
20
+ context.AddError('minimum', schemaPath, instancePath, { comparison: '>=', limit: schema.minimum });
25
21
  }
@@ -1,6 +1,6 @@
1
1
  import * as Schema from '../types/index.mjs';
2
- import { Stack } from './_stack.mjs';
2
+ import * as Stack from './_stack.mjs';
3
3
  import { BuildContext, CheckContext, ErrorContext } from './_context.mjs';
4
- export declare function BuildMultipleOf(_stack: Stack, _context: BuildContext, schema: Schema.XMultipleOf, value: string): string;
5
- export declare function CheckMultipleOf(_stack: Stack, _context: CheckContext, schema: Schema.XMultipleOf, value: number | bigint): boolean;
6
- export declare function ErrorMultipleOf(stack: Stack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XMultipleOf, value: number | bigint): boolean;
4
+ export declare function BuildMultipleOf(_stack: Stack.XStack, _context: BuildContext, schema: Schema.XMultipleOf, value: string): string;
5
+ export declare function CheckMultipleOf(_stack: Stack.XStack, _context: CheckContext, schema: Schema.XMultipleOf, value: number | bigint): boolean;
6
+ export declare function ErrorMultipleOf(stack: Stack.XStack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XMultipleOf, value: number | bigint): boolean;
@@ -16,10 +16,6 @@ export function CheckMultipleOf(_stack, _context, schema, value) {
16
16
  // Error
17
17
  // ------------------------------------------------------------------
18
18
  export function ErrorMultipleOf(stack, context, schemaPath, instancePath, schema, value) {
19
- return CheckMultipleOf(stack, context, schema, value) || context.AddError({
20
- keyword: 'multipleOf',
21
- schemaPath,
22
- instancePath,
23
- params: { multipleOf: schema.multipleOf }
24
- });
19
+ return CheckMultipleOf(stack, context, schema, value) ||
20
+ context.AddError('multipleOf', schemaPath, instancePath, { multipleOf: schema.multipleOf });
25
21
  }
@@ -1,6 +1,6 @@
1
1
  import * as Schema from '../types/index.mjs';
2
- import { Stack } from './_stack.mjs';
2
+ import * as Stack from './_stack.mjs';
3
3
  import { BuildContext, CheckContext, ErrorContext } from './_context.mjs';
4
- export declare function BuildNot(stack: Stack, context: BuildContext, schema: Schema.XNot, value: string): string;
5
- export declare function CheckNot(stack: Stack, context: CheckContext, schema: Schema.XNot, value: unknown): boolean;
6
- export declare function ErrorNot(stack: Stack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XNot, value: unknown): boolean;
4
+ export declare function BuildNot(stack: Stack.XStack, context: BuildContext, schema: Schema.XNot, value: string): string;
5
+ export declare function CheckNot(stack: Stack.XStack, context: CheckContext, schema: Schema.XNot, value: unknown): boolean;
6
+ export declare function ErrorNot(stack: Stack.XStack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XNot, value: unknown): boolean;
@@ -1,8 +1,8 @@
1
1
  // deno-fmt-ignore-file
2
- import { CheckContext } from './_context.mjs';
3
2
  import { Reducer } from './_reducer.mjs';
4
- import { EmitGuard as E } from '../../guard/index.mjs';
3
+ import { CheckContext } from './_context.mjs';
5
4
  import { BuildSchema, CheckSchema } from './schema.mjs';
5
+ import { EmitGuard as E } from '../../guard/index.mjs';
6
6
  // ------------------------------------------------------------------
7
7
  // Build
8
8
  // ------------------------------------------------------------------
@@ -30,10 +30,6 @@ export function CheckNot(stack, context, schema, value) {
30
30
  // Error
31
31
  // ------------------------------------------------------------------
32
32
  export function ErrorNot(stack, context, schemaPath, instancePath, schema, value) {
33
- return CheckNot(stack, context, schema, value) || context.AddError({
34
- keyword: 'not',
35
- schemaPath,
36
- instancePath,
37
- params: {},
38
- });
33
+ return CheckNot(stack, context, schema, value) ||
34
+ context.AddError('not', schemaPath, instancePath, {});
39
35
  }
@@ -1,6 +1,6 @@
1
1
  import * as Schema from '../types/index.mjs';
2
- import { Stack } from './_stack.mjs';
2
+ import * as Stack from './_stack.mjs';
3
3
  import { BuildContext, CheckContext, ErrorContext } from './_context.mjs';
4
- export declare function BuildOneOf(stack: Stack, context: BuildContext, schema: Schema.XOneOf, value: string): string;
5
- export declare function CheckOneOf(stack: Stack, context: CheckContext, schema: Schema.XOneOf, value: unknown): boolean;
6
- export declare function ErrorOneOf(stack: Stack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XOneOf, value: unknown): boolean;
4
+ export declare function BuildOneOf(stack: Stack.XStack, context: BuildContext, schema: Schema.XOneOf, value: string): string;
5
+ export declare function CheckOneOf(stack: Stack.XStack, context: CheckContext, schema: Schema.XOneOf, value: unknown): boolean;
6
+ export declare function ErrorOneOf(stack: Stack.XStack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XOneOf, value: unknown): boolean;
@@ -1,9 +1,9 @@
1
1
  // deno-fmt-ignore-file
2
- import { CheckContext, AccumulatedErrorContext } from './_context.mjs';
3
2
  import { Reducer } from './_reducer.mjs';
4
- import { EmitGuard as E, Guard as G } from '../../guard/index.mjs';
5
- import { BuildSchema, CheckSchema, ErrorSchema } from './schema.mjs';
6
3
  import { Unique } from './_unique.mjs';
4
+ import { CheckContext, ErrorContext } from './_context.mjs';
5
+ import { BuildSchema, CheckSchema, ErrorSchema } from './schema.mjs';
6
+ import { EmitGuard as E, Guard as G } from '../../guard/index.mjs';
7
7
  // ------------------------------------------------------------------
8
8
  // Build
9
9
  // ------------------------------------------------------------------
@@ -38,7 +38,7 @@ export function ErrorOneOf(stack, context, schemaPath, instancePath, schema, val
38
38
  const failedContexts = [];
39
39
  const passingSchemas = [];
40
40
  const passedContexts = schema.oneOf.reduce((result, schema, index) => {
41
- const nextContext = new AccumulatedErrorContext();
41
+ const nextContext = new ErrorContext();
42
42
  const nextSchemaPath = `${schemaPath}/oneOf/${index}`;
43
43
  const isSchema = ErrorSchema(stack, nextContext, nextSchemaPath, instancePath, schema, value);
44
44
  if (isSchema)
@@ -49,11 +49,6 @@ export function ErrorOneOf(stack, context, schemaPath, instancePath, schema, val
49
49
  }, []);
50
50
  const isOneOf = G.IsEqual(passedContexts.length, 1) && context.Merge(passedContexts);
51
51
  if (!isOneOf && G.IsEqual(passingSchemas.length, 0))
52
- failedContexts.forEach(failed => failed.GetErrors().forEach(error => context.AddError(error)));
53
- return isOneOf || context.AddError({
54
- keyword: 'oneOf',
55
- schemaPath,
56
- instancePath,
57
- params: { passingSchemas },
58
- });
52
+ failedContexts.forEach(failed => context.AddErrors(failed.GetErrors()));
53
+ return isOneOf || context.AddError('oneOf', schemaPath, instancePath, { passingSchemas });
59
54
  }
@@ -1,6 +1,6 @@
1
1
  import * as Schema from '../types/index.mjs';
2
- import { Stack } from './_stack.mjs';
2
+ import * as Stack from './_stack.mjs';
3
3
  import { BuildContext, CheckContext, ErrorContext } from './_context.mjs';
4
- export declare function BuildPattern(_stack: Stack, _context: BuildContext, schema: Schema.XPattern, value: string): string;
5
- export declare function CheckPattern(_stack: Stack, _context: CheckContext, schema: Schema.XPattern, value: string): boolean;
6
- export declare function ErrorPattern(stack: Stack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XPattern, value: string): boolean;
4
+ export declare function BuildPattern(_stack: Stack.XStack, _context: BuildContext, schema: Schema.XPattern, value: string): string;
5
+ export declare function CheckPattern(_stack: Stack.XStack, _context: CheckContext, schema: Schema.XPattern, value: string): boolean;
6
+ export declare function ErrorPattern(stack: Stack.XStack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XPattern, value: string): boolean;
@@ -1,7 +1,7 @@
1
1
  // deno-fmt-ignore-file
2
2
  import * as Externals from './_externals.mjs';
3
- import { Guard as G, EmitGuard as E } from '../../guard/index.mjs';
4
3
  import { UnicodeRegExp } from './_regexp.mjs';
4
+ import { Guard as G, EmitGuard as E } from '../../guard/index.mjs';
5
5
  // ------------------------------------------------------------------
6
6
  // Build
7
7
  // ------------------------------------------------------------------
@@ -20,10 +20,6 @@ export function CheckPattern(_stack, _context, schema, value) {
20
20
  // Error
21
21
  // ------------------------------------------------------------------
22
22
  export function ErrorPattern(stack, context, schemaPath, instancePath, schema, value) {
23
- return CheckPattern(stack, context, schema, value) || context.AddError({
24
- keyword: 'pattern',
25
- schemaPath,
26
- instancePath,
27
- params: { pattern: schema.pattern }
28
- });
23
+ return CheckPattern(stack, context, schema, value) ||
24
+ context.AddError('pattern', schemaPath, instancePath, { pattern: schema.pattern });
29
25
  }
@@ -1,6 +1,6 @@
1
1
  import * as Schema from '../types/index.mjs';
2
- import { Stack } from './_stack.mjs';
2
+ import * as Stack from './_stack.mjs';
3
3
  import { BuildContext, CheckContext, ErrorContext } from './_context.mjs';
4
- export declare function BuildPatternProperties(stack: Stack, context: BuildContext, schema: Schema.XPatternProperties, value: string): string;
5
- export declare function CheckPatternProperties(stack: Stack, context: CheckContext, schema: Schema.XPatternProperties, value: Record<PropertyKey, unknown>): boolean;
6
- export declare function ErrorPatternProperties(stack: Stack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XPatternProperties, value: Record<PropertyKey, unknown>): boolean;
4
+ export declare function BuildPatternProperties(stack: Stack.XStack, context: BuildContext, schema: Schema.XPatternProperties, value: string): string;
5
+ export declare function CheckPatternProperties(stack: Stack.XStack, context: CheckContext, schema: Schema.XPatternProperties, value: Record<PropertyKey, unknown>): boolean;
6
+ export declare function ErrorPatternProperties(stack: Stack.XStack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XPatternProperties, value: Record<PropertyKey, unknown>): boolean;
@@ -2,8 +2,8 @@
2
2
  import * as Externals from './_externals.mjs';
3
3
  import { Unique } from './_unique.mjs';
4
4
  import { UnicodeRegExp } from './_regexp.mjs';
5
- import { Guard as G, EmitGuard as E } from '../../guard/index.mjs';
6
5
  import { BuildSchemaPushStack, CheckSchemaPushStack, ErrorSchemaPushStack } from './schema.mjs';
6
+ import { Guard as G, EmitGuard as E } from '../../guard/index.mjs';
7
7
  // ------------------------------------------------------------------
8
8
  // Build
9
9
  // ------------------------------------------------------------------
@@ -1,6 +1,6 @@
1
1
  import * as Schema from '../types/index.mjs';
2
- import { Stack } from './_stack.mjs';
2
+ import * as Stack from './_stack.mjs';
3
3
  import { BuildContext, CheckContext, ErrorContext } from './_context.mjs';
4
- export declare function BuildPrefixItems(stack: Stack, context: BuildContext, schema: Schema.XPrefixItems, value: string): string;
5
- export declare function CheckPrefixItems(stack: Stack, context: CheckContext, schema: Schema.XPrefixItems, value: unknown[]): boolean;
6
- export declare function ErrorPrefixItems(stack: Stack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XPrefixItems, value: unknown[]): boolean;
4
+ export declare function BuildPrefixItems(stack: Stack.XStack, context: BuildContext, schema: Schema.XPrefixItems, value: string): string;
5
+ export declare function CheckPrefixItems(stack: Stack.XStack, context: CheckContext, schema: Schema.XPrefixItems, value: unknown[]): boolean;
6
+ export declare function ErrorPrefixItems(stack: Stack.XStack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XPrefixItems, value: unknown[]): boolean;
@@ -1,6 +1,6 @@
1
1
  // deno-fmt-ignore-file
2
- import { Guard as G, EmitGuard as E } from '../../guard/index.mjs';
3
2
  import { BuildSchemaPushStack, CheckSchemaPushStack, ErrorSchemaPushStack } from './schema.mjs';
3
+ import { Guard as G, EmitGuard as E } from '../../guard/index.mjs';
4
4
  // ------------------------------------------------------------------
5
5
  // Build
6
6
  // ------------------------------------------------------------------
@@ -1,6 +1,6 @@
1
1
  import * as Schema from '../types/index.mjs';
2
- import { Stack } from './_stack.mjs';
2
+ import * as Stack from './_stack.mjs';
3
3
  import { BuildContext, CheckContext, ErrorContext } from './_context.mjs';
4
- export declare function BuildProperties(stack: Stack, context: BuildContext, schema: Schema.XProperties, value: string): string;
5
- export declare function CheckProperties(stack: Stack, context: CheckContext, schema: Schema.XProperties, value: Record<PropertyKey, unknown>): boolean;
6
- export declare function ErrorProperties(stack: Stack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XProperties, value: Record<PropertyKey, unknown>): boolean;
4
+ export declare function BuildProperties(stack: Stack.XStack, context: BuildContext, schema: Schema.XProperties, value: string): string;
5
+ export declare function CheckProperties(stack: Stack.XStack, context: CheckContext, schema: Schema.XProperties, value: Record<PropertyKey, unknown>): boolean;
6
+ export declare function ErrorProperties(stack: Stack.XStack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XProperties, value: Record<PropertyKey, unknown>): boolean;
@@ -1,8 +1,8 @@
1
1
  // deno-fmt-ignore-file
2
2
  import * as Schema from '../types/index.mjs';
3
- import { Guard as G, EmitGuard as E } from '../../guard/index.mjs';
4
3
  import { BuildSchemaPushStack, CheckSchemaPushStack, ErrorSchemaPushStack } from './schema.mjs';
5
4
  import { InexactOptionalCheck, InexactOptionalBuild, IsExactOptional } from './_exact_optional.mjs';
5
+ import { Guard as G, EmitGuard as E } from '../../guard/index.mjs';
6
6
  // ------------------------------------------------------------------
7
7
  // Build
8
8
  // ------------------------------------------------------------------
@@ -1,6 +1,6 @@
1
1
  import * as Schema from '../types/index.mjs';
2
- import { Stack } from './_stack.mjs';
2
+ import * as Stack from './_stack.mjs';
3
3
  import { BuildContext, CheckContext, ErrorContext } from './_context.mjs';
4
- export declare function BuildPropertyNames(stack: Stack, context: BuildContext, schema: Schema.XPropertyNames, value: string): string;
5
- export declare function CheckPropertyNames(stack: Stack, context: CheckContext, schema: Schema.XPropertyNames, value: Record<PropertyKey, unknown>): boolean;
6
- export declare function ErrorPropertyNames(stack: Stack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XPropertyNames, value: Record<PropertyKey, unknown>): boolean;
4
+ export declare function BuildPropertyNames(stack: Stack.XStack, context: BuildContext, schema: Schema.XPropertyNames, value: string): string;
5
+ export declare function CheckPropertyNames(stack: Stack.XStack, context: CheckContext, schema: Schema.XPropertyNames, value: Record<PropertyKey, unknown>): boolean;
6
+ export declare function ErrorPropertyNames(stack: Stack.XStack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XPropertyNames, value: Record<PropertyKey, unknown>): boolean;
@@ -1,8 +1,7 @@
1
1
  // deno-fmt-ignore-file
2
2
  import { Unique } from './_unique.mjs';
3
- import { AccumulatedErrorContext } from './_context.mjs';
4
- import { EmitGuard as E, Guard as G } from '../../guard/index.mjs';
5
3
  import { BuildSchema, CheckSchema, ErrorSchema } from './schema.mjs';
4
+ import { EmitGuard as E, Guard as G } from '../../guard/index.mjs';
6
5
  // ------------------------------------------------------------------
7
6
  // Build
8
7
  // ------------------------------------------------------------------
@@ -24,16 +23,11 @@ export function ErrorPropertyNames(stack, context, schemaPath, instancePath, sch
24
23
  const isPropertyNames = G.EveryAll(G.Keys(value), 0, (key, _index) => {
25
24
  const nextInstancePath = `${instancePath}/${key}`;
26
25
  const nextSchemaPath = `${schemaPath}/propertyNames`;
27
- const nextContext = new AccumulatedErrorContext();
28
- const isPropertyName = ErrorSchema(stack, nextContext, nextSchemaPath, nextInstancePath, schema.propertyNames, key);
26
+ const isPropertyName = ErrorSchema(stack, context, nextSchemaPath, nextInstancePath, schema.propertyNames, key);
29
27
  if (!isPropertyName)
30
28
  propertyNames.push(key);
31
29
  return isPropertyName;
32
30
  });
33
- return isPropertyNames || context.AddError({
34
- keyword: 'propertyNames',
35
- schemaPath,
36
- instancePath,
37
- params: { propertyNames }
38
- });
31
+ return isPropertyNames ||
32
+ context.AddError('propertyNames', schemaPath, instancePath, { propertyNames });
39
33
  }
@@ -1,6 +1,6 @@
1
1
  import * as Schema from '../types/index.mjs';
2
- import { Stack } from './_stack.mjs';
2
+ import * as Stack from './_stack.mjs';
3
3
  import { BuildContext, CheckContext, ErrorContext } from './_context.mjs';
4
- export declare function BuildRecursiveRef(stack: Stack, context: BuildContext, schema: Schema.XRecursiveRef, value: string): string;
5
- export declare function CheckRecursiveRef(stack: Stack, context: CheckContext, schema: Schema.XRecursiveRef, value: unknown): boolean;
6
- export declare function ErrorRecursiveRef(stack: Stack, context: ErrorContext, _schemaPath: string, instancePath: string, schema: Schema.XRecursiveRef, value: unknown): boolean;
4
+ export declare function BuildRecursiveRef(stack: Stack.XStack, context: BuildContext, schema: Schema.XRecursiveRef, value: string): string;
5
+ export declare function CheckRecursiveRef(stack: Stack.XStack, context: CheckContext, schema: Schema.XRecursiveRef, value: unknown): boolean;
6
+ export declare function ErrorRecursiveRef(stack: Stack.XStack, context: ErrorContext, _schemaPath: string, instancePath: string, schema: Schema.XRecursiveRef, value: unknown): boolean;
@@ -1,25 +1,29 @@
1
1
  // deno-fmt-ignore-file
2
- import * as Functions from './_functions.mjs';
3
2
  import * as Schema from '../types/index.mjs';
3
+ import * as Functions from './_functions.mjs';
4
+ import { Resolve } from '../resolve/index.mjs';
4
5
  import { CheckSchema, ErrorSchema } from './schema.mjs';
5
6
  // ------------------------------------------------------------------
6
7
  // Build
7
8
  // ------------------------------------------------------------------
8
9
  export function BuildRecursiveRef(stack, context, schema, value) {
9
- const target = stack.RecursiveRef(schema) ?? false;
10
- return Functions.CreateFunction(stack, context, target, value);
10
+ const target = Resolve.RecursiveRef(stack, schema) ?? false;
11
+ const nextStack = target ? { ...stack, pendingResource: true } : stack;
12
+ return Functions.CreateFunction(nextStack, context, target, value);
11
13
  }
12
14
  // ------------------------------------------------------------------
13
15
  // Check
14
16
  // ------------------------------------------------------------------
15
17
  export function CheckRecursiveRef(stack, context, schema, value) {
16
- const target = stack.RecursiveRef(schema) ?? false;
17
- return (Schema.IsSchema(target) && CheckSchema(stack, context, target, value));
18
+ const target = Resolve.RecursiveRef(stack, schema) ?? false;
19
+ const nextStack = target ? { ...stack, pendingResource: true } : stack;
20
+ return (Schema.IsSchema(target) && CheckSchema(nextStack, context, target, value));
18
21
  }
19
22
  // ------------------------------------------------------------------
20
23
  // Error
21
24
  // ------------------------------------------------------------------
22
25
  export function ErrorRecursiveRef(stack, context, _schemaPath, instancePath, schema, value) {
23
- const target = stack.RecursiveRef(schema) ?? false;
24
- return (Schema.IsSchema(target) && ErrorSchema(stack, context, '#', instancePath, target, value));
26
+ const target = Resolve.RecursiveRef(stack, schema) ?? false;
27
+ const nextStack = target ? { ...stack, pendingResource: true } : stack;
28
+ return (Schema.IsSchema(target) && ErrorSchema(nextStack, context, '#', instancePath, target, value));
25
29
  }
@@ -1,6 +1,6 @@
1
1
  import * as Schema from '../types/index.mjs';
2
- import { Stack } from './_stack.mjs';
2
+ import * as Stack from './_stack.mjs';
3
3
  import { BuildContext, CheckContext, ErrorContext } from './_context.mjs';
4
- export declare function BuildRef(stack: Stack, context: BuildContext, schema: Schema.XRef, value: string): string;
5
- export declare function CheckRef(stack: Stack, context: CheckContext, schema: Schema.XRef, value: unknown): boolean;
6
- export declare function ErrorRef(stack: Stack, context: ErrorContext, _schemaPath: string, instancePath: string, schema: Schema.XRef, value: unknown): boolean;
4
+ export declare function BuildRef(stack: Stack.XStack, context: BuildContext, schema: Schema.XRef, value: string): string;
5
+ export declare function CheckRef(stack: Stack.XStack, context: CheckContext, schema: Schema.XRef, value: unknown): boolean;
6
+ export declare function ErrorRef(stack: Stack.XStack, context: ErrorContext, _schemaPath: string, instancePath: string, schema: Schema.XRef, value: unknown): boolean;