@warlock.js/seal 4.0.162 → 4.0.164

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 (765) hide show
  1. package/cjs/config.d.ts +48 -0
  2. package/cjs/config.d.ts.map +1 -0
  3. package/cjs/config.js +42 -0
  4. package/cjs/config.js.map +1 -0
  5. package/cjs/factory/index.d.ts +3 -0
  6. package/cjs/factory/index.d.ts.map +1 -0
  7. package/cjs/factory/validate.d.ts +8 -0
  8. package/cjs/factory/validate.d.ts.map +1 -0
  9. package/cjs/factory/validate.js +23 -0
  10. package/cjs/factory/validate.js.map +1 -0
  11. package/cjs/factory/validators.d.ts +56 -0
  12. package/cjs/factory/validators.d.ts.map +1 -0
  13. package/cjs/factory/validators.js +45 -0
  14. package/cjs/factory/validators.js.map +1 -0
  15. package/cjs/helpers/date-helpers.d.ts +16 -0
  16. package/cjs/helpers/date-helpers.d.ts.map +1 -0
  17. package/cjs/helpers/date-helpers.js +20 -0
  18. package/cjs/helpers/date-helpers.js.map +1 -0
  19. package/cjs/helpers/file.utils.d.ts +8 -0
  20. package/cjs/helpers/file.utils.d.ts.map +1 -0
  21. package/cjs/helpers/file.utils.js +29 -0
  22. package/cjs/helpers/file.utils.js.map +1 -0
  23. package/cjs/helpers/get-field-value.d.ts +37 -0
  24. package/cjs/helpers/get-field-value.d.ts.map +1 -0
  25. package/cjs/helpers/get-field-value.js +40 -0
  26. package/cjs/helpers/get-field-value.js.map +1 -0
  27. package/cjs/helpers/index.d.ts +6 -0
  28. package/cjs/helpers/index.d.ts.map +1 -0
  29. package/cjs/helpers/is-empty-value.d.ts +2 -0
  30. package/cjs/helpers/is-empty-value.d.ts.map +1 -0
  31. package/cjs/helpers/is-empty-value.js +3 -0
  32. package/cjs/helpers/is-empty-value.js.map +1 -0
  33. package/cjs/helpers/path-helpers.d.ts +5 -0
  34. package/cjs/helpers/path-helpers.d.ts.map +1 -0
  35. package/cjs/helpers/path-helpers.js +8 -0
  36. package/cjs/helpers/path-helpers.js.map +1 -0
  37. package/cjs/helpers/validation-helpers.d.ts +26 -0
  38. package/cjs/helpers/validation-helpers.d.ts.map +1 -0
  39. package/cjs/helpers/validation-helpers.js +74 -0
  40. package/cjs/helpers/validation-helpers.js.map +1 -0
  41. package/cjs/index.d.ts +30 -0
  42. package/cjs/index.d.ts.map +1 -0
  43. package/cjs/index.js +1 -0
  44. package/cjs/index.js.map +1 -0
  45. package/cjs/mutators/array-mutators.d.ts +12 -0
  46. package/cjs/mutators/array-mutators.d.ts.map +1 -0
  47. package/cjs/mutators/array-mutators.js +37 -0
  48. package/cjs/mutators/array-mutators.js.map +1 -0
  49. package/cjs/mutators/date-mutators.d.ts +39 -0
  50. package/cjs/mutators/date-mutators.d.ts.map +1 -0
  51. package/cjs/mutators/date-mutators.js +120 -0
  52. package/cjs/mutators/date-mutators.js.map +1 -0
  53. package/cjs/mutators/index.d.ts +7 -0
  54. package/cjs/mutators/index.d.ts.map +1 -0
  55. package/cjs/mutators/number-mutators.d.ts +22 -0
  56. package/cjs/mutators/number-mutators.d.ts.map +1 -0
  57. package/cjs/mutators/number-mutators.js +53 -0
  58. package/cjs/mutators/number-mutators.js.map +1 -0
  59. package/cjs/mutators/object-mutators.d.ts +8 -0
  60. package/cjs/mutators/object-mutators.d.ts.map +1 -0
  61. package/cjs/mutators/object-mutators.js +48 -0
  62. package/cjs/mutators/object-mutators.js.map +1 -0
  63. package/cjs/mutators/scalar-mutators.d.ts +3 -0
  64. package/cjs/mutators/scalar-mutators.d.ts.map +1 -0
  65. package/cjs/mutators/scalar-mutators.js +6 -0
  66. package/cjs/mutators/scalar-mutators.js.map +1 -0
  67. package/cjs/mutators/string-mutators.d.ts +72 -0
  68. package/cjs/mutators/string-mutators.d.ts.map +1 -0
  69. package/cjs/mutators/string-mutators.js +193 -0
  70. package/cjs/mutators/string-mutators.js.map +1 -0
  71. package/cjs/plugins/index.d.ts +7 -0
  72. package/cjs/plugins/index.d.ts.map +1 -0
  73. package/cjs/plugins/plugin-system.d.ts +71 -0
  74. package/cjs/plugins/plugin-system.d.ts.map +1 -0
  75. package/cjs/plugins/plugin-system.js +67 -0
  76. package/cjs/plugins/plugin-system.js.map +1 -0
  77. package/cjs/rules/array/array-rules.d.ts +12 -0
  78. package/cjs/rules/array/array-rules.d.ts.map +1 -0
  79. package/cjs/rules/array/array-rules.js +45 -0
  80. package/cjs/rules/array/array-rules.js.map +1 -0
  81. package/cjs/rules/array/index.d.ts +2 -0
  82. package/cjs/rules/array/index.d.ts.map +1 -0
  83. package/cjs/rules/color/color-rules.d.ts +30 -0
  84. package/cjs/rules/color/color-rules.d.ts.map +1 -0
  85. package/cjs/rules/color/color-rules.js +120 -0
  86. package/cjs/rules/color/color-rules.js.map +1 -0
  87. package/cjs/rules/color/index.d.ts +2 -0
  88. package/cjs/rules/color/index.d.ts.map +1 -0
  89. package/cjs/rules/common/enum.d.ts +26 -0
  90. package/cjs/rules/common/enum.d.ts.map +1 -0
  91. package/cjs/rules/common/enum.js +69 -0
  92. package/cjs/rules/common/enum.js.map +1 -0
  93. package/cjs/rules/common/equals-field-rules.d.ts +18 -0
  94. package/cjs/rules/common/equals-field-rules.d.ts.map +1 -0
  95. package/cjs/rules/common/equals-field-rules.js +39 -0
  96. package/cjs/rules/common/equals-field-rules.js.map +1 -0
  97. package/cjs/rules/common/index.d.ts +5 -0
  98. package/cjs/rules/common/index.d.ts.map +1 -0
  99. package/cjs/rules/common/type-rules.d.ts +38 -0
  100. package/cjs/rules/common/type-rules.d.ts.map +1 -0
  101. package/cjs/rules/common/type-rules.js +117 -0
  102. package/cjs/rules/common/type-rules.js.map +1 -0
  103. package/cjs/rules/common/unknown-key.d.ts +9 -0
  104. package/cjs/rules/common/unknown-key.d.ts.map +1 -0
  105. package/cjs/rules/common/unknown-key.js +17 -0
  106. package/cjs/rules/common/unknown-key.js.map +1 -0
  107. package/cjs/rules/conditional/forbidden-if-rules.d.ts +54 -0
  108. package/cjs/rules/conditional/forbidden-if-rules.d.ts.map +1 -0
  109. package/cjs/rules/conditional/forbidden-if-rules.js +118 -0
  110. package/cjs/rules/conditional/forbidden-if-rules.js.map +1 -0
  111. package/cjs/rules/conditional/index.d.ts +11 -0
  112. package/cjs/rules/conditional/index.d.ts.map +1 -0
  113. package/cjs/rules/conditional/present-if-rules.d.ts +45 -0
  114. package/cjs/rules/conditional/present-if-rules.d.ts.map +1 -0
  115. package/cjs/rules/conditional/present-if-rules.js +100 -0
  116. package/cjs/rules/conditional/present-if-rules.js.map +1 -0
  117. package/cjs/rules/conditional/present-unless-rules.d.ts +11 -0
  118. package/cjs/rules/conditional/present-unless-rules.d.ts.map +1 -0
  119. package/cjs/rules/conditional/present-unless-rules.js +22 -0
  120. package/cjs/rules/conditional/present-unless-rules.js.map +1 -0
  121. package/cjs/rules/conditional/present-with-rules.d.ts +26 -0
  122. package/cjs/rules/conditional/present-with-rules.d.ts.map +1 -0
  123. package/cjs/rules/conditional/present-with-rules.js +70 -0
  124. package/cjs/rules/conditional/present-with-rules.js.map +1 -0
  125. package/cjs/rules/conditional/present-without-rules.d.ts +26 -0
  126. package/cjs/rules/conditional/present-without-rules.d.ts.map +1 -0
  127. package/cjs/rules/conditional/present-without-rules.js +70 -0
  128. package/cjs/rules/conditional/present-without-rules.js.map +1 -0
  129. package/cjs/rules/conditional/required-if-rules.d.ts +77 -0
  130. package/cjs/rules/conditional/required-if-rules.d.ts.map +1 -0
  131. package/cjs/rules/conditional/required-if-rules.js +205 -0
  132. package/cjs/rules/conditional/required-if-rules.js.map +1 -0
  133. package/cjs/rules/conditional/required-unless-rules.d.ts +11 -0
  134. package/cjs/rules/conditional/required-unless-rules.d.ts.map +1 -0
  135. package/cjs/rules/conditional/required-unless-rules.js +22 -0
  136. package/cjs/rules/conditional/required-unless-rules.js.map +1 -0
  137. package/cjs/rules/conditional/required-when-rule.d.ts +18 -0
  138. package/cjs/rules/conditional/required-when-rule.d.ts.map +1 -0
  139. package/cjs/rules/conditional/required-when-rule.js +26 -0
  140. package/cjs/rules/conditional/required-when-rule.js.map +1 -0
  141. package/cjs/rules/conditional/required-with-rules.d.ts +26 -0
  142. package/cjs/rules/conditional/required-with-rules.d.ts.map +1 -0
  143. package/cjs/rules/conditional/required-with-rules.js +64 -0
  144. package/cjs/rules/conditional/required-with-rules.js.map +1 -0
  145. package/cjs/rules/conditional/required-without-rules.d.ts +26 -0
  146. package/cjs/rules/conditional/required-without-rules.d.ts.map +1 -0
  147. package/cjs/rules/conditional/required-without-rules.js +64 -0
  148. package/cjs/rules/conditional/required-without-rules.js.map +1 -0
  149. package/cjs/rules/core/equal.d.ts +8 -0
  150. package/cjs/rules/core/equal.d.ts.map +1 -0
  151. package/cjs/rules/core/equal.js +14 -0
  152. package/cjs/rules/core/equal.js.map +1 -0
  153. package/cjs/rules/core/forbidden.d.ts +6 -0
  154. package/cjs/rules/core/forbidden.d.ts.map +1 -0
  155. package/cjs/rules/core/forbidden.js +13 -0
  156. package/cjs/rules/core/forbidden.js.map +1 -0
  157. package/cjs/rules/core/index.d.ts +6 -0
  158. package/cjs/rules/core/index.d.ts.map +1 -0
  159. package/cjs/rules/core/required.d.ts +11 -0
  160. package/cjs/rules/core/required.d.ts.map +1 -0
  161. package/cjs/rules/core/required.js +31 -0
  162. package/cjs/rules/core/required.js.map +1 -0
  163. package/cjs/rules/core/union.d.ts +9 -0
  164. package/cjs/rules/core/union.d.ts.map +1 -0
  165. package/cjs/rules/core/union.js +40 -0
  166. package/cjs/rules/core/union.js.map +1 -0
  167. package/cjs/rules/core/when.d.ts +6 -0
  168. package/cjs/rules/core/when.d.ts.map +1 -0
  169. package/cjs/rules/core/when.js +40 -0
  170. package/cjs/rules/core/when.js.map +1 -0
  171. package/cjs/rules/date/date-comparison-rules.d.ts +25 -0
  172. package/cjs/rules/date/date-comparison-rules.d.ts.map +1 -0
  173. package/cjs/rules/date/date-comparison-rules.js +80 -0
  174. package/cjs/rules/date/date-comparison-rules.js.map +1 -0
  175. package/cjs/rules/date/date-day-rules.d.ts +21 -0
  176. package/cjs/rules/date/date-day-rules.d.ts.map +1 -0
  177. package/cjs/rules/date/date-day-rules.js +68 -0
  178. package/cjs/rules/date/date-day-rules.js.map +1 -0
  179. package/cjs/rules/date/date-field-comparison-rules.d.ts +28 -0
  180. package/cjs/rules/date/date-field-comparison-rules.d.ts.map +1 -0
  181. package/cjs/rules/date/date-field-comparison-rules.js +94 -0
  182. package/cjs/rules/date/date-field-comparison-rules.js.map +1 -0
  183. package/cjs/rules/date/date-period-rules.d.ts +124 -0
  184. package/cjs/rules/date/date-period-rules.d.ts.map +1 -0
  185. package/cjs/rules/date/date-period-rules.js +605 -0
  186. package/cjs/rules/date/date-period-rules.js.map +1 -0
  187. package/cjs/rules/date/date-relative-rules.d.ts +20 -0
  188. package/cjs/rules/date/date-relative-rules.d.ts.map +1 -0
  189. package/cjs/rules/date/date-relative-rules.js +60 -0
  190. package/cjs/rules/date/date-relative-rules.js.map +1 -0
  191. package/cjs/rules/date/date-special-rules.d.ts +20 -0
  192. package/cjs/rules/date/date-special-rules.d.ts.map +1 -0
  193. package/cjs/rules/date/date-special-rules.js +71 -0
  194. package/cjs/rules/date/date-special-rules.js.map +1 -0
  195. package/cjs/rules/date/date.d.ts +93 -0
  196. package/cjs/rules/date/date.d.ts.map +1 -0
  197. package/cjs/rules/date/date.js +288 -0
  198. package/cjs/rules/date/date.js.map +1 -0
  199. package/cjs/rules/date/index.d.ts +8 -0
  200. package/cjs/rules/date/index.d.ts.map +1 -0
  201. package/cjs/rules/file/dimensions.d.ts +26 -0
  202. package/cjs/rules/file/dimensions.d.ts.map +1 -0
  203. package/cjs/rules/file/dimensions.js +60 -0
  204. package/cjs/rules/file/dimensions.js.map +1 -0
  205. package/cjs/rules/file/file-size.d.ts +14 -0
  206. package/cjs/rules/file/file-size.d.ts.map +1 -0
  207. package/cjs/rules/file/file-size.js +30 -0
  208. package/cjs/rules/file/file-size.js.map +1 -0
  209. package/cjs/rules/file/index.d.ts +11 -0
  210. package/cjs/rules/file/index.d.ts.map +1 -0
  211. package/cjs/rules/index.d.ts +19 -0
  212. package/cjs/rules/index.d.ts.map +1 -0
  213. package/cjs/rules/length/index.d.ts +2 -0
  214. package/cjs/rules/length/index.d.ts.map +1 -0
  215. package/cjs/rules/length/length-rules.d.ts +49 -0
  216. package/cjs/rules/length/length-rules.d.ts.map +1 -0
  217. package/cjs/rules/length/length-rules.js +107 -0
  218. package/cjs/rules/length/length-rules.js.map +1 -0
  219. package/cjs/rules/number/index.d.ts +2 -0
  220. package/cjs/rules/number/index.d.ts.map +1 -0
  221. package/cjs/rules/number/number-rules.d.ts +65 -0
  222. package/cjs/rules/number/number-rules.d.ts.map +1 -0
  223. package/cjs/rules/number/number-rules.js +245 -0
  224. package/cjs/rules/number/number-rules.js.map +1 -0
  225. package/cjs/rules/scalar/accepted-rule.d.ts +39 -0
  226. package/cjs/rules/scalar/accepted-rule.d.ts.map +1 -0
  227. package/cjs/rules/scalar/accepted-rule.js +117 -0
  228. package/cjs/rules/scalar/accepted-rule.js.map +1 -0
  229. package/cjs/rules/scalar/declined-rule.d.ts +39 -0
  230. package/cjs/rules/scalar/declined-rule.d.ts.map +1 -0
  231. package/cjs/rules/scalar/declined-rule.js +117 -0
  232. package/cjs/rules/scalar/declined-rule.js.map +1 -0
  233. package/cjs/rules/scalar/index.d.ts +3 -0
  234. package/cjs/rules/scalar/index.d.ts.map +1 -0
  235. package/cjs/rules/string/alpha.d.ts +14 -0
  236. package/cjs/rules/string/alpha.d.ts.map +1 -0
  237. package/cjs/rules/string/alpha.js +39 -0
  238. package/cjs/rules/string/alpha.js.map +1 -0
  239. package/cjs/rules/string/credit-card.d.ts +6 -0
  240. package/cjs/rules/string/credit-card.d.ts.map +1 -0
  241. package/cjs/rules/string/credit-card.js +31 -0
  242. package/cjs/rules/string/credit-card.js.map +1 -0
  243. package/cjs/rules/string/email.d.ts +6 -0
  244. package/cjs/rules/string/email.d.ts.map +1 -0
  245. package/cjs/rules/string/email.js +13 -0
  246. package/cjs/rules/string/email.js.map +1 -0
  247. package/cjs/rules/string/index.d.ts +17 -0
  248. package/cjs/rules/string/index.d.ts.map +1 -0
  249. package/cjs/rules/string/ip.d.ts +14 -0
  250. package/cjs/rules/string/ip.d.ts.map +1 -0
  251. package/cjs/rules/string/ip.js +39 -0
  252. package/cjs/rules/string/ip.js.map +1 -0
  253. package/cjs/rules/string/matches.d.ts +8 -0
  254. package/cjs/rules/string/matches.d.ts.map +1 -0
  255. package/cjs/rules/string/matches.js +15 -0
  256. package/cjs/rules/string/matches.js.map +1 -0
  257. package/cjs/rules/string/pattern.d.ts +8 -0
  258. package/cjs/rules/string/pattern.d.ts.map +1 -0
  259. package/cjs/rules/string/pattern.js +14 -0
  260. package/cjs/rules/string/pattern.js.map +1 -0
  261. package/cjs/rules/string/string-comparison.d.ts +26 -0
  262. package/cjs/rules/string/string-comparison.d.ts.map +1 -0
  263. package/cjs/rules/string/string-comparison.js +56 -0
  264. package/cjs/rules/string/string-comparison.js.map +1 -0
  265. package/cjs/rules/string/strong-password-rule.d.ts +14 -0
  266. package/cjs/rules/string/strong-password-rule.d.ts.map +1 -0
  267. package/cjs/rules/string/strong-password-rule.js +38 -0
  268. package/cjs/rules/string/strong-password-rule.js.map +1 -0
  269. package/cjs/rules/string/url.d.ts +6 -0
  270. package/cjs/rules/string/url.d.ts.map +1 -0
  271. package/cjs/rules/string/url.js +16 -0
  272. package/cjs/rules/string/url.js.map +1 -0
  273. package/cjs/rules/string/without-whitespace.d.ts +6 -0
  274. package/cjs/rules/string/without-whitespace.d.ts.map +1 -0
  275. package/cjs/rules/string/without-whitespace.js +13 -0
  276. package/cjs/rules/string/without-whitespace.js.map +1 -0
  277. package/cjs/standard-schema/index.d.ts +4 -0
  278. package/cjs/standard-schema/index.d.ts.map +1 -0
  279. package/cjs/standard-schema/json-schema.d.ts +61 -0
  280. package/cjs/standard-schema/json-schema.d.ts.map +1 -0
  281. package/cjs/standard-schema/json-schema.js +85 -0
  282. package/cjs/standard-schema/json-schema.js.map +1 -0
  283. package/cjs/standard-schema/map-result.d.ts +18 -0
  284. package/cjs/standard-schema/map-result.d.ts.map +1 -0
  285. package/cjs/standard-schema/map-result.js +27 -0
  286. package/cjs/standard-schema/map-result.js.map +1 -0
  287. package/cjs/standard-schema/types.d.ts +93 -0
  288. package/cjs/standard-schema/types.d.ts.map +1 -0
  289. package/cjs/types/conditional-types.d.ts +15 -0
  290. package/cjs/types/conditional-types.d.ts.map +1 -0
  291. package/cjs/types/context-types.d.ts +47 -0
  292. package/cjs/types/context-types.d.ts.map +1 -0
  293. package/cjs/types/data-transformer-types.d.ts +25 -0
  294. package/cjs/types/data-transformer-types.d.ts.map +1 -0
  295. package/cjs/types/date-types.d.ts +9 -0
  296. package/cjs/types/date-types.d.ts.map +1 -0
  297. package/cjs/types/date-types.js +12 -0
  298. package/cjs/types/date-types.js.map +1 -0
  299. package/cjs/types/file.types.d.ts +5 -0
  300. package/cjs/types/file.types.d.ts.map +1 -0
  301. package/cjs/types/index.d.ts +11 -0
  302. package/cjs/types/index.d.ts.map +1 -0
  303. package/cjs/types/inference-types.d.ts +32 -0
  304. package/cjs/types/inference-types.d.ts.map +1 -0
  305. package/cjs/types/mutator-types.d.ts +27 -0
  306. package/cjs/types/mutator-types.d.ts.map +1 -0
  307. package/cjs/types/result-types.d.ts +19 -0
  308. package/cjs/types/result-types.d.ts.map +1 -0
  309. package/cjs/types/rule-types.d.ts +58 -0
  310. package/cjs/types/rule-types.d.ts.map +1 -0
  311. package/cjs/types/schema-types.d.ts +6 -0
  312. package/cjs/types/schema-types.d.ts.map +1 -0
  313. package/cjs/validators/any-validator.d.ts +29 -0
  314. package/cjs/validators/any-validator.d.ts.map +1 -0
  315. package/cjs/validators/any-validator.js +31 -0
  316. package/cjs/validators/any-validator.js.map +1 -0
  317. package/cjs/validators/array-validator.d.ts +72 -0
  318. package/cjs/validators/array-validator.d.ts.map +1 -0
  319. package/cjs/validators/array-validator.js +162 -0
  320. package/cjs/validators/array-validator.js.map +1 -0
  321. package/cjs/validators/base-validator.d.ts +425 -0
  322. package/cjs/validators/base-validator.d.ts.map +1 -0
  323. package/cjs/validators/base-validator.js +637 -0
  324. package/cjs/validators/base-validator.js.map +1 -0
  325. package/cjs/validators/boolean-validator.d.ts +67 -0
  326. package/cjs/validators/boolean-validator.d.ts.map +1 -0
  327. package/cjs/validators/boolean-validator.js +105 -0
  328. package/cjs/validators/boolean-validator.js.map +1 -0
  329. package/cjs/validators/computed-validator.d.ts +75 -0
  330. package/cjs/validators/computed-validator.d.ts.map +1 -0
  331. package/cjs/validators/computed-validator.js +124 -0
  332. package/cjs/validators/computed-validator.js.map +1 -0
  333. package/cjs/validators/date-validator.d.ts +330 -0
  334. package/cjs/validators/date-validator.d.ts.map +1 -0
  335. package/cjs/validators/date-validator.js +614 -0
  336. package/cjs/validators/date-validator.js.map +1 -0
  337. package/cjs/validators/float-validator.d.ts +8 -0
  338. package/cjs/validators/float-validator.d.ts.map +1 -0
  339. package/cjs/validators/float-validator.js +9 -0
  340. package/cjs/validators/float-validator.js.map +1 -0
  341. package/cjs/validators/index.d.ts +31 -0
  342. package/cjs/validators/index.d.ts.map +1 -0
  343. package/cjs/validators/int-validator.d.ts +19 -0
  344. package/cjs/validators/int-validator.d.ts.map +1 -0
  345. package/cjs/validators/int-validator.js +21 -0
  346. package/cjs/validators/int-validator.js.map +1 -0
  347. package/cjs/validators/managed-validator.d.ts +38 -0
  348. package/cjs/validators/managed-validator.d.ts.map +1 -0
  349. package/cjs/validators/managed-validator.js +34 -0
  350. package/cjs/validators/managed-validator.js.map +1 -0
  351. package/cjs/validators/methods/equality-conditional-methods.d.ts +88 -0
  352. package/cjs/validators/methods/equality-conditional-methods.d.ts.map +1 -0
  353. package/cjs/validators/methods/equality-conditional-methods.js +118 -0
  354. package/cjs/validators/methods/equality-conditional-methods.js.map +1 -0
  355. package/cjs/validators/methods/forbidden-methods.d.ts +58 -0
  356. package/cjs/validators/methods/forbidden-methods.d.ts.map +1 -0
  357. package/cjs/validators/methods/forbidden-methods.js +122 -0
  358. package/cjs/validators/methods/forbidden-methods.js.map +1 -0
  359. package/cjs/validators/methods/present-methods.d.ts +102 -0
  360. package/cjs/validators/methods/present-methods.d.ts.map +1 -0
  361. package/cjs/validators/methods/present-methods.js +229 -0
  362. package/cjs/validators/methods/present-methods.js.map +1 -0
  363. package/cjs/validators/methods/required-methods.d.ts +174 -0
  364. package/cjs/validators/methods/required-methods.d.ts.map +1 -0
  365. package/cjs/validators/methods/required-methods.js +246 -0
  366. package/cjs/validators/methods/required-methods.js.map +1 -0
  367. package/cjs/validators/number-validator.d.ts +166 -0
  368. package/cjs/validators/number-validator.d.ts.map +1 -0
  369. package/cjs/validators/number-validator.js +307 -0
  370. package/cjs/validators/number-validator.js.map +1 -0
  371. package/cjs/validators/numeric-validator.d.ts +15 -0
  372. package/cjs/validators/numeric-validator.d.ts.map +1 -0
  373. package/cjs/validators/numeric-validator.js +18 -0
  374. package/cjs/validators/numeric-validator.js.map +1 -0
  375. package/cjs/validators/object-validator.d.ts +233 -0
  376. package/cjs/validators/object-validator.d.ts.map +1 -0
  377. package/cjs/validators/object-validator.js +517 -0
  378. package/cjs/validators/object-validator.js.map +1 -0
  379. package/cjs/validators/primitive-validator.d.ts +70 -0
  380. package/cjs/validators/primitive-validator.d.ts.map +1 -0
  381. package/cjs/validators/primitive-validator.js +80 -0
  382. package/cjs/validators/primitive-validator.js.map +1 -0
  383. package/cjs/validators/record-validator.d.ts +54 -0
  384. package/cjs/validators/record-validator.d.ts.map +1 -0
  385. package/cjs/validators/record-validator.js +100 -0
  386. package/cjs/validators/record-validator.js.map +1 -0
  387. package/cjs/validators/scalar-validator.d.ts +93 -0
  388. package/cjs/validators/scalar-validator.d.ts.map +1 -0
  389. package/cjs/validators/scalar-validator.js +149 -0
  390. package/cjs/validators/scalar-validator.js.map +1 -0
  391. package/cjs/validators/string-validator.d.ts +189 -0
  392. package/cjs/validators/string-validator.d.ts.map +1 -0
  393. package/cjs/validators/string-validator.js +387 -0
  394. package/cjs/validators/string-validator.js.map +1 -0
  395. package/cjs/validators/tuple-validator.d.ts +56 -0
  396. package/cjs/validators/tuple-validator.d.ts.map +1 -0
  397. package/cjs/validators/tuple-validator.js +121 -0
  398. package/cjs/validators/tuple-validator.js.map +1 -0
  399. package/cjs/validators/union-validator.d.ts +55 -0
  400. package/cjs/validators/union-validator.d.ts.map +1 -0
  401. package/cjs/validators/union-validator.js +60 -0
  402. package/cjs/validators/union-validator.js.map +1 -0
  403. package/esm/index.d.ts +30 -0
  404. package/esm/index.d.ts.map +1 -0
  405. package/esm/index.js +1 -0
  406. package/esm/index.js.map +1 -0
  407. package/esm/mutators/array-mutators.d.ts +12 -0
  408. package/esm/mutators/array-mutators.d.ts.map +1 -0
  409. package/esm/mutators/array-mutators.js +37 -0
  410. package/esm/mutators/array-mutators.js.map +1 -0
  411. package/esm/mutators/date-mutators.d.ts +39 -0
  412. package/esm/mutators/date-mutators.d.ts.map +1 -0
  413. package/esm/mutators/date-mutators.js +120 -0
  414. package/esm/mutators/date-mutators.js.map +1 -0
  415. package/esm/mutators/index.d.ts +7 -0
  416. package/esm/mutators/index.d.ts.map +1 -0
  417. package/esm/mutators/number-mutators.d.ts +22 -0
  418. package/esm/mutators/number-mutators.d.ts.map +1 -0
  419. package/esm/mutators/number-mutators.js +53 -0
  420. package/esm/mutators/number-mutators.js.map +1 -0
  421. package/esm/mutators/object-mutators.d.ts +8 -0
  422. package/esm/mutators/object-mutators.d.ts.map +1 -0
  423. package/esm/mutators/object-mutators.js +48 -0
  424. package/esm/mutators/object-mutators.js.map +1 -0
  425. package/esm/mutators/scalar-mutators.d.ts +3 -0
  426. package/esm/mutators/scalar-mutators.d.ts.map +1 -0
  427. package/esm/mutators/scalar-mutators.js +6 -0
  428. package/esm/mutators/scalar-mutators.js.map +1 -0
  429. package/esm/mutators/string-mutators.d.ts +72 -0
  430. package/esm/mutators/string-mutators.d.ts.map +1 -0
  431. package/esm/mutators/string-mutators.js +193 -0
  432. package/esm/mutators/string-mutators.js.map +1 -0
  433. package/esm/plugins/index.d.ts +7 -0
  434. package/esm/plugins/index.d.ts.map +1 -0
  435. package/esm/plugins/plugin-system.d.ts +71 -0
  436. package/esm/plugins/plugin-system.d.ts.map +1 -0
  437. package/esm/plugins/plugin-system.js +67 -0
  438. package/esm/plugins/plugin-system.js.map +1 -0
  439. package/esm/rules/array/array-rules.d.ts +12 -0
  440. package/esm/rules/array/array-rules.d.ts.map +1 -0
  441. package/esm/rules/array/array-rules.js +45 -0
  442. package/esm/rules/array/array-rules.js.map +1 -0
  443. package/esm/rules/array/index.d.ts +2 -0
  444. package/esm/rules/array/index.d.ts.map +1 -0
  445. package/esm/rules/color/color-rules.d.ts +30 -0
  446. package/esm/rules/color/color-rules.d.ts.map +1 -0
  447. package/esm/rules/color/color-rules.js +120 -0
  448. package/esm/rules/color/color-rules.js.map +1 -0
  449. package/esm/rules/color/index.d.ts +2 -0
  450. package/esm/rules/color/index.d.ts.map +1 -0
  451. package/esm/rules/common/enum.d.ts +26 -0
  452. package/esm/rules/common/enum.d.ts.map +1 -0
  453. package/esm/rules/common/enum.js +69 -0
  454. package/esm/rules/common/enum.js.map +1 -0
  455. package/esm/rules/common/equals-field-rules.d.ts +18 -0
  456. package/esm/rules/common/equals-field-rules.d.ts.map +1 -0
  457. package/esm/rules/common/equals-field-rules.js +39 -0
  458. package/esm/rules/common/equals-field-rules.js.map +1 -0
  459. package/esm/rules/common/index.d.ts +5 -0
  460. package/esm/rules/common/index.d.ts.map +1 -0
  461. package/esm/rules/common/type-rules.d.ts +38 -0
  462. package/esm/rules/common/type-rules.d.ts.map +1 -0
  463. package/esm/rules/common/type-rules.js +117 -0
  464. package/esm/rules/common/type-rules.js.map +1 -0
  465. package/esm/rules/common/unknown-key.d.ts +9 -0
  466. package/esm/rules/common/unknown-key.d.ts.map +1 -0
  467. package/esm/rules/common/unknown-key.js +17 -0
  468. package/esm/rules/common/unknown-key.js.map +1 -0
  469. package/esm/rules/conditional/forbidden-if-rules.d.ts +54 -0
  470. package/esm/rules/conditional/forbidden-if-rules.d.ts.map +1 -0
  471. package/esm/rules/conditional/forbidden-if-rules.js +118 -0
  472. package/esm/rules/conditional/forbidden-if-rules.js.map +1 -0
  473. package/esm/rules/conditional/index.d.ts +11 -0
  474. package/esm/rules/conditional/index.d.ts.map +1 -0
  475. package/esm/rules/conditional/present-if-rules.d.ts +45 -0
  476. package/esm/rules/conditional/present-if-rules.d.ts.map +1 -0
  477. package/esm/rules/conditional/present-if-rules.js +100 -0
  478. package/esm/rules/conditional/present-if-rules.js.map +1 -0
  479. package/esm/rules/conditional/present-unless-rules.d.ts +11 -0
  480. package/esm/rules/conditional/present-unless-rules.d.ts.map +1 -0
  481. package/esm/rules/conditional/present-unless-rules.js +22 -0
  482. package/esm/rules/conditional/present-unless-rules.js.map +1 -0
  483. package/esm/rules/conditional/present-with-rules.d.ts +26 -0
  484. package/esm/rules/conditional/present-with-rules.d.ts.map +1 -0
  485. package/esm/rules/conditional/present-with-rules.js +70 -0
  486. package/esm/rules/conditional/present-with-rules.js.map +1 -0
  487. package/esm/rules/conditional/present-without-rules.d.ts +26 -0
  488. package/esm/rules/conditional/present-without-rules.d.ts.map +1 -0
  489. package/esm/rules/conditional/present-without-rules.js +70 -0
  490. package/esm/rules/conditional/present-without-rules.js.map +1 -0
  491. package/esm/rules/conditional/required-if-rules.d.ts +77 -0
  492. package/esm/rules/conditional/required-if-rules.d.ts.map +1 -0
  493. package/esm/rules/conditional/required-if-rules.js +205 -0
  494. package/esm/rules/conditional/required-if-rules.js.map +1 -0
  495. package/esm/rules/conditional/required-unless-rules.d.ts +11 -0
  496. package/esm/rules/conditional/required-unless-rules.d.ts.map +1 -0
  497. package/esm/rules/conditional/required-unless-rules.js +22 -0
  498. package/esm/rules/conditional/required-unless-rules.js.map +1 -0
  499. package/esm/rules/conditional/required-when-rule.d.ts +18 -0
  500. package/esm/rules/conditional/required-when-rule.d.ts.map +1 -0
  501. package/esm/rules/conditional/required-when-rule.js +26 -0
  502. package/esm/rules/conditional/required-when-rule.js.map +1 -0
  503. package/esm/rules/conditional/required-with-rules.d.ts +26 -0
  504. package/esm/rules/conditional/required-with-rules.d.ts.map +1 -0
  505. package/esm/rules/conditional/required-with-rules.js +64 -0
  506. package/esm/rules/conditional/required-with-rules.js.map +1 -0
  507. package/esm/rules/conditional/required-without-rules.d.ts +26 -0
  508. package/esm/rules/conditional/required-without-rules.d.ts.map +1 -0
  509. package/esm/rules/conditional/required-without-rules.js +64 -0
  510. package/esm/rules/conditional/required-without-rules.js.map +1 -0
  511. package/esm/rules/core/equal.d.ts +8 -0
  512. package/esm/rules/core/equal.d.ts.map +1 -0
  513. package/esm/rules/core/equal.js +14 -0
  514. package/esm/rules/core/equal.js.map +1 -0
  515. package/esm/rules/core/forbidden.d.ts +6 -0
  516. package/esm/rules/core/forbidden.d.ts.map +1 -0
  517. package/esm/rules/core/forbidden.js +13 -0
  518. package/esm/rules/core/forbidden.js.map +1 -0
  519. package/esm/rules/core/index.d.ts +6 -0
  520. package/esm/rules/core/index.d.ts.map +1 -0
  521. package/esm/rules/core/required.d.ts +11 -0
  522. package/esm/rules/core/required.d.ts.map +1 -0
  523. package/esm/rules/core/required.js +31 -0
  524. package/esm/rules/core/required.js.map +1 -0
  525. package/esm/rules/core/union.d.ts +9 -0
  526. package/esm/rules/core/union.d.ts.map +1 -0
  527. package/esm/rules/core/union.js +40 -0
  528. package/esm/rules/core/union.js.map +1 -0
  529. package/esm/rules/core/when.d.ts +6 -0
  530. package/esm/rules/core/when.d.ts.map +1 -0
  531. package/esm/rules/core/when.js +40 -0
  532. package/esm/rules/core/when.js.map +1 -0
  533. package/esm/rules/date/date-comparison-rules.d.ts +25 -0
  534. package/esm/rules/date/date-comparison-rules.d.ts.map +1 -0
  535. package/esm/rules/date/date-comparison-rules.js +80 -0
  536. package/esm/rules/date/date-comparison-rules.js.map +1 -0
  537. package/esm/rules/date/date-day-rules.d.ts +21 -0
  538. package/esm/rules/date/date-day-rules.d.ts.map +1 -0
  539. package/esm/rules/date/date-day-rules.js +68 -0
  540. package/esm/rules/date/date-day-rules.js.map +1 -0
  541. package/esm/rules/date/date-field-comparison-rules.d.ts +28 -0
  542. package/esm/rules/date/date-field-comparison-rules.d.ts.map +1 -0
  543. package/esm/rules/date/date-field-comparison-rules.js +94 -0
  544. package/esm/rules/date/date-field-comparison-rules.js.map +1 -0
  545. package/esm/rules/date/date-period-rules.d.ts +124 -0
  546. package/esm/rules/date/date-period-rules.d.ts.map +1 -0
  547. package/esm/rules/date/date-period-rules.js +605 -0
  548. package/esm/rules/date/date-period-rules.js.map +1 -0
  549. package/esm/rules/date/date-relative-rules.d.ts +20 -0
  550. package/esm/rules/date/date-relative-rules.d.ts.map +1 -0
  551. package/esm/rules/date/date-relative-rules.js +60 -0
  552. package/esm/rules/date/date-relative-rules.js.map +1 -0
  553. package/esm/rules/date/date-special-rules.d.ts +20 -0
  554. package/esm/rules/date/date-special-rules.d.ts.map +1 -0
  555. package/esm/rules/date/date-special-rules.js +71 -0
  556. package/esm/rules/date/date-special-rules.js.map +1 -0
  557. package/esm/rules/date/date.d.ts +93 -0
  558. package/esm/rules/date/date.d.ts.map +1 -0
  559. package/esm/rules/date/date.js +288 -0
  560. package/esm/rules/date/date.js.map +1 -0
  561. package/esm/rules/date/index.d.ts +8 -0
  562. package/esm/rules/date/index.d.ts.map +1 -0
  563. package/esm/rules/file/dimensions.d.ts +26 -0
  564. package/esm/rules/file/dimensions.d.ts.map +1 -0
  565. package/esm/rules/file/dimensions.js +60 -0
  566. package/esm/rules/file/dimensions.js.map +1 -0
  567. package/esm/rules/file/file-size.d.ts +14 -0
  568. package/esm/rules/file/file-size.d.ts.map +1 -0
  569. package/esm/rules/file/file-size.js +30 -0
  570. package/esm/rules/file/file-size.js.map +1 -0
  571. package/esm/rules/file/index.d.ts +11 -0
  572. package/esm/rules/file/index.d.ts.map +1 -0
  573. package/esm/rules/index.d.ts +19 -0
  574. package/esm/rules/index.d.ts.map +1 -0
  575. package/esm/rules/length/index.d.ts +2 -0
  576. package/esm/rules/length/index.d.ts.map +1 -0
  577. package/esm/rules/length/length-rules.d.ts +49 -0
  578. package/esm/rules/length/length-rules.d.ts.map +1 -0
  579. package/esm/rules/length/length-rules.js +107 -0
  580. package/esm/rules/length/length-rules.js.map +1 -0
  581. package/esm/rules/number/index.d.ts +2 -0
  582. package/esm/rules/number/index.d.ts.map +1 -0
  583. package/esm/rules/number/number-rules.d.ts +65 -0
  584. package/esm/rules/number/number-rules.d.ts.map +1 -0
  585. package/esm/rules/number/number-rules.js +245 -0
  586. package/esm/rules/number/number-rules.js.map +1 -0
  587. package/esm/rules/scalar/accepted-rule.d.ts +39 -0
  588. package/esm/rules/scalar/accepted-rule.d.ts.map +1 -0
  589. package/esm/rules/scalar/accepted-rule.js +117 -0
  590. package/esm/rules/scalar/accepted-rule.js.map +1 -0
  591. package/esm/rules/scalar/declined-rule.d.ts +39 -0
  592. package/esm/rules/scalar/declined-rule.d.ts.map +1 -0
  593. package/esm/rules/scalar/declined-rule.js +117 -0
  594. package/esm/rules/scalar/declined-rule.js.map +1 -0
  595. package/esm/rules/scalar/index.d.ts +3 -0
  596. package/esm/rules/scalar/index.d.ts.map +1 -0
  597. package/esm/rules/string/alpha.d.ts +14 -0
  598. package/esm/rules/string/alpha.d.ts.map +1 -0
  599. package/esm/rules/string/alpha.js +39 -0
  600. package/esm/rules/string/alpha.js.map +1 -0
  601. package/esm/rules/string/credit-card.d.ts +6 -0
  602. package/esm/rules/string/credit-card.d.ts.map +1 -0
  603. package/esm/rules/string/credit-card.js +31 -0
  604. package/esm/rules/string/credit-card.js.map +1 -0
  605. package/esm/rules/string/email.d.ts +6 -0
  606. package/esm/rules/string/email.d.ts.map +1 -0
  607. package/esm/rules/string/email.js +13 -0
  608. package/esm/rules/string/email.js.map +1 -0
  609. package/esm/rules/string/index.d.ts +17 -0
  610. package/esm/rules/string/index.d.ts.map +1 -0
  611. package/esm/rules/string/ip.d.ts +14 -0
  612. package/esm/rules/string/ip.d.ts.map +1 -0
  613. package/esm/rules/string/ip.js +39 -0
  614. package/esm/rules/string/ip.js.map +1 -0
  615. package/esm/rules/string/matches.d.ts +8 -0
  616. package/esm/rules/string/matches.d.ts.map +1 -0
  617. package/esm/rules/string/matches.js +15 -0
  618. package/esm/rules/string/matches.js.map +1 -0
  619. package/esm/rules/string/pattern.d.ts +8 -0
  620. package/esm/rules/string/pattern.d.ts.map +1 -0
  621. package/esm/rules/string/pattern.js +14 -0
  622. package/esm/rules/string/pattern.js.map +1 -0
  623. package/esm/rules/string/string-comparison.d.ts +26 -0
  624. package/esm/rules/string/string-comparison.d.ts.map +1 -0
  625. package/esm/rules/string/string-comparison.js +56 -0
  626. package/esm/rules/string/string-comparison.js.map +1 -0
  627. package/esm/rules/string/strong-password-rule.d.ts +14 -0
  628. package/esm/rules/string/strong-password-rule.d.ts.map +1 -0
  629. package/esm/rules/string/strong-password-rule.js +38 -0
  630. package/esm/rules/string/strong-password-rule.js.map +1 -0
  631. package/esm/rules/string/url.d.ts +6 -0
  632. package/esm/rules/string/url.d.ts.map +1 -0
  633. package/esm/rules/string/url.js +16 -0
  634. package/esm/rules/string/url.js.map +1 -0
  635. package/esm/rules/string/without-whitespace.d.ts +6 -0
  636. package/esm/rules/string/without-whitespace.d.ts.map +1 -0
  637. package/esm/rules/string/without-whitespace.js +13 -0
  638. package/esm/rules/string/without-whitespace.js.map +1 -0
  639. package/esm/standard-schema/index.d.ts +4 -0
  640. package/esm/standard-schema/index.d.ts.map +1 -0
  641. package/esm/standard-schema/json-schema.d.ts +61 -0
  642. package/esm/standard-schema/json-schema.d.ts.map +1 -0
  643. package/esm/standard-schema/json-schema.js +85 -0
  644. package/esm/standard-schema/json-schema.js.map +1 -0
  645. package/esm/standard-schema/map-result.d.ts +18 -0
  646. package/esm/standard-schema/map-result.d.ts.map +1 -0
  647. package/esm/standard-schema/map-result.js +27 -0
  648. package/esm/standard-schema/map-result.js.map +1 -0
  649. package/esm/standard-schema/types.d.ts +93 -0
  650. package/esm/standard-schema/types.d.ts.map +1 -0
  651. package/esm/types/conditional-types.d.ts +15 -0
  652. package/esm/types/conditional-types.d.ts.map +1 -0
  653. package/esm/types/context-types.d.ts +47 -0
  654. package/esm/types/context-types.d.ts.map +1 -0
  655. package/esm/types/data-transformer-types.d.ts +25 -0
  656. package/esm/types/data-transformer-types.d.ts.map +1 -0
  657. package/esm/types/date-types.d.ts +9 -0
  658. package/esm/types/date-types.d.ts.map +1 -0
  659. package/esm/types/date-types.js +12 -0
  660. package/esm/types/date-types.js.map +1 -0
  661. package/esm/types/file.types.d.ts +5 -0
  662. package/esm/types/file.types.d.ts.map +1 -0
  663. package/esm/types/index.d.ts +11 -0
  664. package/esm/types/index.d.ts.map +1 -0
  665. package/esm/types/inference-types.d.ts +32 -0
  666. package/esm/types/inference-types.d.ts.map +1 -0
  667. package/esm/types/mutator-types.d.ts +27 -0
  668. package/esm/types/mutator-types.d.ts.map +1 -0
  669. package/esm/types/result-types.d.ts +19 -0
  670. package/esm/types/result-types.d.ts.map +1 -0
  671. package/esm/types/rule-types.d.ts +58 -0
  672. package/esm/types/rule-types.d.ts.map +1 -0
  673. package/esm/types/schema-types.d.ts +6 -0
  674. package/esm/types/schema-types.d.ts.map +1 -0
  675. package/esm/validators/any-validator.d.ts +29 -0
  676. package/esm/validators/any-validator.d.ts.map +1 -0
  677. package/esm/validators/any-validator.js +31 -0
  678. package/esm/validators/any-validator.js.map +1 -0
  679. package/esm/validators/array-validator.d.ts +72 -0
  680. package/esm/validators/array-validator.d.ts.map +1 -0
  681. package/esm/validators/array-validator.js +162 -0
  682. package/esm/validators/array-validator.js.map +1 -0
  683. package/esm/validators/base-validator.d.ts +425 -0
  684. package/esm/validators/base-validator.d.ts.map +1 -0
  685. package/esm/validators/base-validator.js +637 -0
  686. package/esm/validators/base-validator.js.map +1 -0
  687. package/esm/validators/boolean-validator.d.ts +67 -0
  688. package/esm/validators/boolean-validator.d.ts.map +1 -0
  689. package/esm/validators/boolean-validator.js +105 -0
  690. package/esm/validators/boolean-validator.js.map +1 -0
  691. package/esm/validators/computed-validator.d.ts +75 -0
  692. package/esm/validators/computed-validator.d.ts.map +1 -0
  693. package/esm/validators/computed-validator.js +124 -0
  694. package/esm/validators/computed-validator.js.map +1 -0
  695. package/esm/validators/date-validator.d.ts +330 -0
  696. package/esm/validators/date-validator.d.ts.map +1 -0
  697. package/esm/validators/date-validator.js +614 -0
  698. package/esm/validators/date-validator.js.map +1 -0
  699. package/esm/validators/float-validator.d.ts +8 -0
  700. package/esm/validators/float-validator.d.ts.map +1 -0
  701. package/esm/validators/float-validator.js +9 -0
  702. package/esm/validators/float-validator.js.map +1 -0
  703. package/esm/validators/index.d.ts +31 -0
  704. package/esm/validators/index.d.ts.map +1 -0
  705. package/esm/validators/int-validator.d.ts +19 -0
  706. package/esm/validators/int-validator.d.ts.map +1 -0
  707. package/esm/validators/int-validator.js +21 -0
  708. package/esm/validators/int-validator.js.map +1 -0
  709. package/esm/validators/managed-validator.d.ts +38 -0
  710. package/esm/validators/managed-validator.d.ts.map +1 -0
  711. package/esm/validators/managed-validator.js +34 -0
  712. package/esm/validators/managed-validator.js.map +1 -0
  713. package/esm/validators/methods/equality-conditional-methods.d.ts +88 -0
  714. package/esm/validators/methods/equality-conditional-methods.d.ts.map +1 -0
  715. package/esm/validators/methods/equality-conditional-methods.js +118 -0
  716. package/esm/validators/methods/equality-conditional-methods.js.map +1 -0
  717. package/esm/validators/methods/forbidden-methods.d.ts +58 -0
  718. package/esm/validators/methods/forbidden-methods.d.ts.map +1 -0
  719. package/esm/validators/methods/forbidden-methods.js +122 -0
  720. package/esm/validators/methods/forbidden-methods.js.map +1 -0
  721. package/esm/validators/methods/present-methods.d.ts +102 -0
  722. package/esm/validators/methods/present-methods.d.ts.map +1 -0
  723. package/esm/validators/methods/present-methods.js +229 -0
  724. package/esm/validators/methods/present-methods.js.map +1 -0
  725. package/esm/validators/methods/required-methods.d.ts +174 -0
  726. package/esm/validators/methods/required-methods.d.ts.map +1 -0
  727. package/esm/validators/methods/required-methods.js +246 -0
  728. package/esm/validators/methods/required-methods.js.map +1 -0
  729. package/esm/validators/number-validator.d.ts +166 -0
  730. package/esm/validators/number-validator.d.ts.map +1 -0
  731. package/esm/validators/number-validator.js +307 -0
  732. package/esm/validators/number-validator.js.map +1 -0
  733. package/esm/validators/numeric-validator.d.ts +15 -0
  734. package/esm/validators/numeric-validator.d.ts.map +1 -0
  735. package/esm/validators/numeric-validator.js +18 -0
  736. package/esm/validators/numeric-validator.js.map +1 -0
  737. package/esm/validators/object-validator.d.ts +233 -0
  738. package/esm/validators/object-validator.d.ts.map +1 -0
  739. package/esm/validators/object-validator.js +517 -0
  740. package/esm/validators/object-validator.js.map +1 -0
  741. package/esm/validators/primitive-validator.d.ts +70 -0
  742. package/esm/validators/primitive-validator.d.ts.map +1 -0
  743. package/esm/validators/primitive-validator.js +80 -0
  744. package/esm/validators/primitive-validator.js.map +1 -0
  745. package/esm/validators/record-validator.d.ts +54 -0
  746. package/esm/validators/record-validator.d.ts.map +1 -0
  747. package/esm/validators/record-validator.js +100 -0
  748. package/esm/validators/record-validator.js.map +1 -0
  749. package/esm/validators/scalar-validator.d.ts +93 -0
  750. package/esm/validators/scalar-validator.d.ts.map +1 -0
  751. package/esm/validators/scalar-validator.js +149 -0
  752. package/esm/validators/scalar-validator.js.map +1 -0
  753. package/esm/validators/string-validator.d.ts +189 -0
  754. package/esm/validators/string-validator.d.ts.map +1 -0
  755. package/esm/validators/string-validator.js +387 -0
  756. package/esm/validators/string-validator.js.map +1 -0
  757. package/esm/validators/tuple-validator.d.ts +56 -0
  758. package/esm/validators/tuple-validator.d.ts.map +1 -0
  759. package/esm/validators/tuple-validator.js +121 -0
  760. package/esm/validators/tuple-validator.js.map +1 -0
  761. package/esm/validators/union-validator.d.ts +55 -0
  762. package/esm/validators/union-validator.d.ts.map +1 -0
  763. package/esm/validators/union-validator.js +60 -0
  764. package/esm/validators/union-validator.js.map +1 -0
  765. package/package.json +1 -1
@@ -0,0 +1,100 @@
1
+ 'use strict';var getFieldValue=require('../../helpers/get-field-value.js'),validationHelpers=require('../../helpers/validation-helpers.js'),isEmptyValue=require('../../helpers/is-empty-value.js');/**
2
+ * Present if rule - field must be present if another field equals a specific value
3
+ * Supports both global and sibling scope
4
+ */
5
+ const presentIfRule = {
6
+ name: "presentIf",
7
+ description: "The field must be present if another field equals a specific value",
8
+ sortOrder: -2,
9
+ requiresValue: false,
10
+ defaultErrorMessage: "The :input field must be present",
11
+ async validate(value, context) {
12
+ const { value: expectedValue } = this.context.options;
13
+ const fieldValue = getFieldValue.getFieldValue(this, context);
14
+ // Field must be present if the other field equals the expected value
15
+ if (value === undefined && fieldValue === expectedValue) {
16
+ this.context.translationParams.value = expectedValue;
17
+ this.context.translatableParams.field = this.context.options.field;
18
+ return validationHelpers.invalidRule(this, context);
19
+ }
20
+ return validationHelpers.VALID_RULE;
21
+ },
22
+ };
23
+ /**
24
+ * Present if empty rule - field must be present if another field is empty
25
+ * Supports both global and sibling scope
26
+ */
27
+ const presentIfEmptyRule = {
28
+ name: "presentIfEmpty",
29
+ description: "The field must be present if another field is empty",
30
+ sortOrder: -2,
31
+ requiresValue: false,
32
+ defaultErrorMessage: "The :input field must be present",
33
+ async validate(value, context) {
34
+ const fieldValue = getFieldValue.getFieldValue(this, context);
35
+ // Field must be present if the other field is empty
36
+ if (value === undefined && isEmptyValue.isEmptyValue(fieldValue)) {
37
+ return validationHelpers.invalidRule(this, context);
38
+ }
39
+ return validationHelpers.VALID_RULE;
40
+ },
41
+ };
42
+ /**
43
+ * Present if not empty rule - field must be present if another field is not empty
44
+ * Supports both global and sibling scope
45
+ */
46
+ const presentIfNotEmptyRule = {
47
+ name: "presentIfNotEmpty",
48
+ description: "The field must be present if another field is not empty",
49
+ sortOrder: -2,
50
+ requiresValue: false,
51
+ defaultErrorMessage: "The :input field must be present",
52
+ async validate(value, context) {
53
+ const fieldValue = getFieldValue.getFieldValue(this, context);
54
+ // Field must be present if the other field is not empty
55
+ if (value === undefined && !isEmptyValue.isEmptyValue(fieldValue)) {
56
+ return validationHelpers.invalidRule(this, context);
57
+ }
58
+ return validationHelpers.VALID_RULE;
59
+ },
60
+ };
61
+ /**
62
+ * Present if in rule - field must be present if another field's value is in the given array
63
+ * Supports both global and sibling scope
64
+ */
65
+ const presentIfInRule = {
66
+ name: "presentIfIn",
67
+ description: "The field must be present if another field's value is in the given array",
68
+ sortOrder: -2,
69
+ requiresValue: false,
70
+ defaultErrorMessage: "The :input field must be present",
71
+ async validate(value, context) {
72
+ const { values } = this.context.options;
73
+ const fieldValue = getFieldValue.getFieldValue(this, context);
74
+ // Field must be present if the other field's value is in the array
75
+ if (value === undefined && values.includes(fieldValue)) {
76
+ return validationHelpers.invalidRule(this, context);
77
+ }
78
+ return validationHelpers.VALID_RULE;
79
+ },
80
+ };
81
+ /**
82
+ * Present if not in rule - field must be present if another field's value is NOT in the given array
83
+ * Supports both global and sibling scope
84
+ */
85
+ const presentIfNotInRule = {
86
+ name: "presentIfNotIn",
87
+ description: "The field must be present if another field's value is NOT in the given array",
88
+ sortOrder: -2,
89
+ requiresValue: false,
90
+ defaultErrorMessage: "The :input field must be present",
91
+ async validate(value, context) {
92
+ const { values } = this.context.options;
93
+ const fieldValue = getFieldValue.getFieldValue(this, context);
94
+ // Field must be present if the other field's value is NOT in the array
95
+ if (value === undefined && !values.includes(fieldValue)) {
96
+ return validationHelpers.invalidRule(this, context);
97
+ }
98
+ return validationHelpers.VALID_RULE;
99
+ },
100
+ };exports.presentIfEmptyRule=presentIfEmptyRule;exports.presentIfInRule=presentIfInRule;exports.presentIfNotEmptyRule=presentIfNotEmptyRule;exports.presentIfNotInRule=presentIfNotInRule;exports.presentIfRule=presentIfRule;//# sourceMappingURL=present-if-rules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"present-if-rules.js","sources":["../../../src/rules/conditional/present-if-rules.ts"],"sourcesContent":[null],"names":["getFieldValue","invalidRule","VALID_RULE","isEmptyValue"],"mappings":"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"}
@@ -0,0 +1,11 @@
1
+ import type { SchemaRule } from "../../types";
2
+ /**
3
+ * Present unless rule - field must be present unless another field equals a specific value
4
+ * Supports both global and sibling scope
5
+ */
6
+ export declare const presentUnlessRule: SchemaRule<{
7
+ field: string;
8
+ value: any;
9
+ scope?: "global" | "sibling";
10
+ }>;
11
+ //# sourceMappingURL=present-unless-rules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"present-unless-rules.d.ts","sourceRoot":"","sources":["../../../src/rules/conditional/present-unless-rules.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,UAAU,CAAC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,GAAG,CAAC;IACX,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC9B,CAmBA,CAAC"}
@@ -0,0 +1,22 @@
1
+ 'use strict';var getFieldValue=require('../../helpers/get-field-value.js'),validationHelpers=require('../../helpers/validation-helpers.js');/**
2
+ * Present unless rule - field must be present unless another field equals a specific value
3
+ * Supports both global and sibling scope
4
+ */
5
+ const presentUnlessRule = {
6
+ name: "presentUnless",
7
+ description: "The field must be present unless another field equals a specific value",
8
+ sortOrder: -2,
9
+ requiresValue: false,
10
+ defaultErrorMessage: "The :input field must be present",
11
+ async validate(value, context) {
12
+ const { value: expectedValue } = this.context.options;
13
+ const fieldValue = getFieldValue.getFieldValue(this, context);
14
+ // Field must be present unless the other field equals the expected value
15
+ if (value === undefined && fieldValue !== expectedValue) {
16
+ this.context.translationParams.value = expectedValue;
17
+ this.context.translatableParams.field = this.context.options.field;
18
+ return validationHelpers.invalidRule(this, context);
19
+ }
20
+ return validationHelpers.VALID_RULE;
21
+ },
22
+ };exports.presentUnlessRule=presentUnlessRule;//# sourceMappingURL=present-unless-rules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"present-unless-rules.js","sources":["../../../src/rules/conditional/present-unless-rules.ts"],"sourcesContent":[null],"names":["getFieldValue","invalidRule","VALID_RULE"],"mappings":"4IAGA;;;AAGG;AACU,MAAA,iBAAiB,GAIzB;AACH,IAAA,IAAI,EAAE,eAAe;AACrB,IAAA,WAAW,EAAE,wEAAwE;IACrF,SAAS,EAAE,CAAC,CAAC;AACb,IAAA,aAAa,EAAE,KAAK;AACpB,IAAA,mBAAmB,EAAE,kCAAkC;AACvD,IAAA,MAAM,QAAQ,CAAC,KAAU,EAAE,OAAO,EAAA;QAChC,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;QACtD,MAAM,UAAU,GAAGA,2BAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;;AAGhD,QAAA,IAAI,KAAK,KAAK,SAAS,IAAI,UAAU,KAAK,aAAa,EAAE;YACvD,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,KAAK,GAAG,aAAa,CAAC;AACrD,YAAA,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC;AACnE,YAAA,OAAOC,6BAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACnC,SAAA;AAED,QAAA,OAAOC,4BAAU,CAAC;KACnB;"}
@@ -0,0 +1,26 @@
1
+ import type { SchemaRule } from "../../types";
2
+ /**
3
+ * Present with rule - field must be present if another field is present
4
+ * Supports both global and sibling scope
5
+ */
6
+ export declare const presentWithRule: SchemaRule<{
7
+ field: string;
8
+ scope?: "global" | "sibling";
9
+ }>;
10
+ /**
11
+ * Present with all rule - field must be present if all specified fields are present
12
+ * Supports both global and sibling scope
13
+ */
14
+ export declare const presentWithAllRule: SchemaRule<{
15
+ fields: string[];
16
+ scope?: "global" | "sibling";
17
+ }>;
18
+ /**
19
+ * Present with any rule - field must be present if any of the specified fields is present
20
+ * Supports both global and sibling scope
21
+ */
22
+ export declare const presentWithAnyRule: SchemaRule<{
23
+ fields: string[];
24
+ scope?: "global" | "sibling";
25
+ }>;
26
+ //# sourceMappingURL=present-with-rules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"present-with-rules.d.ts","sourceRoot":"","sources":["../../../src/rules/conditional/present-with-rules.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,UAAU,CAAC;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC9B,CAiBA,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,UAAU,CAAC;IAC1C,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC9B,CAwBA,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,UAAU,CAAC;IAC1C,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC9B,CAwBA,CAAC"}
@@ -0,0 +1,70 @@
1
+ 'use strict';var reinforcements=require('@mongez/reinforcements'),getFieldValue=require('../../helpers/get-field-value.js'),validationHelpers=require('../../helpers/validation-helpers.js');/**
2
+ * Present with rule - field must be present if another field is present
3
+ * Supports both global and sibling scope
4
+ */
5
+ const presentWithRule = {
6
+ name: "presentWith",
7
+ description: "The field must be present if another field is present",
8
+ sortOrder: -2,
9
+ requiresValue: false,
10
+ defaultErrorMessage: "The :input field must be present",
11
+ async validate(value, context) {
12
+ const fieldValue = getFieldValue.getFieldValue(this, context);
13
+ // The field must be present if the other field is present
14
+ if (value === undefined && fieldValue !== undefined) {
15
+ this.context.translatableParams.field = this.context.options.field;
16
+ return validationHelpers.invalidRule(this, context);
17
+ }
18
+ return validationHelpers.VALID_RULE;
19
+ },
20
+ };
21
+ /**
22
+ * Present with all rule - field must be present if all specified fields are present
23
+ * Supports both global and sibling scope
24
+ */
25
+ const presentWithAllRule = {
26
+ name: "presentWithAll",
27
+ description: "The field must be present if all specified fields are present",
28
+ sortOrder: -2,
29
+ requiresValue: false,
30
+ defaultErrorMessage: "The :input field must be present",
31
+ async validate(value, context) {
32
+ const { fields, scope = "global" } = this.context.options;
33
+ const source = scope === "sibling" ? context.parent : context.allValues;
34
+ // Check if all fields are present
35
+ const allPresent = fields.every((field) => reinforcements.get(source, field) !== undefined);
36
+ // Field must be present if all other fields are present
37
+ if (value === undefined && allPresent) {
38
+ fields.forEach((field) => {
39
+ this.context.translatableParams.field = field;
40
+ });
41
+ return validationHelpers.invalidRule(this, context);
42
+ }
43
+ return validationHelpers.VALID_RULE;
44
+ },
45
+ };
46
+ /**
47
+ * Present with any rule - field must be present if any of the specified fields is present
48
+ * Supports both global and sibling scope
49
+ */
50
+ const presentWithAnyRule = {
51
+ name: "presentWithAny",
52
+ description: "The field must be present if any of the specified fields is present",
53
+ sortOrder: -2,
54
+ requiresValue: false,
55
+ defaultErrorMessage: "The :input field must be present",
56
+ async validate(value, context) {
57
+ const { fields, scope = "global" } = this.context.options;
58
+ const source = scope === "sibling" ? context.parent : context.allValues;
59
+ // Check if any field is present
60
+ const anyPresent = fields.some((field) => reinforcements.get(source, field) !== undefined);
61
+ // Field must be present if any other field is present
62
+ if (value === undefined && anyPresent) {
63
+ fields.forEach((field) => {
64
+ this.context.translatableParams.field = field;
65
+ });
66
+ return validationHelpers.invalidRule(this, context);
67
+ }
68
+ return validationHelpers.VALID_RULE;
69
+ },
70
+ };exports.presentWithAllRule=presentWithAllRule;exports.presentWithAnyRule=presentWithAnyRule;exports.presentWithRule=presentWithRule;//# sourceMappingURL=present-with-rules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"present-with-rules.js","sources":["../../../src/rules/conditional/present-with-rules.ts"],"sourcesContent":[null],"names":["getFieldValue","invalidRule","VALID_RULE","get"],"mappings":"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"}
@@ -0,0 +1,26 @@
1
+ import type { SchemaRule } from "../../types";
2
+ /**
3
+ * Present without rule - field must be present if another field is missing
4
+ * Supports both global and sibling scope
5
+ */
6
+ export declare const presentWithoutRule: SchemaRule<{
7
+ field: string;
8
+ scope?: "global" | "sibling";
9
+ }>;
10
+ /**
11
+ * Present without all rule - field must be present if all specified fields are missing
12
+ * Supports both global and sibling scope
13
+ */
14
+ export declare const presentWithoutAllRule: SchemaRule<{
15
+ fields: string[];
16
+ scope?: "global" | "sibling";
17
+ }>;
18
+ /**
19
+ * Present without any rule - field must be present if any of the specified fields is missing
20
+ * Supports both global and sibling scope
21
+ */
22
+ export declare const presentWithoutAnyRule: SchemaRule<{
23
+ fields: string[];
24
+ scope?: "global" | "sibling";
25
+ }>;
26
+ //# sourceMappingURL=present-without-rules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"present-without-rules.d.ts","sourceRoot":"","sources":["../../../src/rules/conditional/present-without-rules.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,UAAU,CAAC;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC9B,CAiBA,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,UAAU,CAAC;IAC7C,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC9B,CAwBA,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,UAAU,CAAC;IAC7C,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC9B,CAwBA,CAAC"}
@@ -0,0 +1,70 @@
1
+ 'use strict';var reinforcements=require('@mongez/reinforcements'),getFieldValue=require('../../helpers/get-field-value.js'),validationHelpers=require('../../helpers/validation-helpers.js');/**
2
+ * Present without rule - field must be present if another field is missing
3
+ * Supports both global and sibling scope
4
+ */
5
+ const presentWithoutRule = {
6
+ name: "presentWithout",
7
+ description: "The field must be present if another field is missing",
8
+ sortOrder: -2,
9
+ requiresValue: false,
10
+ defaultErrorMessage: "The :input field must be present",
11
+ async validate(value, context) {
12
+ const fieldValue = getFieldValue.getFieldValue(this, context);
13
+ // Field must be present if the other field is missing
14
+ if (value === undefined && fieldValue === undefined) {
15
+ this.context.translatableParams.field = this.context.options.field;
16
+ return validationHelpers.invalidRule(this, context);
17
+ }
18
+ return validationHelpers.VALID_RULE;
19
+ },
20
+ };
21
+ /**
22
+ * Present without all rule - field must be present if all specified fields are missing
23
+ * Supports both global and sibling scope
24
+ */
25
+ const presentWithoutAllRule = {
26
+ name: "presentWithoutAll",
27
+ description: "The field must be present if all specified fields are missing",
28
+ sortOrder: -2,
29
+ requiresValue: false,
30
+ defaultErrorMessage: "The :input field must be present",
31
+ async validate(value, context) {
32
+ const { fields, scope = "global" } = this.context.options;
33
+ const source = scope === "sibling" ? context.parent : context.allValues;
34
+ // Check if all fields are missing
35
+ const allMissing = fields.every((field) => reinforcements.get(source, field) === undefined);
36
+ // Field must be present if all other fields are missing
37
+ if (value === undefined && allMissing) {
38
+ fields.forEach((field) => {
39
+ this.context.translatableParams.field = field;
40
+ });
41
+ return validationHelpers.invalidRule(this, context);
42
+ }
43
+ return validationHelpers.VALID_RULE;
44
+ },
45
+ };
46
+ /**
47
+ * Present without any rule - field must be present if any of the specified fields is missing
48
+ * Supports both global and sibling scope
49
+ */
50
+ const presentWithoutAnyRule = {
51
+ name: "presentWithoutAny",
52
+ description: "The field must be present if any of the specified fields is missing",
53
+ sortOrder: -2,
54
+ requiresValue: false,
55
+ defaultErrorMessage: "The :input field must be present",
56
+ async validate(value, context) {
57
+ const { fields, scope = "global" } = this.context.options;
58
+ const source = scope === "sibling" ? context.parent : context.allValues;
59
+ // Check if any field is missing
60
+ const anyMissing = fields.some((field) => reinforcements.get(source, field) === undefined);
61
+ // Field must be present if any other field is missing
62
+ if (value === undefined && anyMissing) {
63
+ fields.forEach((field) => {
64
+ this.context.translatableParams.field = field;
65
+ });
66
+ return validationHelpers.invalidRule(this, context);
67
+ }
68
+ return validationHelpers.VALID_RULE;
69
+ },
70
+ };exports.presentWithoutAllRule=presentWithoutAllRule;exports.presentWithoutAnyRule=presentWithoutAnyRule;exports.presentWithoutRule=presentWithoutRule;//# sourceMappingURL=present-without-rules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"present-without-rules.js","sources":["../../../src/rules/conditional/present-without-rules.ts"],"sourcesContent":[null],"names":["getFieldValue","invalidRule","VALID_RULE","get"],"mappings":"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"}
@@ -0,0 +1,77 @@
1
+ import type { SchemaRule } from "../../types";
2
+ /**
3
+ * Required if rule - field is required if another field equals a specific value
4
+ * Supports both global and sibling scope
5
+ */
6
+ export declare const requiredIfRule: SchemaRule<{
7
+ field: string;
8
+ value: any;
9
+ scope?: "global" | "sibling";
10
+ }>;
11
+ /**
12
+ * Required if empty rule - field is required if another field is empty
13
+ * Supports both global and sibling scope
14
+ */
15
+ export declare const requiredIfEmptyRule: SchemaRule<{
16
+ field: string;
17
+ scope?: "global" | "sibling";
18
+ }>;
19
+ /**
20
+ * Required if not empty rule - field is required if another field is not empty
21
+ * Supports both global and sibling scope
22
+ */
23
+ export declare const requiredIfNotEmptyRule: SchemaRule<{
24
+ field: string;
25
+ scope?: "global" | "sibling";
26
+ }>;
27
+ /**
28
+ * Required if in rule - field is required if another field's value is in the given array
29
+ * Supports both global and sibling scope
30
+ */
31
+ export declare const requiredIfInRule: SchemaRule<{
32
+ field: string;
33
+ values: any[];
34
+ scope?: "global" | "sibling";
35
+ }>;
36
+ /**
37
+ * Required if not in rule - field is required if another field's value is NOT in the given array
38
+ * Supports both global and sibling scope
39
+ */
40
+ export declare const requiredIfNotInRule: SchemaRule<{
41
+ field: string;
42
+ values: any[];
43
+ scope?: "global" | "sibling";
44
+ }>;
45
+ /**
46
+ * Required if all empty rule - field is required if ALL specified fields are empty
47
+ * Supports both global and sibling scope
48
+ */
49
+ export declare const requiredIfAllEmptyRule: SchemaRule<{
50
+ fields: string[];
51
+ scope?: "global" | "sibling";
52
+ }>;
53
+ /**
54
+ * Required if any empty rule - field is required if ANY of the specified fields is empty
55
+ * Supports both global and sibling scope
56
+ */
57
+ export declare const requiredIfAnyEmptyRule: SchemaRule<{
58
+ fields: string[];
59
+ scope?: "global" | "sibling";
60
+ }>;
61
+ /**
62
+ * Required if all not empty rule - field is required if ALL specified fields are NOT empty
63
+ * Supports both global and sibling scope
64
+ */
65
+ export declare const requiredIfAllNotEmptyRule: SchemaRule<{
66
+ fields: string[];
67
+ scope?: "global" | "sibling";
68
+ }>;
69
+ /**
70
+ * Required if any not empty rule - field is required if ANY of the specified fields is NOT empty
71
+ * Supports both global and sibling scope
72
+ */
73
+ export declare const requiredIfAnyNotEmptyRule: SchemaRule<{
74
+ fields: string[];
75
+ scope?: "global" | "sibling";
76
+ }>;
77
+ //# sourceMappingURL=required-if-rules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"required-if-rules.d.ts","sourceRoot":"","sources":["../../../src/rules/conditional/required-if-rules.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,UAAU,CAAC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,GAAG,CAAC;IACX,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC9B,CAkBA,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,UAAU,CAAC;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC9B,CAiBA,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,UAAU,CAAC;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC9B,CAiBA,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,UAAU,CAAC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,GAAG,EAAE,CAAC;IACd,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC9B,CAmBA,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,UAAU,CAAC;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,GAAG,EAAE,CAAC;IACd,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC9B,CAmBA,CAAC;AAcF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,UAAU,CAAC;IAC9C,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC9B,CAoBA,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,UAAU,CAAC;IAC9C,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC9B,CAoBA,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,UAAU,CAAC;IACjD,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC9B,CAoBA,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,UAAU,CAAC;IACjD,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC9B,CAoBA,CAAC"}
@@ -0,0 +1,205 @@
1
+ 'use strict';var reinforcements=require('@mongez/reinforcements'),getFieldValue=require('../../helpers/get-field-value.js'),validationHelpers=require('../../helpers/validation-helpers.js'),isEmptyValue=require('../../helpers/is-empty-value.js');/**
2
+ * Required if rule - field is required if another field equals a specific value
3
+ * Supports both global and sibling scope
4
+ */
5
+ const requiredIfRule = {
6
+ name: "requiredIf",
7
+ description: "The field is required if another field equals a specific value",
8
+ sortOrder: -2,
9
+ requiresValue: false,
10
+ defaultErrorMessage: "The :input is required",
11
+ async validate(value, context) {
12
+ const { value: expectedValue } = this.context.options;
13
+ const fieldValue = getFieldValue.getFieldValue(this, context);
14
+ // Field is required if the other field equals the expected value
15
+ if (isEmptyValue.isEmptyValue(value) && fieldValue === expectedValue) {
16
+ this.context.translatableParams.field = this.context.options.field;
17
+ return validationHelpers.invalidRule(this, context);
18
+ }
19
+ return validationHelpers.VALID_RULE;
20
+ },
21
+ };
22
+ /**
23
+ * Required if empty rule - field is required if another field is empty
24
+ * Supports both global and sibling scope
25
+ */
26
+ const requiredIfEmptyRule = {
27
+ name: "requiredIfEmpty",
28
+ description: "The field is required if :field is empty",
29
+ sortOrder: -2,
30
+ requiresValue: false,
31
+ defaultErrorMessage: "The :input is required",
32
+ async validate(value, context) {
33
+ const fieldValue = getFieldValue.getFieldValue(this, context);
34
+ // Field is required if the other field is empty
35
+ if (isEmptyValue.isEmptyValue(value) && isEmptyValue.isEmptyValue(fieldValue)) {
36
+ this.context.translatableParams.field = this.context.options.field;
37
+ return validationHelpers.invalidRule(this, context);
38
+ }
39
+ return validationHelpers.VALID_RULE;
40
+ },
41
+ };
42
+ /**
43
+ * Required if not empty rule - field is required if another field is not empty
44
+ * Supports both global and sibling scope
45
+ */
46
+ const requiredIfNotEmptyRule = {
47
+ name: "requiredIfNotEmpty",
48
+ description: "The field is required if :field is not empty",
49
+ sortOrder: -2,
50
+ requiresValue: false,
51
+ defaultErrorMessage: "The :input is required",
52
+ async validate(value, context) {
53
+ const fieldValue = getFieldValue.getFieldValue(this, context);
54
+ // Field is required if the other field is not empty
55
+ if (isEmptyValue.isEmptyValue(value) && !isEmptyValue.isEmptyValue(fieldValue)) {
56
+ this.context.translatableParams.field = this.context.options.field;
57
+ return validationHelpers.invalidRule(this, context);
58
+ }
59
+ return validationHelpers.VALID_RULE;
60
+ },
61
+ };
62
+ /**
63
+ * Required if in rule - field is required if another field's value is in the given array
64
+ * Supports both global and sibling scope
65
+ */
66
+ const requiredIfInRule = {
67
+ name: "requiredIfIn",
68
+ description: "The field is required if :field value is in the given array",
69
+ sortOrder: -2,
70
+ requiresValue: false,
71
+ defaultErrorMessage: "The :input is required",
72
+ async validate(value, context) {
73
+ const { values } = this.context.options;
74
+ const fieldValue = getFieldValue.getFieldValue(this, context);
75
+ // Field is required if the other field's value is in the array
76
+ if (isEmptyValue.isEmptyValue(value) && values.includes(fieldValue)) {
77
+ this.context.translatableParams.field = this.context.options.field;
78
+ this.context.translationParams.values = this.context.options.values.join(", ");
79
+ return validationHelpers.invalidRule(this, context);
80
+ }
81
+ return validationHelpers.VALID_RULE;
82
+ },
83
+ };
84
+ /**
85
+ * Required if not in rule - field is required if another field's value is NOT in the given array
86
+ * Supports both global and sibling scope
87
+ */
88
+ const requiredIfNotInRule = {
89
+ name: "requiredIfNotIn",
90
+ description: "The field is required if another field's value is NOT in the given array",
91
+ sortOrder: -2,
92
+ requiresValue: false,
93
+ defaultErrorMessage: "The :input is required",
94
+ async validate(value, context) {
95
+ const { values } = this.context.options;
96
+ const fieldValue = getFieldValue.getFieldValue(this, context);
97
+ // Field is required if the other field's value is NOT in the array
98
+ if (isEmptyValue.isEmptyValue(value) && !values.includes(fieldValue)) {
99
+ this.context.translatableParams.field = this.context.options.field;
100
+ this.context.translationParams.values = this.context.options.values.join(", ");
101
+ return validationHelpers.invalidRule(this, context);
102
+ }
103
+ return validationHelpers.VALID_RULE;
104
+ },
105
+ };
106
+ /**
107
+ * Get multiple field values based on scope
108
+ */
109
+ function getFieldsValues(rule, context) {
110
+ const { fields, scope = "global" } = rule.context.options;
111
+ const source = scope === "sibling" ? context.parent : context.allValues;
112
+ return fields.map((field) => reinforcements.get(source, field));
113
+ }
114
+ /**
115
+ * Required if all empty rule - field is required if ALL specified fields are empty
116
+ * Supports both global and sibling scope
117
+ */
118
+ const requiredIfAllEmptyRule = {
119
+ name: "requiredIfAllEmpty",
120
+ description: "The field is required if all :fields are empty",
121
+ sortOrder: -2,
122
+ requiresValue: false,
123
+ defaultErrorMessage: "The :input is required",
124
+ async validate(value, context) {
125
+ const fieldValues = getFieldsValues(this, context);
126
+ // Field is required if ALL other fields are empty
127
+ const allEmpty = fieldValues.every((v) => isEmptyValue.isEmptyValue(v));
128
+ if (isEmptyValue.isEmptyValue(value) && allEmpty) {
129
+ this.context.options.fields.forEach((field) => {
130
+ this.context.translatableParams.field = field;
131
+ });
132
+ return validationHelpers.invalidRule(this, context);
133
+ }
134
+ return validationHelpers.VALID_RULE;
135
+ },
136
+ };
137
+ /**
138
+ * Required if any empty rule - field is required if ANY of the specified fields is empty
139
+ * Supports both global and sibling scope
140
+ */
141
+ const requiredIfAnyEmptyRule = {
142
+ name: "requiredIfAnyEmpty",
143
+ description: "The field is required if any of the :fields is empty",
144
+ sortOrder: -2,
145
+ requiresValue: false,
146
+ defaultErrorMessage: "The :input is required",
147
+ async validate(value, context) {
148
+ const fieldValues = getFieldsValues(this, context);
149
+ // Field is required if ANY other field is empty
150
+ const anyEmpty = fieldValues.some((v) => isEmptyValue.isEmptyValue(v));
151
+ if (isEmptyValue.isEmptyValue(value) && anyEmpty) {
152
+ this.context.options.fields.forEach((field) => {
153
+ this.context.translatableParams.field = field;
154
+ });
155
+ return validationHelpers.invalidRule(this, context);
156
+ }
157
+ return validationHelpers.VALID_RULE;
158
+ },
159
+ };
160
+ /**
161
+ * Required if all not empty rule - field is required if ALL specified fields are NOT empty
162
+ * Supports both global and sibling scope
163
+ */
164
+ const requiredIfAllNotEmptyRule = {
165
+ name: "requiredIfAllNotEmpty",
166
+ description: "The field is required if all :fields are not empty",
167
+ sortOrder: -2,
168
+ requiresValue: false,
169
+ defaultErrorMessage: "The :input is required",
170
+ async validate(value, context) {
171
+ const fieldValues = getFieldsValues(this, context);
172
+ // Field is required if ALL other fields are NOT empty
173
+ const allNotEmpty = fieldValues.every((v) => !isEmptyValue.isEmptyValue(v));
174
+ if (isEmptyValue.isEmptyValue(value) && allNotEmpty) {
175
+ this.context.options.fields.forEach((field) => {
176
+ this.context.translatableParams.field = field;
177
+ });
178
+ return validationHelpers.invalidRule(this, context);
179
+ }
180
+ return validationHelpers.VALID_RULE;
181
+ },
182
+ };
183
+ /**
184
+ * Required if any not empty rule - field is required if ANY of the specified fields is NOT empty
185
+ * Supports both global and sibling scope
186
+ */
187
+ const requiredIfAnyNotEmptyRule = {
188
+ name: "requiredIfAnyNotEmpty",
189
+ description: "The field is required if any of the :fields is not empty",
190
+ sortOrder: -2,
191
+ requiresValue: false,
192
+ defaultErrorMessage: "The :input is required",
193
+ async validate(value, context) {
194
+ const fieldValues = getFieldsValues(this, context);
195
+ // Field is required if ANY other field is NOT empty
196
+ const anyNotEmpty = fieldValues.some((v) => !isEmptyValue.isEmptyValue(v));
197
+ if (isEmptyValue.isEmptyValue(value) && anyNotEmpty) {
198
+ this.context.options.fields.forEach((field) => {
199
+ this.context.translatableParams.field = field;
200
+ });
201
+ return validationHelpers.invalidRule(this, context);
202
+ }
203
+ return validationHelpers.VALID_RULE;
204
+ },
205
+ };exports.requiredIfAllEmptyRule=requiredIfAllEmptyRule;exports.requiredIfAllNotEmptyRule=requiredIfAllNotEmptyRule;exports.requiredIfAnyEmptyRule=requiredIfAnyEmptyRule;exports.requiredIfAnyNotEmptyRule=requiredIfAnyNotEmptyRule;exports.requiredIfEmptyRule=requiredIfEmptyRule;exports.requiredIfInRule=requiredIfInRule;exports.requiredIfNotEmptyRule=requiredIfNotEmptyRule;exports.requiredIfNotInRule=requiredIfNotInRule;exports.requiredIfRule=requiredIfRule;//# sourceMappingURL=required-if-rules.js.map