@spotlightjs/spotlight 4.11.3 → 4.11.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.
Files changed (191) hide show
  1. package/dist/_virtual/ajv.js +6 -3
  2. package/dist/_virtual/ajv2.js +13 -0
  3. package/dist/_virtual/index.js +6 -3
  4. package/dist/_virtual/index10.js +3 -3
  5. package/dist/_virtual/index11.js +3 -3
  6. package/dist/_virtual/index12.js +13 -0
  7. package/dist/_virtual/index2.js +3 -3
  8. package/dist/_virtual/index4.js +3 -3
  9. package/dist/_virtual/index5.js +3 -3
  10. package/dist/_virtual/index6.js +3 -3
  11. package/dist/_virtual/index7.js +3 -3
  12. package/dist/_virtual/index8.js +3 -3
  13. package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js +1 -1
  14. package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js.map +1 -1
  15. package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js +3 -3
  16. package/dist/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/formats.js +203 -194
  17. package/dist/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/formats.js.map +1 -1
  18. package/dist/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/index.js +47 -47
  19. package/dist/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/index.js.map +1 -1
  20. package/dist/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/limit.js +77 -69
  21. package/dist/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/limit.js.map +1 -1
  22. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/ajv.js +80 -85
  23. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/ajv.js.map +1 -1
  24. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/code.js +145 -136
  25. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/code.js.map +1 -1
  26. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/index.js +692 -685
  27. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/index.js.map +1 -1
  28. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/scope.js +143 -135
  29. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/scope.js.map +1 -1
  30. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/errors.js +122 -116
  31. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/errors.js.map +1 -1
  32. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/index.js +218 -218
  33. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/index.js.map +1 -1
  34. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/names.js +43 -35
  35. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/names.js.map +1 -1
  36. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/ref_error.js +19 -11
  37. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/ref_error.js.map +1 -1
  38. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/resolve.js +149 -144
  39. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/resolve.js.map +1 -1
  40. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/rules.js +31 -25
  41. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/rules.js.map +1 -1
  42. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/util.js +164 -160
  43. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/util.js.map +1 -1
  44. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/applicability.js +23 -17
  45. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/applicability.js.map +1 -1
  46. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/boolSchema.js +52 -49
  47. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/boolSchema.js.map +1 -1
  48. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/dataType.js +174 -173
  49. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/dataType.js.map +1 -1
  50. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/defaults.js +36 -32
  51. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/defaults.js.map +1 -1
  52. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/index.js +473 -478
  53. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/index.js.map +1 -1
  54. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/keyword.js +113 -111
  55. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/keyword.js.map +1 -1
  56. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/subschema.js +81 -77
  57. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/subschema.js.map +1 -1
  58. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/core.js +573 -574
  59. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/core.js.map +1 -1
  60. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/data.json.js +3 -17
  61. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/data.json.js.map +1 -1
  62. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-draft-07.json.js +4 -236
  63. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-draft-07.json.js.map +1 -1
  64. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/equal.js +16 -7
  65. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/equal.js.map +1 -1
  66. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/ucs2length.js +27 -18
  67. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/ucs2length.js.map +1 -1
  68. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/uri.js +16 -7
  69. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/uri.js.map +1 -1
  70. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/validation_error.js +17 -8
  71. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/validation_error.js.map +1 -1
  72. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +55 -48
  73. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +1 -1
  74. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +104 -99
  75. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +1 -1
  76. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/allOf.js +30 -22
  77. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +1 -1
  78. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +20 -12
  79. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map +1 -1
  80. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/contains.js +95 -88
  81. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +1 -1
  82. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +94 -88
  83. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +1 -1
  84. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/if.js +71 -64
  85. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/if.js.map +1 -1
  86. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/index.js +66 -73
  87. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/index.js.map +1 -1
  88. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/items.js +60 -54
  89. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/items.js.map +1 -1
  90. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/items2020.js +41 -36
  91. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map +1 -1
  92. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/not.js +34 -26
  93. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/not.js.map +1 -1
  94. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +60 -53
  95. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +1 -1
  96. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +73 -67
  97. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +1 -1
  98. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +20 -12
  99. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map +1 -1
  100. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/properties.js +62 -57
  101. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +1 -1
  102. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +46 -39
  103. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map +1 -1
  104. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +21 -13
  105. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map +1 -1
  106. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/code.js +132 -129
  107. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/code.js.map +1 -1
  108. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/id.js +17 -8
  109. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/id.js.map +1 -1
  110. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/index.js +27 -20
  111. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/index.js.map +1 -1
  112. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/ref.js +121 -118
  113. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/ref.js.map +1 -1
  114. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/discriminator/index.js +103 -99
  115. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -1
  116. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/discriminator/types.js +15 -9
  117. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +1 -1
  118. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/draft7.js +30 -26
  119. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/draft7.js.map +1 -1
  120. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/format/format.js +84 -76
  121. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/format/format.js.map +1 -1
  122. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/format/index.js +16 -8
  123. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/format/index.js.map +1 -1
  124. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/metadata.js +24 -18
  125. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/metadata.js.map +1 -1
  126. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/const.js +33 -27
  127. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/const.js.map +1 -1
  128. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/enum.js +53 -47
  129. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/enum.js.map +1 -1
  130. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/index.js +52 -53
  131. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/index.js.map +1 -1
  132. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitItems.js +32 -24
  133. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map +1 -1
  134. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js +37 -31
  135. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map +1 -1
  136. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +35 -27
  137. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map +1 -1
  138. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +32 -24
  139. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +1 -1
  140. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +31 -23
  141. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map +1 -1
  142. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/pattern.js +41 -35
  143. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/pattern.js.map +1 -1
  144. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/required.js +80 -74
  145. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/required.js.map +1 -1
  146. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +71 -66
  147. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map +1 -1
  148. package/dist/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js +34 -27
  149. package/dist/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js.map +1 -1
  150. package/dist/node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/index.js +300 -0
  151. package/dist/node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/index.js.map +1 -0
  152. package/dist/node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/lib/schemes.js +223 -0
  153. package/dist/node_modules/.pnpm/{fast-uri@3.1.0 → fast-uri@3.1.2}/node_modules/fast-uri/lib/schemes.js.map +1 -1
  154. package/dist/node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/lib/utils.js +325 -0
  155. package/dist/node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/lib/utils.js.map +1 -0
  156. package/dist/node_modules/.pnpm/hono@4.12.18/node_modules/hono/dist/helper/streaming/sse.js.map +1 -0
  157. package/dist/node_modules/.pnpm/{hono@4.12.8 → hono@4.12.18}/node_modules/hono/dist/middleware/cors/index.js +8 -8
  158. package/dist/node_modules/.pnpm/hono@4.12.18/node_modules/hono/dist/middleware/cors/index.js.map +1 -0
  159. package/dist/node_modules/.pnpm/hono@4.12.18/node_modules/hono/dist/utils/html.js.map +1 -0
  160. package/dist/node_modules/.pnpm/hono@4.12.18/node_modules/hono/dist/utils/stream.js.map +1 -0
  161. package/dist/node_modules/.pnpm/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js +83 -78
  162. package/dist/node_modules/.pnpm/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js.map +1 -1
  163. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/Options.js +1 -1
  164. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/Options.js.map +1 -1
  165. package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/util.js +1 -1
  166. package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/util.js.map +1 -1
  167. package/dist/sentry-config.js +2 -2
  168. package/dist/server/cli/run.js +2 -2
  169. package/dist/server/cli.js +2 -2
  170. package/dist/server/main.js +2 -2
  171. package/dist/server/mcp/mcp.js +2 -2
  172. package/dist/server/routes/stream/streaming.js +2 -2
  173. package/dist/ui/assets/index.js +61 -70
  174. package/dist/ui/assets/index2.js +1 -1
  175. package/dist/ui/assets/instrumentation.js +18 -18
  176. package/dist/ui/assets/main.css +1 -1
  177. package/dist/ui/assets/main.js +1 -1
  178. package/dist/ui/assets/serverTimingMeta.js +23 -30
  179. package/package.json +9 -9
  180. package/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/index.js +0 -264
  181. package/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/index.js.map +0 -1
  182. package/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/schemes.js +0 -197
  183. package/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/utils.js +0 -261
  184. package/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/utils.js.map +0 -1
  185. package/dist/node_modules/.pnpm/hono@4.12.8/node_modules/hono/dist/helper/streaming/sse.js.map +0 -1
  186. package/dist/node_modules/.pnpm/hono@4.12.8/node_modules/hono/dist/middleware/cors/index.js.map +0 -1
  187. package/dist/node_modules/.pnpm/hono@4.12.8/node_modules/hono/dist/utils/html.js.map +0 -1
  188. package/dist/node_modules/.pnpm/hono@4.12.8/node_modules/hono/dist/utils/stream.js.map +0 -1
  189. /package/dist/node_modules/.pnpm/{hono@4.12.8 → hono@4.12.18}/node_modules/hono/dist/helper/streaming/sse.js +0 -0
  190. /package/dist/node_modules/.pnpm/{hono@4.12.8 → hono@4.12.18}/node_modules/hono/dist/utils/html.js +0 -0
  191. /package/dist/node_modules/.pnpm/{hono@4.12.8 → hono@4.12.18}/node_modules/hono/dist/utils/stream.js +0 -0
@@ -2,534 +2,529 @@
2
2
  !(function() {
3
3
  try {
4
4
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
5
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "77419236-6021-45dd-94e7-3596d97b1cbe", e._sentryDebugIdIdentifier = "sentry-dbid-77419236-6021-45dd-94e7-3596d97b1cbe");
5
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "5531f7c5-c4cf-4aba-8eac-dd5409c154ba", e._sentryDebugIdIdentifier = "sentry-dbid-5531f7c5-c4cf-4aba-8eac-dd5409c154ba");
6
6
  } catch (e2) {
7
7
  }
8
8
  })();
9
- import { __exports as validate } from "../../../../../../../../_virtual/index.js";
10
- import "./boolSchema.js";
11
- import "./dataType.js";
12
- import "./applicability.js";
13
- import "./defaults.js";
14
- import "./keyword.js";
15
- import "./subschema.js";
16
- import "../codegen/index.js";
17
- import "../names.js";
18
- import "../resolve.js";
19
- import "../util.js";
20
- import "../errors.js";
21
- import { __exports as keyword } from "../../../../../../../../_virtual/keyword.js";
22
- import { __exports as util } from "../../../../../../../../_virtual/util.js";
23
- import { __exports as names } from "../../../../../../../../_virtual/names.js";
24
- import { __exports as codegen } from "../../../../../../../../_virtual/index2.js";
25
- import { __exports as errors } from "../../../../../../../../_virtual/errors.js";
26
- import { __exports as dataType } from "../../../../../../../../_virtual/dataType.js";
27
- import { __exports as subschema } from "../../../../../../../../_virtual/subschema.js";
28
- import { __exports as boolSchema } from "../../../../../../../../_virtual/boolSchema.js";
29
- import { __exports as resolve } from "../../../../../../../../_virtual/resolve.js";
30
- import { __exports as applicability } from "../../../../../../../../_virtual/applicability.js";
31
- import { __exports as defaults } from "../../../../../../../../_virtual/defaults.js";
32
- Object.defineProperty(validate, "__esModule", { value: true });
33
- validate.getData = validate.KeywordCxt = validate.validateFunctionCode = void 0;
34
- const boolSchema_1 = boolSchema;
35
- const dataType_1 = dataType;
36
- const applicability_1 = applicability;
37
- const dataType_2 = dataType;
38
- const defaults_1 = defaults;
39
- const keyword_1 = keyword;
40
- const subschema_1 = subschema;
41
- const codegen_1 = codegen;
42
- const names_1 = names;
43
- const resolve_1 = resolve;
44
- const util_1 = util;
45
- const errors_1 = errors;
46
- function validateFunctionCode(it) {
47
- if (isSchemaObj(it)) {
48
- checkKeywords(it);
49
- if (schemaCxtHasRules(it)) {
50
- topSchemaObjCode(it);
51
- return;
9
+ import { __exports as validate } from "../../../../../../../../_virtual/index4.js";
10
+ import { __require as requireBoolSchema } from "./boolSchema.js";
11
+ import { __require as requireDataType } from "./dataType.js";
12
+ import { __require as requireApplicability } from "./applicability.js";
13
+ import { __require as requireDefaults } from "./defaults.js";
14
+ import { __require as requireKeyword } from "./keyword.js";
15
+ import { __require as requireSubschema } from "./subschema.js";
16
+ import { __require as requireCodegen } from "../codegen/index.js";
17
+ import { __require as requireNames } from "../names.js";
18
+ import { __require as requireResolve } from "../resolve.js";
19
+ import { __require as requireUtil } from "../util.js";
20
+ import { __require as requireErrors } from "../errors.js";
21
+ var hasRequiredValidate;
22
+ function requireValidate() {
23
+ if (hasRequiredValidate) return validate;
24
+ hasRequiredValidate = 1;
25
+ Object.defineProperty(validate, "__esModule", { value: true });
26
+ validate.getData = validate.KeywordCxt = validate.validateFunctionCode = void 0;
27
+ const boolSchema_1 = /* @__PURE__ */ requireBoolSchema();
28
+ const dataType_1 = /* @__PURE__ */ requireDataType();
29
+ const applicability_1 = /* @__PURE__ */ requireApplicability();
30
+ const dataType_2 = /* @__PURE__ */ requireDataType();
31
+ const defaults_1 = /* @__PURE__ */ requireDefaults();
32
+ const keyword_1 = /* @__PURE__ */ requireKeyword();
33
+ const subschema_1 = /* @__PURE__ */ requireSubschema();
34
+ const codegen_1 = /* @__PURE__ */ requireCodegen();
35
+ const names_1 = /* @__PURE__ */ requireNames();
36
+ const resolve_1 = /* @__PURE__ */ requireResolve();
37
+ const util_1 = /* @__PURE__ */ requireUtil();
38
+ const errors_1 = /* @__PURE__ */ requireErrors();
39
+ function validateFunctionCode(it) {
40
+ if (isSchemaObj(it)) {
41
+ checkKeywords(it);
42
+ if (schemaCxtHasRules(it)) {
43
+ topSchemaObjCode(it);
44
+ return;
45
+ }
46
+ }
47
+ validateFunction(it, () => (0, boolSchema_1.topBoolOrEmptySchema)(it));
48
+ }
49
+ validate.validateFunctionCode = validateFunctionCode;
50
+ function validateFunction({ gen, validateName, schema, schemaEnv, opts }, body) {
51
+ if (opts.code.es5) {
52
+ gen.func(validateName, (0, codegen_1._)`${names_1.default.data}, ${names_1.default.valCxt}`, schemaEnv.$async, () => {
53
+ gen.code((0, codegen_1._)`"use strict"; ${funcSourceUrl(schema, opts)}`);
54
+ destructureValCxtES5(gen, opts);
55
+ gen.code(body);
56
+ });
57
+ } else {
58
+ gen.func(validateName, (0, codegen_1._)`${names_1.default.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => gen.code(funcSourceUrl(schema, opts)).code(body));
52
59
  }
53
60
  }
54
- validateFunction(it, () => (0, boolSchema_1.topBoolOrEmptySchema)(it));
55
- }
56
- validate.validateFunctionCode = validateFunctionCode;
57
- function validateFunction({ gen, validateName, schema, schemaEnv, opts }, body) {
58
- if (opts.code.es5) {
59
- gen.func(validateName, (0, codegen_1._)`${names_1.default.data}, ${names_1.default.valCxt}`, schemaEnv.$async, () => {
60
- gen.code((0, codegen_1._)`"use strict"; ${funcSourceUrl(schema, opts)}`);
61
- destructureValCxtES5(gen, opts);
62
- gen.code(body);
61
+ function destructureValCxt(opts) {
62
+ return (0, codegen_1._)`{${names_1.default.instancePath}="", ${names_1.default.parentData}, ${names_1.default.parentDataProperty}, ${names_1.default.rootData}=${names_1.default.data}${opts.dynamicRef ? (0, codegen_1._)`, ${names_1.default.dynamicAnchors}={}` : codegen_1.nil}}={}`;
63
+ }
64
+ function destructureValCxtES5(gen, opts) {
65
+ gen.if(names_1.default.valCxt, () => {
66
+ gen.var(names_1.default.instancePath, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.instancePath}`);
67
+ gen.var(names_1.default.parentData, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.parentData}`);
68
+ gen.var(names_1.default.parentDataProperty, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.parentDataProperty}`);
69
+ gen.var(names_1.default.rootData, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.rootData}`);
70
+ if (opts.dynamicRef)
71
+ gen.var(names_1.default.dynamicAnchors, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.dynamicAnchors}`);
72
+ }, () => {
73
+ gen.var(names_1.default.instancePath, (0, codegen_1._)`""`);
74
+ gen.var(names_1.default.parentData, (0, codegen_1._)`undefined`);
75
+ gen.var(names_1.default.parentDataProperty, (0, codegen_1._)`undefined`);
76
+ gen.var(names_1.default.rootData, names_1.default.data);
77
+ if (opts.dynamicRef)
78
+ gen.var(names_1.default.dynamicAnchors, (0, codegen_1._)`{}`);
63
79
  });
64
- } else {
65
- gen.func(validateName, (0, codegen_1._)`${names_1.default.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => gen.code(funcSourceUrl(schema, opts)).code(body));
66
80
  }
67
- }
68
- function destructureValCxt(opts) {
69
- return (0, codegen_1._)`{${names_1.default.instancePath}="", ${names_1.default.parentData}, ${names_1.default.parentDataProperty}, ${names_1.default.rootData}=${names_1.default.data}${opts.dynamicRef ? (0, codegen_1._)`, ${names_1.default.dynamicAnchors}={}` : codegen_1.nil}}={}`;
70
- }
71
- function destructureValCxtES5(gen, opts) {
72
- gen.if(names_1.default.valCxt, () => {
73
- gen.var(names_1.default.instancePath, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.instancePath}`);
74
- gen.var(names_1.default.parentData, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.parentData}`);
75
- gen.var(names_1.default.parentDataProperty, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.parentDataProperty}`);
76
- gen.var(names_1.default.rootData, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.rootData}`);
77
- if (opts.dynamicRef)
78
- gen.var(names_1.default.dynamicAnchors, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.dynamicAnchors}`);
79
- }, () => {
80
- gen.var(names_1.default.instancePath, (0, codegen_1._)`""`);
81
- gen.var(names_1.default.parentData, (0, codegen_1._)`undefined`);
82
- gen.var(names_1.default.parentDataProperty, (0, codegen_1._)`undefined`);
83
- gen.var(names_1.default.rootData, names_1.default.data);
84
- if (opts.dynamicRef)
85
- gen.var(names_1.default.dynamicAnchors, (0, codegen_1._)`{}`);
86
- });
87
- }
88
- function topSchemaObjCode(it) {
89
- const { schema, opts, gen } = it;
90
- validateFunction(it, () => {
91
- if (opts.$comment && schema.$comment)
92
- commentKeyword(it);
93
- checkNoDefault(it);
94
- gen.let(names_1.default.vErrors, null);
95
- gen.let(names_1.default.errors, 0);
96
- if (opts.unevaluated)
97
- resetEvaluated(it);
98
- typeAndKeywords(it);
99
- returnResults(it);
100
- });
101
- return;
102
- }
103
- function resetEvaluated(it) {
104
- const { gen, validateName } = it;
105
- it.evaluated = gen.const("evaluated", (0, codegen_1._)`${validateName}.evaluated`);
106
- gen.if((0, codegen_1._)`${it.evaluated}.dynamicProps`, () => gen.assign((0, codegen_1._)`${it.evaluated}.props`, (0, codegen_1._)`undefined`));
107
- gen.if((0, codegen_1._)`${it.evaluated}.dynamicItems`, () => gen.assign((0, codegen_1._)`${it.evaluated}.items`, (0, codegen_1._)`undefined`));
108
- }
109
- function funcSourceUrl(schema, opts) {
110
- const schId = typeof schema == "object" && schema[opts.schemaId];
111
- return schId && (opts.code.source || opts.code.process) ? (0, codegen_1._)`/*# sourceURL=${schId} */` : codegen_1.nil;
112
- }
113
- function subschemaCode(it, valid) {
114
- if (isSchemaObj(it)) {
115
- checkKeywords(it);
116
- if (schemaCxtHasRules(it)) {
117
- subSchemaObjCode(it, valid);
118
- return;
81
+ function topSchemaObjCode(it) {
82
+ const { schema, opts, gen } = it;
83
+ validateFunction(it, () => {
84
+ if (opts.$comment && schema.$comment)
85
+ commentKeyword(it);
86
+ checkNoDefault(it);
87
+ gen.let(names_1.default.vErrors, null);
88
+ gen.let(names_1.default.errors, 0);
89
+ if (opts.unevaluated)
90
+ resetEvaluated(it);
91
+ typeAndKeywords(it);
92
+ returnResults(it);
93
+ });
94
+ return;
95
+ }
96
+ function resetEvaluated(it) {
97
+ const { gen, validateName } = it;
98
+ it.evaluated = gen.const("evaluated", (0, codegen_1._)`${validateName}.evaluated`);
99
+ gen.if((0, codegen_1._)`${it.evaluated}.dynamicProps`, () => gen.assign((0, codegen_1._)`${it.evaluated}.props`, (0, codegen_1._)`undefined`));
100
+ gen.if((0, codegen_1._)`${it.evaluated}.dynamicItems`, () => gen.assign((0, codegen_1._)`${it.evaluated}.items`, (0, codegen_1._)`undefined`));
101
+ }
102
+ function funcSourceUrl(schema, opts) {
103
+ const schId = typeof schema == "object" && schema[opts.schemaId];
104
+ return schId && (opts.code.source || opts.code.process) ? (0, codegen_1._)`/*# sourceURL=${schId} */` : codegen_1.nil;
105
+ }
106
+ function subschemaCode(it, valid) {
107
+ if (isSchemaObj(it)) {
108
+ checkKeywords(it);
109
+ if (schemaCxtHasRules(it)) {
110
+ subSchemaObjCode(it, valid);
111
+ return;
112
+ }
119
113
  }
114
+ (0, boolSchema_1.boolOrEmptySchema)(it, valid);
120
115
  }
121
- (0, boolSchema_1.boolOrEmptySchema)(it, valid);
122
- }
123
- function schemaCxtHasRules({ schema, self: self2 }) {
124
- if (typeof schema == "boolean")
125
- return !schema;
126
- for (const key in schema)
127
- if (self2.RULES.all[key])
128
- return true;
129
- return false;
130
- }
131
- function isSchemaObj(it) {
132
- return typeof it.schema != "boolean";
133
- }
134
- function subSchemaObjCode(it, valid) {
135
- const { schema, gen, opts } = it;
136
- if (opts.$comment && schema.$comment)
137
- commentKeyword(it);
138
- updateContext(it);
139
- checkAsyncSchema(it);
140
- const errsCount = gen.const("_errs", names_1.default.errors);
141
- typeAndKeywords(it, errsCount);
142
- gen.var(valid, (0, codegen_1._)`${errsCount} === ${names_1.default.errors}`);
143
- }
144
- function checkKeywords(it) {
145
- (0, util_1.checkUnknownRules)(it);
146
- checkRefsAndKeywords(it);
147
- }
148
- function typeAndKeywords(it, errsCount) {
149
- if (it.opts.jtd)
150
- return schemaKeywords(it, [], false, errsCount);
151
- const types = (0, dataType_1.getSchemaTypes)(it.schema);
152
- const checkedTypes = (0, dataType_1.coerceAndCheckDataType)(it, types);
153
- schemaKeywords(it, types, !checkedTypes, errsCount);
154
- }
155
- function checkRefsAndKeywords(it) {
156
- const { schema, errSchemaPath, opts, self: self2 } = it;
157
- if (schema.$ref && opts.ignoreKeywordsWithRef && (0, util_1.schemaHasRulesButRef)(schema, self2.RULES)) {
158
- self2.logger.warn(`$ref: keywords ignored in schema at path "${errSchemaPath}"`);
116
+ function schemaCxtHasRules({ schema, self: self2 }) {
117
+ if (typeof schema == "boolean")
118
+ return !schema;
119
+ for (const key in schema)
120
+ if (self2.RULES.all[key])
121
+ return true;
122
+ return false;
159
123
  }
160
- }
161
- function checkNoDefault(it) {
162
- const { schema, opts } = it;
163
- if (schema.default !== void 0 && opts.useDefaults && opts.strictSchema) {
164
- (0, util_1.checkStrictMode)(it, "default is ignored in the schema root");
124
+ function isSchemaObj(it) {
125
+ return typeof it.schema != "boolean";
165
126
  }
166
- }
167
- function updateContext(it) {
168
- const schId = it.schema[it.opts.schemaId];
169
- if (schId)
170
- it.baseId = (0, resolve_1.resolveUrl)(it.opts.uriResolver, it.baseId, schId);
171
- }
172
- function checkAsyncSchema(it) {
173
- if (it.schema.$async && !it.schemaEnv.$async)
174
- throw new Error("async schema in sync schema");
175
- }
176
- function commentKeyword({ gen, schemaEnv, schema, errSchemaPath, opts }) {
177
- const msg = schema.$comment;
178
- if (opts.$comment === true) {
179
- gen.code((0, codegen_1._)`${names_1.default.self}.logger.log(${msg})`);
180
- } else if (typeof opts.$comment == "function") {
181
- const schemaPath = (0, codegen_1.str)`${errSchemaPath}/$comment`;
182
- const rootName = gen.scopeValue("root", { ref: schemaEnv.root });
183
- gen.code((0, codegen_1._)`${names_1.default.self}.opts.$comment(${msg}, ${schemaPath}, ${rootName}.schema)`);
127
+ function subSchemaObjCode(it, valid) {
128
+ const { schema, gen, opts } = it;
129
+ if (opts.$comment && schema.$comment)
130
+ commentKeyword(it);
131
+ updateContext(it);
132
+ checkAsyncSchema(it);
133
+ const errsCount = gen.const("_errs", names_1.default.errors);
134
+ typeAndKeywords(it, errsCount);
135
+ gen.var(valid, (0, codegen_1._)`${errsCount} === ${names_1.default.errors}`);
136
+ }
137
+ function checkKeywords(it) {
138
+ (0, util_1.checkUnknownRules)(it);
139
+ checkRefsAndKeywords(it);
140
+ }
141
+ function typeAndKeywords(it, errsCount) {
142
+ if (it.opts.jtd)
143
+ return schemaKeywords(it, [], false, errsCount);
144
+ const types = (0, dataType_1.getSchemaTypes)(it.schema);
145
+ const checkedTypes = (0, dataType_1.coerceAndCheckDataType)(it, types);
146
+ schemaKeywords(it, types, !checkedTypes, errsCount);
147
+ }
148
+ function checkRefsAndKeywords(it) {
149
+ const { schema, errSchemaPath, opts, self: self2 } = it;
150
+ if (schema.$ref && opts.ignoreKeywordsWithRef && (0, util_1.schemaHasRulesButRef)(schema, self2.RULES)) {
151
+ self2.logger.warn(`$ref: keywords ignored in schema at path "${errSchemaPath}"`);
152
+ }
184
153
  }
185
- }
186
- function returnResults(it) {
187
- const { gen, schemaEnv, validateName, ValidationError, opts } = it;
188
- if (schemaEnv.$async) {
189
- gen.if((0, codegen_1._)`${names_1.default.errors} === 0`, () => gen.return(names_1.default.data), () => gen.throw((0, codegen_1._)`new ${ValidationError}(${names_1.default.vErrors})`));
190
- } else {
191
- gen.assign((0, codegen_1._)`${validateName}.errors`, names_1.default.vErrors);
192
- if (opts.unevaluated)
193
- assignEvaluated(it);
194
- gen.return((0, codegen_1._)`${names_1.default.errors} === 0`);
154
+ function checkNoDefault(it) {
155
+ const { schema, opts } = it;
156
+ if (schema.default !== void 0 && opts.useDefaults && opts.strictSchema) {
157
+ (0, util_1.checkStrictMode)(it, "default is ignored in the schema root");
158
+ }
195
159
  }
196
- }
197
- function assignEvaluated({ gen, evaluated, props, items }) {
198
- if (props instanceof codegen_1.Name)
199
- gen.assign((0, codegen_1._)`${evaluated}.props`, props);
200
- if (items instanceof codegen_1.Name)
201
- gen.assign((0, codegen_1._)`${evaluated}.items`, items);
202
- }
203
- function schemaKeywords(it, types, typeErrors, errsCount) {
204
- const { gen, schema, data, allErrors, opts, self: self2 } = it;
205
- const { RULES } = self2;
206
- if (schema.$ref && (opts.ignoreKeywordsWithRef || !(0, util_1.schemaHasRulesButRef)(schema, RULES))) {
207
- gen.block(() => keywordCode(it, "$ref", RULES.all.$ref.definition));
208
- return;
160
+ function updateContext(it) {
161
+ const schId = it.schema[it.opts.schemaId];
162
+ if (schId)
163
+ it.baseId = (0, resolve_1.resolveUrl)(it.opts.uriResolver, it.baseId, schId);
164
+ }
165
+ function checkAsyncSchema(it) {
166
+ if (it.schema.$async && !it.schemaEnv.$async)
167
+ throw new Error("async schema in sync schema");
168
+ }
169
+ function commentKeyword({ gen, schemaEnv, schema, errSchemaPath, opts }) {
170
+ const msg = schema.$comment;
171
+ if (opts.$comment === true) {
172
+ gen.code((0, codegen_1._)`${names_1.default.self}.logger.log(${msg})`);
173
+ } else if (typeof opts.$comment == "function") {
174
+ const schemaPath = (0, codegen_1.str)`${errSchemaPath}/$comment`;
175
+ const rootName = gen.scopeValue("root", { ref: schemaEnv.root });
176
+ gen.code((0, codegen_1._)`${names_1.default.self}.opts.$comment(${msg}, ${schemaPath}, ${rootName}.schema)`);
177
+ }
209
178
  }
210
- if (!opts.jtd)
211
- checkStrictTypes(it, types);
212
- gen.block(() => {
213
- for (const group of RULES.rules)
214
- groupKeywords(group);
215
- groupKeywords(RULES.post);
216
- });
217
- function groupKeywords(group) {
218
- if (!(0, applicability_1.shouldUseGroup)(schema, group))
179
+ function returnResults(it) {
180
+ const { gen, schemaEnv, validateName, ValidationError, opts } = it;
181
+ if (schemaEnv.$async) {
182
+ gen.if((0, codegen_1._)`${names_1.default.errors} === 0`, () => gen.return(names_1.default.data), () => gen.throw((0, codegen_1._)`new ${ValidationError}(${names_1.default.vErrors})`));
183
+ } else {
184
+ gen.assign((0, codegen_1._)`${validateName}.errors`, names_1.default.vErrors);
185
+ if (opts.unevaluated)
186
+ assignEvaluated(it);
187
+ gen.return((0, codegen_1._)`${names_1.default.errors} === 0`);
188
+ }
189
+ }
190
+ function assignEvaluated({ gen, evaluated, props, items }) {
191
+ if (props instanceof codegen_1.Name)
192
+ gen.assign((0, codegen_1._)`${evaluated}.props`, props);
193
+ if (items instanceof codegen_1.Name)
194
+ gen.assign((0, codegen_1._)`${evaluated}.items`, items);
195
+ }
196
+ function schemaKeywords(it, types, typeErrors, errsCount) {
197
+ const { gen, schema, data, allErrors, opts, self: self2 } = it;
198
+ const { RULES } = self2;
199
+ if (schema.$ref && (opts.ignoreKeywordsWithRef || !(0, util_1.schemaHasRulesButRef)(schema, RULES))) {
200
+ gen.block(() => keywordCode(it, "$ref", RULES.all.$ref.definition));
219
201
  return;
220
- if (group.type) {
221
- gen.if((0, dataType_2.checkDataType)(group.type, data, opts.strictNumbers));
222
- iterateKeywords(it, group);
223
- if (types.length === 1 && types[0] === group.type && typeErrors) {
224
- gen.else();
225
- (0, dataType_2.reportTypeError)(it);
202
+ }
203
+ if (!opts.jtd)
204
+ checkStrictTypes(it, types);
205
+ gen.block(() => {
206
+ for (const group of RULES.rules)
207
+ groupKeywords(group);
208
+ groupKeywords(RULES.post);
209
+ });
210
+ function groupKeywords(group) {
211
+ if (!(0, applicability_1.shouldUseGroup)(schema, group))
212
+ return;
213
+ if (group.type) {
214
+ gen.if((0, dataType_2.checkDataType)(group.type, data, opts.strictNumbers));
215
+ iterateKeywords(it, group);
216
+ if (types.length === 1 && types[0] === group.type && typeErrors) {
217
+ gen.else();
218
+ (0, dataType_2.reportTypeError)(it);
219
+ }
220
+ gen.endIf();
221
+ } else {
222
+ iterateKeywords(it, group);
226
223
  }
227
- gen.endIf();
228
- } else {
229
- iterateKeywords(it, group);
224
+ if (!allErrors)
225
+ gen.if((0, codegen_1._)`${names_1.default.errors} === ${errsCount || 0}`);
230
226
  }
231
- if (!allErrors)
232
- gen.if((0, codegen_1._)`${names_1.default.errors} === ${errsCount || 0}`);
233
227
  }
234
- }
235
- function iterateKeywords(it, group) {
236
- const { gen, schema, opts: { useDefaults } } = it;
237
- if (useDefaults)
238
- (0, defaults_1.assignDefaults)(it, group.type);
239
- gen.block(() => {
240
- for (const rule of group.rules) {
241
- if ((0, applicability_1.shouldUseRule)(schema, rule)) {
242
- keywordCode(it, rule.keyword, rule.definition, group.type);
228
+ function iterateKeywords(it, group) {
229
+ const { gen, schema, opts: { useDefaults } } = it;
230
+ if (useDefaults)
231
+ (0, defaults_1.assignDefaults)(it, group.type);
232
+ gen.block(() => {
233
+ for (const rule of group.rules) {
234
+ if ((0, applicability_1.shouldUseRule)(schema, rule)) {
235
+ keywordCode(it, rule.keyword, rule.definition, group.type);
236
+ }
243
237
  }
238
+ });
239
+ }
240
+ function checkStrictTypes(it, types) {
241
+ if (it.schemaEnv.meta || !it.opts.strictTypes)
242
+ return;
243
+ checkContextTypes(it, types);
244
+ if (!it.opts.allowUnionTypes)
245
+ checkMultipleTypes(it, types);
246
+ checkKeywordTypes(it, it.dataTypes);
247
+ }
248
+ function checkContextTypes(it, types) {
249
+ if (!types.length)
250
+ return;
251
+ if (!it.dataTypes.length) {
252
+ it.dataTypes = types;
253
+ return;
244
254
  }
245
- });
246
- }
247
- function checkStrictTypes(it, types) {
248
- if (it.schemaEnv.meta || !it.opts.strictTypes)
249
- return;
250
- checkContextTypes(it, types);
251
- if (!it.opts.allowUnionTypes)
252
- checkMultipleTypes(it, types);
253
- checkKeywordTypes(it, it.dataTypes);
254
- }
255
- function checkContextTypes(it, types) {
256
- if (!types.length)
257
- return;
258
- if (!it.dataTypes.length) {
259
- it.dataTypes = types;
260
- return;
255
+ types.forEach((t) => {
256
+ if (!includesType(it.dataTypes, t)) {
257
+ strictTypesError(it, `type "${t}" not allowed by context "${it.dataTypes.join(",")}"`);
258
+ }
259
+ });
260
+ narrowSchemaTypes(it, types);
261
261
  }
262
- types.forEach((t) => {
263
- if (!includesType(it.dataTypes, t)) {
264
- strictTypesError(it, `type "${t}" not allowed by context "${it.dataTypes.join(",")}"`);
262
+ function checkMultipleTypes(it, ts) {
263
+ if (ts.length > 1 && !(ts.length === 2 && ts.includes("null"))) {
264
+ strictTypesError(it, "use allowUnionTypes to allow union type keyword");
265
265
  }
266
- });
267
- narrowSchemaTypes(it, types);
268
- }
269
- function checkMultipleTypes(it, ts) {
270
- if (ts.length > 1 && !(ts.length === 2 && ts.includes("null"))) {
271
- strictTypesError(it, "use allowUnionTypes to allow union type keyword");
272
266
  }
273
- }
274
- function checkKeywordTypes(it, ts) {
275
- const rules = it.self.RULES.all;
276
- for (const keyword2 in rules) {
277
- const rule = rules[keyword2];
278
- if (typeof rule == "object" && (0, applicability_1.shouldUseRule)(it.schema, rule)) {
279
- const { type } = rule.definition;
280
- if (type.length && !type.some((t) => hasApplicableType(ts, t))) {
281
- strictTypesError(it, `missing type "${type.join(",")}" for keyword "${keyword2}"`);
267
+ function checkKeywordTypes(it, ts) {
268
+ const rules = it.self.RULES.all;
269
+ for (const keyword in rules) {
270
+ const rule = rules[keyword];
271
+ if (typeof rule == "object" && (0, applicability_1.shouldUseRule)(it.schema, rule)) {
272
+ const { type } = rule.definition;
273
+ if (type.length && !type.some((t) => hasApplicableType(ts, t))) {
274
+ strictTypesError(it, `missing type "${type.join(",")}" for keyword "${keyword}"`);
275
+ }
282
276
  }
283
277
  }
284
278
  }
285
- }
286
- function hasApplicableType(schTs, kwdT) {
287
- return schTs.includes(kwdT) || kwdT === "number" && schTs.includes("integer");
288
- }
289
- function includesType(ts, t) {
290
- return ts.includes(t) || t === "integer" && ts.includes("number");
291
- }
292
- function narrowSchemaTypes(it, withTypes) {
293
- const ts = [];
294
- for (const t of it.dataTypes) {
295
- if (includesType(withTypes, t))
296
- ts.push(t);
297
- else if (withTypes.includes("integer") && t === "number")
298
- ts.push("integer");
299
- }
300
- it.dataTypes = ts;
301
- }
302
- function strictTypesError(it, msg) {
303
- const schemaPath = it.schemaEnv.baseId + it.errSchemaPath;
304
- msg += ` at "${schemaPath}" (strictTypes)`;
305
- (0, util_1.checkStrictMode)(it, msg, it.opts.strictTypes);
306
- }
307
- class KeywordCxt {
308
- constructor(it, def, keyword2) {
309
- (0, keyword_1.validateKeywordUsage)(it, def, keyword2);
310
- this.gen = it.gen;
311
- this.allErrors = it.allErrors;
312
- this.keyword = keyword2;
313
- this.data = it.data;
314
- this.schema = it.schema[keyword2];
315
- this.$data = def.$data && it.opts.$data && this.schema && this.schema.$data;
316
- this.schemaValue = (0, util_1.schemaRefOrVal)(it, this.schema, keyword2, this.$data);
317
- this.schemaType = def.schemaType;
318
- this.parentSchema = it.schema;
319
- this.params = {};
320
- this.it = it;
321
- this.def = def;
322
- if (this.$data) {
323
- this.schemaCode = it.gen.const("vSchema", getData(this.$data, it));
324
- } else {
325
- this.schemaCode = this.schemaValue;
326
- if (!(0, keyword_1.validSchemaType)(this.schema, def.schemaType, def.allowUndefined)) {
327
- throw new Error(`${keyword2} value must be ${JSON.stringify(def.schemaType)}`);
279
+ function hasApplicableType(schTs, kwdT) {
280
+ return schTs.includes(kwdT) || kwdT === "number" && schTs.includes("integer");
281
+ }
282
+ function includesType(ts, t) {
283
+ return ts.includes(t) || t === "integer" && ts.includes("number");
284
+ }
285
+ function narrowSchemaTypes(it, withTypes) {
286
+ const ts = [];
287
+ for (const t of it.dataTypes) {
288
+ if (includesType(withTypes, t))
289
+ ts.push(t);
290
+ else if (withTypes.includes("integer") && t === "number")
291
+ ts.push("integer");
292
+ }
293
+ it.dataTypes = ts;
294
+ }
295
+ function strictTypesError(it, msg) {
296
+ const schemaPath = it.schemaEnv.baseId + it.errSchemaPath;
297
+ msg += ` at "${schemaPath}" (strictTypes)`;
298
+ (0, util_1.checkStrictMode)(it, msg, it.opts.strictTypes);
299
+ }
300
+ class KeywordCxt {
301
+ constructor(it, def, keyword) {
302
+ (0, keyword_1.validateKeywordUsage)(it, def, keyword);
303
+ this.gen = it.gen;
304
+ this.allErrors = it.allErrors;
305
+ this.keyword = keyword;
306
+ this.data = it.data;
307
+ this.schema = it.schema[keyword];
308
+ this.$data = def.$data && it.opts.$data && this.schema && this.schema.$data;
309
+ this.schemaValue = (0, util_1.schemaRefOrVal)(it, this.schema, keyword, this.$data);
310
+ this.schemaType = def.schemaType;
311
+ this.parentSchema = it.schema;
312
+ this.params = {};
313
+ this.it = it;
314
+ this.def = def;
315
+ if (this.$data) {
316
+ this.schemaCode = it.gen.const("vSchema", getData(this.$data, it));
317
+ } else {
318
+ this.schemaCode = this.schemaValue;
319
+ if (!(0, keyword_1.validSchemaType)(this.schema, def.schemaType, def.allowUndefined)) {
320
+ throw new Error(`${keyword} value must be ${JSON.stringify(def.schemaType)}`);
321
+ }
322
+ }
323
+ if ("code" in def ? def.trackErrors : def.errors !== false) {
324
+ this.errsCount = it.gen.const("_errs", names_1.default.errors);
328
325
  }
329
326
  }
330
- if ("code" in def ? def.trackErrors : def.errors !== false) {
331
- this.errsCount = it.gen.const("_errs", names_1.default.errors);
327
+ result(condition, successAction, failAction) {
328
+ this.failResult((0, codegen_1.not)(condition), successAction, failAction);
332
329
  }
333
- }
334
- result(condition, successAction, failAction) {
335
- this.failResult((0, codegen_1.not)(condition), successAction, failAction);
336
- }
337
- failResult(condition, successAction, failAction) {
338
- this.gen.if(condition);
339
- if (failAction)
340
- failAction();
341
- else
330
+ failResult(condition, successAction, failAction) {
331
+ this.gen.if(condition);
332
+ if (failAction)
333
+ failAction();
334
+ else
335
+ this.error();
336
+ if (successAction) {
337
+ this.gen.else();
338
+ successAction();
339
+ if (this.allErrors)
340
+ this.gen.endIf();
341
+ } else {
342
+ if (this.allErrors)
343
+ this.gen.endIf();
344
+ else
345
+ this.gen.else();
346
+ }
347
+ }
348
+ pass(condition, failAction) {
349
+ this.failResult((0, codegen_1.not)(condition), void 0, failAction);
350
+ }
351
+ fail(condition) {
352
+ if (condition === void 0) {
353
+ this.error();
354
+ if (!this.allErrors)
355
+ this.gen.if(false);
356
+ return;
357
+ }
358
+ this.gen.if(condition);
342
359
  this.error();
343
- if (successAction) {
344
- this.gen.else();
345
- successAction();
346
- if (this.allErrors)
347
- this.gen.endIf();
348
- } else {
349
360
  if (this.allErrors)
350
361
  this.gen.endIf();
351
362
  else
352
363
  this.gen.else();
353
364
  }
354
- }
355
- pass(condition, failAction) {
356
- this.failResult((0, codegen_1.not)(condition), void 0, failAction);
357
- }
358
- fail(condition) {
359
- if (condition === void 0) {
360
- this.error();
361
- if (!this.allErrors)
362
- this.gen.if(false);
363
- return;
365
+ fail$data(condition) {
366
+ if (!this.$data)
367
+ return this.fail(condition);
368
+ const { schemaCode } = this;
369
+ this.fail((0, codegen_1._)`${schemaCode} !== undefined && (${(0, codegen_1.or)(this.invalid$data(), condition)})`);
364
370
  }
365
- this.gen.if(condition);
366
- this.error();
367
- if (this.allErrors)
368
- this.gen.endIf();
369
- else
370
- this.gen.else();
371
- }
372
- fail$data(condition) {
373
- if (!this.$data)
374
- return this.fail(condition);
375
- const { schemaCode } = this;
376
- this.fail((0, codegen_1._)`${schemaCode} !== undefined && (${(0, codegen_1.or)(this.invalid$data(), condition)})`);
377
- }
378
- error(append, errorParams, errorPaths) {
379
- if (errorParams) {
380
- this.setParams(errorParams);
371
+ error(append, errorParams, errorPaths) {
372
+ if (errorParams) {
373
+ this.setParams(errorParams);
374
+ this._error(append, errorPaths);
375
+ this.setParams({});
376
+ return;
377
+ }
381
378
  this._error(append, errorPaths);
382
- this.setParams({});
383
- return;
384
379
  }
385
- this._error(append, errorPaths);
386
- }
387
- _error(append, errorPaths) {
388
- (append ? errors_1.reportExtraError : errors_1.reportError)(this, this.def.error, errorPaths);
389
- }
390
- $dataError() {
391
- (0, errors_1.reportError)(this, this.def.$dataError || errors_1.keyword$DataError);
392
- }
393
- reset() {
394
- if (this.errsCount === void 0)
395
- throw new Error('add "trackErrors" to keyword definition');
396
- (0, errors_1.resetErrorsCount)(this.gen, this.errsCount);
397
- }
398
- ok(cond) {
399
- if (!this.allErrors)
400
- this.gen.if(cond);
401
- }
402
- setParams(obj, assign) {
403
- if (assign)
404
- Object.assign(this.params, obj);
405
- else
406
- this.params = obj;
407
- }
408
- block$data(valid, codeBlock, $dataValid = codegen_1.nil) {
409
- this.gen.block(() => {
410
- this.check$data(valid, $dataValid);
411
- codeBlock();
412
- });
413
- }
414
- check$data(valid = codegen_1.nil, $dataValid = codegen_1.nil) {
415
- if (!this.$data)
416
- return;
417
- const { gen, schemaCode, schemaType, def } = this;
418
- gen.if((0, codegen_1.or)((0, codegen_1._)`${schemaCode} === undefined`, $dataValid));
419
- if (valid !== codegen_1.nil)
420
- gen.assign(valid, true);
421
- if (schemaType.length || def.validateSchema) {
422
- gen.elseIf(this.invalid$data());
423
- this.$dataError();
380
+ _error(append, errorPaths) {
381
+ (append ? errors_1.reportExtraError : errors_1.reportError)(this, this.def.error, errorPaths);
382
+ }
383
+ $dataError() {
384
+ (0, errors_1.reportError)(this, this.def.$dataError || errors_1.keyword$DataError);
385
+ }
386
+ reset() {
387
+ if (this.errsCount === void 0)
388
+ throw new Error('add "trackErrors" to keyword definition');
389
+ (0, errors_1.resetErrorsCount)(this.gen, this.errsCount);
390
+ }
391
+ ok(cond) {
392
+ if (!this.allErrors)
393
+ this.gen.if(cond);
394
+ }
395
+ setParams(obj, assign) {
396
+ if (assign)
397
+ Object.assign(this.params, obj);
398
+ else
399
+ this.params = obj;
400
+ }
401
+ block$data(valid, codeBlock, $dataValid = codegen_1.nil) {
402
+ this.gen.block(() => {
403
+ this.check$data(valid, $dataValid);
404
+ codeBlock();
405
+ });
406
+ }
407
+ check$data(valid = codegen_1.nil, $dataValid = codegen_1.nil) {
408
+ if (!this.$data)
409
+ return;
410
+ const { gen, schemaCode, schemaType, def } = this;
411
+ gen.if((0, codegen_1.or)((0, codegen_1._)`${schemaCode} === undefined`, $dataValid));
424
412
  if (valid !== codegen_1.nil)
425
- gen.assign(valid, false);
426
- }
427
- gen.else();
428
- }
429
- invalid$data() {
430
- const { gen, schemaCode, schemaType, def, it } = this;
431
- return (0, codegen_1.or)(wrong$DataType(), invalid$DataSchema());
432
- function wrong$DataType() {
433
- if (schemaType.length) {
434
- if (!(schemaCode instanceof codegen_1.Name))
435
- throw new Error("ajv implementation error");
436
- const st = Array.isArray(schemaType) ? schemaType : [schemaType];
437
- return (0, codegen_1._)`${(0, dataType_2.checkDataTypes)(st, schemaCode, it.opts.strictNumbers, dataType_2.DataType.Wrong)}`;
413
+ gen.assign(valid, true);
414
+ if (schemaType.length || def.validateSchema) {
415
+ gen.elseIf(this.invalid$data());
416
+ this.$dataError();
417
+ if (valid !== codegen_1.nil)
418
+ gen.assign(valid, false);
438
419
  }
439
- return codegen_1.nil;
420
+ gen.else();
440
421
  }
441
- function invalid$DataSchema() {
442
- if (def.validateSchema) {
443
- const validateSchemaRef = gen.scopeValue("validate$data", { ref: def.validateSchema });
444
- return (0, codegen_1._)`!${validateSchemaRef}(${schemaCode})`;
422
+ invalid$data() {
423
+ const { gen, schemaCode, schemaType, def, it } = this;
424
+ return (0, codegen_1.or)(wrong$DataType(), invalid$DataSchema());
425
+ function wrong$DataType() {
426
+ if (schemaType.length) {
427
+ if (!(schemaCode instanceof codegen_1.Name))
428
+ throw new Error("ajv implementation error");
429
+ const st = Array.isArray(schemaType) ? schemaType : [schemaType];
430
+ return (0, codegen_1._)`${(0, dataType_2.checkDataTypes)(st, schemaCode, it.opts.strictNumbers, dataType_2.DataType.Wrong)}`;
431
+ }
432
+ return codegen_1.nil;
433
+ }
434
+ function invalid$DataSchema() {
435
+ if (def.validateSchema) {
436
+ const validateSchemaRef = gen.scopeValue("validate$data", { ref: def.validateSchema });
437
+ return (0, codegen_1._)`!${validateSchemaRef}(${schemaCode})`;
438
+ }
439
+ return codegen_1.nil;
445
440
  }
446
- return codegen_1.nil;
447
441
  }
448
- }
449
- subschema(appl, valid) {
450
- const subschema2 = (0, subschema_1.getSubschema)(this.it, appl);
451
- (0, subschema_1.extendSubschemaData)(subschema2, this.it, appl);
452
- (0, subschema_1.extendSubschemaMode)(subschema2, appl);
453
- const nextContext = { ...this.it, ...subschema2, items: void 0, props: void 0 };
454
- subschemaCode(nextContext, valid);
455
- return nextContext;
456
- }
457
- mergeEvaluated(schemaCxt, toName) {
458
- const { it, gen } = this;
459
- if (!it.opts.unevaluated)
460
- return;
461
- if (it.props !== true && schemaCxt.props !== void 0) {
462
- it.props = util_1.mergeEvaluated.props(gen, schemaCxt.props, it.props, toName);
442
+ subschema(appl, valid) {
443
+ const subschema = (0, subschema_1.getSubschema)(this.it, appl);
444
+ (0, subschema_1.extendSubschemaData)(subschema, this.it, appl);
445
+ (0, subschema_1.extendSubschemaMode)(subschema, appl);
446
+ const nextContext = { ...this.it, ...subschema, items: void 0, props: void 0 };
447
+ subschemaCode(nextContext, valid);
448
+ return nextContext;
449
+ }
450
+ mergeEvaluated(schemaCxt, toName) {
451
+ const { it, gen } = this;
452
+ if (!it.opts.unevaluated)
453
+ return;
454
+ if (it.props !== true && schemaCxt.props !== void 0) {
455
+ it.props = util_1.mergeEvaluated.props(gen, schemaCxt.props, it.props, toName);
456
+ }
457
+ if (it.items !== true && schemaCxt.items !== void 0) {
458
+ it.items = util_1.mergeEvaluated.items(gen, schemaCxt.items, it.items, toName);
459
+ }
463
460
  }
464
- if (it.items !== true && schemaCxt.items !== void 0) {
465
- it.items = util_1.mergeEvaluated.items(gen, schemaCxt.items, it.items, toName);
461
+ mergeValidEvaluated(schemaCxt, valid) {
462
+ const { it, gen } = this;
463
+ if (it.opts.unevaluated && (it.props !== true || it.items !== true)) {
464
+ gen.if(valid, () => this.mergeEvaluated(schemaCxt, codegen_1.Name));
465
+ return true;
466
+ }
466
467
  }
467
468
  }
468
- mergeValidEvaluated(schemaCxt, valid) {
469
- const { it, gen } = this;
470
- if (it.opts.unevaluated && (it.props !== true || it.items !== true)) {
471
- gen.if(valid, () => this.mergeEvaluated(schemaCxt, codegen_1.Name));
472
- return true;
469
+ validate.KeywordCxt = KeywordCxt;
470
+ function keywordCode(it, keyword, def, ruleType) {
471
+ const cxt = new KeywordCxt(it, def, keyword);
472
+ if ("code" in def) {
473
+ def.code(cxt, ruleType);
474
+ } else if (cxt.$data && def.validate) {
475
+ (0, keyword_1.funcKeywordCode)(cxt, def);
476
+ } else if ("macro" in def) {
477
+ (0, keyword_1.macroKeywordCode)(cxt, def);
478
+ } else if (def.compile || def.validate) {
479
+ (0, keyword_1.funcKeywordCode)(cxt, def);
473
480
  }
474
481
  }
475
- }
476
- validate.KeywordCxt = KeywordCxt;
477
- function keywordCode(it, keyword2, def, ruleType) {
478
- const cxt = new KeywordCxt(it, def, keyword2);
479
- if ("code" in def) {
480
- def.code(cxt, ruleType);
481
- } else if (cxt.$data && def.validate) {
482
- (0, keyword_1.funcKeywordCode)(cxt, def);
483
- } else if ("macro" in def) {
484
- (0, keyword_1.macroKeywordCode)(cxt, def);
485
- } else if (def.compile || def.validate) {
486
- (0, keyword_1.funcKeywordCode)(cxt, def);
487
- }
488
- }
489
- const JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/;
490
- const RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
491
- function getData($data, { dataLevel, dataNames, dataPathArr }) {
492
- let jsonPointer;
493
- let data;
494
- if ($data === "")
495
- return names_1.default.rootData;
496
- if ($data[0] === "/") {
497
- if (!JSON_POINTER.test($data))
498
- throw new Error(`Invalid JSON-pointer: ${$data}`);
499
- jsonPointer = $data;
500
- data = names_1.default.rootData;
501
- } else {
502
- const matches = RELATIVE_JSON_POINTER.exec($data);
503
- if (!matches)
504
- throw new Error(`Invalid JSON-pointer: ${$data}`);
505
- const up = +matches[1];
506
- jsonPointer = matches[2];
507
- if (jsonPointer === "#") {
508
- if (up >= dataLevel)
509
- throw new Error(errorMsg("property/index", up));
510
- return dataPathArr[dataLevel - up];
511
- }
512
- if (up > dataLevel)
513
- throw new Error(errorMsg("data", up));
514
- data = dataNames[dataLevel - up];
515
- if (!jsonPointer)
516
- return data;
517
- }
518
- let expr = data;
519
- const segments = jsonPointer.split("/");
520
- for (const segment of segments) {
521
- if (segment) {
522
- data = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)((0, util_1.unescapeJsonPointer)(segment))}`;
523
- expr = (0, codegen_1._)`${expr} && ${data}`;
524
- }
525
- }
526
- return expr;
527
- function errorMsg(pointerType, up) {
528
- return `Cannot access ${pointerType} ${up} levels up, current level is ${dataLevel}`;
482
+ const JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/;
483
+ const RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
484
+ function getData($data, { dataLevel, dataNames, dataPathArr }) {
485
+ let jsonPointer;
486
+ let data;
487
+ if ($data === "")
488
+ return names_1.default.rootData;
489
+ if ($data[0] === "/") {
490
+ if (!JSON_POINTER.test($data))
491
+ throw new Error(`Invalid JSON-pointer: ${$data}`);
492
+ jsonPointer = $data;
493
+ data = names_1.default.rootData;
494
+ } else {
495
+ const matches = RELATIVE_JSON_POINTER.exec($data);
496
+ if (!matches)
497
+ throw new Error(`Invalid JSON-pointer: ${$data}`);
498
+ const up = +matches[1];
499
+ jsonPointer = matches[2];
500
+ if (jsonPointer === "#") {
501
+ if (up >= dataLevel)
502
+ throw new Error(errorMsg("property/index", up));
503
+ return dataPathArr[dataLevel - up];
504
+ }
505
+ if (up > dataLevel)
506
+ throw new Error(errorMsg("data", up));
507
+ data = dataNames[dataLevel - up];
508
+ if (!jsonPointer)
509
+ return data;
510
+ }
511
+ let expr = data;
512
+ const segments = jsonPointer.split("/");
513
+ for (const segment of segments) {
514
+ if (segment) {
515
+ data = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)((0, util_1.unescapeJsonPointer)(segment))}`;
516
+ expr = (0, codegen_1._)`${expr} && ${data}`;
517
+ }
518
+ }
519
+ return expr;
520
+ function errorMsg(pointerType, up) {
521
+ return `Cannot access ${pointerType} ${up} levels up, current level is ${dataLevel}`;
522
+ }
529
523
  }
524
+ validate.getData = getData;
525
+ return validate;
530
526
  }
531
- validate.getData = getData;
532
527
  export {
533
- validate as default
528
+ requireValidate as __require
534
529
  };
535
530
  //# sourceMappingURL=index.js.map