@warlock.js/seal 5.24.0 → 5.26.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 (255) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/LICENSE +21 -21
  3. package/cjs/index.cjs +10 -5
  4. package/cjs/index.cjs.map +1 -1
  5. package/cjs/{object-DPPttDAF.cjs → object-BuKApaax.cjs} +3 -3
  6. package/cjs/object-BuKApaax.cjs.map +1 -0
  7. package/cjs/object.cjs +2 -2
  8. package/cjs/{required-methods-DJTm7yNP.cjs → required-methods-BOVNRtci.cjs} +12 -2
  9. package/cjs/required-methods-BOVNRtci.cjs.map +1 -0
  10. package/cjs/{string-C_pAtZPC.cjs → string-DpDpgefH.cjs} +2 -2
  11. package/cjs/string-DpDpgefH.cjs.map +1 -0
  12. package/cjs/string.cjs +2 -2
  13. package/esm/config.d.mts +0 -1
  14. package/esm/config.d.mts.map +1 -1
  15. package/esm/config.mjs.map +1 -1
  16. package/esm/factory/validate.mjs.map +1 -1
  17. package/esm/factory/validators.d.mts.map +1 -1
  18. package/esm/factory/validators.mjs +1 -1
  19. package/esm/factory/validators.mjs.map +1 -1
  20. package/esm/helpers/date-helpers.mjs.map +1 -1
  21. package/esm/helpers/get-field-value.d.mts +0 -1
  22. package/esm/helpers/get-field-value.d.mts.map +1 -1
  23. package/esm/helpers/get-field-value.mjs.map +1 -1
  24. package/esm/helpers/index.d.mts +5 -0
  25. package/esm/helpers/path-helpers.mjs.map +1 -1
  26. package/esm/helpers/validation-helpers.d.mts +0 -1
  27. package/esm/helpers/validation-helpers.d.mts.map +1 -1
  28. package/esm/mutators/array-mutators.d.mts +0 -1
  29. package/esm/mutators/array-mutators.d.mts.map +1 -1
  30. package/esm/mutators/array-mutators.mjs.map +1 -1
  31. package/esm/mutators/boolean-mutators.d.mts +0 -1
  32. package/esm/mutators/boolean-mutators.d.mts.map +1 -1
  33. package/esm/mutators/date-mutators.d.mts +0 -1
  34. package/esm/mutators/date-mutators.d.mts.map +1 -1
  35. package/esm/mutators/date-mutators.mjs.map +1 -1
  36. package/esm/mutators/index.d.mts +7 -0
  37. package/esm/mutators/number-mutators.d.mts +0 -1
  38. package/esm/mutators/number-mutators.d.mts.map +1 -1
  39. package/esm/mutators/number-mutators.mjs.map +1 -1
  40. package/esm/mutators/object-mutators.d.mts +0 -1
  41. package/esm/mutators/object-mutators.d.mts.map +1 -1
  42. package/esm/mutators/object-mutators.mjs.map +1 -1
  43. package/esm/mutators/scalar-mutators.d.mts +0 -1
  44. package/esm/mutators/scalar-mutators.d.mts.map +1 -1
  45. package/esm/mutators/scalar-mutators.mjs.map +1 -1
  46. package/esm/mutators/string-mutators.d.mts +0 -1
  47. package/esm/mutators/string-mutators.d.mts.map +1 -1
  48. package/esm/mutators/string-mutators.mjs.map +1 -1
  49. package/esm/plugins/plugin-system.mjs.map +1 -1
  50. package/esm/rules/array/array-rules.d.mts +0 -1
  51. package/esm/rules/array/array-rules.d.mts.map +1 -1
  52. package/esm/rules/array/array-rules.mjs.map +1 -1
  53. package/esm/rules/array/index.d.mts +1 -0
  54. package/esm/rules/color/color-rules.d.mts +0 -1
  55. package/esm/rules/color/color-rules.d.mts.map +1 -1
  56. package/esm/rules/color/color-rules.mjs.map +1 -1
  57. package/esm/rules/color/index.d.mts +1 -0
  58. package/esm/rules/common/enum.d.mts +0 -1
  59. package/esm/rules/common/enum.d.mts.map +1 -1
  60. package/esm/rules/common/enum.mjs.map +1 -1
  61. package/esm/rules/common/equals-field-rules.d.mts +0 -1
  62. package/esm/rules/common/equals-field-rules.d.mts.map +1 -1
  63. package/esm/rules/common/equals-field-rules.mjs.map +1 -1
  64. package/esm/rules/common/index.d.mts +6 -0
  65. package/esm/rules/common/instanceof.d.mts +0 -1
  66. package/esm/rules/common/instanceof.d.mts.map +1 -1
  67. package/esm/rules/common/literal.d.mts +0 -1
  68. package/esm/rules/common/literal.d.mts.map +1 -1
  69. package/esm/rules/common/type-rules.d.mts +0 -1
  70. package/esm/rules/common/type-rules.d.mts.map +1 -1
  71. package/esm/rules/common/type-rules.mjs.map +1 -1
  72. package/esm/rules/common/unknown-key.d.mts +0 -1
  73. package/esm/rules/common/unknown-key.d.mts.map +1 -1
  74. package/esm/rules/conditional/forbidden-if-rules.d.mts +0 -1
  75. package/esm/rules/conditional/forbidden-if-rules.d.mts.map +1 -1
  76. package/esm/rules/conditional/forbidden-if-rules.mjs.map +1 -1
  77. package/esm/rules/conditional/index.d.mts +10 -0
  78. package/esm/rules/conditional/present-if-rules.d.mts +0 -1
  79. package/esm/rules/conditional/present-if-rules.d.mts.map +1 -1
  80. package/esm/rules/conditional/present-if-rules.mjs.map +1 -1
  81. package/esm/rules/conditional/present-unless-rules.d.mts +0 -1
  82. package/esm/rules/conditional/present-unless-rules.d.mts.map +1 -1
  83. package/esm/rules/conditional/present-unless-rules.mjs.map +1 -1
  84. package/esm/rules/conditional/present-with-rules.d.mts +0 -1
  85. package/esm/rules/conditional/present-with-rules.d.mts.map +1 -1
  86. package/esm/rules/conditional/present-with-rules.mjs.map +1 -1
  87. package/esm/rules/conditional/present-without-rules.d.mts +0 -1
  88. package/esm/rules/conditional/present-without-rules.d.mts.map +1 -1
  89. package/esm/rules/conditional/present-without-rules.mjs.map +1 -1
  90. package/esm/rules/conditional/required-if-rules.d.mts +0 -1
  91. package/esm/rules/conditional/required-if-rules.d.mts.map +1 -1
  92. package/esm/rules/conditional/required-if-rules.mjs.map +1 -1
  93. package/esm/rules/conditional/required-unless-rules.d.mts +0 -1
  94. package/esm/rules/conditional/required-unless-rules.d.mts.map +1 -1
  95. package/esm/rules/conditional/required-unless-rules.mjs.map +1 -1
  96. package/esm/rules/conditional/required-when-rule.d.mts +0 -1
  97. package/esm/rules/conditional/required-when-rule.d.mts.map +1 -1
  98. package/esm/rules/conditional/required-with-rules.d.mts +0 -1
  99. package/esm/rules/conditional/required-with-rules.d.mts.map +1 -1
  100. package/esm/rules/conditional/required-with-rules.mjs.map +1 -1
  101. package/esm/rules/conditional/required-without-rules.d.mts +0 -1
  102. package/esm/rules/conditional/required-without-rules.d.mts.map +1 -1
  103. package/esm/rules/conditional/required-without-rules.mjs.map +1 -1
  104. package/esm/rules/core/equal.d.mts +0 -1
  105. package/esm/rules/core/equal.d.mts.map +1 -1
  106. package/esm/rules/core/equal.mjs.map +1 -1
  107. package/esm/rules/core/forbidden.d.mts +0 -1
  108. package/esm/rules/core/forbidden.d.mts.map +1 -1
  109. package/esm/rules/core/forbidden.mjs.map +1 -1
  110. package/esm/rules/core/index.d.mts +5 -0
  111. package/esm/rules/core/required.d.mts +0 -1
  112. package/esm/rules/core/required.d.mts.map +1 -1
  113. package/esm/rules/core/required.mjs.map +1 -1
  114. package/esm/rules/core/union.d.mts.map +1 -1
  115. package/esm/rules/core/union.mjs.map +1 -1
  116. package/esm/rules/core/when.d.mts +0 -1
  117. package/esm/rules/core/when.d.mts.map +1 -1
  118. package/esm/rules/core/when.mjs.map +1 -1
  119. package/esm/rules/date/date-comparison-rules.d.mts +0 -1
  120. package/esm/rules/date/date-comparison-rules.d.mts.map +1 -1
  121. package/esm/rules/date/date-comparison-rules.mjs.map +1 -1
  122. package/esm/rules/date/date-day-rules.d.mts +0 -1
  123. package/esm/rules/date/date-day-rules.d.mts.map +1 -1
  124. package/esm/rules/date/date-day-rules.mjs.map +1 -1
  125. package/esm/rules/date/date-field-comparison-rules.d.mts +0 -1
  126. package/esm/rules/date/date-field-comparison-rules.d.mts.map +1 -1
  127. package/esm/rules/date/date-field-comparison-rules.mjs.map +1 -1
  128. package/esm/rules/date/date-period-rules.d.mts +0 -1
  129. package/esm/rules/date/date-period-rules.d.mts.map +1 -1
  130. package/esm/rules/date/date-period-rules.mjs.map +1 -1
  131. package/esm/rules/date/date-relative-rules.d.mts +0 -1
  132. package/esm/rules/date/date-relative-rules.d.mts.map +1 -1
  133. package/esm/rules/date/date-relative-rules.mjs.map +1 -1
  134. package/esm/rules/date/date-special-rules.d.mts +0 -1
  135. package/esm/rules/date/date-special-rules.d.mts.map +1 -1
  136. package/esm/rules/date/date-special-rules.mjs.map +1 -1
  137. package/esm/rules/date/date.d.mts +0 -1
  138. package/esm/rules/date/date.d.mts.map +1 -1
  139. package/esm/rules/date/date.mjs.map +1 -1
  140. package/esm/rules/date/index.d.mts +7 -0
  141. package/esm/rules/file/dimensions.d.mts +0 -1
  142. package/esm/rules/file/dimensions.d.mts.map +1 -1
  143. package/esm/rules/file/dimensions.mjs.map +1 -1
  144. package/esm/rules/file/file-size.d.mts +0 -1
  145. package/esm/rules/file/file-size.d.mts.map +1 -1
  146. package/esm/rules/file/file-size.mjs.map +1 -1
  147. package/esm/rules/file/index.d.mts +2 -0
  148. package/esm/rules/index.d.mts +45 -0
  149. package/esm/rules/length/index.d.mts +1 -0
  150. package/esm/rules/length/length-rules.d.mts +0 -1
  151. package/esm/rules/length/length-rules.d.mts.map +1 -1
  152. package/esm/rules/length/length-rules.mjs.map +1 -1
  153. package/esm/rules/number/index.d.mts +1 -0
  154. package/esm/rules/number/number-rules.d.mts +0 -1
  155. package/esm/rules/number/number-rules.d.mts.map +1 -1
  156. package/esm/rules/number/number-rules.mjs.map +1 -1
  157. package/esm/rules/scalar/accepted-rule.mjs.map +1 -1
  158. package/esm/rules/scalar/declined-rule.mjs.map +1 -1
  159. package/esm/rules/string/alpha.d.mts +0 -1
  160. package/esm/rules/string/alpha.d.mts.map +1 -1
  161. package/esm/rules/string/alpha.mjs.map +1 -1
  162. package/esm/rules/string/credit-card.d.mts +0 -1
  163. package/esm/rules/string/credit-card.d.mts.map +1 -1
  164. package/esm/rules/string/credit-card.mjs.map +1 -1
  165. package/esm/rules/string/email.d.mts +0 -1
  166. package/esm/rules/string/email.d.mts.map +1 -1
  167. package/esm/rules/string/email.mjs.map +1 -1
  168. package/esm/rules/string/id-formats.d.mts +0 -1
  169. package/esm/rules/string/id-formats.d.mts.map +1 -1
  170. package/esm/rules/string/index.d.mts +11 -0
  171. package/esm/rules/string/ip.d.mts +0 -1
  172. package/esm/rules/string/ip.d.mts.map +1 -1
  173. package/esm/rules/string/matches.d.mts +0 -1
  174. package/esm/rules/string/matches.d.mts.map +1 -1
  175. package/esm/rules/string/matches.mjs.map +1 -1
  176. package/esm/rules/string/pattern.d.mts +0 -1
  177. package/esm/rules/string/pattern.d.mts.map +1 -1
  178. package/esm/rules/string/pattern.mjs.map +1 -1
  179. package/esm/rules/string/string-comparison.d.mts +0 -1
  180. package/esm/rules/string/string-comparison.d.mts.map +1 -1
  181. package/esm/rules/string/string-comparison.mjs.map +1 -1
  182. package/esm/rules/string/strong-password-rule.d.mts +0 -1
  183. package/esm/rules/string/strong-password-rule.d.mts.map +1 -1
  184. package/esm/rules/string/strong-password-rule.mjs.map +1 -1
  185. package/esm/rules/string/url.d.mts +0 -1
  186. package/esm/rules/string/url.d.mts.map +1 -1
  187. package/esm/rules/string/url.mjs.map +1 -1
  188. package/esm/rules/string/without-whitespace.d.mts +0 -1
  189. package/esm/rules/string/without-whitespace.d.mts.map +1 -1
  190. package/esm/rules/string/without-whitespace.mjs.map +1 -1
  191. package/esm/standard-schema/index.d.mts +3 -0
  192. package/esm/standard-schema/map-result.d.mts +0 -1
  193. package/esm/standard-schema/map-result.d.mts.map +1 -1
  194. package/esm/types/date-types.mjs.map +1 -1
  195. package/esm/types/index.d.mts +10 -0
  196. package/esm/validators/any-validator.mjs.map +1 -1
  197. package/esm/validators/array-validator.d.mts.map +1 -1
  198. package/esm/validators/array-validator.mjs +1 -0
  199. package/esm/validators/array-validator.mjs.map +1 -1
  200. package/esm/validators/base-validator.d.mts +2 -1
  201. package/esm/validators/base-validator.d.mts.map +1 -1
  202. package/esm/validators/base-validator.mjs +11 -1
  203. package/esm/validators/base-validator.mjs.map +1 -1
  204. package/esm/validators/boolean-validator.d.mts.map +1 -1
  205. package/esm/validators/boolean-validator.mjs +1 -0
  206. package/esm/validators/boolean-validator.mjs.map +1 -1
  207. package/esm/validators/computed-validator.d.mts.map +1 -1
  208. package/esm/validators/date-validator.d.mts +0 -1
  209. package/esm/validators/date-validator.d.mts.map +1 -1
  210. package/esm/validators/date-validator.mjs +1 -0
  211. package/esm/validators/date-validator.mjs.map +1 -1
  212. package/esm/validators/discriminated-union-validator.d.mts.map +1 -1
  213. package/esm/validators/float-validator.mjs.map +1 -1
  214. package/esm/validators/int-validator.mjs.map +1 -1
  215. package/esm/validators/lazy-validator.d.mts.map +1 -1
  216. package/esm/validators/literal-validator.d.mts.map +1 -1
  217. package/esm/validators/literal-validator.mjs +1 -3
  218. package/esm/validators/literal-validator.mjs.map +1 -1
  219. package/esm/validators/managed-validator.d.mts.map +1 -1
  220. package/esm/validators/methods/equality-conditional-methods.d.mts +0 -1
  221. package/esm/validators/methods/equality-conditional-methods.d.mts.map +1 -1
  222. package/esm/validators/methods/equality-conditional-methods.mjs.map +1 -1
  223. package/esm/validators/methods/forbidden-methods.mjs.map +1 -1
  224. package/esm/validators/methods/present-methods.mjs.map +1 -1
  225. package/esm/validators/methods/required-methods.d.mts +0 -1
  226. package/esm/validators/methods/required-methods.d.mts.map +1 -1
  227. package/esm/validators/methods/required-methods.mjs.map +1 -1
  228. package/esm/validators/number-validator.d.mts.map +1 -1
  229. package/esm/validators/number-validator.mjs +1 -0
  230. package/esm/validators/number-validator.mjs.map +1 -1
  231. package/esm/validators/numeric-validator.mjs.map +1 -1
  232. package/esm/validators/object-validator.d.mts.map +1 -1
  233. package/esm/validators/object-validator.mjs +1 -1
  234. package/esm/validators/object-validator.mjs.map +1 -1
  235. package/esm/validators/record-validator.d.mts.map +1 -1
  236. package/esm/validators/record-validator.mjs.map +1 -1
  237. package/esm/validators/scalar-validator.d.mts.map +1 -1
  238. package/esm/validators/scalar-validator.mjs +1 -0
  239. package/esm/validators/scalar-validator.mjs.map +1 -1
  240. package/esm/validators/string-validator.mjs.map +1 -1
  241. package/esm/validators/tuple-validator.d.mts.map +1 -1
  242. package/esm/validators/tuple-validator.mjs.map +1 -1
  243. package/esm/validators/union-validator.mjs.map +1 -1
  244. package/llms-full.txt +1166 -1168
  245. package/llms.txt +1 -1
  246. package/package.json +1 -1
  247. package/skills/bridge-standard-schema/SKILL.md +138 -138
  248. package/skills/define-structural-shape/SKILL.md +138 -138
  249. package/skills/extend-seal-with-plugins/SKILL.md +178 -178
  250. package/skills/generate-json-schema/SKILL.md +143 -143
  251. package/skills/handle-seal-errors/SKILL.md +148 -148
  252. package/skills/pick-seal-primitive/SKILL.md +149 -149
  253. package/cjs/object-DPPttDAF.cjs.map +0 -1
  254. package/cjs/required-methods-DJTm7yNP.cjs.map +0 -1
  255. package/cjs/string-C_pAtZPC.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"equality-conditional-methods.mjs","names":[],"sources":["../../../../../../../../seal/src/validators/methods/equality-conditional-methods.ts"],"sourcesContent":["import { equalsFieldRule, notEqualsFieldRule } from \"../../rules\";\r\nimport { equalRule } from \"../../rules/core/equal\";\r\nimport { whenRule } from \"../../rules/core/when\";\r\nimport type { WhenRuleOptions } from \"../../types\";\r\nimport { BaseValidator } from \"../base-validator\";\r\n\r\n/**\r\n * Marker re-exported by the validators barrel so the dts bundler keeps this\r\n * module (and its `declare module` augmentation) in the bundled `.d.ts`.\r\n */\r\nexport const equalityConditionalMethodsApplied = true;\r\n\r\ndeclare module \"../base-validator\" {\r\n interface BaseValidator {\r\n /**\r\n * Value must be equal to the given value\r\n */\r\n equal(value: any, errorMessage?: string): this;\r\n\r\n /**\r\n * Value must be the same as another field's value\r\n */\r\n sameAs(field: string, errorMessage?: string): this;\r\n\r\n /**\r\n * Value must be the same as another sibling field's value\r\n */\r\n sameAsSibling(field: string, errorMessage?: string): this;\r\n\r\n /**\r\n * Value must be different from another field's value\r\n */\r\n differentFrom(field: string, errorMessage?: string): this;\r\n\r\n /**\r\n * Value must be different from another sibling field's value\r\n */\r\n differentFromSibling(field: string, errorMessage?: string): this;\r\n\r\n /**\r\n * Apply different validation rules based on another field's value (global scope)\r\n *\r\n * Use this when you need to apply completely different validators\r\n * based on another field's value (not just required/optional).\r\n *\r\n * @param field - Field name to check (can be nested with dot notation)\r\n * @param options - Validation options per field value\r\n *\r\n * @example\r\n * ```ts\r\n * // Different allowed values based on user type\r\n * v.object({\r\n * userType: v.string().in(['admin', 'user']),\r\n * role: v.string().when('userType', {\r\n * is: {\r\n * admin: v.string().in(['super', 'moderator']),\r\n * user: v.string().in(['member', 'guest'])\r\n * },\r\n * otherwise: v.string().optional()\r\n * })\r\n * })\r\n *\r\n * // Different validation rules based on type\r\n * v.object({\r\n * contactType: v.string().in(['email', 'phone']),\r\n * contact: v.string().when('contactType', {\r\n * is: {\r\n * email: v.string().email(),\r\n * phone: v.string().pattern(/^\\d{10}$/)\r\n * }\r\n * })\r\n * })\r\n * ```\r\n * @category Conditional Validation\r\n */\r\n when(field: string, options: Omit<WhenRuleOptions, \"field\" | \"scope\">): this;\r\n\r\n /**\r\n * Apply different validation rules based on sibling field's value\r\n *\r\n * Use this for nested objects where you need to check a field\r\n * within the same parent object.\r\n *\r\n * @param siblingField - Sibling field name to check\r\n * @param options - Validation options per field value\r\n *\r\n * @example\r\n * ```ts\r\n * // Array of users with role-based permissions\r\n * v.array(v.object({\r\n * userType: v.string().in(['admin', 'user']),\r\n * permissions: v.string().whenSibling('userType', {\r\n * is: {\r\n * admin: v.string().in(['read', 'write', 'delete']),\r\n * user: v.string().in(['read'])\r\n * }\r\n * })\r\n * }))\r\n * ```\r\n * @category Conditional Validation\r\n */\r\n whenSibling(siblingField: string, options: Omit<WhenRuleOptions, \"field\" | \"scope\">): this;\r\n }\r\n}\r\n\r\n/**\r\n * Value must be equal to the given value\r\n */\r\nBaseValidator.prototype.equal = function (value: any, errorMessage?: string) {\r\n return this.addRule(equalRule, errorMessage, { value });\r\n};\r\n\r\n/**\r\n * Value must be the same as another field's value\r\n */\r\nBaseValidator.prototype.sameAs = function (field: string, errorMessage?: string) {\r\n return this.addRule(equalsFieldRule, errorMessage, {\r\n field,\r\n scope: \"global\",\r\n });\r\n};\r\n\r\n/**\r\n * Value must be the same as another sibling field's value\r\n */\r\nBaseValidator.prototype.sameAsSibling = function (field: string, errorMessage?: string) {\r\n return this.addRule(equalsFieldRule, errorMessage, {\r\n field,\r\n scope: \"sibling\",\r\n });\r\n};\r\n\r\n/**\r\n * Value must be different from another field's value\r\n */\r\nBaseValidator.prototype.differentFrom = function (field: string, errorMessage?: string) {\r\n return this.addRule(notEqualsFieldRule, errorMessage, {\r\n field,\r\n scope: \"global\",\r\n });\r\n};\r\n\r\n/**\r\n * Value must be different from another sibling field's value\r\n */\r\nBaseValidator.prototype.differentFromSibling = function (field: string, errorMessage?: string) {\r\n return this.addRule(notEqualsFieldRule, errorMessage, {\r\n field,\r\n scope: \"sibling\",\r\n });\r\n};\r\n\r\n/**\r\n * Apply different validation rules based on another field's value (global scope)\r\n *\r\n * Use this when you need to apply completely different validators\r\n * based on another field's value (not just required/optional).\r\n *\r\n * @param field - Field name to check (can be nested with dot notation)\r\n * @param options - Validation options per field value\r\n *\r\n * @example\r\n * ```ts\r\n * // Different allowed values based on user type\r\n * v.object({\r\n * userType: v.string().in(['admin', 'user']),\r\n * role: v.string().when('userType', {\r\n * is: {\r\n * admin: v.string().in(['super', 'moderator']),\r\n * user: v.string().in(['member', 'guest'])\r\n * },\r\n * otherwise: v.string().optional()\r\n * })\r\n * })\r\n *\r\n * // Different validation rules based on type\r\n * v.object({\r\n * contactType: v.string().in(['email', 'phone']),\r\n * contact: v.string().when('contactType', {\r\n * is: {\r\n * email: v.string().email(),\r\n * phone: v.string().pattern(/^\\d{10}$/)\r\n * }\r\n * })\r\n * })\r\n * ```\r\n * @category Conditional Validation\r\n */\r\nBaseValidator.prototype.when = function (\r\n field: string,\r\n options: Omit<WhenRuleOptions, \"field\" | \"scope\">,\r\n) {\r\n return this.addRule(whenRule, undefined, {\r\n field,\r\n is: options.is,\r\n otherwise: options.otherwise,\r\n scope: \"global\",\r\n });\r\n};\r\n\r\n/**\r\n * Apply different validation rules based on sibling field's value\r\n *\r\n * Use this for nested objects where you need to check a field\r\n * within the same parent object.\r\n *\r\n * @param siblingField - Sibling field name to check\r\n * @param options - Validation options per field value\r\n *\r\n * @example\r\n * ```ts\r\n * // Array of users with role-based permissions\r\n * v.array(v.object({\r\n * userType: v.string().in(['admin', 'user']),\r\n * permissions: v.string().whenSibling('userType', {\r\n * is: {\r\n * admin: v.string().in(['read', 'write', 'delete']),\r\n * user: v.string().in(['read'])\r\n * }\r\n * })\r\n * }))\r\n * ```\r\n * @category Conditional Validation\r\n */\r\nBaseValidator.prototype.whenSibling = function (\r\n siblingField: string,\r\n options: Omit<WhenRuleOptions, \"field\" | \"scope\">,\r\n) {\r\n return this.addRule(whenRule, undefined, {\r\n field: siblingField,\r\n is: options.is,\r\n otherwise: options.otherwise,\r\n scope: \"sibling\",\r\n });\r\n};\r\n"],"mappings":";;;;;;;;;;;AAUA,MAAa,oCAAoC;;;;AAkGjD,cAAc,UAAU,QAAQ,SAAU,OAAY,cAAuB;CAC3E,OAAO,KAAK,QAAQ,WAAW,cAAc,EAAE,MAAM,CAAC;AACxD;;;;AAKA,cAAc,UAAU,SAAS,SAAU,OAAe,cAAuB;CAC/E,OAAO,KAAK,QAAQ,iBAAiB,cAAc;EACjD;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,gBAAgB,SAAU,OAAe,cAAuB;CACtF,OAAO,KAAK,QAAQ,iBAAiB,cAAc;EACjD;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,gBAAgB,SAAU,OAAe,cAAuB;CACtF,OAAO,KAAK,QAAQ,oBAAoB,cAAc;EACpD;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,uBAAuB,SAAU,OAAe,cAAuB;CAC7F,OAAO,KAAK,QAAQ,oBAAoB,cAAc;EACpD;EACA,OAAO;CACT,CAAC;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,cAAc,UAAU,OAAO,SAC7B,OACA,SACA;CACA,OAAO,KAAK,QAAQ,UAAU,QAAW;EACvC;EACA,IAAI,QAAQ;EACZ,WAAW,QAAQ;EACnB,OAAO;CACT,CAAC;AACH;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,cAAc,UAAU,cAAc,SACpC,cACA,SACA;CACA,OAAO,KAAK,QAAQ,UAAU,QAAW;EACvC,OAAO;EACP,IAAI,QAAQ;EACZ,WAAW,QAAQ;EACnB,OAAO;CACT,CAAC;AACH"}
1
+ {"version":3,"file":"equality-conditional-methods.mjs","names":[],"sources":["../../../../../../../../seal/src/validators/methods/equality-conditional-methods.ts"],"sourcesContent":["import { equalsFieldRule, notEqualsFieldRule } from \"../../rules\";\nimport { equalRule } from \"../../rules/core/equal\";\nimport { whenRule } from \"../../rules/core/when\";\nimport type { WhenRuleOptions } from \"../../types\";\nimport { BaseValidator } from \"../base-validator\";\n\n/**\n * Marker re-exported by the validators barrel so the dts bundler keeps this\n * module (and its `declare module` augmentation) in the bundled `.d.ts`.\n */\nexport const equalityConditionalMethodsApplied = true;\n\ndeclare module \"../base-validator\" {\n interface BaseValidator {\n /**\n * Value must be equal to the given value\n */\n equal(value: any, errorMessage?: string): this;\n\n /**\n * Value must be the same as another field's value\n */\n sameAs(field: string, errorMessage?: string): this;\n\n /**\n * Value must be the same as another sibling field's value\n */\n sameAsSibling(field: string, errorMessage?: string): this;\n\n /**\n * Value must be different from another field's value\n */\n differentFrom(field: string, errorMessage?: string): this;\n\n /**\n * Value must be different from another sibling field's value\n */\n differentFromSibling(field: string, errorMessage?: string): this;\n\n /**\n * Apply different validation rules based on another field's value (global scope)\n *\n * Use this when you need to apply completely different validators\n * based on another field's value (not just required/optional).\n *\n * @param field - Field name to check (can be nested with dot notation)\n * @param options - Validation options per field value\n *\n * @example\n * ```ts\n * // Different allowed values based on user type\n * v.object({\n * userType: v.string().in(['admin', 'user']),\n * role: v.string().when('userType', {\n * is: {\n * admin: v.string().in(['super', 'moderator']),\n * user: v.string().in(['member', 'guest'])\n * },\n * otherwise: v.string().optional()\n * })\n * })\n *\n * // Different validation rules based on type\n * v.object({\n * contactType: v.string().in(['email', 'phone']),\n * contact: v.string().when('contactType', {\n * is: {\n * email: v.string().email(),\n * phone: v.string().pattern(/^\\d{10}$/)\n * }\n * })\n * })\n * ```\n * @category Conditional Validation\n */\n when(field: string, options: Omit<WhenRuleOptions, \"field\" | \"scope\">): this;\n\n /**\n * Apply different validation rules based on sibling field's value\n *\n * Use this for nested objects where you need to check a field\n * within the same parent object.\n *\n * @param siblingField - Sibling field name to check\n * @param options - Validation options per field value\n *\n * @example\n * ```ts\n * // Array of users with role-based permissions\n * v.array(v.object({\n * userType: v.string().in(['admin', 'user']),\n * permissions: v.string().whenSibling('userType', {\n * is: {\n * admin: v.string().in(['read', 'write', 'delete']),\n * user: v.string().in(['read'])\n * }\n * })\n * }))\n * ```\n * @category Conditional Validation\n */\n whenSibling(siblingField: string, options: Omit<WhenRuleOptions, \"field\" | \"scope\">): this;\n }\n}\n\n/**\n * Value must be equal to the given value\n */\nBaseValidator.prototype.equal = function (value: any, errorMessage?: string) {\n return this.addRule(equalRule, errorMessage, { value });\n};\n\n/**\n * Value must be the same as another field's value\n */\nBaseValidator.prototype.sameAs = function (field: string, errorMessage?: string) {\n return this.addRule(equalsFieldRule, errorMessage, {\n field,\n scope: \"global\",\n });\n};\n\n/**\n * Value must be the same as another sibling field's value\n */\nBaseValidator.prototype.sameAsSibling = function (field: string, errorMessage?: string) {\n return this.addRule(equalsFieldRule, errorMessage, {\n field,\n scope: \"sibling\",\n });\n};\n\n/**\n * Value must be different from another field's value\n */\nBaseValidator.prototype.differentFrom = function (field: string, errorMessage?: string) {\n return this.addRule(notEqualsFieldRule, errorMessage, {\n field,\n scope: \"global\",\n });\n};\n\n/**\n * Value must be different from another sibling field's value\n */\nBaseValidator.prototype.differentFromSibling = function (field: string, errorMessage?: string) {\n return this.addRule(notEqualsFieldRule, errorMessage, {\n field,\n scope: \"sibling\",\n });\n};\n\n/**\n * Apply different validation rules based on another field's value (global scope)\n *\n * Use this when you need to apply completely different validators\n * based on another field's value (not just required/optional).\n *\n * @param field - Field name to check (can be nested with dot notation)\n * @param options - Validation options per field value\n *\n * @example\n * ```ts\n * // Different allowed values based on user type\n * v.object({\n * userType: v.string().in(['admin', 'user']),\n * role: v.string().when('userType', {\n * is: {\n * admin: v.string().in(['super', 'moderator']),\n * user: v.string().in(['member', 'guest'])\n * },\n * otherwise: v.string().optional()\n * })\n * })\n *\n * // Different validation rules based on type\n * v.object({\n * contactType: v.string().in(['email', 'phone']),\n * contact: v.string().when('contactType', {\n * is: {\n * email: v.string().email(),\n * phone: v.string().pattern(/^\\d{10}$/)\n * }\n * })\n * })\n * ```\n * @category Conditional Validation\n */\nBaseValidator.prototype.when = function (\n field: string,\n options: Omit<WhenRuleOptions, \"field\" | \"scope\">,\n) {\n return this.addRule(whenRule, undefined, {\n field,\n is: options.is,\n otherwise: options.otherwise,\n scope: \"global\",\n });\n};\n\n/**\n * Apply different validation rules based on sibling field's value\n *\n * Use this for nested objects where you need to check a field\n * within the same parent object.\n *\n * @param siblingField - Sibling field name to check\n * @param options - Validation options per field value\n *\n * @example\n * ```ts\n * // Array of users with role-based permissions\n * v.array(v.object({\n * userType: v.string().in(['admin', 'user']),\n * permissions: v.string().whenSibling('userType', {\n * is: {\n * admin: v.string().in(['read', 'write', 'delete']),\n * user: v.string().in(['read'])\n * }\n * })\n * }))\n * ```\n * @category Conditional Validation\n */\nBaseValidator.prototype.whenSibling = function (\n siblingField: string,\n options: Omit<WhenRuleOptions, \"field\" | \"scope\">,\n) {\n return this.addRule(whenRule, undefined, {\n field: siblingField,\n is: options.is,\n otherwise: options.otherwise,\n scope: \"sibling\",\n });\n};\n"],"mappings":";;;;;;;;;;;AAUA,MAAa,oCAAoC;;;;AAkGjD,cAAc,UAAU,QAAQ,SAAU,OAAY,cAAuB;CAC3E,OAAO,KAAK,QAAQ,WAAW,cAAc,EAAE,MAAM,CAAC;AACxD;;;;AAKA,cAAc,UAAU,SAAS,SAAU,OAAe,cAAuB;CAC/E,OAAO,KAAK,QAAQ,iBAAiB,cAAc;EACjD;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,gBAAgB,SAAU,OAAe,cAAuB;CACtF,OAAO,KAAK,QAAQ,iBAAiB,cAAc;EACjD;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,gBAAgB,SAAU,OAAe,cAAuB;CACtF,OAAO,KAAK,QAAQ,oBAAoB,cAAc;EACpD;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,uBAAuB,SAAU,OAAe,cAAuB;CAC7F,OAAO,KAAK,QAAQ,oBAAoB,cAAc;EACpD;EACA,OAAO;CACT,CAAC;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,cAAc,UAAU,OAAO,SAC7B,OACA,SACA;CACA,OAAO,KAAK,QAAQ,UAAU,QAAW;EACvC;EACA,IAAI,QAAQ;EACZ,WAAW,QAAQ;EACnB,OAAO;CACT,CAAC;AACH;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,cAAc,UAAU,cAAc,SACpC,cACA,SACA;CACA,OAAO,KAAK,QAAQ,UAAU,QAAW;EACvC,OAAO;EACP,IAAI,QAAQ;EACZ,WAAW,QAAQ;EACnB,OAAO;CACT,CAAC;AACH"}
@@ -1 +1 @@
1
- {"version":3,"file":"forbidden-methods.mjs","names":[],"sources":["../../../../../../../../seal/src/validators/methods/forbidden-methods.ts"],"sourcesContent":["import {\r\n forbiddenIfEmptyRule,\r\n forbiddenIfInRule,\r\n forbiddenIfNotEmptyRule,\r\n forbiddenIfNotInRule,\r\n forbiddenIfNotRule,\r\n forbiddenIfRule,\r\n} from \"../../rules/conditional/forbidden-if-rules\";\r\nimport { forbiddenRule } from \"../../rules/core/forbidden\";\r\nimport { BaseValidator } from \"../base-validator\";\r\n\r\n/**\r\n * Marker re-exported by the validators barrel so the dts bundler keeps this\r\n * module (and its `declare module` augmentation) in the bundled `.d.ts`.\r\n */\r\nexport const forbiddenMethodsApplied = true;\r\n\r\ndeclare module \"../base-validator\" {\r\n interface BaseValidator {\r\n /**\r\n * Value is forbidden to be present\r\n */\r\n forbidden(errorMessage?: string): this;\r\n\r\n /**\r\n * Value is forbidden if another field equals a specific value (global scope)\r\n */\r\n forbiddenIf(field: string, value: any, errorMessage?: string): this;\r\n\r\n /**\r\n * Value is forbidden if another field equals a specific value (sibling scope)\r\n */\r\n forbiddenIfSibling(field: string, value: any, errorMessage?: string): this;\r\n\r\n /**\r\n * Value is forbidden if another field does NOT equal a specific value (global scope)\r\n */\r\n forbiddenIfNot(field: string, value: any, errorMessage?: string): this;\r\n\r\n /**\r\n * Value is forbidden if another field does NOT equal a specific value (sibling scope)\r\n */\r\n forbiddenIfNotSibling(field: string, value: any, errorMessage?: string): this;\r\n\r\n /**\r\n * Value is forbidden if another field is empty (global scope)\r\n */\r\n forbiddenIfEmpty(field: string, errorMessage?: string): this;\r\n\r\n /**\r\n * Value is forbidden if another field is empty (sibling scope)\r\n */\r\n forbiddenIfEmptySibling(field: string, errorMessage?: string): this;\r\n\r\n /**\r\n * Value is forbidden if another field is not empty (global scope)\r\n */\r\n forbiddenIfNotEmpty(field: string, errorMessage?: string): this;\r\n\r\n /**\r\n * Value is forbidden if another field is not empty (sibling scope)\r\n */\r\n forbiddenIfNotEmptySibling(field: string, errorMessage?: string): this;\r\n\r\n /**\r\n * Value is forbidden if another field's value is in the given array (global scope)\r\n */\r\n forbiddenIfIn(field: string, values: any[], errorMessage?: string): this;\r\n\r\n /**\r\n * Value is forbidden if another field's value is in the given array (sibling scope)\r\n */\r\n forbiddenIfInSibling(field: string, values: any[], errorMessage?: string): this;\r\n\r\n /**\r\n * Value is forbidden if another field's value is NOT in the given array (global scope)\r\n */\r\n forbiddenIfNotIn(field: string, values: any[], errorMessage?: string): this;\r\n\r\n /**\r\n * Value is forbidden if another field's value is NOT in the given array (sibling scope)\r\n */\r\n forbiddenIfNotInSibling(field: string, values: any[], errorMessage?: string): this;\r\n }\r\n}\r\n\r\n/**\r\n * Value is forbidden to be present\r\n */\r\nBaseValidator.prototype.forbidden = function (errorMessage?: string) {\r\n return this.addRule(forbiddenRule, errorMessage);\r\n};\r\n\r\n/**\r\n * Value is forbidden if another field equals a specific value (global scope)\r\n */\r\nBaseValidator.prototype.forbiddenIf = function (field: string, value: any, errorMessage?: string) {\r\n return this.addRule(forbiddenIfRule, errorMessage, {\r\n field,\r\n value,\r\n scope: \"global\",\r\n });\r\n};\r\n\r\n/**\r\n * Value is forbidden if another field equals a specific value (sibling scope)\r\n */\r\nBaseValidator.prototype.forbiddenIfSibling = function (\r\n field: string,\r\n value: any,\r\n errorMessage?: string,\r\n) {\r\n return this.addRule(forbiddenIfRule, errorMessage, {\r\n field,\r\n value,\r\n scope: \"sibling\",\r\n });\r\n};\r\n\r\n/**\r\n * Value is forbidden if another field does NOT equal a specific value (global scope)\r\n */\r\nBaseValidator.prototype.forbiddenIfNot = function (\r\n field: string,\r\n value: any,\r\n errorMessage?: string,\r\n) {\r\n return this.addRule(forbiddenIfNotRule, errorMessage, {\r\n field,\r\n value,\r\n scope: \"global\",\r\n });\r\n};\r\n\r\n/**\r\n * Value is forbidden if another field does NOT equal a specific value (sibling scope)\r\n */\r\nBaseValidator.prototype.forbiddenIfNotSibling = function (\r\n field: string,\r\n value: any,\r\n errorMessage?: string,\r\n) {\r\n return this.addRule(forbiddenIfNotRule, errorMessage, {\r\n field,\r\n value,\r\n scope: \"sibling\",\r\n });\r\n};\r\n\r\n/**\r\n * Value is forbidden if another field is empty (global scope)\r\n */\r\nBaseValidator.prototype.forbiddenIfEmpty = function (field: string, errorMessage?: string) {\r\n return this.addRule(forbiddenIfEmptyRule, errorMessage, {\r\n field,\r\n scope: \"global\",\r\n });\r\n};\r\n\r\n/**\r\n * Value is forbidden if another field is empty (sibling scope)\r\n */\r\nBaseValidator.prototype.forbiddenIfEmptySibling = function (field: string, errorMessage?: string) {\r\n return this.addRule(forbiddenIfEmptyRule, errorMessage, {\r\n field,\r\n scope: \"sibling\",\r\n });\r\n};\r\n\r\n/**\r\n * Value is forbidden if another field is not empty (global scope)\r\n */\r\nBaseValidator.prototype.forbiddenIfNotEmpty = function (field: string, errorMessage?: string) {\r\n return this.addRule(forbiddenIfNotEmptyRule, errorMessage, {\r\n field,\r\n scope: \"global\",\r\n });\r\n};\r\n\r\n/**\r\n * Value is forbidden if another field is not empty (sibling scope)\r\n */\r\nBaseValidator.prototype.forbiddenIfNotEmptySibling = function (\r\n field: string,\r\n errorMessage?: string,\r\n) {\r\n return this.addRule(forbiddenIfNotEmptyRule, errorMessage, {\r\n field,\r\n scope: \"sibling\",\r\n });\r\n};\r\n\r\n/**\r\n * Value is forbidden if another field's value is in the given array (global scope)\r\n */\r\nBaseValidator.prototype.forbiddenIfIn = function (\r\n field: string,\r\n values: any[],\r\n errorMessage?: string,\r\n) {\r\n return this.addRule(forbiddenIfInRule, errorMessage, {\r\n field,\r\n values,\r\n scope: \"global\",\r\n });\r\n};\r\n\r\n/**\r\n * Value is forbidden if another field's value is in the given array (sibling scope)\r\n */\r\nBaseValidator.prototype.forbiddenIfInSibling = function (\r\n field: string,\r\n values: any[],\r\n errorMessage?: string,\r\n) {\r\n return this.addRule(forbiddenIfInRule, errorMessage, {\r\n field,\r\n values,\r\n scope: \"sibling\",\r\n });\r\n};\r\n\r\n/**\r\n * Value is forbidden if another field's value is NOT in the given array (global scope)\r\n */\r\nBaseValidator.prototype.forbiddenIfNotIn = function (\r\n field: string,\r\n values: any[],\r\n errorMessage?: string,\r\n) {\r\n return this.addRule(forbiddenIfNotInRule, errorMessage, {\r\n field,\r\n values,\r\n scope: \"global\",\r\n });\r\n};\r\n\r\n/**\r\n * Value is forbidden if another field's value is NOT in the given array (sibling scope)\r\n */\r\nBaseValidator.prototype.forbiddenIfNotInSibling = function (\r\n field: string,\r\n values: any[],\r\n errorMessage?: string,\r\n) {\r\n return this.addRule(forbiddenIfNot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CACA,OAAO,KAAK,QAAQ,mBAAmB,cAAc;EACnD;EACA;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,uBAAuB,SAC7C,OACA,QACA,cACA;CACA,OAAO,KAAK,QAAQ,mBAAmB,cAAc;EACnD;EACA;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,mBAAmB,SACzC,OACA,QACA,cACA;CACA,OAAO,KAAK,QAAQ,sBAAsB,cAAc;EACtD;EACA;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,0BAA0B,SAChD,OACA,QACA,cACA;CACA,OAAO,KAAK,QAAQ,sBAAsB,cAAc;EACtD;EACA;EACA,OAAO;CACT,CAAC;AACH"}
1
+ {"version":3,"file":"forbidden-methods.mjs","names":[],"sources":["../../../../../../../../seal/src/validators/methods/forbidden-methods.ts"],"sourcesContent":["import {\n forbiddenIfEmptyRule,\n forbiddenIfInRule,\n forbiddenIfNotEmptyRule,\n forbiddenIfNotInRule,\n forbiddenIfNotRule,\n forbiddenIfRule,\n} from \"../../rules/conditional/forbidden-if-rules\";\nimport { forbiddenRule } from \"../../rules/core/forbidden\";\nimport { BaseValidator } from \"../base-validator\";\n\n/**\n * Marker re-exported by the validators barrel so the dts bundler keeps this\n * module (and its `declare module` augmentation) in the bundled `.d.ts`.\n */\nexport const forbiddenMethodsApplied = true;\n\ndeclare module \"../base-validator\" {\n interface BaseValidator {\n /**\n * Value is forbidden to be present\n */\n forbidden(errorMessage?: string): this;\n\n /**\n * Value is forbidden if another field equals a specific value (global scope)\n */\n forbiddenIf(field: string, value: any, errorMessage?: string): this;\n\n /**\n * Value is forbidden if another field equals a specific value (sibling scope)\n */\n forbiddenIfSibling(field: string, value: any, errorMessage?: string): this;\n\n /**\n * Value is forbidden if another field does NOT equal a specific value (global scope)\n */\n forbiddenIfNot(field: string, value: any, errorMessage?: string): this;\n\n /**\n * Value is forbidden if another field does NOT equal a specific value (sibling scope)\n */\n forbiddenIfNotSibling(field: string, value: any, errorMessage?: string): this;\n\n /**\n * Value is forbidden if another field is empty (global scope)\n */\n forbiddenIfEmpty(field: string, errorMessage?: string): this;\n\n /**\n * Value is forbidden if another field is empty (sibling scope)\n */\n forbiddenIfEmptySibling(field: string, errorMessage?: string): this;\n\n /**\n * Value is forbidden if another field is not empty (global scope)\n */\n forbiddenIfNotEmpty(field: string, errorMessage?: string): this;\n\n /**\n * Value is forbidden if another field is not empty (sibling scope)\n */\n forbiddenIfNotEmptySibling(field: string, errorMessage?: string): this;\n\n /**\n * Value is forbidden if another field's value is in the given array (global scope)\n */\n forbiddenIfIn(field: string, values: any[], errorMessage?: string): this;\n\n /**\n * Value is forbidden if another field's value is in the given array (sibling scope)\n */\n forbiddenIfInSibling(field: string, values: any[], errorMessage?: string): this;\n\n /**\n * Value is forbidden if another field's value is NOT in the given array (global scope)\n */\n forbiddenIfNotIn(field: string, values: any[], errorMessage?: string): this;\n\n /**\n * Value is forbidden if another field's value is NOT in the given array (sibling scope)\n */\n forbiddenIfNotInSibling(field: string, values: any[], errorMessage?: string): this;\n }\n}\n\n/**\n * Value is forbidden to be present\n */\nBaseValidator.prototype.forbidden = function (errorMessage?: string) {\n return this.addRule(forbiddenRule, errorMessage);\n};\n\n/**\n * Value is forbidden if another field equals a specific value (global scope)\n */\nBaseValidator.prototype.forbiddenIf = function (field: string, value: any, errorMessage?: string) {\n return this.addRule(forbiddenIfRule, errorMessage, {\n field,\n value,\n scope: \"global\",\n });\n};\n\n/**\n * Value is forbidden if another field equals a specific value (sibling scope)\n */\nBaseValidator.prototype.forbiddenIfSibling = function (\n field: string,\n value: any,\n errorMessage?: string,\n) {\n return this.addRule(forbiddenIfRule, errorMessage, {\n field,\n value,\n scope: \"sibling\",\n });\n};\n\n/**\n * Value is forbidden if another field does NOT equal a specific value (global scope)\n */\nBaseValidator.prototype.forbiddenIfNot = function (\n field: string,\n value: any,\n errorMessage?: string,\n) {\n return this.addRule(forbiddenIfNotRule, errorMessage, {\n field,\n value,\n scope: \"global\",\n });\n};\n\n/**\n * Value is forbidden if another field does NOT equal a specific value (sibling scope)\n */\nBaseValidator.prototype.forbiddenIfNotSibling = function (\n field: string,\n value: any,\n errorMessage?: string,\n) {\n return this.addRule(forbiddenIfNotRule, errorMessage, {\n field,\n value,\n scope: \"sibling\",\n });\n};\n\n/**\n * Value is forbidden if another field is empty (global scope)\n */\nBaseValidator.prototype.forbiddenIfEmpty = function (field: string, errorMessage?: string) {\n return this.addRule(forbiddenIfEmptyRule, errorMessage, {\n field,\n scope: \"global\",\n });\n};\n\n/**\n * Value is forbidden if another field is empty (sibling scope)\n */\nBaseValidator.prototype.forbiddenIfEmptySibling = function (field: string, errorMessage?: string) {\n return this.addRule(forbiddenIfEmptyRule, errorMessage, {\n field,\n scope: \"sibling\",\n });\n};\n\n/**\n * Value is forbidden if another field is not empty (global scope)\n */\nBaseValidator.prototype.forbiddenIfNotEmpty = function (field: string, errorMessage?: string) {\n return this.addRule(forbiddenIfNotEmptyRule, errorMessage, {\n field,\n scope: \"global\",\n });\n};\n\n/**\n * Value is forbidden if another field is not empty (sibling scope)\n */\nBaseValidator.prototype.forbiddenIfNotEmptySibling = function (\n field: string,\n errorMessage?: string,\n) {\n return this.addRule(forbiddenIfNotEmptyRule, errorMessage, {\n field,\n scope: \"sibling\",\n });\n};\n\n/**\n * Value is forbidden if another field's value is in the given array (global scope)\n */\nBaseValidator.prototype.forbiddenIfIn = function (\n field: string,\n values: any[],\n errorMessage?: string,\n) {\n return this.addRule(forbiddenIfInRule, errorMessage, {\n field,\n values,\n scope: \"global\",\n });\n};\n\n/**\n * Value is forbidden if another field's value is in the given array (sibling scope)\n */\nBaseValidator.prototype.forbiddenIfInSibling = function (\n field: string,\n values: any[],\n errorMessage?: string,\n) {\n return this.addRule(forbiddenIfInRule, errorMessage, {\n field,\n values,\n scope: \"sibling\",\n });\n};\n\n/**\n * Value is forbidden if another field's value is NOT in the given array (global scope)\n */\nBaseValidator.prototype.forbiddenIfNotIn = function (\n field: string,\n values: any[],\n errorMessage?: string,\n) {\n return this.addRule(forbiddenIfNotInRule, errorMessage, {\n field,\n values,\n scope: \"global\",\n });\n};\n\n/**\n * Value is forbidden if another field's value is NOT in the given array (sibling scope)\n */\nBaseValidator.prototype.forbiddenIfNotInSibling = function (\n field: string,\n values: any[],\n errorMessage?: string,\n) {\n return this.addRule(forbiddenIfNotInRule, errorMessage, {\n field,\n values,\n scope: \"sibling\",\n });\n};\n"],"mappings":";;;;;;;;;AAeA,MAAa,0BAA0B;;;;AA0EvC,cAAc,UAAU,YAAY,SAAU,cAAuB;CACnE,OAAO,KAAK,QAAQ,eAAe,YAAY;AACjD;;;;AAKA,cAAc,UAAU,cAAc,SAAU,OAAe,OAAY,cAAuB;CAChG,OAAO,KAAK,QAAQ,iBAAiB,cAAc;EACjD;EACA;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,qBAAqB,SAC3C,OACA,OACA,cACA;CACA,OAAO,KAAK,QAAQ,iBAAiB,cAAc;EACjD;EACA;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,iBAAiB,SACvC,OACA,OACA,cACA;CACA,OAAO,KAAK,QAAQ,oBAAoB,cAAc;EACpD;EACA;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,wBAAwB,SAC9C,OACA,OACA,cACA;CACA,OAAO,KAAK,QAAQ,oBAAoB,cAAc;EACpD;EACA;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,mBAAmB,SAAU,OAAe,cAAuB;CACzF,OAAO,KAAK,QAAQ,sBAAsB,cAAc;EACtD;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,0BAA0B,SAAU,OAAe,cAAuB;CAChG,OAAO,KAAK,QAAQ,sBAAsB,cAAc;EACtD;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,sBAAsB,SAAU,OAAe,cAAuB;CAC5F,OAAO,KAAK,QAAQ,yBAAyB,cAAc;EACzD;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,6BAA6B,SACnD,OACA,cACA;CACA,OAAO,KAAK,QAAQ,yBAAyB,cAAc;EACzD;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,gBAAgB,SACtC,OACA,QACA,cACA;CACA,OAAO,KAAK,QAAQ,mBAAmB,cAAc;EACnD;EACA;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,uBAAuB,SAC7C,OACA,QACA,cACA;CACA,OAAO,KAAK,QAAQ,mBAAmB,cAAc;EACnD;EACA;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,mBAAmB,SACzC,OACA,QACA,cACA;CACA,OAAO,KAAK,QAAQ,sBAAsB,cAAc;EACtD;EACA;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,0BAA0B,SAChD,OACA,QACA,cACA;CACA,OAAO,KAAK,QAAQ,sBAAsB,cAAc;EACtD;EACA;EACA,OAAO;CACT,CAAC;AACH"}
@@ -1 +1 @@
1
- {"version":3,"file":"present-methods.mjs","names":[],"sources":["../../../../../../../../seal/src/validators/methods/present-methods.ts"],"sourcesContent":["import {\r\n presentIfEmptyRule,\r\n presentIfInRule,\r\n presentIfNotEmptyRule,\r\n presentIfNotInRule,\r\n presentIfRule,\r\n} from \"../../rules/conditional/present-if-rules\";\r\nimport { presentUnlessRule } from \"../../rules/conditional/present-unless-rules\";\r\nimport {\r\n presentWithAllRule,\r\n presentWithAnyRule,\r\n presentWithRule,\r\n} from \"../../rules/conditional/present-with-rules\";\r\nimport {\r\n presentWithoutAllRule,\r\n presentWithoutAnyRule,\r\n presentWithoutRule,\r\n} from \"../../rules/conditional/present-without-rules\";\r\nimport { BaseValidator } from \"../base-validator\";\r\n\r\n/**\r\n * Marker re-exported by the validators barrel so the dts bundler keeps this\r\n * module (and its `declare module` augmentation) in the bundled `.d.ts`.\r\n */\r\nexport const presentMethodsApplied = true;\r\n\r\ndeclare module \"../base-validator\" {\r\n interface BaseValidator {\r\n /**\r\n * Field must be present if another field exists\r\n */\r\n presentWith(field: string, errorMessage?: string): this;\r\n\r\n /**\r\n * Field must be present if another sibling field exists\r\n */\r\n presentWithSibling(field: string, errorMessage?: string): this;\r\n\r\n /**\r\n * Field must be present if another field is missing\r\n */\r\n presentWithout(field: string, errorMessage?: string): this;\r\n\r\n /**\r\n * Field must be present if another sibling field is missing\r\n */\r\n presentWithoutSibling(field: string, errorMessage?: string): this;\r\n\r\n /**\r\n * Field must be present if another field equals a specific value\r\n */\r\n presentIf(field: string, value: any, errorMessage?: string): this;\r\n\r\n /**\r\n * Field must be present if another sibling field equals a specific value\r\n */\r\n presentIfSibling(field: string, value: any, errorMessage?: string): this;\r\n\r\n /**\r\n * Field must be present unless another field equals a specific value\r\n */\r\n presentUnless(field: string, value: any, errorMessage?: string): this;\r\n\r\n /**\r\n * Field must be present unless another sibling field equals a specific value\r\n */\r\n presentUnlessSibling(field: string, value: any, errorMessage?: string): this;\r\n\r\n /**\r\n * Field must be present if another field is empty\r\n */\r\n presentIfEmpty(field: string, errorMessage?: string): this;\r\n\r\n /**\r\n * Field must be present if another sibling field is empty\r\n */\r\n presentIfEmptySibling(field: string, errorMessage?: string): this;\r\n\r\n /**\r\n * Field must be present if another field is not empty\r\n */\r\n presentIfNotEmpty(field: string, errorMessage?: string): this;\r\n\r\n /**\r\n * Field must be present if another sibling field is not empty\r\n */\r\n presentIfNotEmptySibling(field: string, errorMessage?: string): this;\r\n\r\n /**\r\n * Field must be present if another field's value is in the given array\r\n */\r\n presentIfIn(field: string, values: any[], errorMessage?: string): this;\r\n\r\n /**\r\n * Field must be present if another sibling field's value is in the given array\r\n */\r\n presentIfInSibling(field: string, values: any[], errorMessage?: string): this;\r\n\r\n /**\r\n * Field must be present if another field's value is NOT in the given array\r\n */\r\n presentIfNotIn(field: string, values: any[], errorMessage?: string): this;\r\n\r\n /**\r\n * Field must be present if another sibling field's value is NOT in the given array\r\n */\r\n presentIfNotInSibling(field: string, values: any[], errorMessage?: string): this;\r\n\r\n /**\r\n * Field must be present if all specified fields exist\r\n */\r\n presentWithAll(fields: string[], errorMessage?: string): this;\r\n\r\n /**\r\n * Field must be present if all specified sibling fields exist\r\n */\r\n presentWithAllSiblings(fields: string[], errorMessage?: string): this;\r\n\r\n /**\r\n * Field must be present if all specified fields are missing\r\n */\r\n presentWithoutAll(fields: string[], errorMessage?: string): this;\r\n\r\n /**\r\n * Field must be present if all specified sibling fields are missing\r\n */\r\n presentWithoutAllSiblings(fields: string[], errorMessage?: string): this;\r\n\r\n /**\r\n * Field must be present if any of the specified fields exists\r\n */\r\n presentWithAny(fields: string[], errorMessage?: string): this;\r\n\r\n /**\r\n * Field must be present if any of the specified sibling fields exists\r\n */\r\n presentWithAnySiblings(fields: string[], errorMessage?: string): this;\r\n\r\n /**\r\n * Field must be present if any of the specified fields is missing\r\n */\r\n presentWithoutAny(fields: string[], errorMessage?: string): this;\r\n\r\n /**\r\n * Field must be present if any of the specified sibling fields is missing\r\n */\r\n presentWithoutAnySiblings(fields: string[], errorMessage?: string): this;\r\n }\r\n}\r\n\r\n// ==================== PRESENT: BASED ON FIELD PRESENCE ====================\r\n\r\n/**\r\n * Field must be present if another field exists\r\n */\r\nBaseValidator.prototype.presentWith = function (field: string, errorMessage?: string) {\r\n return this.addRule(presentWithRule, errorMessage, {\r\n field,\r\n scope: \"global\",\r\n });\r\n};\r\n\r\n/**\r\n * Field must be present if another sibling field exists\r\n */\r\nBaseValidator.prototype.presentWithSibling = function (field: string, errorMessage?: string) {\r\n return this.addRule(presentWithRule, errorMessage, {\r\n field,\r\n scope: \"sibling\",\r\n });\r\n};\r\n\r\n/**\r\n * Field must be present if another field is missing\r\n */\r\nBaseValidator.prototype.presentWithout = function (field: string, errorMessage?: string) {\r\n return this.addRule(presentWithoutRule, errorMessage, {\r\n field,\r\n scope: \"global\",\r\n });\r\n};\r\n\r\n/**\r\n * Field must be present if another sibling field is missing\r\n */\r\nBaseValidator.prototype.presentWithoutSibling = function (field: string, errorMessage?: string) {\r\n return this.addRule(presentWithoutRule, errorMessage, {\r\n field,\r\n scope: \"sibling\",\r\n });\r\n};\r\n\r\n// ==================== PRESENT: BASED ON FIELD VALUE ====================\r\n\r\n/**\r\n * Field must be present if another field equals a specific value\r\n */\r\nBaseValidator.prototype.presentIf = function (field: string, value: any, errorMessage?: string) {\r\n return this.addRule(presentIfRule, errorMessage, {\r\n field,\r\n value,\r\n scope: \"global\",\r\n });\r\n};\r\n\r\n/**\r\n * Field must be present if another sibling field equals a specific value\r\n */\r\nBaseValidator.prototype.presentIfSibling = function (\r\n field: string,\r\n value: any,\r\n errorMessage?: string,\r\n) {\r\n return this.addRule(presentIfRule, errorMessage, {\r\n field,\r\n value,\r\n scope: \"sibling\",\r\n });\r\n};\r\n\r\n/**\r\n * Field must be present unless another field equals a specific value\r\n */\r\nBaseValidator.prototype.presentUnless = function (\r\n field: string,\r\n value: any,\r\n errorMessage?: string,\r\n) {\r\n return this.addRule(presentUnlessRule, errorMessage, {\r\n field,\r\n value,\r\n scope: \"global\",\r\n });\r\n};\r\n\r\n/**\r\n * Field must be present unless another sibling field equals a specific value\r\n */\r\nBaseValidator.prototype.presentUnlessSibling = function (\r\n field: string,\r\n value: any,\r\n errorMessage?: string,\r\n) {\r\n return this.addRule(presentUnlessRule, errorMessage, {\r\n field,\r\n value,\r\n scope: \"sibling\",\r\n });\r\n};\r\n\r\n// ==================== PRESENT: BASED ON FIELD EMPTY STATE ====================\r\n\r\n/**\r\n * Field must be present if another field is empty\r\n */\r\nBaseValidator.prototype.presentIfEmpty = function (field: string, errorMessage?: string) {\r\n return this.addRule(presentIfEmptyRule, errorMessage, {\r\n field,\r\n scope: \"global\",\r\n });\r\n};\r\n\r\n/**\r\n * Field must be present if another sibling field is empty\r\n */\r\nBaseValidator.prototype.presentIfEmptySibling = function (field: string, errorMessage?: string) {\r\n return this.addRule(presentIfEmptyRule, errorMessage, {\r\n field,\r\n scope: \"sibling\",\r\n });\r\n};\r\n\r\n/**\r\n * Field must be present if another field is not empty\r\n */\r\nBaseValidator.prototype.presentIfNotEmpty = function (field: string, errorMessage?: string) {\r\n return this.addRule(presentIfNotEmptyRule, errorMessage, {\r\n field,\r\n scope: \"global\",\r\n });\r\n};\r\n\r\n/**\r\n * Field must be present if another sibling field is not empty\r\n */\r\nBaseValidator.prototype.presentIfNotEmptySibling = function (field: string, errorMessage?: string) {\r\n return this.addRule(presentIfNotEmptyRule, errorMessage, {\r\n field,\r\n scope: \"sibling\",\r\n });\r\n};\r\n\r\n/**\r\n * Field must be present if another field's value is in the given array\r\n */\r\nBaseValidator.prototype.presentIfIn = function (\r\n field: string,\r\n values: any[],\r\n errorMessage?: string,\r\n) {\r\n return this.addRule(presentIfInRule, errorMessage, {\r\n field,\r\n values,\r\n scope: \"global\",\r\n });\r\n};\r\n\r\n/**\r\n * Field must be present if another sibling field's value is in the given array\r\n */\r\nBaseValidator.prototype.presentIfInSibling = function (\r\n field: string,\r\n values: any[],\r\n errorMessage?: string,\r\n) {\r\n return this.addRule(presentIfInRule, errorMessage, {\r\n field,\r\n values,\r\n scope: \"sibling\",\r\n });\r\n};\r\n\r\n/**\r\n * Field must be present if another field's value is NOT in the given array\r\n */\r\nBaseValidator.prototype.presentIfNotIn = function (\r\n field: string,\r\n values: any[],\r\n errorMessage?: string,\r\n) {\r\n return this.addRule(presentIfNotInRule, errorMessage, {\r\n field,\r\n values,\r\n scope: \"global\",\r\n });\r\n};\r\n\r\n/**\r\n * Field must be present if another sibling field's value is NOT in the given array\r\n */\r\nBaseValidator.prototype.presentIfNotInSibling = function (\r\n field: string,\r\n values: any[],\r\n errorMessage?: string,\r\n) {\r\n return this.addRule(presentIfNotInRule, errorMessage, {\r\n field,\r\n values,\r\n scope: \"sibling\",\r\n });\r\n};\r\n\r\n// ==================== PRESENT: BASED ON MULTIPLE FIELDS (ALL) ====================\r\n\r\n/**\r\n * Field must be present if all specified fields exist\r\n */\r\nBaseValidator.prototype.presentWithAll = function (fields: string[], errorMessage?: string) {\r\n return this.addRule(presentWithAllRule, errorMessage, {\r\n fields,\r\n scope: \"global\",\r\n });\r\n};\r\n\r\n/**\r\n * Field must be present if all specified sibling fields exist\r\n */\r\nBaseValidator.prototype.presentWithAllSiblings = function (\r\n fields: string[],\r\n errorMessage?: string,\r\n) {\r\n return this.addRule(presentWithAllRule, errorMessage, {\r\n fields,\r\n scope: \"sibling\",\r\n });\r\n};\r\n\r\n/**\r\n * Field must be present if all specified fields are missing\r\n */\r\nBaseValidator.prototype.presentWithoutAll = function (fields: string[], errorMessage?: string) {\r\n return this.addRule(presentWithoutAllRule, errorMessage, {\r\n fields,\r\n scope: \"global\",\r\n });\r\n};\r\n\r\n/**\r\n * Field must be present if all specified sibling fields are missing\r\n */\r\nBaseValidator.prototype.presentWithoutAllSiblings = function (\r\n fields: string[],\r\n errorMessage?: string,\r\n) {\r\n return this.addRule(presentWithoutAllRule, errorMessage, {\r\n fields,\r\n scope: \"sibling\",\r\n });\r\n};\r\n\r\n// ==================== PRESENT: BASED ON MULTIPLE FIELDS (ANY) ====================\r\n\r\n/**\r\n * Field must be present if any of the specified fields exists\r\n */\r\nBaseValidator.prototype.presentWithAny = function (fields: string[], errorMessage?: string) {\r\n return this.addRule(presentWithAnyRule, errorMessage, {\r\n fields,\r\n scope: \"global\",\r\n });\r\n};\r\n\r\n/**\r\n * Field must be present if any of the specified sibling fields exists\r\n */\r\nBaseValidator.prototype.presentWithAnySiblings = function (\r\n fields: string[],\r\n errorMessage?: string,\r\n) {\r\n return this.addRule(presentWithAnyRule, errorMessage, {\r\n fields,\r\n scope: \"sibling\",\r\n });\r\n};\r\n\r\n/**\r\n * Field must be present if any of the specified fields is missing\r\n */\r\nBaseValidator.prototype.presentWithoutAny = function (fields: string[], errorMessage?: string) {\r\n return this.addRule(presentWithoutAnyRule, errorMessage, {\r\n fields,\r\n scope: \"global\",\r\n });\r\n};\r\n\r\n/**\r\n * Field must be present if any of the specified sibling fields is missing\r\n */\r\nBaseValidator.prototype.presentWithoutAnySiblings = function (\r\n fields: string[],\r\n errorMessage?: string,\r\n) {\r\n return this.addRule(presentWithoutAnyRule, errorMessage, {\r\n fields,\r\n scope: \"sibling\",\r\n });\r\n};\r\n"],"mappings":";;;;;;;;;;;AAwBA,MAAa,wBAAwB;;;;AAmIrC,cAAc,UAAU,cAAc,SAAU,OAAe,cAAuB;CACpF,OAAO,KAAK,QAAQ,iBAAiB,cAAc;EACjD;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,qBAAqB,SAAU,OAAe,cAAuB;CAC3F,OAAO,KAAK,QAAQ,iBAAiB,cAAc;EACjD;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,iBAAiB,SAAU,OAAe,cAAuB;CACvF,OAAO,KAAK,QAAQ,oBAAoB,cAAc;EACpD;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,wBAAwB,SAAU,OAAe,cAAuB;CAC9F,OAAO,KAAK,QAAQ,oBAAoB,cAAc;EACpD;EACA,OAAO;CACT,CAAC;AACH;;;;AAOA,cAAc,UAAU,YAAY,SAAU,OAAe,OAAY,cAAuB;CAC9F,OAAO,KAAK,QAAQ,eAAe,cAAc;EAC/C;EACA;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,mBAAmB,SACzC,OACA,OACA,cACA;CACA,OAAO,KAAK,QAAQ,eAAe,cAAc;EAC/C;EACA;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,gBAAgB,SACtC,OACA,OACA,cACA;CACA,OAAO,KAAK,QAAQ,mBAAmB,cAAc;EACnD;EACA;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,uBAAuB,SAC7C,OACA,OACA,cACA;CACA,OAAO,KAAK,QAAQ,mBAAmB,cAAc;EACnD;EACA;EACA,OAAO;CACT,CAAC;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AC;AACH;;;;AAKA,cAAc,UAAU,oBAAoB,SAAU,QAAkB,cAAuB;CAC7F,OAAO,KAAK,QAAQ,uBAAuB,cAAc;EACvD;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,4BAA4B,SAClD,QACA,cACA;CACA,OAAO,KAAK,QAAQ,uBAAuB,cAAc;EACvD;EACA,OAAO;CACT,CAAC;AACH;;;;AAOA,cAAc,UAAU,iBAAiB,SAAU,QAAkB,cAAuB;CAC1F,OAAO,KAAK,QAAQ,oBAAoB,cAAc;EACpD;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,yBAAyB,SAC/C,QACA,cACA;CACA,OAAO,KAAK,QAAQ,oBAAoB,cAAc;EACpD;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,oBAAoB,SAAU,QAAkB,cAAuB;CAC7F,OAAO,KAAK,QAAQ,uBAAuB,cAAc;EACvD;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,4BAA4B,SAClD,QACA,cACA;CACA,OAAO,KAAK,QAAQ,uBAAuB,cAAc;EACvD;EACA,OAAO;CACT,CAAC;AACH"}
1
+ {"version":3,"file":"present-methods.mjs","names":[],"sources":["../../../../../../../../seal/src/validators/methods/present-methods.ts"],"sourcesContent":["import {\n presentIfEmptyRule,\n presentIfInRule,\n presentIfNotEmptyRule,\n presentIfNotInRule,\n presentIfRule,\n} from \"../../rules/conditional/present-if-rules\";\nimport { presentUnlessRule } from \"../../rules/conditional/present-unless-rules\";\nimport {\n presentWithAllRule,\n presentWithAnyRule,\n presentWithRule,\n} from \"../../rules/conditional/present-with-rules\";\nimport {\n presentWithoutAllRule,\n presentWithoutAnyRule,\n presentWithoutRule,\n} from \"../../rules/conditional/present-without-rules\";\nimport { BaseValidator } from \"../base-validator\";\n\n/**\n * Marker re-exported by the validators barrel so the dts bundler keeps this\n * module (and its `declare module` augmentation) in the bundled `.d.ts`.\n */\nexport const presentMethodsApplied = true;\n\ndeclare module \"../base-validator\" {\n interface BaseValidator {\n /**\n * Field must be present if another field exists\n */\n presentWith(field: string, errorMessage?: string): this;\n\n /**\n * Field must be present if another sibling field exists\n */\n presentWithSibling(field: string, errorMessage?: string): this;\n\n /**\n * Field must be present if another field is missing\n */\n presentWithout(field: string, errorMessage?: string): this;\n\n /**\n * Field must be present if another sibling field is missing\n */\n presentWithoutSibling(field: string, errorMessage?: string): this;\n\n /**\n * Field must be present if another field equals a specific value\n */\n presentIf(field: string, value: any, errorMessage?: string): this;\n\n /**\n * Field must be present if another sibling field equals a specific value\n */\n presentIfSibling(field: string, value: any, errorMessage?: string): this;\n\n /**\n * Field must be present unless another field equals a specific value\n */\n presentUnless(field: string, value: any, errorMessage?: string): this;\n\n /**\n * Field must be present unless another sibling field equals a specific value\n */\n presentUnlessSibling(field: string, value: any, errorMessage?: string): this;\n\n /**\n * Field must be present if another field is empty\n */\n presentIfEmpty(field: string, errorMessage?: string): this;\n\n /**\n * Field must be present if another sibling field is empty\n */\n presentIfEmptySibling(field: string, errorMessage?: string): this;\n\n /**\n * Field must be present if another field is not empty\n */\n presentIfNotEmpty(field: string, errorMessage?: string): this;\n\n /**\n * Field must be present if another sibling field is not empty\n */\n presentIfNotEmptySibling(field: string, errorMessage?: string): this;\n\n /**\n * Field must be present if another field's value is in the given array\n */\n presentIfIn(field: string, values: any[], errorMessage?: string): this;\n\n /**\n * Field must be present if another sibling field's value is in the given array\n */\n presentIfInSibling(field: string, values: any[], errorMessage?: string): this;\n\n /**\n * Field must be present if another field's value is NOT in the given array\n */\n presentIfNotIn(field: string, values: any[], errorMessage?: string): this;\n\n /**\n * Field must be present if another sibling field's value is NOT in the given array\n */\n presentIfNotInSibling(field: string, values: any[], errorMessage?: string): this;\n\n /**\n * Field must be present if all specified fields exist\n */\n presentWithAll(fields: string[], errorMessage?: string): this;\n\n /**\n * Field must be present if all specified sibling fields exist\n */\n presentWithAllSiblings(fields: string[], errorMessage?: string): this;\n\n /**\n * Field must be present if all specified fields are missing\n */\n presentWithoutAll(fields: string[], errorMessage?: string): this;\n\n /**\n * Field must be present if all specified sibling fields are missing\n */\n presentWithoutAllSiblings(fields: string[], errorMessage?: string): this;\n\n /**\n * Field must be present if any of the specified fields exists\n */\n presentWithAny(fields: string[], errorMessage?: string): this;\n\n /**\n * Field must be present if any of the specified sibling fields exists\n */\n presentWithAnySiblings(fields: string[], errorMessage?: string): this;\n\n /**\n * Field must be present if any of the specified fields is missing\n */\n presentWithoutAny(fields: string[], errorMessage?: string): this;\n\n /**\n * Field must be present if any of the specified sibling fields is missing\n */\n presentWithoutAnySiblings(fields: string[], errorMessage?: string): this;\n }\n}\n\n// ==================== PRESENT: BASED ON FIELD PRESENCE ====================\n\n/**\n * Field must be present if another field exists\n */\nBaseValidator.prototype.presentWith = function (field: string, errorMessage?: string) {\n return this.addRule(presentWithRule, errorMessage, {\n field,\n scope: \"global\",\n });\n};\n\n/**\n * Field must be present if another sibling field exists\n */\nBaseValidator.prototype.presentWithSibling = function (field: string, errorMessage?: string) {\n return this.addRule(presentWithRule, errorMessage, {\n field,\n scope: \"sibling\",\n });\n};\n\n/**\n * Field must be present if another field is missing\n */\nBaseValidator.prototype.presentWithout = function (field: string, errorMessage?: string) {\n return this.addRule(presentWithoutRule, errorMessage, {\n field,\n scope: \"global\",\n });\n};\n\n/**\n * Field must be present if another sibling field is missing\n */\nBaseValidator.prototype.presentWithoutSibling = function (field: string, errorMessage?: string) {\n return this.addRule(presentWithoutRule, errorMessage, {\n field,\n scope: \"sibling\",\n });\n};\n\n// ==================== PRESENT: BASED ON FIELD VALUE ====================\n\n/**\n * Field must be present if another field equals a specific value\n */\nBaseValidator.prototype.presentIf = function (field: string, value: any, errorMessage?: string) {\n return this.addRule(presentIfRule, errorMessage, {\n field,\n value,\n scope: \"global\",\n });\n};\n\n/**\n * Field must be present if another sibling field equals a specific value\n */\nBaseValidator.prototype.presentIfSibling = function (\n field: string,\n value: any,\n errorMessage?: string,\n) {\n return this.addRule(presentIfRule, errorMessage, {\n field,\n value,\n scope: \"sibling\",\n });\n};\n\n/**\n * Field must be present unless another field equals a specific value\n */\nBaseValidator.prototype.presentUnless = function (\n field: string,\n value: any,\n errorMessage?: string,\n) {\n return this.addRule(presentUnlessRule, errorMessage, {\n field,\n value,\n scope: \"global\",\n });\n};\n\n/**\n * Field must be present unless another sibling field equals a specific value\n */\nBaseValidator.prototype.presentUnlessSibling = function (\n field: string,\n value: any,\n errorMessage?: string,\n) {\n return this.addRule(presentUnlessRule, errorMessage, {\n field,\n value,\n scope: \"sibling\",\n });\n};\n\n// ==================== PRESENT: BASED ON FIELD EMPTY STATE ====================\n\n/**\n * Field must be present if another field is empty\n */\nBaseValidator.prototype.presentIfEmpty = function (field: string, errorMessage?: string) {\n return this.addRule(presentIfEmptyRule, errorMessage, {\n field,\n scope: \"global\",\n });\n};\n\n/**\n * Field must be present if another sibling field is empty\n */\nBaseValidator.prototype.presentIfEmptySibling = function (field: string, errorMessage?: string) {\n return this.addRule(presentIfEmptyRule, errorMessage, {\n field,\n scope: \"sibling\",\n });\n};\n\n/**\n * Field must be present if another field is not empty\n */\nBaseValidator.prototype.presentIfNotEmpty = function (field: string, errorMessage?: string) {\n return this.addRule(presentIfNotEmptyRule, errorMessage, {\n field,\n scope: \"global\",\n });\n};\n\n/**\n * Field must be present if another sibling field is not empty\n */\nBaseValidator.prototype.presentIfNotEmptySibling = function (field: string, errorMessage?: string) {\n return this.addRule(presentIfNotEmptyRule, errorMessage, {\n field,\n scope: \"sibling\",\n });\n};\n\n/**\n * Field must be present if another field's value is in the given array\n */\nBaseValidator.prototype.presentIfIn = function (\n field: string,\n values: any[],\n errorMessage?: string,\n) {\n return this.addRule(presentIfInRule, errorMessage, {\n field,\n values,\n scope: \"global\",\n });\n};\n\n/**\n * Field must be present if another sibling field's value is in the given array\n */\nBaseValidator.prototype.presentIfInSibling = function (\n field: string,\n values: any[],\n errorMessage?: string,\n) {\n return this.addRule(presentIfInRule, errorMessage, {\n field,\n values,\n scope: \"sibling\",\n });\n};\n\n/**\n * Field must be present if another field's value is NOT in the given array\n */\nBaseValidator.prototype.presentIfNotIn = function (\n field: string,\n values: any[],\n errorMessage?: string,\n) {\n return this.addRule(presentIfNotInRule, errorMessage, {\n field,\n values,\n scope: \"global\",\n });\n};\n\n/**\n * Field must be present if another sibling field's value is NOT in the given array\n */\nBaseValidator.prototype.presentIfNotInSibling = function (\n field: string,\n values: any[],\n errorMessage?: string,\n) {\n return this.addRule(presentIfNotInRule, errorMessage, {\n field,\n values,\n scope: \"sibling\",\n });\n};\n\n// ==================== PRESENT: BASED ON MULTIPLE FIELDS (ALL) ====================\n\n/**\n * Field must be present if all specified fields exist\n */\nBaseValidator.prototype.presentWithAll = function (fields: string[], errorMessage?: string) {\n return this.addRule(presentWithAllRule, errorMessage, {\n fields,\n scope: \"global\",\n });\n};\n\n/**\n * Field must be present if all specified sibling fields exist\n */\nBaseValidator.prototype.presentWithAllSiblings = function (\n fields: string[],\n errorMessage?: string,\n) {\n return this.addRule(presentWithAllRule, errorMessage, {\n fields,\n scope: \"sibling\",\n });\n};\n\n/**\n * Field must be present if all specified fields are missing\n */\nBaseValidator.prototype.presentWithoutAll = function (fields: string[], errorMessage?: string) {\n return this.addRule(presentWithoutAllRule, errorMessage, {\n fields,\n scope: \"global\",\n });\n};\n\n/**\n * Field must be present if all specified sibling fields are missing\n */\nBaseValidator.prototype.presentWithoutAllSiblings = function (\n fields: string[],\n errorMessage?: string,\n) {\n return this.addRule(presentWithoutAllRule, errorMessage, {\n fields,\n scope: \"sibling\",\n });\n};\n\n// ==================== PRESENT: BASED ON MULTIPLE FIELDS (ANY) ====================\n\n/**\n * Field must be present if any of the specified fields exists\n */\nBaseValidator.prototype.presentWithAny = function (fields: string[], errorMessage?: string) {\n return this.addRule(presentWithAnyRule, errorMessage, {\n fields,\n scope: \"global\",\n });\n};\n\n/**\n * Field must be present if any of the specified sibling fields exists\n */\nBaseValidator.prototype.presentWithAnySiblings = function (\n fields: string[],\n errorMessage?: string,\n) {\n return this.addRule(presentWithAnyRule, errorMessage, {\n fields,\n scope: \"sibling\",\n });\n};\n\n/**\n * Field must be present if any of the specified fields is missing\n */\nBaseValidator.prototype.presentWithoutAny = function (fields: string[], errorMessage?: string) {\n return this.addRule(presentWithoutAnyRule, errorMessage, {\n fields,\n scope: \"global\",\n });\n};\n\n/**\n * Field must be present if any of the specified sibling fields is missing\n */\nBaseValidator.prototype.presentWithoutAnySiblings = function (\n fields: string[],\n errorMessage?: string,\n) {\n return this.addRule(presentWithoutAnyRule, errorMessage, {\n fields,\n scope: \"sibling\",\n });\n};\n"],"mappings":";;;;;;;;;;;AAwBA,MAAa,wBAAwB;;;;AAmIrC,cAAc,UAAU,cAAc,SAAU,OAAe,cAAuB;CACpF,OAAO,KAAK,QAAQ,iBAAiB,cAAc;EACjD;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,qBAAqB,SAAU,OAAe,cAAuB;CAC3F,OAAO,KAAK,QAAQ,iBAAiB,cAAc;EACjD;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,iBAAiB,SAAU,OAAe,cAAuB;CACvF,OAAO,KAAK,QAAQ,oBAAoB,cAAc;EACpD;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,wBAAwB,SAAU,OAAe,cAAuB;CAC9F,OAAO,KAAK,QAAQ,oBAAoB,cAAc;EACpD;EACA,OAAO;CACT,CAAC;AACH;;;;AAOA,cAAc,UAAU,YAAY,SAAU,OAAe,OAAY,cAAuB;CAC9F,OAAO,KAAK,QAAQ,eAAe,cAAc;EAC/C;EACA;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,mBAAmB,SACzC,OACA,OACA,cACA;CACA,OAAO,KAAK,QAAQ,eAAe,cAAc;EAC/C;EACA;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,gBAAgB,SACtC,OACA,OACA,cACA;CACA,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kB,cAAuB;CAC1F,OAAO,KAAK,QAAQ,oBAAoB,cAAc;EACpD;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,yBAAyB,SAC/C,QACA,cACA;CACA,OAAO,KAAK,QAAQ,oBAAoB,cAAc;EACpD;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,oBAAoB,SAAU,QAAkB,cAAuB;CAC7F,OAAO,KAAK,QAAQ,uBAAuB,cAAc;EACvD;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,4BAA4B,SAClD,QACA,cACA;CACA,OAAO,KAAK,QAAQ,uBAAuB,cAAc;EACvD;EACA,OAAO;CACT,CAAC;AACH;;;;AAOA,cAAc,UAAU,iBAAiB,SAAU,QAAkB,cAAuB;CAC1F,OAAO,KAAK,QAAQ,oBAAoB,cAAc;EACpD;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,yBAAyB,SAC/C,QACA,cACA;CACA,OAAO,KAAK,QAAQ,oBAAoB,cAAc;EACpD;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,oBAAoB,SAAU,QAAkB,cAAuB;CAC7F,OAAO,KAAK,QAAQ,uBAAuB,cAAc;EACvD;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,4BAA4B,SAClD,QACA,cACA;CACA,OAAO,KAAK,QAAQ,uBAAuB,cAAc;EACvD;EACA,OAAO;CACT,CAAC;AACH"}
@@ -1,5 +1,4 @@
1
1
  import { SchemaContext } from "../../types/context-types.mjs";
2
-
3
2
  //#region ../seal/src/validators/methods/required-methods.d.ts
4
3
  /**
5
4
  * Marker re-exported by the validators barrel so the dts bundler keeps this
@@ -1 +1 @@
1
- {"version":3,"file":"required-methods.d.mts","names":[],"sources":["../../../../../../../../seal/src/validators/methods/required-methods.ts"],"mappings":";;;;;AAiCA;;;;cAAa,sBAAA;AAAA;EAAA,UAGD,aAAA;IAyNc;;;IArN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kB,YAAA;;;;IAKrC,0BAAA,CAA2B,MAAA,YAAkB,YAAA;;;;IAK7C,eAAA,CAAgB,MAAA,YAAkB,YAAA;;;;IAKlC,uBAAA,CAAwB,MAAA,YAAkB,YAAA;;;;IAK1C,kBAAA,CAAmB,MAAA,YAAkB,YAAA;;;;IAKrC,0BAAA,CAA2B,MAAA,YAAkB,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;IA0B7C,YAAA,CACE,QAAA,GAAW,OAAA,EAAS,aAAA,eAA4B,OAAO,WACvD,YAAA;EAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"required-methods.mjs","names":[],"sources":["../../../../../../../../seal/src/validators/methods/required-methods.ts"],"sourcesContent":["import {\r\n requiredIfAllEmptyRule,\r\n requiredIfAllNotEmptyRule,\r\n requiredIfAnyEmptyRule,\r\n requiredIfAnyNotEmptyRule,\r\n requiredIfEmptyRule,\r\n requiredIfInRule,\r\n requiredIfNotEmptyRule,\r\n requiredIfNotInRule,\r\n requiredIfRule,\r\n} from \"../../rules/conditional/required-if-rules\";\r\nimport { requiredUnlessRule } from \"../../rules/conditional/required-unless-rules\";\r\nimport { requiredWhenRule } from \"../../rules/conditional/required-when-rule\";\r\nimport {\r\n requiredWithAllRule,\r\n requiredWithAnyRule,\r\n requiredWithRule,\r\n} from \"../../rules/conditional/required-with-rules\";\r\nimport {\r\n requiredWithoutAllRule,\r\n requiredWithoutAnyRule,\r\n requiredWithoutRule,\r\n} from \"../../rules/conditional/required-without-rules\";\r\nimport { presentRule, requiredRule } from \"../../rules/core/required\";\r\nimport type { SchemaContext } from \"../../types\";\r\nimport { BaseValidator } from \"../base-validator\";\r\n\r\n/**\r\n * Marker re-exported by the validators barrel so the dts bundler keeps this\r\n * module (and its `declare module` augmentation) in the bundled `.d.ts`.\r\n * Without a real export, side-effect-only augmentation modules get tree-shaken\r\n * out of the published types, dropping every chainable rule method.\r\n */\r\nexport const requiredMethodsApplied = true;\r\n\r\ndeclare module \"../base-validator\" {\r\n interface BaseValidator {\r\n /**\r\n * This value must be present and has a value\r\n */\r\n required(errorMessage?: string): this;\r\n\r\n /**\r\n * Value must be present but not necessarily has a value\r\n */\r\n present(errorMessage?: string): this;\r\n\r\n /**\r\n * Mark the field as optional, so pass it if it has no value or has a value\r\n * Because this is the default behavior, this method is just syntactic sugar\r\n */\r\n optional(): this & { isOptional: true };\r\n\r\n /**\r\n * Sugar for `.optional().nullable()` — the field may be absent OR null.\r\n *\r\n * Brands the return type with both `{ isOptional: true }` and `{ isNullable: true }`\r\n * so `Infer<>` produces `{ field?: T | null }`.\r\n *\r\n * @example\r\n * v.string().nullish()\r\n * // type: string | null | undefined\r\n * // absent → key omitted\r\n * // null → null\r\n * // \"x\" → \"x\"\r\n */\r\n nullish(): this & { isOptional: true; isNullable: true };\r\n\r\n /**\r\n * Value is required if another field exists\r\n */\r\n requiredWith(field: string, errorMessage?: string): this;\r\n\r\n /**\r\n * Value is required if another sibling field exists\r\n */\r\n requiredWithSibling(field: string, errorMessage?: string): this;\r\n\r\n /**\r\n * Value is required if another field is missing\r\n */\r\n requiredWithout(field: string, errorMessage?: string): this;\r\n\r\n /**\r\n * Value is required if another sibling field is missing\r\n */\r\n requiredWithoutSibling(field: string, errorMessage?: string): this;\r\n\r\n /**\r\n * Value is required if another field equals a specific value\r\n */\r\n requiredIf(field: string, value: any, errorMessage?: string): this;\r\n\r\n /**\r\n * Value is required if another sibling field equals a specific value\r\n */\r\n requiredIfSibling(field: string, value: any, errorMessage?: string): this;\r\n\r\n /**\r\n * Value is required unless another field equals a specific value\r\n */\r\n requiredUnless(field: string, value: any, errorMessage?: string): this;\r\n\r\n /**\r\n * Value is required unless another sibling field equals a specific value\r\n */\r\n requiredUnlessSibling(field: string, value: any, errorMessage?: string): this;\r\n\r\n /**\r\n * Value is required if another field is empty\r\n */\r\n requiredIfEmpty(field: string, errorMessage?: string): this;\r\n\r\n /**\r\n * Value is required if another sibling field is empty\r\n */\r\n requiredIfEmptySibling(field: string, errorMessage?: string): this;\r\n\r\n /**\r\n * Value is required if another field is not empty\r\n */\r\n requiredIfNotEmpty(field: string, errorMessage?: string): this;\r\n\r\n /**\r\n * Value is required if another sibling field is not empty\r\n */\r\n requiredIfNotEmptySibling(field: string, errorMessage?: string): this;\r\n\r\n /**\r\n * Value is required if ALL specified fields are empty\r\n */\r\n requiredIfAllEmpty(fields: string[], errorMessage?: string): this;\r\n\r\n /**\r\n * Value is required if ALL specified sibling fields are empty\r\n */\r\n requiredIfAllEmptySiblings(fields: string[], errorMessage?: string): this;\r\n\r\n /**\r\n * Value is required if ANY of the specified fields is empty\r\n */\r\n requiredIfAnyEmpty(fields: string[], errorMessage?: string): this;\r\n\r\n /**\r\n * Value is required if ANY of the specified sibling fields is empty\r\n */\r\n requiredIfAnyEmptySiblings(fields: string[], errorMessage?: string): this;\r\n\r\n /**\r\n * Value is required if ALL specified fields are NOT empty\r\n */\r\n requiredIfAllNotEmpty(fields: string[], errorMessage?: string): this;\r\n\r\n /**\r\n * Value is required if ALL specified sibling fields are NOT empty\r\n */\r\n requiredIfAllNotEmptySiblings(fields: string[], errorMessage?: string): this;\r\n\r\n /**\r\n * Value is required if ANY of the specified fields is NOT empty\r\n */\r\n requiredIfAnyNotEmpty(fields: string[], errorMessage?: string): this;\r\n\r\n /**\r\n * Value is required if ANY of the specified sibling fields is NOT empty\r\n */\r\n requiredIfAnyNotEmptySiblings(fields: string[], errorMessage?: string): this;\r\n\r\n /**\r\n * Value is required if another field's value is in the given array\r\n */\r\n requiredIfIn(field: string, values: any[], errorMessage?: string): this;\r\n\r\n /**\r\n * Value is required if another sibling field's value is in the given array\r\n */\r\n requiredIfInSibling(field: string, values: any[], errorMessage?: string): this;\r\n\r\n /**\r\n * Value is required if another field's value is NOT in the given array\r\n */\r\n requiredIfNotIn(field: string, values: any[], errorMessage?: string): this;\r\n\r\n /**\r\n * Value is required if another sibling field's value is NOT in the given array\r\n */\r\n requiredIfNotInSibling(field: string, values: any[], errorMessage?: string): this;\r\n\r\n /**\r\n * Value is required if all specified fields exist\r\n */\r\n requiredWithAll(fields: string[], errorMessage?: string): this;\r\n\r\n /**\r\n * Value is required if all specified sibling fields exist\r\n */\r\n requiredWithAllSiblings(fields: string[], errorMessage?: string): this;\r\n\r\n /**\r\n * Value is required if all specified fields are missing\r\n */\r\n requiredWithoutAll(fields: string[], errorMessage?: string): this;\r\n\r\n /**\r\n * Value is required if all specified sibling fields are missing\r\n */\r\n requiredWithoutAllSiblings(fields: string[], errorMessage?: string): this;\r\n\r\n /**\r\n * Value is required if any of the specified fields exists\r\n */\r\n requiredWithAny(fields: string[], errorMessage?: string): this;\r\n\r\n /**\r\n * Value is required if any of the specified sibling fields exists\r\n */\r\n requiredWithAnySiblings(fields: string[], errorMessage?: string): this;\r\n\r\n /**\r\n * Value is required if any of the specified fields is missing\r\n */\r\n requiredWithoutAny(fields: string[], errorMessage?: string): this;\r\n\r\n /**\r\n * Value is required if any of the specified sibling fields is missing\r\n */\r\n requiredWithoutAnySiblings(fields: string[], errorMessage?: string): this;\r\n\r\n /**\r\n * Make this field required based on a custom callback.\r\n *\r\n * The callback receives only the `SchemaContext` (not the value),\r\n * because \"required\" is about surrounding conditions, not the field itself.\r\n * Return `true` if the field should be required.\r\n *\r\n * @param callback - Receives SchemaContext, returns boolean\r\n * @param errorMessage - Optional custom error message\r\n *\r\n * @example\r\n * ```ts\r\n * // Required when email notification is enabled\r\n * v.string().requiredWhen((context) => {\r\n * return context.allData.notificationMethod === 'email';\r\n * })\r\n *\r\n * // Required based on multiple conditions\r\n * v.string().requiredWhen((context) => {\r\n * const { role, department } = context.allData;\r\n * return role === 'manager' && department === 'finance';\r\n * })\r\n * ```\r\n */\r\n requiredWhen(\r\n callback: (context: SchemaContext) => boolean | Promise<boolean>,\r\n errorMessage?: string,\r\n ): this;\r\n }\r\n}\r\n\r\n// ==================== UNCONDITIONAL STATES ====================\r\n\r\n/**\r\n * This value must be present and has a value\r\n */\r\nBaseValidator.prototype.required = function (errorMessage?: string) {\r\n return this.setRequiredRule(requiredRule, errorMessage);\r\n};\r\n\r\n/**\r\n * Value must be present but not necessarily has a value\r\n */\r\nBaseValidator.prototype.present = function (errorMessage?: string) {\r\n return this.setRequiredRule(presentRule, errorMessage);\r\n};\r\n\r\n/**\r\n * Mark the field as optional — it may be absent or empty without validation errors.\r\n * Clears any previously set required rule.\r\n *\r\n * The return type is branded with `{ isOptional: true }` so schema inference\r\n * can mark this key as optional in the inferred TypeScript type.\r\n */\r\nBaseValidator.prototype.optional = function (): BaseValidator & { isOptional: true } {\r\n const instance = this.instance;\r\n instance.isOptional = true;\r\n instance.requiredRule = null;\r\n return instance as BaseValidator & { isOptional: true };\r\n};\r\n\r\n/**\r\n * Sugar — equivalent to `.optional().nullable()`.\r\n */\r\nBaseValidator.prototype.nullish = function (): BaseValidator & {\r\n isOptional: true;\r\n isNullable: true;\r\n} {\r\n const instance = this.optional().nullable();\r\n return instance as BaseValidator & { isOptional: true; isNullable: true };\r\n};\r\n\r\n// ==================== REQUIRED: BASED ON FIELD PRESENCE ====================\r\n\r\n/**\r\n * Value is required if another field exists\r\n */\r\nBaseValidator.prototype.requiredWith = function (field: string, errorMessage?: string) {\r\n return this.setRequiredRule(requiredWithRule, errorMessage, { field, scope: \"global\" });\r\n};\r\n\r\n/**\r\n * Value is required if another sibling field exists\r\n */\r\nBaseValidator.prototype.requiredWithSibling = function (field: string, errorMessage?: string) {\r\n return this.setRequiredRule(requiredWithRule, errorMessage, { field, scope: \"sibling\" });\r\n};\r\n\r\n/**\r\n * Value is required if another field is missing\r\n */\r\nBaseValidator.prototype.requiredWithout = function (field: string, errorMessage?: string) {\r\n return this.setRequiredRule(requiredWithoutRule, errorMessage, { field, scope: \"global\" });\r\n};\r\n\r\n/**\r\n * Value is required if another sibling field is missing\r\n */\r\nBaseValidator.prototype.requiredWithoutSibling = function (field: string, errorMessage?: string) {\r\n return this.setRequiredRule(requiredWithoutRule, errorMessage, { field, scope: \"sibling\" });\r\n};\r\n\r\n// ==================== REQUIRED: BASED ON FIELD VALUE ====================\r\n\r\n/**\r\n * Value is required if another field equals a specific value\r\n */\r\nBaseValidator.prototype.requiredIf = function (field: string, value: any, errorMessage?: string) {\r\n return this.setRequiredRule(requiredIfRule, errorMessage, { field, value, scope: \"global\" });\r\n};\r\n\r\n/**\r\n * Value is required if another sibling field equals a specific value\r\n */\r\nBaseValidator.prototype.requiredIfSibling = function (\r\n field: string,\r\n value: any,\r\n errorMessage?: string,\r\n) {\r\n return this.setRequiredRule(requiredIfRule, errorMessage, { field, value, scope: \"sibling\" });\r\n};\r\n\r\n/**\r\n * Value is required unless another field equals a specific value\r\n */\r\nBaseValidator.prototype.requiredUnless = function (\r\n field: string,\r\n value: any,\r\n errorMessage?: string,\r\n) {\r\n return this.setRequiredRule(requiredUnlessRule, errorMessage, { field, value, scope: \"global\" });\r\n};\r\n\r\n/**\r\n * Value is required unless another sibling field equals a specific value\r\n */\r\nBaseValidator.prototype.requiredUnlessSibling = function (\r\n field: string,\r\n value: any,\r\n errorMessage?: string,\r\n) {\r\n return this.setRequiredRule(requiredUnlessRule, errorMessage, { field, value, scope: \"sibling\" });\r\n};\r\n\r\n// ==================== REQUIRED: BASED ON FIELD EMPTY STATE ====================\r\n\r\n/**\r\n * Value is required if another field is empty\r\n */\r\nBaseValidator.prototype.requiredIfEmpty = function (field: string, errorMessage?: string) {\r\n return this.setRequiredRule(requiredIfEmptyRule, errorMessage, { field, scope: \"global\" });\r\n};\r\n\r\n/**\r\n * Value is required if another sibling field is empty\r\n */\r\nBaseValidator.prototype.requiredIfEmptySibling = function (field: string, errorMessage?: string) {\r\n return this.setRequiredRule(requiredIfEmptyRule, errorMessage, { field, scope: \"sibling\" });\r\n};\r\n\r\n/**\r\n * Value is required if another field is not empty\r\n */\r\nBaseValidator.prototype.requiredIfNotEmpty = function (field: string, errorMessage?: string) {\r\n return this.setRequiredRule(requiredIfNotEmptyRule, errorMessage, { field, scope: \"global\" });\r\n};\r\n\r\n/**\r\n * Value is required if another sibling field is not empty\r\n */\r\nBaseValidator.prototype.requiredIfNotEmptySibling = function (\r\n field: string,\r\n errorMessage?: string,\r\n) {\r\n return this.setRequiredRule(requiredIfNotEmptyRule, errorMessage, { field, scope: \"sibling\" });\r\n};\r\n\r\n// ==================== REQUIRED: BASED ON MULTIPLE FIELDS EMPTY STATE ====================\r\n\r\n/**\r\n * Value is required if ALL specified fields are empty\r\n */\r\nBaseValidator.prototype.requiredIfAllEmpty = function (fields: string[], errorMessage?: string) {\r\n return this.setRequiredRule(requiredIfAllEmptyRule, errorMessage, { fields, scope: \"global\" });\r\n};\r\n\r\n/**\r\n * Value is required if ALL specified sibling fields are empty\r\n */\r\nBaseValidator.prototype.requiredIfAllEmptySiblings = function (\r\n fields: string[],\r\n errorMessage?: string,\r\n) {\r\n return this.setRequiredRule(requiredIfAllEmptyRule, errorMessage, { fields, scope: \"sibling\" });\r\n};\r\n\r\n/**\r\n * Value is required if ANY of the specified fields is empty\r\n */\r\nBaseValidator.prototype.requiredIfAnyEmpty = function (fields: string[], errorMessage?: string) {\r\n return this.setRequiredRule(requiredIfAnyEmptyRule, errorMessage, { fields, scope: \"global\" });\r\n};\r\n\r\n/**\r\n * Value is required if ANY of the specified sibling fields is empty\r\n */\r\nBaseValidator.prototype.requiredIfAnyEmptySiblings = function (\r\n fields: string[],\r\n errorMessage?: string,\r\n) {\r\n return this.setRequiredRule(requiredIfAnyEmptyRule, errorMessage, { fields, scope: \"sibling\" });\r\n};\r\n\r\n/**\r\n * Value is required if ALL specified fields are NOT empty\r\n */\r\nBaseValidator.prototype.requiredIfAllNotEmpty = function (fields: string[], errorMessage?: string) {\r\n return this.setRequiredRule(requiredIfAllNotEmptyRule, errorMessage, { fields, scope: \"global\" });\r\n};\r\n\r\n/**\r\n * Value is required if ALL specified sibling fields are NOT empty\r\n */\r\nBaseValidator.prototype.requiredIfAllNotEmptySiblings = function (\r\n fields: string[],\r\n errorMessage?: string,\r\n) {\r\n return this.setRequiredRule(requiredIfAllNotEmptyRule, errorMessage, {\r\n fields,\r\n scope: \"sibling\",\r\n });\r\n};\r\n\r\n/**\r\n * Value is required if ANY of the specified fields is NOT empty\r\n */\r\nBaseValidator.prototype.requiredIfAnyNotEmpty = function (fields: string[], errorMessage?: string) {\r\n return this.setRequiredRule(requiredIfAnyNotEmptyRule, errorMessage, { fields, scope: \"global\" });\r\n};\r\n\r\n/**\r\n * Value is required if ANY of the specified sibling fields is NOT empty\r\n */\r\nBaseValidator.prototype.requiredIfAnyNotEmptySiblings = function (\r\n fields: string[],\r\n errorMessage?: string,\r\n) {\r\n return this.setRequiredRule(requiredIfAnyNotEmptyRule, errorMessage, {\r\n fields,\r\n scope: \"sibling\",\r\n });\r\n};\r\n\r\n/**\r\n * Value is required if another field's value is in the given array\r\n */\r\nBaseValidator.prototype.requiredIfIn = function (\r\n field: string,\r\n values: any[],\r\n errorMessage?: string,\r\n) {\r\n return this.setRequiredRule(requiredIfInRule, errorMessage, { field, values, scope: \"global\" });\r\n};\r\n\r\n/**\r\n * Value is required if another sibling field's value is in the given array\r\n */\r\nBaseValidator.prototype.requiredIfInSibling = function (\r\n field: string,\r\n values: any[],\r\n errorMessage?: string,\r\n) {\r\n return this.setRequiredRule(requiredIfInRule, errorMessage, { field, values, scope: \"sibling\" });\r\n};\r\n\r\n/**\r\n * Value is required if another field's value is NOT in the given array\r\n */\r\nBaseValidator.prototype.requiredIfNotIn = function (\r\n field: string,\r\n values: any[],\r\n errorMessage?: string,\r\n) {\r\n return this.setRequiredRule(requiredIfNotInRule, errorMessage, {\r\n field,\r\n values,\r\n scope: \"global\",\r\n });\r\n};\r\n\r\n/**\r\n * Value is required if another sibling field's value is NOT in the given array\r\n */\r\nBaseValidator.prototype.requiredIfNotInSibling = function (\r\n field: string,\r\n values: any[],\r\n errorMessage?: string,\r\n) {\r\n return this.setRequiredRule(requiredIfNotInRule, errorMessage, {\r\n field,\r\n values,\r\n scope: \"sibling\",\r\n });\r\n};\r\n\r\n// ==================== REQUIRED: BASED ON MULTIPLE FIELDS (ALL) ====================\r\n\r\n/**\r\n * Value is required if all specified fields exist\r\n */\r\nBaseValidator.prototype.requiredWithAll = function (fields: string[], errorMessage?: string) {\r\n return this.setRequiredRule(requiredWithAllRule, errorMessage, { fields, scope: \"global\" });\r\n};\r\n\r\n/**\r\n * Value is required if all specified sibling fields exist\r\n */\r\nBaseValidator.prototype.requiredWithAllSiblings = function (\r\n fields: string[],\r\n errorMessage?: string,\r\n) {\r\n return this.setRequiredRule(requiredWithAllRule, errorMessage, { fields, scope: \"sibling\" });\r\n};\r\n\r\n/**\r\n * Value is required if all specified fields are missing\r\n */\r\nBaseValidator.prototype.requiredWithoutAll = function (fields: string[], errorMessage?: string) {\r\n return this.setRequiredRule(requiredWithoutAllRule, errorMessage, { fields, scope: \"global\" });\r\n};\r\n\r\n/**\r\n * Value is required if all specified sibling fields are missing\r\n */\r\nBaseValidator.prototype.requiredWithoutAllSiblings = function (\r\n fields: string[],\r\n errorMessage?: string,\r\n) {\r\n return this.setRequiredRule(requiredWithoutAllRule, errorMessage, { fields, scope: \"sibling\" });\r\n};\r\n\r\n// ==================== REQUIRED: BASED ON MULTIPLE FIELDS (ANY) ====================\r\n\r\n/**\r\n * Value is required if any of the specified fields exists\r\n */\r\nBaseValidator.prototype.requiredWithAny = function (fields: string[], errorMessage?: string) {\r\n return this.setRequiredRule(requiredWithAnyRule, errorMessage, { fields, scope: \"global\" });\r\n};\r\n\r\n/**\r\n * Value is required if any of the specified sibling fields exists\r\n */\r\nBaseValidator.prototype.requiredWithAnySiblings = function (\r\n fields: string[],\r\n errorMessage?: string,\r\n) {\r\n return this.setRequiredRule(requiredWithAnyRule, errorMessage, { fields, scope: \"sibling\" });\r\n};\r\n\r\n/**\r\n * Value is required if any of the specified fields is missing\r\n */\r\nBaseValidator.prototype.requiredWithoutAny = function (fields: string[], errorMessage?: string) {\r\n return this.setRequiredRule(requiredWithoutAnyRule, errorMessage, { fields, scope: \"global\" });\r\n};\r\n\r\n/**\r\n * Value is required if any of the specified sibling fields is missing\r\n */\r\nBaseValidator.prototype.requiredWithoutAnySiblings = function (\r\n fields: string[],\r\n errorMessage?: string,\r\n) {\r\n return this.setRequiredRule(requiredWithoutAnyRule, errorMessage, { fields, scope: \"sibling\" });\r\n};\r\n\r\n// ==================== REQUIRED: BASED ON CUSTOM CALLBACK ====================\r\n\r\n/**\r\n * Make this field required based on a custom callback.\r\n * Callback receives only SchemaContext — the framework handles empty-value checking.\r\n */\r\nBaseValidator.prototype.requiredWhen = function (\r\n callback: (context: SchemaContext) => boolean | Promise<boolean>,\r\n errorMessage?: string,\r\n) {\r\n return this.setRequiredRule(requiredWhenRule, errorMessage, { callback });\r\n};\r\n"],"mappings":";;;;;;;;;;;;;;;AAiCA,MAAa,yBAAyB;;;;AAuOtC,cAAc,UAAU,WAAW,SAAU,cAAuB;CAClE,OAAO,KAAK,gBAAgB,cAAc,YAAY;AACxD;;;;AAKA,cAAc,UAAU,UAAU,SAAU,cAAuB;CACjE,OAAO,KAAK,gBAAgB,aAAa,YAAY;AACvD;;;;;;;;AASA,cAAc,UAAU,WAAW,WAAkD;CACnF,MAAM,WAAW,KAAK;CACtB,SAAS,aAAa;CACtB,SAAS,eAAe;CACxB,OAAO;AACT;;;;AAKA,cAAc,UAAU,UAAU,WAGhC;CAEA,OADiB,KAAK,SAAS,CAAC,CAAC,SACnB;AAChB;;;;AAOA,cAAc,UAAU,eAAe,SAAU,OAAe,cAAuB;CACrF,OAAO,KAAK,gBAAgB,kBAAkB,cAAc;EAAE;EAAO,OAAO;CAAS,CAAC;AACxF;;;;AAKA,cAAc,UAAU,sBAAsB,SAAU,OAAe,cAAuB;CAC5F,OAAO,KAAK,gBAAgB,kBAAkB,cAAc;EAAE;EAAO,OAAO;CAAU,CAAC;AACzF;;;;AAKA,cAAc,UAAU,kBAAkB,SAAU,OAAe,cAAuB;CACxF,OAAO,KAAK,gBAAgB,qBAAqB,cAAc;EAAE;EAAO,OAAO;CAAS,CAAC;AAC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,OAAO;CAAU,CAAC;AAChG;;;;;AAQA,cAAc,UAAU,eAAe,SACrC,UACA,cACA;CACA,OAAO,KAAK,gBAAgB,kBAAkB,cAAc,EAAE,SAAS,CAAC;AAC1E"}
1
+ {"version":3,"file":"required-methods.mjs","names":[],"sources":["../../../../../../../../seal/src/validators/methods/required-methods.ts"],"sourcesContent":["import {\n requiredIfAllEmptyRule,\n requiredIfAllNotEmptyRule,\n requiredIfAnyEmptyRule,\n requiredIfAnyNotEmptyRule,\n requiredIfEmptyRule,\n requiredIfInRule,\n requiredIfNotEmptyRule,\n requiredIfNotInRule,\n requiredIfRule,\n} from \"../../rules/conditional/required-if-rules\";\nimport { requiredUnlessRule } from \"../../rules/conditional/required-unless-rules\";\nimport { requiredWhenRule } from \"../../rules/conditional/required-when-rule\";\nimport {\n requiredWithAllRule,\n requiredWithAnyRule,\n requiredWithRule,\n} from \"../../rules/conditional/required-with-rules\";\nimport {\n requiredWithoutAllRule,\n requiredWithoutAnyRule,\n requiredWithoutRule,\n} from \"../../rules/conditional/required-without-rules\";\nimport { presentRule, requiredRule } from \"../../rules/core/required\";\nimport type { SchemaContext } from \"../../types\";\nimport { BaseValidator } from \"../base-validator\";\n\n/**\n * Marker re-exported by the validators barrel so the dts bundler keeps this\n * module (and its `declare module` augmentation) in the bundled `.d.ts`.\n * Without a real export, side-effect-only augmentation modules get tree-shaken\n * out of the published types, dropping every chainable rule method.\n */\nexport const requiredMethodsApplied = true;\n\ndeclare module \"../base-validator\" {\n interface BaseValidator {\n /**\n * This value must be present and has a value\n */\n required(errorMessage?: string): this;\n\n /**\n * Value must be present but not necessarily has a value\n */\n present(errorMessage?: string): this;\n\n /**\n * Mark the field as optional, so pass it if it has no value or has a value\n * Because this is the default behavior, this method is just syntactic sugar\n */\n optional(): this & { isOptional: true };\n\n /**\n * Sugar for `.optional().nullable()` — the field may be absent OR null.\n *\n * Brands the return type with both `{ isOptional: true }` and `{ isNullable: true }`\n * so `Infer<>` produces `{ field?: T | null }`.\n *\n * @example\n * v.string().nullish()\n * // type: string | null | undefined\n * // absent → key omitted\n * // null → null\n * // \"x\" → \"x\"\n */\n nullish(): this & { isOptional: true; isNullable: true };\n\n /**\n * Value is required if another field exists\n */\n requiredWith(field: string, errorMessage?: string): this;\n\n /**\n * Value is required if another sibling field exists\n */\n requiredWithSibling(field: string, errorMessage?: string): this;\n\n /**\n * Value is required if another field is missing\n */\n requiredWithout(field: string, errorMessage?: string): this;\n\n /**\n * Value is required if another sibling field is missing\n */\n requiredWithoutSibling(field: string, errorMessage?: string): this;\n\n /**\n * Value is required if another field equals a specific value\n */\n requiredIf(field: string, value: any, errorMessage?: string): this;\n\n /**\n * Value is required if another sibling field equals a specific value\n */\n requiredIfSibling(field: string, value: any, errorMessage?: string): this;\n\n /**\n * Value is required unless another field equals a specific value\n */\n requiredUnless(field: string, value: any, errorMessage?: string): this;\n\n /**\n * Value is required unless another sibling field equals a specific value\n */\n requiredUnlessSibling(field: string, value: any, errorMessage?: string): this;\n\n /**\n * Value is required if another field is empty\n */\n requiredIfEmpty(field: string, errorMessage?: string): this;\n\n /**\n * Value is required if another sibling field is empty\n */\n requiredIfEmptySibling(field: string, errorMessage?: string): this;\n\n /**\n * Value is required if another field is not empty\n */\n requiredIfNotEmpty(field: string, errorMessage?: string): this;\n\n /**\n * Value is required if another sibling field is not empty\n */\n requiredIfNotEmptySibling(field: string, errorMessage?: string): this;\n\n /**\n * Value is required if ALL specified fields are empty\n */\n requiredIfAllEmpty(fields: string[], errorMessage?: string): this;\n\n /**\n * Value is required if ALL specified sibling fields are empty\n */\n requiredIfAllEmptySiblings(fields: string[], errorMessage?: string): this;\n\n /**\n * Value is required if ANY of the specified fields is empty\n */\n requiredIfAnyEmpty(fields: string[], errorMessage?: string): this;\n\n /**\n * Value is required if ANY of the specified sibling fields is empty\n */\n requiredIfAnyEmptySiblings(fields: string[], errorMessage?: string): this;\n\n /**\n * Value is required if ALL specified fields are NOT empty\n */\n requiredIfAllNotEmpty(fields: string[], errorMessage?: string): this;\n\n /**\n * Value is required if ALL specified sibling fields are NOT empty\n */\n requiredIfAllNotEmptySiblings(fields: string[], errorMessage?: string): this;\n\n /**\n * Value is required if ANY of the specified fields is NOT empty\n */\n requiredIfAnyNotEmpty(fields: string[], errorMessage?: string): this;\n\n /**\n * Value is required if ANY of the specified sibling fields is NOT empty\n */\n requiredIfAnyNotEmptySiblings(fields: string[], errorMessage?: string): this;\n\n /**\n * Value is required if another field's value is in the given array\n */\n requiredIfIn(field: string, values: any[], errorMessage?: string): this;\n\n /**\n * Value is required if another sibling field's value is in the given array\n */\n requiredIfInSibling(field: string, values: any[], errorMessage?: string): this;\n\n /**\n * Value is required if another field's value is NOT in the given array\n */\n requiredIfNotIn(field: string, values: any[], errorMessage?: string): this;\n\n /**\n * Value is required if another sibling field's value is NOT in the given array\n */\n requiredIfNotInSibling(field: string, values: any[], errorMessage?: string): this;\n\n /**\n * Value is required if all specified fields exist\n */\n requiredWithAll(fields: string[], errorMessage?: string): this;\n\n /**\n * Value is required if all specified sibling fields exist\n */\n requiredWithAllSiblings(fields: string[], errorMessage?: string): this;\n\n /**\n * Value is required if all specified fields are missing\n */\n requiredWithoutAll(fields: string[], errorMessage?: string): this;\n\n /**\n * Value is required if all specified sibling fields are missing\n */\n requiredWithoutAllSiblings(fields: string[], errorMessage?: string): this;\n\n /**\n * Value is required if any of the specified fields exists\n */\n requiredWithAny(fields: string[], errorMessage?: string): this;\n\n /**\n * Value is required if any of the specified sibling fields exists\n */\n requiredWithAnySiblings(fields: string[], errorMessage?: string): this;\n\n /**\n * Value is required if any of the specified fields is missing\n */\n requiredWithoutAny(fields: string[], errorMessage?: string): this;\n\n /**\n * Value is required if any of the specified sibling fields is missing\n */\n requiredWithoutAnySiblings(fields: string[], errorMessage?: string): this;\n\n /**\n * Make this field required based on a custom callback.\n *\n * The callback receives only the `SchemaContext` (not the value),\n * because \"required\" is about surrounding conditions, not the field itself.\n * Return `true` if the field should be required.\n *\n * @param callback - Receives SchemaContext, returns boolean\n * @param errorMessage - Optional custom error message\n *\n * @example\n * ```ts\n * // Required when email notification is enabled\n * v.string().requiredWhen((context) => {\n * return context.allData.notificationMethod === 'email';\n * })\n *\n * // Required based on multiple conditions\n * v.string().requiredWhen((context) => {\n * const { role, department } = context.allData;\n * return role === 'manager' && department === 'finance';\n * })\n * ```\n */\n requiredWhen(\n callback: (context: SchemaContext) => boolean | Promise<boolean>,\n errorMessage?: string,\n ): this;\n }\n}\n\n// ==================== UNCONDITIONAL STATES ====================\n\n/**\n * This value must be present and has a value\n */\nBaseValidator.prototype.required = function (errorMessage?: string) {\n return this.setRequiredRule(requiredRule, errorMessage);\n};\n\n/**\n * Value must be present but not necessarily has a value\n */\nBaseValidator.prototype.present = function (errorMessage?: string) {\n return this.setRequiredRule(presentRule, errorMessage);\n};\n\n/**\n * Mark the field as optional — it may be absent or empty without validation errors.\n * Clears any previously set required rule.\n *\n * The return type is branded with `{ isOptional: true }` so schema inference\n * can mark this key as optional in the inferred TypeScript type.\n */\nBaseValidator.prototype.optional = function (): BaseValidator & { isOptional: true } {\n const instance = this.instance;\n instance.isOptional = true;\n instance.requiredRule = null;\n return instance as BaseValidator & { isOptional: true };\n};\n\n/**\n * Sugar — equivalent to `.optional().nullable()`.\n */\nBaseValidator.prototype.nullish = function (): BaseValidator & {\n isOptional: true;\n isNullable: true;\n} {\n const instance = this.optional().nullable();\n return instance as BaseValidator & { isOptional: true; isNullable: true };\n};\n\n// ==================== REQUIRED: BASED ON FIELD PRESENCE ====================\n\n/**\n * Value is required if another field exists\n */\nBaseValidator.prototype.requiredWith = function (field: string, errorMessage?: string) {\n return this.setRequiredRule(requiredWithRule, errorMessage, { field, scope: \"global\" });\n};\n\n/**\n * Value is required if another sibling field exists\n */\nBaseValidator.prototype.requiredWithSibling = function (field: string, errorMessage?: string) {\n return this.setRequiredRule(requiredWithRule, errorMessage, { field, scope: \"sibling\" });\n};\n\n/**\n * Value is required if another field is missing\n */\nBaseValidator.prototype.requiredWithout = function (field: string, errorMessage?: string) {\n return this.setRequiredRule(requiredWithoutRule, errorMessage, { field, scope: \"global\" });\n};\n\n/**\n * Value is required if another sibling field is missing\n */\nBaseValidator.prototype.requiredWithoutSibling = function (field: string, errorMessage?: string) {\n return this.setRequiredRule(requiredWithoutRule, errorMessage, { field, scope: \"sibling\" });\n};\n\n// ==================== REQUIRED: BASED ON FIELD VALUE ====================\n\n/**\n * Value is required if another field equals a specific value\n */\nBaseValidator.prototype.requiredIf = function (field: string, value: any, errorMessage?: string) {\n return this.setRequiredRule(requiredIfRule, errorMessage, { field, value, scope: \"global\" });\n};\n\n/**\n * Value is required if another sibling field equals a specific value\n */\nBaseValidator.prototype.requiredIfSibling = function (\n field: string,\n value: any,\n errorMessage?: string,\n) {\n return this.setRequiredRule(requiredIfRule, errorMessage, { field, value, scope: \"sibling\" });\n};\n\n/**\n * Value is required unless another field equals a specific value\n */\nBaseValidator.prototype.requiredUnless = function (\n field: string,\n value: any,\n errorMessage?: string,\n) {\n return this.setRequiredRule(requiredUnlessRule, errorMessage, { field, value, scope: \"global\" });\n};\n\n/**\n * Value is required unless another sibling field equals a specific value\n */\nBaseValidator.prototype.requiredUnlessSibling = function (\n field: string,\n value: any,\n errorMessage?: string,\n) {\n return this.setRequiredRule(requiredUnlessRule, errorMessage, { field, value, scope: \"sibling\" });\n};\n\n// ==================== REQUIRED: BASED ON FIELD EMPTY STATE ====================\n\n/**\n * Value is required if another field is empty\n */\nBaseValidator.prototype.requiredIfEmpty = function (field: string, errorMessage?: string) {\n return this.setRequiredRule(requiredIfEmptyRule, errorMessage, { field, scope: \"global\" });\n};\n\n/**\n * Value is required if another sibling field is empty\n */\nBaseValidator.prototype.requiredIfEmptySibling = function (field: string, errorMessage?: string) {\n return this.setRequiredRule(requiredIfEmptyRule, errorMessage, { field, scope: \"sibling\" });\n};\n\n/**\n * Value is required if another field is not empty\n */\nBaseValidator.prototype.requiredIfNotEmpty = function (field: string, errorMessage?: string) {\n return this.setRequiredRule(requiredIfNotEmptyRule, errorMessage, { field, scope: \"global\" });\n};\n\n/**\n * Value is required if another sibling field is not empty\n */\nBaseValidator.prototype.requiredIfNotEmptySibling = function (\n field: string,\n errorMessage?: string,\n) {\n return this.setRequiredRule(requiredIfNotEmptyRule, errorMessage, { field, scope: \"sibling\" });\n};\n\n// ==================== REQUIRED: BASED ON MULTIPLE FIELDS EMPTY STATE ====================\n\n/**\n * Value is required if ALL specified fields are empty\n */\nBaseValidator.prototype.requiredIfAllEmpty = function (fields: string[], errorMessage?: string) {\n return this.setRequiredRule(requiredIfAllEmptyRule, errorMessage, { fields, scope: \"global\" });\n};\n\n/**\n * Value is required if ALL specified sibling fields are empty\n */\nBaseValidator.prototype.requiredIfAllEmptySiblings = function (\n fields: string[],\n errorMessage?: string,\n) {\n return this.setRequiredRule(requiredIfAllEmptyRule, errorMessage, { fields, scope: \"sibling\" });\n};\n\n/**\n * Value is required if ANY of the specified fields is empty\n */\nBaseValidator.prototype.requiredIfAnyEmpty = function (fields: string[], errorMessage?: string) {\n return this.setRequiredRule(requiredIfAnyEmptyRule, errorMessage, { fields, scope: \"global\" });\n};\n\n/**\n * Value is required if ANY of the specified sibling fields is empty\n */\nBaseValidator.prototype.requiredIfAnyEmptySiblings = function (\n fields: string[],\n errorMessage?: string,\n) {\n return this.setRequiredRule(requiredIfAnyEmptyRule, errorMessage, { fields, scope: \"sibling\" });\n};\n\n/**\n * Value is required if ALL specified fields are NOT empty\n */\nBaseValidator.prototype.requiredIfAllNotEmpty = function (fields: string[], errorMessage?: string) {\n return this.setRequiredRule(requiredIfAllNotEmptyRule, errorMessage, { fields, scope: \"global\" });\n};\n\n/**\n * Value is required if ALL specified sibling fields are NOT empty\n */\nBaseValidator.prototype.requiredIfAllNotEmptySiblings = function (\n fields: string[],\n errorMessage?: string,\n) {\n return this.setRequiredRule(requiredIfAllNotEmptyRule, errorMessage, {\n fields,\n scope: \"sibling\",\n });\n};\n\n/**\n * Value is required if ANY of the specified fields is NOT empty\n */\nBaseValidator.prototype.requiredIfAnyNotEmpty = function (fields: string[], errorMessage?: string) {\n return this.setRequiredRule(requiredIfAnyNotEmptyRule, errorMessage, { fields, scope: \"global\" });\n};\n\n/**\n * Value is required if ANY of the specified sibling fields is NOT empty\n */\nBaseValidator.prototype.requiredIfAnyNotEmptySiblings = function (\n fields: string[],\n errorMessage?: string,\n) {\n return this.setRequiredRule(requiredIfAnyNotEmptyRule, errorMessage, {\n fields,\n scope: \"sibling\",\n });\n};\n\n/**\n * Value is required if another field's value is in the given array\n */\nBaseValidator.prototype.requiredIfIn = function (\n field: string,\n values: any[],\n errorMessage?: string,\n) {\n return this.setRequiredRule(requiredIfInRule, errorMessage, { field, values, scope: \"global\" });\n};\n\n/**\n * Value is required if another sibling field's value is in the given array\n */\nBaseValidator.prototype.requiredIfInSibling = function (\n field: string,\n values: any[],\n errorMessage?: string,\n) {\n return this.setRequiredRule(requiredIfInRule, errorMessage, { field, values, scope: \"sibling\" });\n};\n\n/**\n * Value is required if another field's value is NOT in the given array\n */\nBaseValidator.prototype.requiredIfNotIn = function (\n field: string,\n values: any[],\n errorMessage?: string,\n) {\n return this.setRequiredRule(requiredIfNotInRule, errorMessage, {\n field,\n values,\n scope: \"global\",\n });\n};\n\n/**\n * Value is required if another sibling field's value is NOT in the given array\n */\nBaseValidator.prototype.requiredIfNotInSibling = function (\n field: string,\n values: any[],\n errorMessage?: string,\n) {\n return this.setRequiredRule(requiredIfNotInRule, errorMessage, {\n field,\n values,\n scope: \"sibling\",\n });\n};\n\n// ==================== REQUIRED: BASED ON MULTIPLE FIELDS (ALL) ====================\n\n/**\n * Value is required if all specified fields exist\n */\nBaseValidator.prototype.requiredWithAll = function (fields: string[], errorMessage?: string) {\n return this.setRequiredRule(requiredWithAllRule, errorMessage, { fields, scope: \"global\" });\n};\n\n/**\n * Value is required if all specified sibling fields exist\n */\nBaseValidator.prototype.requiredWithAllSiblings = function (\n fields: string[],\n errorMessage?: string,\n) {\n return this.setRequiredRule(requiredWithAllRule, errorMessage, { fields, scope: \"sibling\" });\n};\n\n/**\n * Value is required if all specified fields are missing\n */\nBaseValidator.prototype.requiredWithoutAll = function (fields: string[], errorMessage?: string) {\n return this.setRequiredRule(requiredWithoutAllRule, errorMessage, { fields, scope: \"global\" });\n};\n\n/**\n * Value is required if all specified sibling fields are missing\n */\nBaseValidator.prototype.requiredWithoutAllSiblings = function (\n fields: string[],\n errorMessage?: string,\n) {\n return this.setRequiredRule(requiredWithoutAllRule, errorMessage, { fields, scope: \"sibling\" });\n};\n\n// ==================== REQUIRED: BASED ON MULTIPLE FIELDS (ANY) ====================\n\n/**\n * Value is required if any of the specified fields exists\n */\nBaseValidator.prototype.requiredWithAny = function (fields: string[], errorMessage?: string) {\n return this.setRequiredRule(requiredWithAnyRule, errorMessage, { fields, scope: \"global\" });\n};\n\n/**\n * Value is required if any of the specified sibling fields exists\n */\nBaseValidator.prototype.requiredWithAnySiblings = function (\n fields: string[],\n errorMessage?: string,\n) {\n return this.setRequiredRule(requiredWithAnyRule, errorMessage, { fields, scope: \"sibling\" });\n};\n\n/**\n * Value is required if any of the specified fields is missing\n */\nBaseValidator.prototype.requiredWithoutAny = function (fields: string[], errorMessage?: string) {\n return this.setRequiredRule(requiredWithoutAnyRule, errorMessage, { fields, scope: \"global\" });\n};\n\n/**\n * Value is required if any of the specified sibling fields is missing\n */\nBaseValidator.prototype.requiredWithoutAnySiblings = function (\n fields: string[],\n errorMessage?: string,\n) {\n return this.setRequiredRule(requiredWithoutAnyRule, errorMessage, { fields, scope: \"sibling\" });\n};\n\n// ==================== REQUIRED: BASED ON CUSTOM CALLBACK ====================\n\n/**\n * Make this field required based on a custom callback.\n * Callback receives only SchemaContext — the framework handles empty-value checking.\n */\nBaseValidator.prototype.requiredWhen = function (\n callback: (context: SchemaContext) => boolean | Promise<boolean>,\n errorMessage?: string,\n) {\n return this.setRequiredRule(requiredWhenRule, errorMessage, { callback });\n};\n"],"mappings":";;;;;;;;;;;;;;;AAiCA,MAAa,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EAxHT,OAAA,CAAQ,GAAA,mBAAsB,GAAA,mBAAsB,YAAA;EAmIzD;;;AACiB;EAxHZ,cAAA,CAAe,QAAA,UAAkB,QAAA,UAAkB,YAAA;;;;;EAcnD,MAAA,CAAO,MAAA,UAAgB,YAAA;;EAKvB,SAAA,CAAU,MAAA,UAAgB,YAAA;;EAK1B,SAAA,CAAU,MAAA,UAAgB,YAAA;;;;EAS1B,GAAA;;;;EAOA,IAAA;;;;EAOA,KAAA;;;;EAOA,KAAA,CAAM,QAAA;;;;;;;;;;;EAcN,OAAA,CAAQ,QAAA;;;;;;;;;;;;;;;;;;EAqBR,MAAA;IAC8C,SAAA;EAAA;;;;;;;;;;;;;;;;EAkBrC,YAAA,CAAa,MAAA,GAAQ,gBAAA,GAAqC,gBAAA;;;;;;YAShE,qBAAA,CACR,IAAA,wBACA,MAAA,EAAQ,gBAAA,GACP,gBAAA;AAAA"}
@@ -14,6 +14,7 @@ import { PrimitiveValidator } from "./primitive-validator.mjs";
14
14
  var NumberValidator = class extends PrimitiveValidator {
15
15
  constructor(errorMessage) {
16
16
  super();
17
+ this.blankIsMissing = true;
17
18
  this.addMutableRule(numberRule, errorMessage);
18
19
  }
19
20
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"number-validator.mjs","names":[],"sources":["../../../../../../../seal/src/validators/number-validator.ts"],"sourcesContent":["import {\r\n absMutator,\r\n ceilMutator,\r\n floorMutator,\r\n numericMutator,\r\n roundMutator,\r\n toFixedMutator,\r\n} from \"../mutators\";\r\nimport {\r\n betweenNumbersRule,\r\n evenRule,\r\n greaterThanRule,\r\n lengthRule,\r\n lessThanRule,\r\n maxLengthRule,\r\n maxRule,\r\n minLengthRule,\r\n minRule,\r\n moduloRule,\r\n negativeRule,\r\n numberRule,\r\n oddRule,\r\n positiveRule,\r\n} from \"../rules\";\r\nimport { PrimitiveValidator } from \"./primitive-validator\";\r\nimport { applyNullable, getRuleOptions } from \"../standard-schema/json-schema\";\r\nimport type { JsonSchemaResult, JsonSchemaTarget } from \"../standard-schema/json-schema\";\r\n\r\n/**\r\n * Number validator class - base for Int and Float validators\r\n */\r\nexport class NumberValidator extends PrimitiveValidator {\r\n public constructor(errorMessage?: string) {\r\n super();\r\n this.addMutableRule(numberRule, errorMessage);\r\n }\r\n\r\n /**\r\n * Check if value is a number type\r\n */\r\n public matchesType(value: any): boolean {\r\n return typeof value === \"number\" && !isNaN(value);\r\n }\r\n\r\n /**\r\n * Value must be equal or higher than the given number or field\r\n * Smart detection: number or field name\r\n *\r\n * @category Validation Rule\r\n */\r\n public min(min: number | string, errorMessage?: string) {\r\n return this.addRule(minRule, errorMessage, { min, scope: \"global\" });\r\n }\r\n\r\n /**\r\n * Value must be equal or less than the given number or field\r\n * Smart detection: number or field name\r\n *\r\n * @category Validation Rule\r\n */\r\n public max(max: number | string, errorMessage?: string) {\r\n return this.addRule(maxRule, errorMessage, { max, scope: \"global\" });\r\n }\r\n\r\n /**\r\n * Value must be >= sibling field value\r\n * @category Validation Rule\r\n */\r\n public minSibling(field: string, errorMessage?: string) {\r\n return this.addRule(minRule, errorMessage, { min: field, scope: \"sibling\" });\r\n }\r\n\r\n /**\r\n * Value must be <= sibling field value\r\n * @category Validation Rule\r\n */\r\n public maxSibling(field: string, errorMessage?: string) {\r\n return this.addRule(maxRule, errorMessage, { max: field, scope: \"sibling\" });\r\n }\r\n\r\n /**\r\n * Value must be strictly greater than the given number or field (>)\r\n * Smart detection: number or field name\r\n *\r\n * @category Validation Rule\r\n */\r\n public greaterThan(value: number | string, errorMessage?: string) {\r\n return this.addRule(greaterThanRule, errorMessage, {\r\n value,\r\n scope: \"global\",\r\n });\r\n }\r\n\r\n /**\r\n * Value must be strictly less than the given number or field (<)\r\n * Smart detection: number or field name\r\n *\r\n * @category Validation Rule\r\n */\r\n public lessThan(value: number | string, errorMessage?: string) {\r\n return this.addRule(lessThanRule, errorMessage, {\r\n value,\r\n scope: \"global\",\r\n });\r\n }\r\n\r\n /**\r\n * Alias for greaterThan() - shorter syntax\r\n * @category Validation Rule\r\n */\r\n public gt(value: number | string, errorMessage?: string) {\r\n return this.greaterThan(value, errorMessage);\r\n }\r\n\r\n /**\r\n * Alias for lessThan() - shorter syntax\r\n * @category Validation Rule\r\n */\r\n public lt(value: number | string, errorMessage?: string) {\r\n return this.lessThan(value, errorMessage);\r\n }\r\n\r\n /**\r\n * Value must be > sibling field value\r\n * @category Validation Rule\r\n */\r\n public greaterThanSibling(field: string, errorMessage?: string) {\r\n return this.addRule(greaterThanRule, errorMessage, {\r\n value: field,\r\n scope: \"sibling\",\r\n });\r\n }\r\n\r\n /**\r\n * Alias for greaterThanSibling() - shorter syntax\r\n * @category Validation Rule\r\n */\r\n public gtSibling(field: string, errorMessage?: string) {\r\n return this.greaterThanSibling(field, errorMessage);\r\n }\r\n\r\n /**\r\n * Value must be < sibling field value\r\n * @category Validation Rule\r\n */\r\n public lessThanSibling(field: string, errorMessage?: string) {\r\n return this.addRule(lessThanRule, errorMessage, {\r\n value: field,\r\n scope: \"sibling\",\r\n });\r\n }\r\n\r\n /**\r\n * Alias for lessThanSibling() - shorter syntax\r\n * @category Validation Rule\r\n */\r\n public ltSibling(field: string, errorMessage?: string) {\r\n return this.lessThanSibling(field, errorMessage);\r\n }\r\n\r\n /** Value must be a modulo of the given number */\r\n public modulo(value: number, errorMessage?: string) {\r\n return this.addRule(moduloRule, errorMessage, { value });\r\n }\r\n\r\n /**\r\n * Alias for modulo() - Value must be divisible by the given number\r\n */\r\n public divisibleBy(value: number, errorMessage?: string) {\r\n return this.modulo(value, errorMessage);\r\n }\r\n\r\n /**\r\n * Alias for modulo() - Value must be a multiple of the given number\r\n */\r\n public multipleOf(value: number, errorMessage?: string) {\r\n return this.modulo(value, errorMessage);\r\n }\r\n\r\n /**\r\n * Alias for modulo() - Value must be a multiple of the given number\r\n */\r\n public modulusOf(value: number, errorMessage?: string) {\r\n return this.modulo(value, errorMessage);\r\n }\r\n\r\n /** Accept only numbers higher than 0 */\r\n public positive(errorMessage?: string) {\r\n return this.addRule(positiveRule, errorMessage);\r\n }\r\n\r\n /** Accept only negative numbers */\r\n public negative(errorMessage?: string) {\r\n return this.addRule(negativeRule, errorMessage);\r\n }\r\n\r\n /** Accept only odd numbers */\r\n public odd(errorMessage?: string) {\r\n return this.addRule(oddRule, errorMessage);\r\n }\r\n\r\n /** Accept only even numbers */\r\n public even(errorMessage?: string) {\r\n return this.addRule(evenRule, errorMessage);\r\n }\r\n\r\n /**\r\n * Accept only numbers between the given two numbers or fields (Inclusive)\r\n * Smart detection: number or field name\r\n *\r\n * @category Validation Rule\r\n */\r\n public between(min: number | string, max: number | string, errorMessage?: string) {\r\n return this.addRule(betweenNumbersRule, errorMessage, {\r\n min,\r\n max,\r\n scope: \"global\",\r\n });\r\n }\r\n\r\n /**\r\n * Value must be between sibling field values\r\n * @category Validation Rule\r\n */\r\n public betweenSibling(minField: string, maxField: string, errorMessage?: string) {\r\n return this.addRule(betweenNumbersRule, errorMessage, {\r\n min: minField,\r\n max: maxField,\r\n scope: \"sibling\",\r\n });\r\n }\r\n\r\n // Enum and value membership methods are inherited from PrimitiveValidator.\r\n\r\n /**\r\n * Value (as a string) must be exactly this many characters.\r\n * Useful for fixed-format numeric codes (e.g. 4-digit PIN).\r\n */\r\n public length(length: number, errorMessage?: string) {\r\n return this.addRule(lengthRule, errorMessage, { length });\r\n }\r\n\r\n /** Value (as string representation) length must be ≥ min */\r\n public minLength(length: number, errorMessage?: string) {\r\n return this.addRule(minLengthRule, errorMessage, { minLength: length });\r\n }\r\n\r\n /** Value (as string representation) length must be ≤ max */\r\n public maxLength(length: number, errorMessage?: string) {\r\n return this.addRule(maxLengthRule, errorMessage, { maxLength: length });\r\n }\r\n\r\n // Mutators\r\n\r\n /**\r\n * Convert value to its absolute value\r\n */\r\n public abs() {\r\n return this.addMutator(absMutator);\r\n }\r\n\r\n /**\r\n * Round value up to the nearest integer\r\n */\r\n public ceil() {\r\n return this.addMutator(ceilMutator);\r\n }\r\n\r\n /**\r\n * Round value down to the nearest integer\r\n */\r\n public floor() {\r\n return this.addMutator(floorMutator);\r\n }\r\n\r\n /**\r\n * Round value to the nearest integer or specified decimals\r\n */\r\n public round(decimals = 0) {\r\n return this.addMutator(roundMutator, { decimals });\r\n }\r\n\r\n /**\r\n * Round to a fixed number of decimal places, keeping the value a **number**.\r\n *\r\n * `v.number().toFixed(2)` on `3.14159` yields `3.14`, not `\"3.14\"` — a number\r\n * schema has to output a number, or its own type rule rejects the result.\r\n * Format to a fixed-point *string* at the presentation edge instead.\r\n *\r\n * @example\r\n * v.number().toFixed(2) // 3.14159 → 3.14\r\n */\r\n public toFixed(decimals = 2) {\r\n return this.addMutator(toFixedMutator, { decimals });\r\n }\r\n\r\n /**\r\n * Opt in to coercion: a numeric-shaped string is converted to a number\r\n * **before** the type rules run; any other value passes through unchanged\r\n * so bad input still fails the type rule.\r\n *\r\n * Strictness is preserved — coercion only fixes the string *representation*,\r\n * not the value's shape. `v.int().coerce()` turns `\"5\"` into `5` (valid) but\r\n * `\"5.5\"` into `5.5`, which still fails the integer rule. Number validators\r\n * do **not** coerce by default; this only takes effect when explicitly chained.\r\n *\r\n * The output type is unchanged (`Infer<>` keys off the validator class), so\r\n * `v.int().coerce()` still infers `number`.\r\n *\r\n * @example\r\n * v.int().coerce() // \"5\" → 5 (valid); \"5.5\" → 5.5 (invalid); \"abc\" → invalid\r\n * v.number().coerce() // \"5.5\" → 5.5 (valid)\r\n */\r\n public coerce() {\r\n return this.addMutator(numericMutator) as this & { isCoerced: true };\r\n }\r\n\r\n /**\r\n * @inheritdoc\r\n *\r\n * Returns `{ type: \"number\" }` with numeric constraint keywords.\r\n * IntValidator overrides `type` to `\"integer\"`.\r\n *\r\n * @note Sibling-scoped rules (minSibling, maxSibling, etc.) are not representable\r\n * in JSON Schema and are silently omitted.\r\n *\r\n * @example\r\n * ```ts\r\n * v.number().min(0).max(100).toJsonSchema(\"draft-2020-12\")\r\n * // → { type: \"number\", minimum: 0, maximum: 100 }\r\n * ```\r\n */\r\n public override toJsonSchema(target: JsonSchemaTarget = \"draft-2020-12\"): JsonSchemaResult {\r\n return this.buildNumberJsonSchema(\"number\", target);\r\n }\r\n\r\n /**\r\n * Shared logic for number/integer JSON Schema generation.\r\n * Called by NumberValidator.toJsonSchema() (→ type: \"number\")\r\n * and IntValidator.toJsonSchema() (→ type: \"integer\").\r\n */\r\n protected buildNumberJsonSchema(\r\n type: \"number\" | \"integer\",\r\n target: JsonSchemaTarget,\r\n ): JsonSchemaResult {\r\n const schema: JsonSchemaResult = { type };\r\n\r\n // minimum (inclusive)\r\n const minOpts = getRuleOptions(this.rules, \"min\");\r\n if (minOpts?.min !== undefined && typeof minOpts.min === \"number\") {\r\n schema.minimum = minOpts.min;\r\n }\r\n\r\n // maximum (inclusive)\r\n const maxOpts = getRuleOptions(this.rules, \"max\");\r\n if (maxOpts?.max !== undefined && typeof maxOpts.max === \"number\") {\r\n schema.maximum = maxOpts.max;\r\n }\r\n\r\n // between (inclusive range)\r\n const betweenOpts = getRuleOptions(this.rules, \"betweenNumbers\");\r\n if (betweenOpts) {\r\n if (typeof betweenOpts.min === \"number\") schema.minimum = betweenOpts.min;\r\n if (typeof betweenOpts.max === \"number\") schema.maximum = betweenOpts.max;\r\n }\r\n\r\n // greaterThan (>) → exclusiveMinimum\r\n const gtOpts = getRuleOptions(this.rules, \"greaterThan\");\r\n if (gtOpts?.value !== undefined && typeof gtOpts.value === \"number\") {\r\n if (target === \"draft-07\") {\r\n schema.minimum = gtOpts.value;\r\n schema.exclusiveMinimum = true;\r\n } else {\r\n schema.exclusiveMinimum = gtOpts.value;\r\n }\r\n }\r\n\r\n // lessThan (<) → exclusiveMaximum\r\n const ltOpts = getRuleOptions(this.rules, \"lessThan\");\r\n if (ltOpts?.value !== undefined && typeof ltOpts.value === \"number\") {\r\n if (target === \"draft-07\") {\r\n schema.maximum = ltOpts.value;\r\n schema.exclusiveMaximum = true;\r\n } else {\r\n schema.exclusiveMaximum = ltOpts.value;\r\n }\r\n }\r\n\r\n // multipleOf / modulo\r\n const moduloOpts = getRuleOptions(this.rules, \"modulo\");\r\n if (moduloOpts?.value !== undefined && typeof moduloOpts.value === \"number\") {\r\n schema.multipleOf = moduloOpts.value;\r\n }\r\n\r\n // enum (from PrimitiveValidator.in / .enum)\r\n const inOpts = getRuleOptions(this.rules, \"in\");\r\n if (inOpts?.values && Array.isArray(inOpts.values)) {\r\n schema.enum = inOpts.values;\r\n }\r\n\r\n if (this.isNullable) applyNullable(schema, target);\r\n\r\n return schema;\r\n }\r\n}\r\n"],"mappings":";;;;;;;;;;;;;AA+BA,IAAa,kBAAb,cAAqC,mBAAmB;CACtD,AAAO,YAAY,cAAuB;EACxC,MAAM;EACN,KAAK,eAAe,YAAY,YAAY;CAC9C;;;;CAKA,AAAO,YAAY,OAAqB;EACtC,OAAO,OAAO,UAAU,YAAY,CAAC,MAAM,KAAK;CAClD;;;;;;;CAQA,AAAO,IAAI,KAAsB,cAAuB;EACtD,OAAO,KAAK,QAAQ,SAAS,cAAc;GAAE;GAAK,OAAO;EAAS,CAAC;CACrE;;;;;;;CAQA,AAAO,IAAI,KAAsB,cAAuB;EACtD,OAAO,KAAK,QAAQ,SAAS,cAAc;GAAE;GAAK,OAAO;EAAS,CAAC;CACrE;;;;;CAMA,AAAO,WAAW,OAAe,cAAuB;EACtD,OAAO,KAAK,QAAQ,SAAS,cAAc;GAAE,KAAK;GAAO,OAAO;EAAU,CAAC;CAC7E;;;;;CAMA,AAAO,WAAW,OAAe,cAAuB;EACtD,OAAO,KAAK,QAAQ,SAAS,cAAc;GAAE,KAAK;GAAO,OAAO;EAAU,CAAC;CAC7E;;;;;;;CAQA,AAAO,YAAY,OAAwB,cAAuB;EAChE,OAAO,KAAK,QAAQ,iBAAiB,cAAc;GACjD;GACA,OAAO;EACT,CAAC;CACH;;;;;;;CAQA,AAAO,SAAS,OAAwB,cAAuB;EAC7D,OAAO,KAAK,QAAQ,cAAc,cAAc;GAC9C;GACA,OAAO;EACT,CAA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M,UAAU,eAAe,KAAK,OAAO,KAAK;EAChD,IAAI,SAAS,QAAQ,UAAa,OAAO,QAAQ,QAAQ,UACvD,OAAO,UAAU,QAAQ;EAI3B,MAAM,cAAc,eAAe,KAAK,OAAO,gBAAgB;EAC/D,IAAI,aAAa;GACf,IAAI,OAAO,YAAY,QAAQ,UAAU,OAAO,UAAU,YAAY;GACtE,IAAI,OAAO,YAAY,QAAQ,UAAU,OAAO,UAAU,YAAY;EACxE;EAGA,MAAM,SAAS,eAAe,KAAK,OAAO,aAAa;EACvD,IAAI,QAAQ,UAAU,UAAa,OAAO,OAAO,UAAU,UACzD,IAAI,WAAW,YAAY;GACzB,OAAO,UAAU,OAAO;GACxB,OAAO,mBAAmB;EAC5B,OACE,OAAO,mBAAmB,OAAO;EAKrC,MAAM,SAAS,eAAe,KAAK,OAAO,UAAU;EACpD,IAAI,QAAQ,UAAU,UAAa,OAAO,OAAO,UAAU,UACzD,IAAI,WAAW,YAAY;GACzB,OAAO,UAAU,OAAO;GACxB,OAAO,mBAAmB;EAC5B,OACE,OAAO,mBAAmB,OAAO;EAKrC,MAAM,aAAa,eAAe,KAAK,OAAO,QAAQ;EACtD,IAAI,YAAY,UAAU,UAAa,OAAO,WAAW,UAAU,UACjE,OAAO,aAAa,WAAW;EAIjC,MAAM,SAAS,eAAe,KAAK,OAAO,IAAI;EAC9C,IAAI,QAAQ,UAAU,MAAM,QAAQ,OAAO,MAAM,GAC/C,OAAO,OAAO,OAAO;EAGvB,IAAI,KAAK,YAAY,cAAc,QAAQ,MAAM;EAEjD,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"number-validator.mjs","names":[],"sources":["../../../../../../../seal/src/validators/number-validator.ts"],"sourcesContent":["import {\n absMutator,\n ceilMutator,\n floorMutator,\n numericMutator,\n roundMutator,\n toFixedMutator,\n} from \"../mutators\";\nimport {\n betweenNumbersRule,\n evenRule,\n greaterThanRule,\n lengthRule,\n lessThanRule,\n maxLengthRule,\n maxRule,\n minLengthRule,\n minRule,\n moduloRule,\n negativeRule,\n numberRule,\n oddRule,\n positiveRule,\n} from \"../rules\";\nimport { PrimitiveValidator } from \"./primitive-validator\";\nimport { applyNullable, getRuleOptions } from \"../standard-schema/json-schema\";\nimport type { JsonSchemaResult, JsonSchemaTarget } from \"../standard-schema/json-schema\";\n\n/**\n * Number validator class - base for Int and Float validators\n */\nexport class NumberValidator extends PrimitiveValidator {\n public constructor(errorMessage?: string) {\n super();\n this.blankIsMissing = true;\n this.addMutableRule(numberRule, errorMessage);\n }\n\n /**\n * Check if value is a number type\n */\n public matchesType(value: any): boolean {\n return typeof value === \"number\" && !isNaN(value);\n }\n\n /**\n * Value must be equal or higher than the given number or field\n * Smart detection: number or field name\n *\n * @category Validation Rule\n */\n public min(min: number | string, errorMessage?: string) {\n return this.addRule(minRule, errorMessage, { min, scope: \"global\" });\n }\n\n /**\n * Value must be equal or less than the given number or field\n * Smart detection: number or field name\n *\n * @category Validation Rule\n */\n public max(max: number | string, errorMessage?: string) {\n return this.addRule(maxRule, errorMessage, { max, scope: \"global\" });\n }\n\n /**\n * Value must be >= sibling field value\n * @category Validation Rule\n */\n public minSibling(field: string, errorMessage?: string) {\n return this.addRule(minRule, errorMessage, { min: field, scope: \"sibling\" });\n }\n\n /**\n * Value must be <= sibling field value\n * @category Validation Rule\n */\n public maxSibling(field: string, errorMessage?: string) {\n return this.addRule(maxRule, errorMessage, { max: field, scope: \"sibling\" });\n }\n\n /**\n * Value must be strictly greater than the given number or field (>)\n * Smart detection: number or field name\n *\n * @category Validation Rule\n */\n public greaterThan(value: number | string, errorMessage?: string) {\n return this.addRule(greaterThanRule, errorMessage, {\n value,\n scope: \"global\",\n });\n }\n\n /**\n * Value must be strictly less than the given number or field (<)\n * Smart detection: number or field name\n *\n * @category Validation Rule\n */\n public lessThan(value: number | string, errorMessage?: string) {\n return this.addRule(lessThanRule, errorMessage, {\n value,\n scope: \"global\",\n });\n }\n\n /**\n * Alias for greaterThan() - shorter syntax\n * @category Validation Rule\n */\n public gt(value: number | string, errorMessage?: string) {\n return this.greaterThan(value, errorMessage);\n }\n\n /**\n * Alias for lessThan() - shorter syntax\n * @category Validation Rule\n */\n public lt(value: number | string, errorMessage?: string) {\n return this.lessThan(value, errorMessage);\n }\n\n /**\n * Value must be > sibling field value\n * @category Validation Rule\n */\n public greaterThanSibling(field: string, errorMessage?: string) {\n return this.addRule(greaterThanRule, errorMessage, {\n value: field,\n scope: \"sibling\",\n });\n }\n\n /**\n * Alias for greaterThanSibling() - shorter syntax\n * @category Validation Rule\n */\n public gtSibling(field: string, errorMessage?: string) {\n return this.greaterThanSibling(field, errorMessage);\n }\n\n /**\n * Value must be < sibling field value\n * @category Validation Rule\n */\n public lessThanSibling(field: string, errorMessage?: string) {\n return this.addRule(lessThanRule, errorMessage, {\n value: field,\n scope: \"sibling\",\n });\n }\n\n /**\n * Alias for lessThanSibling() - shorter syntax\n * @category Validation Rule\n */\n public ltSibling(field: string, errorMessage?: string) {\n return this.lessThanSibling(field, errorMessage);\n }\n\n /** Value must be a modulo of the given number */\n public modulo(value: number, errorMessage?: string) {\n return this.addRule(moduloRule, errorMessage, { value });\n }\n\n /**\n * Alias for modulo() - Value must be divisible by the given number\n */\n public divisibleBy(value: number, errorMessage?: string) {\n return this.modulo(value, errorMessage);\n }\n\n /**\n * Alias for modulo() - Value must be a multiple of the given number\n */\n public multipleOf(value: number, errorMessage?: string) {\n return this.modulo(value, errorMessage);\n }\n\n /**\n * Alias for modulo() - Value must be a multiple of the given number\n */\n public modulusOf(value: number, errorMessage?: string) {\n return this.modulo(value, errorMessage);\n }\n\n /** Accept only numbers higher than 0 */\n public positive(errorMessage?: string) {\n return this.addRule(positiveRule, errorMessage);\n }\n\n /** Accept only negative numbers */\n public negative(errorMessage?: string) {\n return this.addRule(negativeRule, errorMessage);\n }\n\n /** Accept only odd numbers */\n public odd(errorMessage?: string) {\n return this.addRule(oddRule, errorMessage);\n }\n\n /** Accept only even numbers */\n public even(errorMessage?: string) {\n return this.addRule(evenRule, errorMessage);\n }\n\n /**\n * Accept only numbers between the given two numbers or fields (Inclusive)\n * Smart detection: number or field name\n *\n * @category Validation Rule\n */\n public between(min: number | string, max: number | string, errorMessage?: string) {\n return this.addRule(betweenNumbersRule, errorMessage, {\n min,\n max,\n scope: \"global\",\n });\n }\n\n /**\n * Value must be between sibling field values\n * @category Validation Rule\n */\n public betweenSibling(minField: string, maxField: string, errorMessage?: string) {\n return this.addRule(betweenNumbersRule, errorMessage, {\n min: minField,\n max: maxField,\n scope: \"sibling\",\n });\n }\n\n // Enum and value membership methods are inherited from PrimitiveValidator.\n\n /**\n * Value (as a string) must be exactly this many characters.\n * Useful for fixed-format numeric codes (e.g. 4-digit PIN).\n */\n public length(length: number, errorMessage?: string) {\n return this.addRule(lengthRule, errorMessage, { length });\n }\n\n /** Value (as string representation) length must be ≥ min */\n public minLength(length: number, errorMessage?: string) {\n return this.addRule(minLengthRule, errorMessage, { minLength: length });\n }\n\n /** Value (as string representation) length must be ≤ max */\n public maxLength(length: number, errorMessage?: string) {\n return this.addRule(maxLengthRule, errorMessage, { maxLength: length });\n }\n\n // Mutators\n\n /**\n * Convert value to its absolute value\n */\n public abs() {\n return this.addMutator(absMutator);\n }\n\n /**\n * Round value up to the nearest integer\n */\n public ceil() {\n return this.addMutator(ceilMutator);\n }\n\n /**\n * Round value down to the nearest integer\n */\n public floor() {\n return this.addMutator(floorMutator);\n }\n\n /**\n * Round value to the nearest integer or specified decimals\n */\n public round(decimals = 0) {\n return this.addMutator(roundMutator, { decimals });\n }\n\n /**\n * Round to a fixed number of decimal places, keeping the value a **number**.\n *\n * `v.number().toFixed(2)` on `3.14159` yields `3.14`, not `\"3.14\"` — a number\n * schema has to output a number, or its own type rule rejects the result.\n * Format to a fixed-point *string* at the presentation edge instead.\n *\n * @example\n * v.number().toFixed(2) // 3.14159 → 3.14\n */\n public toFixed(decimals = 2) {\n return this.addMutator(toFixedMutator, { decimals });\n }\n\n /**\n * Opt in to coercion: a numeric-shaped string is converted to a number\n * **before** the type rules run; any other value passes through unchanged\n * so bad input still fails the type rule.\n *\n * Strictness is preserved — coercion only fixes the string *representation*,\n * not the value's shape. `v.int().coerce()` turns `\"5\"` into `5` (valid) but\n * `\"5.5\"` into `5.5`, which still fails the integer rule. Number validators\n * do **not** coerce by default; this only takes effect when explicitly chained.\n *\n * The output type is unchanged (`Infer<>` keys off the validator class), so\n * `v.int().coerce()` still infers `number`.\n *\n * @example\n * v.int().coerce() // \"5\" → 5 (valid); \"5.5\" → 5.5 (invalid); \"abc\" → invalid\n * v.number().coerce() // \"5.5\" → 5.5 (valid)\n */\n public coerce() {\n return this.addMutator(numericMutator) as this & { isCoerced: true };\n }\n\n /**\n * @inheritdoc\n *\n * Returns `{ type: \"number\" }` with numeric constraint keywords.\n * IntValidator overrides `type` to `\"integer\"`.\n *\n * @note Sibling-scoped rules (minSibling, maxSibling, etc.) are not representable\n * in JSON Schema and are silently omitted.\n *\n * @example\n * ```ts\n * v.number().min(0).max(100).toJsonSchema(\"draft-2020-12\")\n * // → { type: \"number\", minimum: 0, maximum: 100 }\n * ```\n */\n public override toJsonSchema(target: JsonSchemaTarget = \"draft-2020-12\"): JsonSchemaResult {\n return this.buildNumberJsonSchema(\"number\", target);\n }\n\n /**\n * Shared logic for number/integer JSON Schema generation.\n * Called by NumberValidator.toJsonSchema() (→ type: \"number\")\n * and IntValidator.toJsonSchema() (→ type: \"integer\").\n */\n protected buildNumberJsonSchema(\n type: \"number\" | \"integer\",\n target: JsonSchemaTarget,\n ): JsonSchemaResult {\n const schema: JsonSchemaResult = { type };\n\n // minimum (inclusive)\n const minOpts = getRuleOptions(this.rules, \"min\");\n if (minOpts?.min !== undefined && typeof minOpts.min === \"number\") {\n schema.minimum = minOpts.min;\n }\n\n // maximum (inclusive)\n const maxOpts = getRuleOptions(this.rules, \"max\");\n if (maxOpts?.max !== undefined && typeof maxOpts.max === \"number\") {\n schema.maximum = maxOpts.max;\n }\n\n // between (inclusive range)\n const betweenOpts = getRuleOptions(this.rules, \"betweenNumbers\");\n if (betweenOpts) {\n if (typeof betweenOpts.min === \"number\") schema.minimum = betweenOpts.min;\n if (typeof betweenOpts.max === \"number\") schema.maximum = betweenOpts.max;\n }\n\n // greaterThan (>) → exclusiveMinimum\n const gtOpts = getRuleOptions(this.rules, \"greaterThan\");\n if (gtOpts?.value !== undefined && typeof gtOpts.value === \"number\") {\n if (target === \"draft-07\") {\n schema.minimum = gtOpts.value;\n schema.exclusiveMinimum = true;\n } else {\n schema.exclusiveMinimum = gtOpts.value;\n }\n }\n\n // lessThan (<) → exclusiveMaximum\n const ltOpts = getRuleOptions(this.rules, \"lessThan\");\n if (ltOpts?.value !== undefined && typeof ltOpts.value === \"number\") {\n if (target === \"draft-07\") {\n schema.maximum = ltOpts.value;\n schema.exclusiveMaximum = true;\n } else {\n schema.exclusiveMaximum = ltOpts.value;\n }\n }\n\n // multipleOf / modulo\n const moduloOpts = getRuleOptions(this.rules, \"modulo\");\n if (moduloOpts?.value !== undefined && typeof moduloOpts.value === \"number\") {\n schema.multipleOf = moduloOpts.value;\n }\n\n // enum (from PrimitiveValidator.in / .enum)\n const inOpts = getRuleOptions(this.rules, \"in\");\n if (inOpts?.values && Array.isArray(inOpts.values)) {\n schema.enum = inOpts.values;\n }\n\n if (this.isNullable) applyNullable(schema, target);\n\n return schema;\n }\n}\n"],"mappings":";;;;;;;;;;;;;AA+BA,IAAa,kBAAb,cAAqC,mBAAmB;CACtD,AAAO,YAAY,cAAuB;EACxC,MAAM;EACN,KAAK,iBAAiB;EACtB,KAAK,eAAe,YAAY,YAAY;CAC9C;;;;CAKA,AAAO,YAAY,OAAqB;EACtC,OAAO,OAAO,UAAU,YAAY,CAAC,MAAM,KAAK;CAClD;;;;;;;CAQA,AAAO,IAAI,KAAsB,cAAuB;EACtD,OAAO,KAAK,QAAQ,SAAS,cAAc;GAAE;GAAK,OAAO;EAAS,CAAC;CACrE;;;;;;;CAQA,AAAO,IAAI,KAAsB,cAAuB;EACtD,O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AQ;EACtD,IAAI,YAAY,UAAU,UAAa,OAAO,WAAW,UAAU,UACjE,OAAO,aAAa,WAAW;EAIjC,MAAM,SAAS,eAAe,KAAK,OAAO,IAAI;EAC9C,IAAI,QAAQ,UAAU,MAAM,QAAQ,OAAO,MAAM,GAC/C,OAAO,OAAO,OAAO;EAGvB,IAAI,KAAK,YAAY,cAAc,QAAQ,MAAM;EAEjD,OAAO;CACT;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"numeric-validator.mjs","names":[],"sources":["../../../../../../../seal/src/validators/numeric-validator.ts"],"sourcesContent":["import { isNumeric } from \"@mongez/supportive-is\";\r\nimport { numericMutator } from \"../mutators/number-mutators\";\r\nimport { NumberValidator } from \"./number-validator\";\r\n\r\n/**\r\n * Numeric validator class - base for Int and Float validators either as number or string\r\n */\r\nexport class NumericValidator extends NumberValidator {\r\n /**\r\n * Constructor\r\n */\r\n public constructor(errorMessage?: string) {\r\n super(errorMessage);\r\n this.addMutableMutator(numericMutator);\r\n }\r\n\r\n /**\r\n * Check if value is a numeric type\r\n */\r\n public matchesType(value: any): boolean {\r\n return isNumeric(value);\r\n }\r\n}\r\n"],"mappings":";;;;;;;;AAOA,IAAa,mBAAb,cAAsC,gBAAgB;;;;CAIpD,AAAO,YAAY,cAAuB;EACxC,MAAM,YAAY;EAClB,KAAK,kBAAkB,cAAc;CACvC;;;;CAKA,AAAO,YAAY,OAAqB;EACtC,OAAO,UAAU,KAAK;CACxB;AACF"}
1
+ {"version":3,"file":"numeric-validator.mjs","names":[],"sources":["../../../../../../../seal/src/validators/numeric-validator.ts"],"sourcesContent":["import { isNumeric } from \"@mongez/supportive-is\";\nimport { numericMutator } from \"../mutators/number-mutators\";\nimport { NumberValidator } from \"./number-validator\";\n\n/**\n * Numeric validator class - base for Int and Float validators either as number or string\n */\nexport class NumericValidator extends NumberValidator {\n /**\n * Constructor\n */\n public constructor(errorMessage?: string) {\n super(errorMessage);\n this.addMutableMutator(numericMutator);\n }\n\n /**\n * Check if value is a numeric type\n */\n public matchesType(value: any): boolean {\n return isNumeric(value);\n }\n}\n"],"mappings":";;;;;;;;AAOA,IAAa,mBAAb,cAAsC,gBAAgB;;;;CAIpD,AAAO,YAAY,cAAuB;EACxC,MAAM,YAAY;EAClB,KAAK,kBAAkB,cAAc;CACvC;;;;CAKA,AAAO,YAAY,OAAqB;EACtC,OAAO,UAAU,KAAK;CACxB;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"object-validator.d.mts","names":[],"sources":["../../../../../../../seal/src/validators/object-validator.ts"],"mappings":";;;;;;;;;;;;AA6BA;;;;;;;;;;;;cAAa,eAAA,iBAAgC,MAAA,GAAS,MAAA,UAAgB,aAAA,CACpE,qBAAA,CAAsB,OAAA,GACtB,sBAAA,CAAuB,OAAA;EAOd,MAAA,EAAQ,OAAA;EAAA,UALP,kBAAA;EAAA,UACA,WAAA;EAAA,UACA,iBAAA;cAGD,MAAA,EAAQ,OAAA,EACf,YAAA;EAyK0B;;;EAhKrB,WAAA,CAAY,KAAA;EAkKU;EA7JtB,YAAA;EAyNqB;EA/MrB,KAAA,IAAS,IAAA;EA+MyD;EAxMlE,IAAA,CAAK,SAAA;EAwMwD;;;EAhM7D,YAAA,CAAa,KAAA;EAuOkB;;;;;;;;;;;;;EApNtB,KAAA,CAAM,IAAA;EApE8C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoI7D,MAAA,oBAA0B,MAAA,EAC/B,iBAAA,EAAmB,UAAA,GAAa,eAAA,CAAgB,UAAA,IAC/C,eAAA,CAAgB,OAAA,GAAU,UAAA;EA6ChB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAN,KAAA,gBAAqB,MAAA,EAC1B,SAAA,EAAW,eAAA,CAAgB,MAAA,IAC1B,eAAA,CAAgB,OAAA,GAAU,MAAA;EAmJc;;;;;;;;;;;;;;;;;;;;;;;AA8M+C;;;;;EArSnF,IAAA,iBAAqB,OAAA,KAAY,IAAA,EAAM,CAAA,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AA,CAAgB,UAAA,IAC/C,eAAA,CAAgB,OAAA,GAAU,UAAA;EA6CtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA,KAAA,gBAAqB,MAAA,EAC1B,SAAA,EAAW,eAAA,CAAgB,MAAA,IAC1B,eAAA,CAAgB,OAAA,GAAU,MAAA;EAmJE;;;;;;;;;;;;;;;;;;;;;;;;AAkN2D;;;;EAzSnF,IAAA,iBAAqB,OAAA,KAAY,IAAA,EAAM,CAAA,KAAM,eAAA,CAAgB,IAAA,CAAK,OAAA,EAAS,CAAA;;;;EAoB3E,OAAA,iBAAwB,OAAA,KAAY,IAAA,EAAM,CAAA;;;;EAmB1C,cAAA,iBAA+B,OAAA,KAAY,IAAA,EAAM,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgDjD,OAAA,iBAAwB,OAAA,KAAY,IAAA,EAAM,CAAA,KAAM,eAAA,CAAgB,IAAA,CAAK,OAAA,EAAS,CAAA;;EAkB9E,MAAA,CAAO,IAAA,OAAW,OAAA,EAAS,aAAA;;EAMrB,QAAA,CACX,IAAA,OACA,OAAA,GAAS,aAAA,GACR,OAAA,CAAQ,gBAAA;;;;;UAiIH,mBAAA;;;;UAOA,iBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+CQ,YAAA,CAAa,MAAA,GAAQ,gBAAA,GAAqC,gBAAA;AAAA"}
@@ -295,7 +295,7 @@ var ObjectValidator = class ObjectValidator extends BaseValidator {
295
295
  }
296
296
  const result = await super.validate(mutatedData, context);
297
297
  if (result.isValid === false) return result;
298
- if (data === void 0) return result;
298
+ if (mutatedData === void 0 || mutatedData === null) return result;
299
299
  const errors = [];
300
300
  const validatedData = {};
301
301
  const validationPromises = Object.entries(this.schema).filter(([, validator]) => !this.isComputedValidator(validator)).map(async ([key, validator]) => {