@warlock.js/seal 4.0.31 → 4.0.39

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 (697) hide show
  1. package/cjs/index.js +2 -1
  2. package/cjs/index.js.map +1 -1
  3. package/esm/index.js +2 -1
  4. package/esm/index.js.map +1 -1
  5. package/package.json +36 -48
  6. package/cjs/config.d.ts +0 -48
  7. package/cjs/config.d.ts.map +0 -1
  8. package/cjs/config.js +0 -42
  9. package/cjs/config.js.map +0 -1
  10. package/cjs/factory/index.d.ts +0 -3
  11. package/cjs/factory/index.d.ts.map +0 -1
  12. package/cjs/factory/validate.d.ts +0 -8
  13. package/cjs/factory/validate.d.ts.map +0 -1
  14. package/cjs/factory/validate.js +0 -21
  15. package/cjs/factory/validate.js.map +0 -1
  16. package/cjs/factory/validators.d.ts +0 -36
  17. package/cjs/factory/validators.d.ts.map +0 -1
  18. package/cjs/factory/validators.js +0 -39
  19. package/cjs/factory/validators.js.map +0 -1
  20. package/cjs/helpers/date-helpers.d.ts +0 -16
  21. package/cjs/helpers/date-helpers.d.ts.map +0 -1
  22. package/cjs/helpers/date-helpers.js +0 -20
  23. package/cjs/helpers/date-helpers.js.map +0 -1
  24. package/cjs/helpers/get-field-value.d.ts +0 -37
  25. package/cjs/helpers/get-field-value.d.ts.map +0 -1
  26. package/cjs/helpers/get-field-value.js +0 -40
  27. package/cjs/helpers/get-field-value.js.map +0 -1
  28. package/cjs/helpers/index.d.ts +0 -5
  29. package/cjs/helpers/index.d.ts.map +0 -1
  30. package/cjs/helpers/path-helpers.d.ts +0 -5
  31. package/cjs/helpers/path-helpers.d.ts.map +0 -1
  32. package/cjs/helpers/path-helpers.js +0 -8
  33. package/cjs/helpers/path-helpers.js.map +0 -1
  34. package/cjs/helpers/validation-helpers.d.ts +0 -4
  35. package/cjs/helpers/validation-helpers.d.ts.map +0 -1
  36. package/cjs/helpers/validation-helpers.js +0 -48
  37. package/cjs/helpers/validation-helpers.js.map +0 -1
  38. package/cjs/index.d.ts +0 -29
  39. package/cjs/index.d.ts.map +0 -1
  40. package/cjs/mutators/array-mutators.d.ts +0 -12
  41. package/cjs/mutators/array-mutators.d.ts.map +0 -1
  42. package/cjs/mutators/array-mutators.js +0 -37
  43. package/cjs/mutators/array-mutators.js.map +0 -1
  44. package/cjs/mutators/date-mutators.d.ts +0 -39
  45. package/cjs/mutators/date-mutators.d.ts.map +0 -1
  46. package/cjs/mutators/date-mutators.js +0 -120
  47. package/cjs/mutators/date-mutators.js.map +0 -1
  48. package/cjs/mutators/index.d.ts +0 -7
  49. package/cjs/mutators/index.d.ts.map +0 -1
  50. package/cjs/mutators/number-mutators.d.ts +0 -9
  51. package/cjs/mutators/number-mutators.d.ts.map +0 -1
  52. package/cjs/mutators/number-mutators.js +0 -23
  53. package/cjs/mutators/number-mutators.js.map +0 -1
  54. package/cjs/mutators/object-mutators.d.ts +0 -8
  55. package/cjs/mutators/object-mutators.d.ts.map +0 -1
  56. package/cjs/mutators/object-mutators.js +0 -50
  57. package/cjs/mutators/object-mutators.js.map +0 -1
  58. package/cjs/mutators/scalar-mutators.d.ts +0 -3
  59. package/cjs/mutators/scalar-mutators.d.ts.map +0 -1
  60. package/cjs/mutators/scalar-mutators.js +0 -6
  61. package/cjs/mutators/scalar-mutators.js.map +0 -1
  62. package/cjs/mutators/string-mutators.d.ts +0 -72
  63. package/cjs/mutators/string-mutators.d.ts.map +0 -1
  64. package/cjs/mutators/string-mutators.js +0 -193
  65. package/cjs/mutators/string-mutators.js.map +0 -1
  66. package/cjs/plugins/index.d.ts +0 -7
  67. package/cjs/plugins/index.d.ts.map +0 -1
  68. package/cjs/plugins/plugin-system.d.ts +0 -71
  69. package/cjs/plugins/plugin-system.d.ts.map +0 -1
  70. package/cjs/plugins/plugin-system.js +0 -68
  71. package/cjs/plugins/plugin-system.js.map +0 -1
  72. package/cjs/rules/array/array-rules.d.ts +0 -12
  73. package/cjs/rules/array/array-rules.d.ts.map +0 -1
  74. package/cjs/rules/array/array-rules.js +0 -44
  75. package/cjs/rules/array/array-rules.js.map +0 -1
  76. package/cjs/rules/array/index.d.ts +0 -2
  77. package/cjs/rules/array/index.d.ts.map +0 -1
  78. package/cjs/rules/color/color-rules.d.ts +0 -30
  79. package/cjs/rules/color/color-rules.d.ts.map +0 -1
  80. package/cjs/rules/color/color-rules.js +0 -120
  81. package/cjs/rules/color/color-rules.js.map +0 -1
  82. package/cjs/rules/color/index.d.ts +0 -2
  83. package/cjs/rules/color/index.d.ts.map +0 -1
  84. package/cjs/rules/common/enum.d.ts +0 -26
  85. package/cjs/rules/common/enum.d.ts.map +0 -1
  86. package/cjs/rules/common/enum.js +0 -55
  87. package/cjs/rules/common/enum.js.map +0 -1
  88. package/cjs/rules/common/equals-field-rules.d.ts +0 -18
  89. package/cjs/rules/common/equals-field-rules.d.ts.map +0 -1
  90. package/cjs/rules/common/equals-field-rules.js +0 -38
  91. package/cjs/rules/common/equals-field-rules.js.map +0 -1
  92. package/cjs/rules/common/index.d.ts +0 -5
  93. package/cjs/rules/common/index.d.ts.map +0 -1
  94. package/cjs/rules/common/type-rules.d.ts +0 -34
  95. package/cjs/rules/common/type-rules.d.ts.map +0 -1
  96. package/cjs/rules/common/type-rules.js +0 -104
  97. package/cjs/rules/common/type-rules.js.map +0 -1
  98. package/cjs/rules/common/unknown-key.d.ts +0 -9
  99. package/cjs/rules/common/unknown-key.d.ts.map +0 -1
  100. package/cjs/rules/common/unknown-key.js +0 -20
  101. package/cjs/rules/common/unknown-key.js.map +0 -1
  102. package/cjs/rules/conditional/forbidden-if-rules.d.ts +0 -54
  103. package/cjs/rules/conditional/forbidden-if-rules.d.ts.map +0 -1
  104. package/cjs/rules/conditional/forbidden-if-rules.js +0 -112
  105. package/cjs/rules/conditional/forbidden-if-rules.js.map +0 -1
  106. package/cjs/rules/conditional/index.d.ts +0 -10
  107. package/cjs/rules/conditional/index.d.ts.map +0 -1
  108. package/cjs/rules/conditional/present-if-rules.d.ts +0 -45
  109. package/cjs/rules/conditional/present-if-rules.d.ts.map +0 -1
  110. package/cjs/rules/conditional/present-if-rules.js +0 -98
  111. package/cjs/rules/conditional/present-if-rules.js.map +0 -1
  112. package/cjs/rules/conditional/present-unless-rules.d.ts +0 -11
  113. package/cjs/rules/conditional/present-unless-rules.d.ts.map +0 -1
  114. package/cjs/rules/conditional/present-unless-rules.js +0 -20
  115. package/cjs/rules/conditional/present-unless-rules.js.map +0 -1
  116. package/cjs/rules/conditional/present-with-rules.d.ts +0 -26
  117. package/cjs/rules/conditional/present-with-rules.d.ts.map +0 -1
  118. package/cjs/rules/conditional/present-with-rules.js +0 -63
  119. package/cjs/rules/conditional/present-with-rules.js.map +0 -1
  120. package/cjs/rules/conditional/present-without-rules.d.ts +0 -26
  121. package/cjs/rules/conditional/present-without-rules.d.ts.map +0 -1
  122. package/cjs/rules/conditional/present-without-rules.js +0 -63
  123. package/cjs/rules/conditional/present-without-rules.js.map +0 -1
  124. package/cjs/rules/conditional/required-if-rules.d.ts +0 -45
  125. package/cjs/rules/conditional/required-if-rules.d.ts.map +0 -1
  126. package/cjs/rules/conditional/required-if-rules.js +0 -98
  127. package/cjs/rules/conditional/required-if-rules.js.map +0 -1
  128. package/cjs/rules/conditional/required-unless-rules.d.ts +0 -11
  129. package/cjs/rules/conditional/required-unless-rules.d.ts.map +0 -1
  130. package/cjs/rules/conditional/required-unless-rules.js +0 -20
  131. package/cjs/rules/conditional/required-unless-rules.js.map +0 -1
  132. package/cjs/rules/conditional/required-with-rules.d.ts +0 -26
  133. package/cjs/rules/conditional/required-with-rules.d.ts.map +0 -1
  134. package/cjs/rules/conditional/required-with-rules.js +0 -63
  135. package/cjs/rules/conditional/required-with-rules.js.map +0 -1
  136. package/cjs/rules/conditional/required-without-rules.d.ts +0 -26
  137. package/cjs/rules/conditional/required-without-rules.d.ts.map +0 -1
  138. package/cjs/rules/conditional/required-without-rules.js +0 -63
  139. package/cjs/rules/conditional/required-without-rules.js.map +0 -1
  140. package/cjs/rules/core/equal.d.ts +0 -8
  141. package/cjs/rules/core/equal.d.ts.map +0 -1
  142. package/cjs/rules/core/equal.js +0 -13
  143. package/cjs/rules/core/equal.js.map +0 -1
  144. package/cjs/rules/core/forbidden.d.ts +0 -6
  145. package/cjs/rules/core/forbidden.d.ts.map +0 -1
  146. package/cjs/rules/core/forbidden.js +0 -13
  147. package/cjs/rules/core/forbidden.js.map +0 -1
  148. package/cjs/rules/core/index.d.ts +0 -6
  149. package/cjs/rules/core/index.d.ts.map +0 -1
  150. package/cjs/rules/core/required.d.ts +0 -11
  151. package/cjs/rules/core/required.d.ts.map +0 -1
  152. package/cjs/rules/core/required.js +0 -31
  153. package/cjs/rules/core/required.js.map +0 -1
  154. package/cjs/rules/core/union.d.ts +0 -9
  155. package/cjs/rules/core/union.d.ts.map +0 -1
  156. package/cjs/rules/core/union.js +0 -40
  157. package/cjs/rules/core/union.js.map +0 -1
  158. package/cjs/rules/core/when.d.ts +0 -6
  159. package/cjs/rules/core/when.d.ts.map +0 -1
  160. package/cjs/rules/core/when.js +0 -40
  161. package/cjs/rules/core/when.js.map +0 -1
  162. package/cjs/rules/date/date-comparison-rules.d.ts +0 -25
  163. package/cjs/rules/date/date-comparison-rules.d.ts.map +0 -1
  164. package/cjs/rules/date/date-comparison-rules.js +0 -78
  165. package/cjs/rules/date/date-comparison-rules.js.map +0 -1
  166. package/cjs/rules/date/date-day-rules.d.ts +0 -21
  167. package/cjs/rules/date/date-day-rules.d.ts.map +0 -1
  168. package/cjs/rules/date/date-day-rules.js +0 -65
  169. package/cjs/rules/date/date-day-rules.js.map +0 -1
  170. package/cjs/rules/date/date-field-comparison-rules.d.ts +0 -28
  171. package/cjs/rules/date/date-field-comparison-rules.d.ts.map +0 -1
  172. package/cjs/rules/date/date-field-comparison-rules.js +0 -90
  173. package/cjs/rules/date/date-field-comparison-rules.js.map +0 -1
  174. package/cjs/rules/date/date-period-rules.d.ts +0 -108
  175. package/cjs/rules/date/date-period-rules.d.ts.map +0 -1
  176. package/cjs/rules/date/date-period-rules.js +0 -566
  177. package/cjs/rules/date/date-period-rules.js.map +0 -1
  178. package/cjs/rules/date/date-relative-rules.d.ts +0 -20
  179. package/cjs/rules/date/date-relative-rules.d.ts.map +0 -1
  180. package/cjs/rules/date/date-relative-rules.js +0 -57
  181. package/cjs/rules/date/date-relative-rules.js.map +0 -1
  182. package/cjs/rules/date/date-special-rules.d.ts +0 -20
  183. package/cjs/rules/date/date-special-rules.d.ts.map +0 -1
  184. package/cjs/rules/date/date-special-rules.js +0 -72
  185. package/cjs/rules/date/date-special-rules.js.map +0 -1
  186. package/cjs/rules/date/date.d.ts +0 -93
  187. package/cjs/rules/date/date.d.ts.map +0 -1
  188. package/cjs/rules/date/date.js +0 -279
  189. package/cjs/rules/date/date.js.map +0 -1
  190. package/cjs/rules/date/index.d.ts +0 -8
  191. package/cjs/rules/date/index.d.ts.map +0 -1
  192. package/cjs/rules/file/dimensions.d.ts +0 -26
  193. package/cjs/rules/file/dimensions.d.ts.map +0 -1
  194. package/cjs/rules/file/dimensions.js +0 -56
  195. package/cjs/rules/file/dimensions.js.map +0 -1
  196. package/cjs/rules/file/file-size.d.ts +0 -14
  197. package/cjs/rules/file/file-size.d.ts.map +0 -1
  198. package/cjs/rules/file/file-size.js +0 -26
  199. package/cjs/rules/file/file-size.js.map +0 -1
  200. package/cjs/rules/file/index.d.ts +0 -11
  201. package/cjs/rules/file/index.d.ts.map +0 -1
  202. package/cjs/rules/index.d.ts +0 -19
  203. package/cjs/rules/index.d.ts.map +0 -1
  204. package/cjs/rules/length/index.d.ts +0 -2
  205. package/cjs/rules/length/index.d.ts.map +0 -1
  206. package/cjs/rules/length/length-rules.d.ts +0 -49
  207. package/cjs/rules/length/length-rules.d.ts.map +0 -1
  208. package/cjs/rules/length/length-rules.js +0 -116
  209. package/cjs/rules/length/length-rules.js.map +0 -1
  210. package/cjs/rules/number/index.d.ts +0 -2
  211. package/cjs/rules/number/index.d.ts.map +0 -1
  212. package/cjs/rules/number/number-rules.d.ts +0 -65
  213. package/cjs/rules/number/number-rules.d.ts.map +0 -1
  214. package/cjs/rules/number/number-rules.js +0 -234
  215. package/cjs/rules/number/number-rules.js.map +0 -1
  216. package/cjs/rules/scalar/accepted-rule.d.ts +0 -39
  217. package/cjs/rules/scalar/accepted-rule.d.ts.map +0 -1
  218. package/cjs/rules/scalar/accepted-rule.js +0 -110
  219. package/cjs/rules/scalar/accepted-rule.js.map +0 -1
  220. package/cjs/rules/scalar/declined-rule.d.ts +0 -39
  221. package/cjs/rules/scalar/declined-rule.d.ts.map +0 -1
  222. package/cjs/rules/scalar/declined-rule.js +0 -110
  223. package/cjs/rules/scalar/declined-rule.js.map +0 -1
  224. package/cjs/rules/scalar/index.d.ts +0 -3
  225. package/cjs/rules/scalar/index.d.ts.map +0 -1
  226. package/cjs/rules/string/alpha.d.ts +0 -14
  227. package/cjs/rules/string/alpha.d.ts.map +0 -1
  228. package/cjs/rules/string/alpha.js +0 -39
  229. package/cjs/rules/string/alpha.js.map +0 -1
  230. package/cjs/rules/string/credit-card.d.ts +0 -6
  231. package/cjs/rules/string/credit-card.d.ts.map +0 -1
  232. package/cjs/rules/string/credit-card.js +0 -31
  233. package/cjs/rules/string/credit-card.js.map +0 -1
  234. package/cjs/rules/string/email.d.ts +0 -6
  235. package/cjs/rules/string/email.d.ts.map +0 -1
  236. package/cjs/rules/string/email.js +0 -13
  237. package/cjs/rules/string/email.js.map +0 -1
  238. package/cjs/rules/string/index.d.ts +0 -17
  239. package/cjs/rules/string/index.d.ts.map +0 -1
  240. package/cjs/rules/string/ip.d.ts +0 -14
  241. package/cjs/rules/string/ip.d.ts.map +0 -1
  242. package/cjs/rules/string/ip.js +0 -39
  243. package/cjs/rules/string/ip.js.map +0 -1
  244. package/cjs/rules/string/matches.d.ts +0 -8
  245. package/cjs/rules/string/matches.d.ts.map +0 -1
  246. package/cjs/rules/string/matches.js +0 -14
  247. package/cjs/rules/string/matches.js.map +0 -1
  248. package/cjs/rules/string/pattern.d.ts +0 -8
  249. package/cjs/rules/string/pattern.d.ts.map +0 -1
  250. package/cjs/rules/string/pattern.js +0 -13
  251. package/cjs/rules/string/pattern.js.map +0 -1
  252. package/cjs/rules/string/string-comparison.d.ts +0 -26
  253. package/cjs/rules/string/string-comparison.d.ts.map +0 -1
  254. package/cjs/rules/string/string-comparison.js +0 -52
  255. package/cjs/rules/string/string-comparison.js.map +0 -1
  256. package/cjs/rules/string/strong-password-rule.d.ts +0 -14
  257. package/cjs/rules/string/strong-password-rule.d.ts.map +0 -1
  258. package/cjs/rules/string/strong-password-rule.js +0 -38
  259. package/cjs/rules/string/strong-password-rule.js.map +0 -1
  260. package/cjs/rules/string/url.d.ts +0 -6
  261. package/cjs/rules/string/url.d.ts.map +0 -1
  262. package/cjs/rules/string/url.js +0 -16
  263. package/cjs/rules/string/url.js.map +0 -1
  264. package/cjs/rules/string/without-whitespace.d.ts +0 -6
  265. package/cjs/rules/string/without-whitespace.d.ts.map +0 -1
  266. package/cjs/rules/string/without-whitespace.js +0 -13
  267. package/cjs/rules/string/without-whitespace.js.map +0 -1
  268. package/cjs/types/conditional-types.d.ts +0 -15
  269. package/cjs/types/conditional-types.d.ts.map +0 -1
  270. package/cjs/types/context-types.d.ts +0 -44
  271. package/cjs/types/context-types.d.ts.map +0 -1
  272. package/cjs/types/data-transformer-types.d.ts +0 -25
  273. package/cjs/types/data-transformer-types.d.ts.map +0 -1
  274. package/cjs/types/date-types.d.ts +0 -9
  275. package/cjs/types/date-types.d.ts.map +0 -1
  276. package/cjs/types/date-types.js +0 -12
  277. package/cjs/types/date-types.js.map +0 -1
  278. package/cjs/types/index.d.ts +0 -10
  279. package/cjs/types/index.d.ts.map +0 -1
  280. package/cjs/types/inference-types.d.ts +0 -29
  281. package/cjs/types/inference-types.d.ts.map +0 -1
  282. package/cjs/types/mutator-types.d.ts +0 -27
  283. package/cjs/types/mutator-types.d.ts.map +0 -1
  284. package/cjs/types/result-types.d.ts +0 -19
  285. package/cjs/types/result-types.d.ts.map +0 -1
  286. package/cjs/types/rule-types.d.ts +0 -54
  287. package/cjs/types/rule-types.d.ts.map +0 -1
  288. package/cjs/types/schema-types.d.ts +0 -6
  289. package/cjs/types/schema-types.d.ts.map +0 -1
  290. package/cjs/validators/any-validator.d.ts +0 -7
  291. package/cjs/validators/any-validator.d.ts.map +0 -1
  292. package/cjs/validators/any-validator.js +0 -5
  293. package/cjs/validators/any-validator.js.map +0 -1
  294. package/cjs/validators/array-validator.d.ts +0 -59
  295. package/cjs/validators/array-validator.d.ts.map +0 -1
  296. package/cjs/validators/array-validator.js +0 -134
  297. package/cjs/validators/array-validator.js.map +0 -1
  298. package/cjs/validators/base-validator.d.ts +0 -609
  299. package/cjs/validators/base-validator.d.ts.map +0 -1
  300. package/cjs/validators/base-validator.js +0 -1154
  301. package/cjs/validators/base-validator.js.map +0 -1
  302. package/cjs/validators/boolean-validator.d.ts +0 -47
  303. package/cjs/validators/boolean-validator.d.ts.map +0 -1
  304. package/cjs/validators/boolean-validator.js +0 -54
  305. package/cjs/validators/boolean-validator.js.map +0 -1
  306. package/cjs/validators/date-validator.d.ts +0 -307
  307. package/cjs/validators/date-validator.d.ts.map +0 -1
  308. package/cjs/validators/date-validator.js +0 -645
  309. package/cjs/validators/date-validator.js.map +0 -1
  310. package/cjs/validators/float-validator.d.ts +0 -8
  311. package/cjs/validators/float-validator.d.ts.map +0 -1
  312. package/cjs/validators/float-validator.js +0 -9
  313. package/cjs/validators/float-validator.js.map +0 -1
  314. package/cjs/validators/index.d.ts +0 -24
  315. package/cjs/validators/index.d.ts.map +0 -1
  316. package/cjs/validators/int-validator.d.ts +0 -8
  317. package/cjs/validators/int-validator.d.ts.map +0 -1
  318. package/cjs/validators/int-validator.js +0 -9
  319. package/cjs/validators/int-validator.js.map +0 -1
  320. package/cjs/validators/number-validator.d.ts +0 -113
  321. package/cjs/validators/number-validator.d.ts.map +0 -1
  322. package/cjs/validators/number-validator.js +0 -192
  323. package/cjs/validators/number-validator.js.map +0 -1
  324. package/cjs/validators/numeric-validator.d.ts +0 -15
  325. package/cjs/validators/numeric-validator.d.ts.map +0 -1
  326. package/cjs/validators/numeric-validator.js +0 -18
  327. package/cjs/validators/numeric-validator.js.map +0 -1
  328. package/cjs/validators/object-validator.d.ts +0 -178
  329. package/cjs/validators/object-validator.d.ts.map +0 -1
  330. package/cjs/validators/object-validator.js +0 -356
  331. package/cjs/validators/object-validator.js.map +0 -1
  332. package/cjs/validators/record-validator.d.ts +0 -33
  333. package/cjs/validators/record-validator.d.ts.map +0 -1
  334. package/cjs/validators/record-validator.js +0 -70
  335. package/cjs/validators/record-validator.js.map +0 -1
  336. package/cjs/validators/scalar-validator.d.ts +0 -82
  337. package/cjs/validators/scalar-validator.d.ts.map +0 -1
  338. package/cjs/validators/scalar-validator.js +0 -160
  339. package/cjs/validators/scalar-validator.js.map +0 -1
  340. package/cjs/validators/string-validator.d.ts +0 -191
  341. package/cjs/validators/string-validator.d.ts.map +0 -1
  342. package/cjs/validators/string-validator.js +0 -410
  343. package/cjs/validators/string-validator.js.map +0 -1
  344. package/cjs/validators/tuple-validator.d.ts +0 -34
  345. package/cjs/validators/tuple-validator.d.ts.map +0 -1
  346. package/cjs/validators/tuple-validator.js +0 -79
  347. package/cjs/validators/tuple-validator.js.map +0 -1
  348. package/cjs/validators/union-validator.d.ts +0 -42
  349. package/cjs/validators/union-validator.d.ts.map +0 -1
  350. package/cjs/validators/union-validator.js +0 -44
  351. package/cjs/validators/union-validator.js.map +0 -1
  352. package/esm/config.d.ts +0 -48
  353. package/esm/config.d.ts.map +0 -1
  354. package/esm/config.js +0 -42
  355. package/esm/config.js.map +0 -1
  356. package/esm/factory/index.d.ts +0 -3
  357. package/esm/factory/index.d.ts.map +0 -1
  358. package/esm/factory/validate.d.ts +0 -8
  359. package/esm/factory/validate.d.ts.map +0 -1
  360. package/esm/factory/validate.js +0 -21
  361. package/esm/factory/validate.js.map +0 -1
  362. package/esm/factory/validators.d.ts +0 -36
  363. package/esm/factory/validators.d.ts.map +0 -1
  364. package/esm/factory/validators.js +0 -39
  365. package/esm/factory/validators.js.map +0 -1
  366. package/esm/helpers/date-helpers.d.ts +0 -16
  367. package/esm/helpers/date-helpers.d.ts.map +0 -1
  368. package/esm/helpers/date-helpers.js +0 -20
  369. package/esm/helpers/date-helpers.js.map +0 -1
  370. package/esm/helpers/get-field-value.d.ts +0 -37
  371. package/esm/helpers/get-field-value.d.ts.map +0 -1
  372. package/esm/helpers/get-field-value.js +0 -40
  373. package/esm/helpers/get-field-value.js.map +0 -1
  374. package/esm/helpers/index.d.ts +0 -5
  375. package/esm/helpers/index.d.ts.map +0 -1
  376. package/esm/helpers/path-helpers.d.ts +0 -5
  377. package/esm/helpers/path-helpers.d.ts.map +0 -1
  378. package/esm/helpers/path-helpers.js +0 -8
  379. package/esm/helpers/path-helpers.js.map +0 -1
  380. package/esm/helpers/validation-helpers.d.ts +0 -4
  381. package/esm/helpers/validation-helpers.d.ts.map +0 -1
  382. package/esm/helpers/validation-helpers.js +0 -48
  383. package/esm/helpers/validation-helpers.js.map +0 -1
  384. package/esm/index.d.ts +0 -29
  385. package/esm/index.d.ts.map +0 -1
  386. package/esm/mutators/array-mutators.d.ts +0 -12
  387. package/esm/mutators/array-mutators.d.ts.map +0 -1
  388. package/esm/mutators/array-mutators.js +0 -37
  389. package/esm/mutators/array-mutators.js.map +0 -1
  390. package/esm/mutators/date-mutators.d.ts +0 -39
  391. package/esm/mutators/date-mutators.d.ts.map +0 -1
  392. package/esm/mutators/date-mutators.js +0 -120
  393. package/esm/mutators/date-mutators.js.map +0 -1
  394. package/esm/mutators/index.d.ts +0 -7
  395. package/esm/mutators/index.d.ts.map +0 -1
  396. package/esm/mutators/number-mutators.d.ts +0 -9
  397. package/esm/mutators/number-mutators.d.ts.map +0 -1
  398. package/esm/mutators/number-mutators.js +0 -23
  399. package/esm/mutators/number-mutators.js.map +0 -1
  400. package/esm/mutators/object-mutators.d.ts +0 -8
  401. package/esm/mutators/object-mutators.d.ts.map +0 -1
  402. package/esm/mutators/object-mutators.js +0 -50
  403. package/esm/mutators/object-mutators.js.map +0 -1
  404. package/esm/mutators/scalar-mutators.d.ts +0 -3
  405. package/esm/mutators/scalar-mutators.d.ts.map +0 -1
  406. package/esm/mutators/scalar-mutators.js +0 -6
  407. package/esm/mutators/scalar-mutators.js.map +0 -1
  408. package/esm/mutators/string-mutators.d.ts +0 -72
  409. package/esm/mutators/string-mutators.d.ts.map +0 -1
  410. package/esm/mutators/string-mutators.js +0 -193
  411. package/esm/mutators/string-mutators.js.map +0 -1
  412. package/esm/plugins/index.d.ts +0 -7
  413. package/esm/plugins/index.d.ts.map +0 -1
  414. package/esm/plugins/plugin-system.d.ts +0 -71
  415. package/esm/plugins/plugin-system.d.ts.map +0 -1
  416. package/esm/plugins/plugin-system.js +0 -68
  417. package/esm/plugins/plugin-system.js.map +0 -1
  418. package/esm/rules/array/array-rules.d.ts +0 -12
  419. package/esm/rules/array/array-rules.d.ts.map +0 -1
  420. package/esm/rules/array/array-rules.js +0 -44
  421. package/esm/rules/array/array-rules.js.map +0 -1
  422. package/esm/rules/array/index.d.ts +0 -2
  423. package/esm/rules/array/index.d.ts.map +0 -1
  424. package/esm/rules/color/color-rules.d.ts +0 -30
  425. package/esm/rules/color/color-rules.d.ts.map +0 -1
  426. package/esm/rules/color/color-rules.js +0 -120
  427. package/esm/rules/color/color-rules.js.map +0 -1
  428. package/esm/rules/color/index.d.ts +0 -2
  429. package/esm/rules/color/index.d.ts.map +0 -1
  430. package/esm/rules/common/enum.d.ts +0 -26
  431. package/esm/rules/common/enum.d.ts.map +0 -1
  432. package/esm/rules/common/enum.js +0 -55
  433. package/esm/rules/common/enum.js.map +0 -1
  434. package/esm/rules/common/equals-field-rules.d.ts +0 -18
  435. package/esm/rules/common/equals-field-rules.d.ts.map +0 -1
  436. package/esm/rules/common/equals-field-rules.js +0 -38
  437. package/esm/rules/common/equals-field-rules.js.map +0 -1
  438. package/esm/rules/common/index.d.ts +0 -5
  439. package/esm/rules/common/index.d.ts.map +0 -1
  440. package/esm/rules/common/type-rules.d.ts +0 -34
  441. package/esm/rules/common/type-rules.d.ts.map +0 -1
  442. package/esm/rules/common/type-rules.js +0 -104
  443. package/esm/rules/common/type-rules.js.map +0 -1
  444. package/esm/rules/common/unknown-key.d.ts +0 -9
  445. package/esm/rules/common/unknown-key.d.ts.map +0 -1
  446. package/esm/rules/common/unknown-key.js +0 -20
  447. package/esm/rules/common/unknown-key.js.map +0 -1
  448. package/esm/rules/conditional/forbidden-if-rules.d.ts +0 -54
  449. package/esm/rules/conditional/forbidden-if-rules.d.ts.map +0 -1
  450. package/esm/rules/conditional/forbidden-if-rules.js +0 -112
  451. package/esm/rules/conditional/forbidden-if-rules.js.map +0 -1
  452. package/esm/rules/conditional/index.d.ts +0 -10
  453. package/esm/rules/conditional/index.d.ts.map +0 -1
  454. package/esm/rules/conditional/present-if-rules.d.ts +0 -45
  455. package/esm/rules/conditional/present-if-rules.d.ts.map +0 -1
  456. package/esm/rules/conditional/present-if-rules.js +0 -98
  457. package/esm/rules/conditional/present-if-rules.js.map +0 -1
  458. package/esm/rules/conditional/present-unless-rules.d.ts +0 -11
  459. package/esm/rules/conditional/present-unless-rules.d.ts.map +0 -1
  460. package/esm/rules/conditional/present-unless-rules.js +0 -20
  461. package/esm/rules/conditional/present-unless-rules.js.map +0 -1
  462. package/esm/rules/conditional/present-with-rules.d.ts +0 -26
  463. package/esm/rules/conditional/present-with-rules.d.ts.map +0 -1
  464. package/esm/rules/conditional/present-with-rules.js +0 -63
  465. package/esm/rules/conditional/present-with-rules.js.map +0 -1
  466. package/esm/rules/conditional/present-without-rules.d.ts +0 -26
  467. package/esm/rules/conditional/present-without-rules.d.ts.map +0 -1
  468. package/esm/rules/conditional/present-without-rules.js +0 -63
  469. package/esm/rules/conditional/present-without-rules.js.map +0 -1
  470. package/esm/rules/conditional/required-if-rules.d.ts +0 -45
  471. package/esm/rules/conditional/required-if-rules.d.ts.map +0 -1
  472. package/esm/rules/conditional/required-if-rules.js +0 -98
  473. package/esm/rules/conditional/required-if-rules.js.map +0 -1
  474. package/esm/rules/conditional/required-unless-rules.d.ts +0 -11
  475. package/esm/rules/conditional/required-unless-rules.d.ts.map +0 -1
  476. package/esm/rules/conditional/required-unless-rules.js +0 -20
  477. package/esm/rules/conditional/required-unless-rules.js.map +0 -1
  478. package/esm/rules/conditional/required-with-rules.d.ts +0 -26
  479. package/esm/rules/conditional/required-with-rules.d.ts.map +0 -1
  480. package/esm/rules/conditional/required-with-rules.js +0 -63
  481. package/esm/rules/conditional/required-with-rules.js.map +0 -1
  482. package/esm/rules/conditional/required-without-rules.d.ts +0 -26
  483. package/esm/rules/conditional/required-without-rules.d.ts.map +0 -1
  484. package/esm/rules/conditional/required-without-rules.js +0 -63
  485. package/esm/rules/conditional/required-without-rules.js.map +0 -1
  486. package/esm/rules/core/equal.d.ts +0 -8
  487. package/esm/rules/core/equal.d.ts.map +0 -1
  488. package/esm/rules/core/equal.js +0 -13
  489. package/esm/rules/core/equal.js.map +0 -1
  490. package/esm/rules/core/forbidden.d.ts +0 -6
  491. package/esm/rules/core/forbidden.d.ts.map +0 -1
  492. package/esm/rules/core/forbidden.js +0 -13
  493. package/esm/rules/core/forbidden.js.map +0 -1
  494. package/esm/rules/core/index.d.ts +0 -6
  495. package/esm/rules/core/index.d.ts.map +0 -1
  496. package/esm/rules/core/required.d.ts +0 -11
  497. package/esm/rules/core/required.d.ts.map +0 -1
  498. package/esm/rules/core/required.js +0 -31
  499. package/esm/rules/core/required.js.map +0 -1
  500. package/esm/rules/core/union.d.ts +0 -9
  501. package/esm/rules/core/union.d.ts.map +0 -1
  502. package/esm/rules/core/union.js +0 -40
  503. package/esm/rules/core/union.js.map +0 -1
  504. package/esm/rules/core/when.d.ts +0 -6
  505. package/esm/rules/core/when.d.ts.map +0 -1
  506. package/esm/rules/core/when.js +0 -40
  507. package/esm/rules/core/when.js.map +0 -1
  508. package/esm/rules/date/date-comparison-rules.d.ts +0 -25
  509. package/esm/rules/date/date-comparison-rules.d.ts.map +0 -1
  510. package/esm/rules/date/date-comparison-rules.js +0 -78
  511. package/esm/rules/date/date-comparison-rules.js.map +0 -1
  512. package/esm/rules/date/date-day-rules.d.ts +0 -21
  513. package/esm/rules/date/date-day-rules.d.ts.map +0 -1
  514. package/esm/rules/date/date-day-rules.js +0 -65
  515. package/esm/rules/date/date-day-rules.js.map +0 -1
  516. package/esm/rules/date/date-field-comparison-rules.d.ts +0 -28
  517. package/esm/rules/date/date-field-comparison-rules.d.ts.map +0 -1
  518. package/esm/rules/date/date-field-comparison-rules.js +0 -90
  519. package/esm/rules/date/date-field-comparison-rules.js.map +0 -1
  520. package/esm/rules/date/date-period-rules.d.ts +0 -108
  521. package/esm/rules/date/date-period-rules.d.ts.map +0 -1
  522. package/esm/rules/date/date-period-rules.js +0 -566
  523. package/esm/rules/date/date-period-rules.js.map +0 -1
  524. package/esm/rules/date/date-relative-rules.d.ts +0 -20
  525. package/esm/rules/date/date-relative-rules.d.ts.map +0 -1
  526. package/esm/rules/date/date-relative-rules.js +0 -57
  527. package/esm/rules/date/date-relative-rules.js.map +0 -1
  528. package/esm/rules/date/date-special-rules.d.ts +0 -20
  529. package/esm/rules/date/date-special-rules.d.ts.map +0 -1
  530. package/esm/rules/date/date-special-rules.js +0 -72
  531. package/esm/rules/date/date-special-rules.js.map +0 -1
  532. package/esm/rules/date/date.d.ts +0 -93
  533. package/esm/rules/date/date.d.ts.map +0 -1
  534. package/esm/rules/date/date.js +0 -279
  535. package/esm/rules/date/date.js.map +0 -1
  536. package/esm/rules/date/index.d.ts +0 -8
  537. package/esm/rules/date/index.d.ts.map +0 -1
  538. package/esm/rules/file/dimensions.d.ts +0 -26
  539. package/esm/rules/file/dimensions.d.ts.map +0 -1
  540. package/esm/rules/file/dimensions.js +0 -56
  541. package/esm/rules/file/dimensions.js.map +0 -1
  542. package/esm/rules/file/file-size.d.ts +0 -14
  543. package/esm/rules/file/file-size.d.ts.map +0 -1
  544. package/esm/rules/file/file-size.js +0 -26
  545. package/esm/rules/file/file-size.js.map +0 -1
  546. package/esm/rules/file/index.d.ts +0 -11
  547. package/esm/rules/file/index.d.ts.map +0 -1
  548. package/esm/rules/index.d.ts +0 -19
  549. package/esm/rules/index.d.ts.map +0 -1
  550. package/esm/rules/length/index.d.ts +0 -2
  551. package/esm/rules/length/index.d.ts.map +0 -1
  552. package/esm/rules/length/length-rules.d.ts +0 -49
  553. package/esm/rules/length/length-rules.d.ts.map +0 -1
  554. package/esm/rules/length/length-rules.js +0 -116
  555. package/esm/rules/length/length-rules.js.map +0 -1
  556. package/esm/rules/number/index.d.ts +0 -2
  557. package/esm/rules/number/index.d.ts.map +0 -1
  558. package/esm/rules/number/number-rules.d.ts +0 -65
  559. package/esm/rules/number/number-rules.d.ts.map +0 -1
  560. package/esm/rules/number/number-rules.js +0 -234
  561. package/esm/rules/number/number-rules.js.map +0 -1
  562. package/esm/rules/scalar/accepted-rule.d.ts +0 -39
  563. package/esm/rules/scalar/accepted-rule.d.ts.map +0 -1
  564. package/esm/rules/scalar/accepted-rule.js +0 -110
  565. package/esm/rules/scalar/accepted-rule.js.map +0 -1
  566. package/esm/rules/scalar/declined-rule.d.ts +0 -39
  567. package/esm/rules/scalar/declined-rule.d.ts.map +0 -1
  568. package/esm/rules/scalar/declined-rule.js +0 -110
  569. package/esm/rules/scalar/declined-rule.js.map +0 -1
  570. package/esm/rules/scalar/index.d.ts +0 -3
  571. package/esm/rules/scalar/index.d.ts.map +0 -1
  572. package/esm/rules/string/alpha.d.ts +0 -14
  573. package/esm/rules/string/alpha.d.ts.map +0 -1
  574. package/esm/rules/string/alpha.js +0 -39
  575. package/esm/rules/string/alpha.js.map +0 -1
  576. package/esm/rules/string/credit-card.d.ts +0 -6
  577. package/esm/rules/string/credit-card.d.ts.map +0 -1
  578. package/esm/rules/string/credit-card.js +0 -31
  579. package/esm/rules/string/credit-card.js.map +0 -1
  580. package/esm/rules/string/email.d.ts +0 -6
  581. package/esm/rules/string/email.d.ts.map +0 -1
  582. package/esm/rules/string/email.js +0 -13
  583. package/esm/rules/string/email.js.map +0 -1
  584. package/esm/rules/string/index.d.ts +0 -17
  585. package/esm/rules/string/index.d.ts.map +0 -1
  586. package/esm/rules/string/ip.d.ts +0 -14
  587. package/esm/rules/string/ip.d.ts.map +0 -1
  588. package/esm/rules/string/ip.js +0 -39
  589. package/esm/rules/string/ip.js.map +0 -1
  590. package/esm/rules/string/matches.d.ts +0 -8
  591. package/esm/rules/string/matches.d.ts.map +0 -1
  592. package/esm/rules/string/matches.js +0 -14
  593. package/esm/rules/string/matches.js.map +0 -1
  594. package/esm/rules/string/pattern.d.ts +0 -8
  595. package/esm/rules/string/pattern.d.ts.map +0 -1
  596. package/esm/rules/string/pattern.js +0 -13
  597. package/esm/rules/string/pattern.js.map +0 -1
  598. package/esm/rules/string/string-comparison.d.ts +0 -26
  599. package/esm/rules/string/string-comparison.d.ts.map +0 -1
  600. package/esm/rules/string/string-comparison.js +0 -52
  601. package/esm/rules/string/string-comparison.js.map +0 -1
  602. package/esm/rules/string/strong-password-rule.d.ts +0 -14
  603. package/esm/rules/string/strong-password-rule.d.ts.map +0 -1
  604. package/esm/rules/string/strong-password-rule.js +0 -38
  605. package/esm/rules/string/strong-password-rule.js.map +0 -1
  606. package/esm/rules/string/url.d.ts +0 -6
  607. package/esm/rules/string/url.d.ts.map +0 -1
  608. package/esm/rules/string/url.js +0 -16
  609. package/esm/rules/string/url.js.map +0 -1
  610. package/esm/rules/string/without-whitespace.d.ts +0 -6
  611. package/esm/rules/string/without-whitespace.d.ts.map +0 -1
  612. package/esm/rules/string/without-whitespace.js +0 -13
  613. package/esm/rules/string/without-whitespace.js.map +0 -1
  614. package/esm/types/conditional-types.d.ts +0 -15
  615. package/esm/types/conditional-types.d.ts.map +0 -1
  616. package/esm/types/context-types.d.ts +0 -44
  617. package/esm/types/context-types.d.ts.map +0 -1
  618. package/esm/types/data-transformer-types.d.ts +0 -25
  619. package/esm/types/data-transformer-types.d.ts.map +0 -1
  620. package/esm/types/date-types.d.ts +0 -9
  621. package/esm/types/date-types.d.ts.map +0 -1
  622. package/esm/types/date-types.js +0 -12
  623. package/esm/types/date-types.js.map +0 -1
  624. package/esm/types/index.d.ts +0 -10
  625. package/esm/types/index.d.ts.map +0 -1
  626. package/esm/types/inference-types.d.ts +0 -29
  627. package/esm/types/inference-types.d.ts.map +0 -1
  628. package/esm/types/mutator-types.d.ts +0 -27
  629. package/esm/types/mutator-types.d.ts.map +0 -1
  630. package/esm/types/result-types.d.ts +0 -19
  631. package/esm/types/result-types.d.ts.map +0 -1
  632. package/esm/types/rule-types.d.ts +0 -54
  633. package/esm/types/rule-types.d.ts.map +0 -1
  634. package/esm/types/schema-types.d.ts +0 -6
  635. package/esm/types/schema-types.d.ts.map +0 -1
  636. package/esm/validators/any-validator.d.ts +0 -7
  637. package/esm/validators/any-validator.d.ts.map +0 -1
  638. package/esm/validators/any-validator.js +0 -5
  639. package/esm/validators/any-validator.js.map +0 -1
  640. package/esm/validators/array-validator.d.ts +0 -59
  641. package/esm/validators/array-validator.d.ts.map +0 -1
  642. package/esm/validators/array-validator.js +0 -134
  643. package/esm/validators/array-validator.js.map +0 -1
  644. package/esm/validators/base-validator.d.ts +0 -609
  645. package/esm/validators/base-validator.d.ts.map +0 -1
  646. package/esm/validators/base-validator.js +0 -1154
  647. package/esm/validators/base-validator.js.map +0 -1
  648. package/esm/validators/boolean-validator.d.ts +0 -47
  649. package/esm/validators/boolean-validator.d.ts.map +0 -1
  650. package/esm/validators/boolean-validator.js +0 -54
  651. package/esm/validators/boolean-validator.js.map +0 -1
  652. package/esm/validators/date-validator.d.ts +0 -307
  653. package/esm/validators/date-validator.d.ts.map +0 -1
  654. package/esm/validators/date-validator.js +0 -645
  655. package/esm/validators/date-validator.js.map +0 -1
  656. package/esm/validators/float-validator.d.ts +0 -8
  657. package/esm/validators/float-validator.d.ts.map +0 -1
  658. package/esm/validators/float-validator.js +0 -9
  659. package/esm/validators/float-validator.js.map +0 -1
  660. package/esm/validators/index.d.ts +0 -24
  661. package/esm/validators/index.d.ts.map +0 -1
  662. package/esm/validators/int-validator.d.ts +0 -8
  663. package/esm/validators/int-validator.d.ts.map +0 -1
  664. package/esm/validators/int-validator.js +0 -9
  665. package/esm/validators/int-validator.js.map +0 -1
  666. package/esm/validators/number-validator.d.ts +0 -113
  667. package/esm/validators/number-validator.d.ts.map +0 -1
  668. package/esm/validators/number-validator.js +0 -192
  669. package/esm/validators/number-validator.js.map +0 -1
  670. package/esm/validators/numeric-validator.d.ts +0 -15
  671. package/esm/validators/numeric-validator.d.ts.map +0 -1
  672. package/esm/validators/numeric-validator.js +0 -18
  673. package/esm/validators/numeric-validator.js.map +0 -1
  674. package/esm/validators/object-validator.d.ts +0 -178
  675. package/esm/validators/object-validator.d.ts.map +0 -1
  676. package/esm/validators/object-validator.js +0 -356
  677. package/esm/validators/object-validator.js.map +0 -1
  678. package/esm/validators/record-validator.d.ts +0 -33
  679. package/esm/validators/record-validator.d.ts.map +0 -1
  680. package/esm/validators/record-validator.js +0 -70
  681. package/esm/validators/record-validator.js.map +0 -1
  682. package/esm/validators/scalar-validator.d.ts +0 -82
  683. package/esm/validators/scalar-validator.d.ts.map +0 -1
  684. package/esm/validators/scalar-validator.js +0 -160
  685. package/esm/validators/scalar-validator.js.map +0 -1
  686. package/esm/validators/string-validator.d.ts +0 -191
  687. package/esm/validators/string-validator.d.ts.map +0 -1
  688. package/esm/validators/string-validator.js +0 -410
  689. package/esm/validators/string-validator.js.map +0 -1
  690. package/esm/validators/tuple-validator.d.ts +0 -34
  691. package/esm/validators/tuple-validator.d.ts.map +0 -1
  692. package/esm/validators/tuple-validator.js +0 -79
  693. package/esm/validators/tuple-validator.js.map +0 -1
  694. package/esm/validators/union-validator.d.ts +0 -42
  695. package/esm/validators/union-validator.d.ts.map +0 -1
  696. package/esm/validators/union-validator.js +0 -44
  697. package/esm/validators/union-validator.js.map +0 -1
@@ -1,26 +0,0 @@
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
@@ -1 +0,0 @@
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,CAgBA,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,CAoBA,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,CAqBA,CAAC"}
@@ -1,63 +0,0 @@
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
- return validationHelpers.invalidRule(this, context);
16
- }
17
- return validationHelpers.VALID_RULE;
18
- },
19
- };
20
- /**
21
- * Present without all rule - field must be present if all specified fields are missing
22
- * Supports both global and sibling scope
23
- */
24
- const presentWithoutAllRule = {
25
- name: "presentWithoutAll",
26
- description: "The field must be present if all specified fields are missing",
27
- sortOrder: -2,
28
- requiresValue: false,
29
- defaultErrorMessage: "The :input field must be present",
30
- async validate(value, context) {
31
- const { fields, scope = "global" } = this.context.options;
32
- const source = scope === "sibling" ? context.parent : context.allValues;
33
- // Check if all fields are missing
34
- const allMissing = fields.every(field => reinforcements.get(source, field) === undefined);
35
- // Field must be present if all other fields are missing
36
- if (value === undefined && allMissing) {
37
- return validationHelpers.invalidRule(this, context);
38
- }
39
- return validationHelpers.VALID_RULE;
40
- },
41
- };
42
- /**
43
- * Present without any rule - field must be present if any of the specified fields is missing
44
- * Supports both global and sibling scope
45
- */
46
- const presentWithoutAnyRule = {
47
- name: "presentWithoutAny",
48
- description: "The field must be present if any of the specified fields is missing",
49
- sortOrder: -2,
50
- requiresValue: false,
51
- defaultErrorMessage: "The :input field must be present",
52
- async validate(value, context) {
53
- const { fields, scope = "global" } = this.context.options;
54
- const source = scope === "sibling" ? context.parent : context.allValues;
55
- // Check if any field is missing
56
- const anyMissing = fields.some(field => reinforcements.get(source, field) === undefined);
57
- // Field must be present if any other field is missing
58
- if (value === undefined && anyMissing) {
59
- return validationHelpers.invalidRule(this, context);
60
- }
61
- return validationHelpers.VALID_RULE;
62
- },
63
- };exports.presentWithoutAllRule=presentWithoutAllRule;exports.presentWithoutAnyRule=presentWithoutAnyRule;exports.presentWithoutRule=presentWithoutRule;//# sourceMappingURL=present-without-rules.js.map
@@ -1 +0,0 @@
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":"6LAIA;;;AAGG;AACU,MAAA,kBAAkB,GAG1B;AACH,IAAA,IAAI,EAAE,gBAAgB;AACtB,IAAA,WAAW,EAAE,uDAAuD;IACpE,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,UAAU,GAAGA,2BAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;;AAGhD,QAAA,IAAI,KAAK,KAAK,SAAS,IAAI,UAAU,KAAK,SAAS,EAAE;AACnD,YAAA,OAAOC,6BAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACnC,SAAA;AAED,QAAA,OAAOC,4BAAU,CAAC;KACnB;EACD;AAEF;;;AAGG;AACU,MAAA,qBAAqB,GAG7B;AACH,IAAA,IAAI,EAAE,mBAAmB;AACzB,IAAA,WAAW,EAAE,+DAA+D;IAC5E,SAAS,EAAE,CAAC,CAAC;AACb,IAAA,aAAa,EAAE,KAAK;AACpB,IAAA,mBAAmB,EAAE,kCAAkC;AACvD,IAAA,MAAM,QAAQ,CAAC,KAAU,EAAE,OAAO,EAAA;AAChC,QAAA,MAAM,EAAE,MAAM,EAAE,KAAK,GAAG,QAAQ,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;AAC1D,QAAA,MAAM,MAAM,GAAG,KAAK,KAAK,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;;AAGxE,QAAA,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,IAAIC,kBAAG,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,SAAS,CAAC,CAAC;;AAG3E,QAAA,IAAI,KAAK,KAAK,SAAS,IAAI,UAAU,EAAE;AACrC,YAAA,OAAOF,6BAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACnC,SAAA;AAED,QAAA,OAAOC,4BAAU,CAAC;KACnB;EACD;AAEF;;;AAGG;AACU,MAAA,qBAAqB,GAG7B;AACH,IAAA,IAAI,EAAE,mBAAmB;AACzB,IAAA,WAAW,EACT,qEAAqE;IACvE,SAAS,EAAE,CAAC,CAAC;AACb,IAAA,aAAa,EAAE,KAAK;AACpB,IAAA,mBAAmB,EAAE,kCAAkC;AACvD,IAAA,MAAM,QAAQ,CAAC,KAAU,EAAE,OAAO,EAAA;AAChC,QAAA,MAAM,EAAE,MAAM,EAAE,KAAK,GAAG,QAAQ,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;AAC1D,QAAA,MAAM,MAAM,GAAG,KAAK,KAAK,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;;AAGxE,QAAA,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,IAAIC,kBAAG,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,SAAS,CAAC,CAAC;;AAG1E,QAAA,IAAI,KAAK,KAAK,SAAS,IAAI,UAAU,EAAE;AACrC,YAAA,OAAOF,6BAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACnC,SAAA;AAED,QAAA,OAAOC,4BAAU,CAAC;KACnB;"}
@@ -1,45 +0,0 @@
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
- //# sourceMappingURL=required-if-rules.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"required-if-rules.d.ts","sourceRoot":"","sources":["../../../src/rules/conditional/required-if-rules.ts"],"names":[],"mappings":"AAEA,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,CAiBA,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,UAAU,CAAC;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC9B,CAgBA,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,UAAU,CAAC;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC9B,CAgBA,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,CAkBA,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,CAkBA,CAAC"}
@@ -1,98 +0,0 @@
1
- 'use strict';var supportiveIs=require('@mongez/supportive-is'),getFieldValue=require('../../helpers/get-field-value.js'),validationHelpers=require('../../helpers/validation-helpers.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 (supportiveIs.isEmpty(value) && fieldValue === expectedValue) {
16
- return validationHelpers.invalidRule(this, context);
17
- }
18
- return validationHelpers.VALID_RULE;
19
- },
20
- };
21
- /**
22
- * Required if empty rule - field is required if another field is empty
23
- * Supports both global and sibling scope
24
- */
25
- const requiredIfEmptyRule = {
26
- name: "requiredIfEmpty",
27
- description: "The field is required if another field is empty",
28
- sortOrder: -2,
29
- requiresValue: false,
30
- defaultErrorMessage: "The :input is required",
31
- async validate(value, context) {
32
- const fieldValue = getFieldValue.getFieldValue(this, context);
33
- // Field is required if the other field is empty
34
- if (supportiveIs.isEmpty(value) && supportiveIs.isEmpty(fieldValue)) {
35
- return validationHelpers.invalidRule(this, context);
36
- }
37
- return validationHelpers.VALID_RULE;
38
- },
39
- };
40
- /**
41
- * Required if not empty rule - field is required if another field is not empty
42
- * Supports both global and sibling scope
43
- */
44
- const requiredIfNotEmptyRule = {
45
- name: "requiredIfNotEmpty",
46
- description: "The field is required if another field is not empty",
47
- sortOrder: -2,
48
- requiresValue: false,
49
- defaultErrorMessage: "The :input is required",
50
- async validate(value, context) {
51
- const fieldValue = getFieldValue.getFieldValue(this, context);
52
- // Field is required if the other field is not empty
53
- if (supportiveIs.isEmpty(value) && !supportiveIs.isEmpty(fieldValue)) {
54
- return validationHelpers.invalidRule(this, context);
55
- }
56
- return validationHelpers.VALID_RULE;
57
- },
58
- };
59
- /**
60
- * Required if in rule - field is required if another field's value is in the given array
61
- * Supports both global and sibling scope
62
- */
63
- const requiredIfInRule = {
64
- name: "requiredIfIn",
65
- description: "The field is required if another field's value is in the given array",
66
- sortOrder: -2,
67
- requiresValue: false,
68
- defaultErrorMessage: "The :input is required",
69
- async validate(value, context) {
70
- const { values } = this.context.options;
71
- const fieldValue = getFieldValue.getFieldValue(this, context);
72
- // Field is required if the other field's value is in the array
73
- if (supportiveIs.isEmpty(value) && values.includes(fieldValue)) {
74
- return validationHelpers.invalidRule(this, context);
75
- }
76
- return validationHelpers.VALID_RULE;
77
- },
78
- };
79
- /**
80
- * Required if not in rule - field is required if another field's value is NOT in the given array
81
- * Supports both global and sibling scope
82
- */
83
- const requiredIfNotInRule = {
84
- name: "requiredIfNotIn",
85
- description: "The field is required if another field's value is NOT in the given array",
86
- sortOrder: -2,
87
- requiresValue: false,
88
- defaultErrorMessage: "The :input is required",
89
- async validate(value, context) {
90
- const { values } = this.context.options;
91
- const fieldValue = getFieldValue.getFieldValue(this, context);
92
- // Field is required if the other field's value is NOT in the array
93
- if (supportiveIs.isEmpty(value) && !values.includes(fieldValue)) {
94
- return validationHelpers.invalidRule(this, context);
95
- }
96
- return validationHelpers.VALID_RULE;
97
- },
98
- };exports.requiredIfEmptyRule=requiredIfEmptyRule;exports.requiredIfInRule=requiredIfInRule;exports.requiredIfNotEmptyRule=requiredIfNotEmptyRule;exports.requiredIfNotInRule=requiredIfNotInRule;exports.requiredIfRule=requiredIfRule;//# sourceMappingURL=required-if-rules.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"required-if-rules.js","sources":["../../../src/rules/conditional/required-if-rules.ts"],"sourcesContent":[null],"names":["getFieldValue","isEmpty","invalidRule","VALID_RULE"],"mappings":"0LAIA;;;AAGG;AACU,MAAA,cAAc,GAItB;AACH,IAAA,IAAI,EAAE,YAAY;AAClB,IAAA,WAAW,EAAE,gEAAgE;IAC7E,SAAS,EAAE,CAAC,CAAC;AACb,IAAA,aAAa,EAAE,KAAK;AACpB,IAAA,mBAAmB,EAAE,wBAAwB;AAC7C,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;;QAGhD,IAAIC,oBAAO,CAAC,KAAK,CAAC,IAAI,UAAU,KAAK,aAAa,EAAE;AAClD,YAAA,OAAOC,6BAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACnC,SAAA;AAED,QAAA,OAAOC,4BAAU,CAAC;KACnB;EACD;AAEF;;;AAGG;AACU,MAAA,mBAAmB,GAG3B;AACH,IAAA,IAAI,EAAE,iBAAiB;AACvB,IAAA,WAAW,EAAE,iDAAiD;IAC9D,SAAS,EAAE,CAAC,CAAC;AACb,IAAA,aAAa,EAAE,KAAK;AACpB,IAAA,mBAAmB,EAAE,wBAAwB;AAC7C,IAAA,MAAM,QAAQ,CAAC,KAAU,EAAE,OAAO,EAAA;QAChC,MAAM,UAAU,GAAGH,2BAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;;QAGhD,IAAIC,oBAAO,CAAC,KAAK,CAAC,IAAIA,oBAAO,CAAC,UAAU,CAAC,EAAE;AACzC,YAAA,OAAOC,6BAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACnC,SAAA;AAED,QAAA,OAAOC,4BAAU,CAAC;KACnB;EACD;AAEF;;;AAGG;AACU,MAAA,sBAAsB,GAG9B;AACH,IAAA,IAAI,EAAE,oBAAoB;AAC1B,IAAA,WAAW,EAAE,qDAAqD;IAClE,SAAS,EAAE,CAAC,CAAC;AACb,IAAA,aAAa,EAAE,KAAK;AACpB,IAAA,mBAAmB,EAAE,wBAAwB;AAC7C,IAAA,MAAM,QAAQ,CAAC,KAAU,EAAE,OAAO,EAAA;QAChC,MAAM,UAAU,GAAGH,2BAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;;QAGhD,IAAIC,oBAAO,CAAC,KAAK,CAAC,IAAI,CAACA,oBAAO,CAAC,UAAU,CAAC,EAAE;AAC1C,YAAA,OAAOC,6BAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACnC,SAAA;AAED,QAAA,OAAOC,4BAAU,CAAC;KACnB;EACD;AAEF;;;AAGG;AACU,MAAA,gBAAgB,GAIxB;AACH,IAAA,IAAI,EAAE,cAAc;AACpB,IAAA,WAAW,EACT,sEAAsE;IACxE,SAAS,EAAE,CAAC,CAAC;AACb,IAAA,aAAa,EAAE,KAAK;AACpB,IAAA,mBAAmB,EAAE,wBAAwB;AAC7C,IAAA,MAAM,QAAQ,CAAC,KAAU,EAAE,OAAO,EAAA;QAChC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;QACxC,MAAM,UAAU,GAAGH,2BAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;;QAGhD,IAAIC,oBAAO,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;AACjD,YAAA,OAAOC,6BAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACnC,SAAA;AAED,QAAA,OAAOC,4BAAU,CAAC;KACnB;EACD;AAEF;;;AAGG;AACU,MAAA,mBAAmB,GAI3B;AACH,IAAA,IAAI,EAAE,iBAAiB;AACvB,IAAA,WAAW,EACT,0EAA0E;IAC5E,SAAS,EAAE,CAAC,CAAC;AACb,IAAA,aAAa,EAAE,KAAK;AACpB,IAAA,mBAAmB,EAAE,wBAAwB;AAC7C,IAAA,MAAM,QAAQ,CAAC,KAAU,EAAE,OAAO,EAAA;QAChC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;QACxC,MAAM,UAAU,GAAGH,2BAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;;AAGhD,QAAA,IAAIC,oBAAO,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;AAClD,YAAA,OAAOC,6BAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACnC,SAAA;AAED,QAAA,OAAOC,4BAAU,CAAC;KACnB;"}
@@ -1,11 +0,0 @@
1
- import type { SchemaRule } from "../../types";
2
- /**
3
- * Required unless rule - field is required unless another field equals a specific value
4
- * Supports both global and sibling scope
5
- */
6
- export declare const requiredUnlessRule: SchemaRule<{
7
- field: string;
8
- value: any;
9
- scope?: "global" | "sibling";
10
- }>;
11
- //# sourceMappingURL=required-unless-rules.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"required-unless-rules.d.ts","sourceRoot":"","sources":["../../../src/rules/conditional/required-unless-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,EAAE,GAAG,CAAC;IACX,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC9B,CAkBA,CAAC"}
@@ -1,20 +0,0 @@
1
- 'use strict';var supportiveIs=require('@mongez/supportive-is'),getFieldValue=require('../../helpers/get-field-value.js'),validationHelpers=require('../../helpers/validation-helpers.js');/**
2
- * Required unless rule - field is required unless another field equals a specific value
3
- * Supports both global and sibling scope
4
- */
5
- const requiredUnlessRule = {
6
- name: "requiredUnless",
7
- description: "The field is required unless 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 unless the other field equals the expected value
15
- if (supportiveIs.isEmpty(value) && fieldValue !== expectedValue) {
16
- return validationHelpers.invalidRule(this, context);
17
- }
18
- return validationHelpers.VALID_RULE;
19
- },
20
- };exports.requiredUnlessRule=requiredUnlessRule;//# sourceMappingURL=required-unless-rules.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"required-unless-rules.js","sources":["../../../src/rules/conditional/required-unless-rules.ts"],"sourcesContent":[null],"names":["getFieldValue","isEmpty","invalidRule","VALID_RULE"],"mappings":"0LAIA;;;AAGG;AACU,MAAA,kBAAkB,GAI1B;AACH,IAAA,IAAI,EAAE,gBAAgB;AACtB,IAAA,WAAW,EACT,oEAAoE;IACtE,SAAS,EAAE,CAAC,CAAC;AACb,IAAA,aAAa,EAAE,KAAK;AACpB,IAAA,mBAAmB,EAAE,wBAAwB;AAC7C,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;;QAGhD,IAAIC,oBAAO,CAAC,KAAK,CAAC,IAAI,UAAU,KAAK,aAAa,EAAE;AAClD,YAAA,OAAOC,6BAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACnC,SAAA;AAED,QAAA,OAAOC,4BAAU,CAAC;KACnB;"}
@@ -1,26 +0,0 @@
1
- import type { SchemaRule } from "../../types";
2
- /**
3
- * Required with rule - field is required if another field is present
4
- * Supports both global and sibling scope
5
- */
6
- export declare const requiredWithRule: SchemaRule<{
7
- field: string;
8
- scope?: "global" | "sibling";
9
- }>;
10
- /**
11
- * Required with all rule - field is required if all specified fields are present
12
- * Supports both global and sibling scope
13
- */
14
- export declare const requiredWithAllRule: SchemaRule<{
15
- fields: string[];
16
- scope?: "global" | "sibling";
17
- }>;
18
- /**
19
- * Required with any rule - field is required if any of the specified fields is present
20
- * Supports both global and sibling scope
21
- */
22
- export declare const requiredWithAnyRule: SchemaRule<{
23
- fields: string[];
24
- scope?: "global" | "sibling";
25
- }>;
26
- //# sourceMappingURL=required-with-rules.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"required-with-rules.d.ts","sourceRoot":"","sources":["../../../src/rules/conditional/required-with-rules.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,UAAU,CAAC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC9B,CAgBA,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,UAAU,CAAC;IAC3C,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC9B,CAoBA,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,UAAU,CAAC;IAC3C,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC9B,CAqBA,CAAC"}
@@ -1,63 +0,0 @@
1
- 'use strict';var reinforcements=require('@mongez/reinforcements'),supportiveIs=require('@mongez/supportive-is'),getFieldValue=require('../../helpers/get-field-value.js'),validationHelpers=require('../../helpers/validation-helpers.js');/**
2
- * Required with rule - field is required if another field is present
3
- * Supports both global and sibling scope
4
- */
5
- const requiredWithRule = {
6
- name: "requiredWith",
7
- description: "The field is required if another field is present",
8
- sortOrder: -2,
9
- requiresValue: false,
10
- defaultErrorMessage: "The :input is required",
11
- async validate(value, context) {
12
- const fieldValue = getFieldValue.getFieldValue(this, context);
13
- // Field is required if the other field is present
14
- if (supportiveIs.isEmpty(value) && fieldValue !== undefined) {
15
- return validationHelpers.invalidRule(this, context);
16
- }
17
- return validationHelpers.VALID_RULE;
18
- },
19
- };
20
- /**
21
- * Required with all rule - field is required if all specified fields are present
22
- * Supports both global and sibling scope
23
- */
24
- const requiredWithAllRule = {
25
- name: "requiredWithAll",
26
- description: "The field is required if all specified fields are present",
27
- sortOrder: -2,
28
- requiresValue: false,
29
- defaultErrorMessage: "The :input is required",
30
- async validate(value, context) {
31
- const { fields, scope = "global" } = this.context.options;
32
- const source = scope === "sibling" ? context.parent : context.allValues;
33
- // Check if all fields are present
34
- const allPresent = fields.every(field => reinforcements.get(source, field) !== undefined);
35
- // Field is required if all other fields are present
36
- if (supportiveIs.isEmpty(value) && allPresent) {
37
- return validationHelpers.invalidRule(this, context);
38
- }
39
- return validationHelpers.VALID_RULE;
40
- },
41
- };
42
- /**
43
- * Required with any rule - field is required if any of the specified fields is present
44
- * Supports both global and sibling scope
45
- */
46
- const requiredWithAnyRule = {
47
- name: "requiredWithAny",
48
- description: "The field is required if any of the specified fields is present",
49
- sortOrder: -2,
50
- requiresValue: false,
51
- defaultErrorMessage: "The :input is required",
52
- async validate(value, context) {
53
- const { fields, scope = "global" } = this.context.options;
54
- const source = scope === "sibling" ? context.parent : context.allValues;
55
- // Check if any field is present
56
- const anyPresent = fields.some(field => reinforcements.get(source, field) !== undefined);
57
- // Field is required if any other field is present
58
- if (supportiveIs.isEmpty(value) && anyPresent) {
59
- return validationHelpers.invalidRule(this, context);
60
- }
61
- return validationHelpers.VALID_RULE;
62
- },
63
- };exports.requiredWithAllRule=requiredWithAllRule;exports.requiredWithAnyRule=requiredWithAnyRule;exports.requiredWithRule=requiredWithRule;//# sourceMappingURL=required-with-rules.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"required-with-rules.js","sources":["../../../src/rules/conditional/required-with-rules.ts"],"sourcesContent":[null],"names":["getFieldValue","isEmpty","invalidRule","VALID_RULE","get"],"mappings":"2OAKA;;;AAGG;AACU,MAAA,gBAAgB,GAGxB;AACH,IAAA,IAAI,EAAE,cAAc;AACpB,IAAA,WAAW,EAAE,mDAAmD;IAChE,SAAS,EAAE,CAAC,CAAC;AACb,IAAA,aAAa,EAAE,KAAK;AACpB,IAAA,mBAAmB,EAAE,wBAAwB;AAC7C,IAAA,MAAM,QAAQ,CAAC,KAAU,EAAE,OAAO,EAAA;QAChC,MAAM,UAAU,GAAGA,2BAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;;QAGhD,IAAIC,oBAAO,CAAC,KAAK,CAAC,IAAI,UAAU,KAAK,SAAS,EAAE;AAC9C,YAAA,OAAOC,6BAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACnC,SAAA;AAED,QAAA,OAAOC,4BAAU,CAAC;KACnB;EACD;AAEF;;;AAGG;AACU,MAAA,mBAAmB,GAG3B;AACH,IAAA,IAAI,EAAE,iBAAiB;AACvB,IAAA,WAAW,EAAE,2DAA2D;IACxE,SAAS,EAAE,CAAC,CAAC;AACb,IAAA,aAAa,EAAE,KAAK;AACpB,IAAA,mBAAmB,EAAE,wBAAwB;AAC7C,IAAA,MAAM,QAAQ,CAAC,KAAU,EAAE,OAAO,EAAA;AAChC,QAAA,MAAM,EAAE,MAAM,EAAE,KAAK,GAAG,QAAQ,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;AAC1D,QAAA,MAAM,MAAM,GAAG,KAAK,KAAK,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;;AAGxE,QAAA,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,IAAIC,kBAAG,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,SAAS,CAAC,CAAC;;AAG3E,QAAA,IAAIH,oBAAO,CAAC,KAAK,CAAC,IAAI,UAAU,EAAE;AAChC,YAAA,OAAOC,6BAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACnC,SAAA;AAED,QAAA,OAAOC,4BAAU,CAAC;KACnB;EACD;AAEF;;;AAGG;AACU,MAAA,mBAAmB,GAG3B;AACH,IAAA,IAAI,EAAE,iBAAiB;AACvB,IAAA,WAAW,EACT,iEAAiE;IACnE,SAAS,EAAE,CAAC,CAAC;AACb,IAAA,aAAa,EAAE,KAAK;AACpB,IAAA,mBAAmB,EAAE,wBAAwB;AAC7C,IAAA,MAAM,QAAQ,CAAC,KAAU,EAAE,OAAO,EAAA;AAChC,QAAA,MAAM,EAAE,MAAM,EAAE,KAAK,GAAG,QAAQ,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;AAC1D,QAAA,MAAM,MAAM,GAAG,KAAK,KAAK,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;;AAGxE,QAAA,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,IAAIC,kBAAG,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,SAAS,CAAC,CAAC;;AAG1E,QAAA,IAAIH,oBAAO,CAAC,KAAK,CAAC,IAAI,UAAU,EAAE;AAChC,YAAA,OAAOC,6BAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACnC,SAAA;AAED,QAAA,OAAOC,4BAAU,CAAC;KACnB;"}
@@ -1,26 +0,0 @@
1
- import type { SchemaRule } from "../../types";
2
- /**
3
- * Required without rule - field is required if another field is missing
4
- * Supports both global and sibling scope
5
- */
6
- export declare const requiredWithoutRule: SchemaRule<{
7
- field: string;
8
- scope?: "global" | "sibling";
9
- }>;
10
- /**
11
- * Required without all rule - field is required if all specified fields are missing
12
- * Supports both global and sibling scope
13
- */
14
- export declare const requiredWithoutAllRule: SchemaRule<{
15
- fields: string[];
16
- scope?: "global" | "sibling";
17
- }>;
18
- /**
19
- * Required without any rule - field is required if any of the specified fields is missing
20
- * Supports both global and sibling scope
21
- */
22
- export declare const requiredWithoutAnyRule: SchemaRule<{
23
- fields: string[];
24
- scope?: "global" | "sibling";
25
- }>;
26
- //# sourceMappingURL=required-without-rules.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"required-without-rules.d.ts","sourceRoot":"","sources":["../../../src/rules/conditional/required-without-rules.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,UAAU,CAAC;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC9B,CAgBA,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,sBAAsB,EAAE,UAAU,CAAC;IAC9C,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC9B,CAqBA,CAAC"}
@@ -1,63 +0,0 @@
1
- 'use strict';var reinforcements=require('@mongez/reinforcements'),supportiveIs=require('@mongez/supportive-is'),getFieldValue=require('../../helpers/get-field-value.js'),validationHelpers=require('../../helpers/validation-helpers.js');/**
2
- * Required without rule - field is required if another field is missing
3
- * Supports both global and sibling scope
4
- */
5
- const requiredWithoutRule = {
6
- name: "requiredWithout",
7
- description: "The field is required if another field is missing",
8
- sortOrder: -2,
9
- requiresValue: false,
10
- defaultErrorMessage: "The :input is required",
11
- async validate(value, context) {
12
- const fieldValue = getFieldValue.getFieldValue(this, context);
13
- // Field is required if the other field is missing
14
- if (supportiveIs.isEmpty(value) && fieldValue === undefined) {
15
- return validationHelpers.invalidRule(this, context);
16
- }
17
- return validationHelpers.VALID_RULE;
18
- },
19
- };
20
- /**
21
- * Required without all rule - field is required if all specified fields are missing
22
- * Supports both global and sibling scope
23
- */
24
- const requiredWithoutAllRule = {
25
- name: "requiredWithoutAll",
26
- description: "The field is required if all specified fields are missing",
27
- sortOrder: -2,
28
- requiresValue: false,
29
- defaultErrorMessage: "The :input is required",
30
- async validate(value, context) {
31
- const { fields, scope = "global" } = this.context.options;
32
- const source = scope === "sibling" ? context.parent : context.allValues;
33
- // Check if all fields are missing
34
- const allMissing = fields.every(field => reinforcements.get(source, field) === undefined);
35
- // Field is required if all other fields are missing
36
- if (supportiveIs.isEmpty(value) && allMissing) {
37
- return validationHelpers.invalidRule(this, context);
38
- }
39
- return validationHelpers.VALID_RULE;
40
- },
41
- };
42
- /**
43
- * Required without any rule - field is required if any of the specified fields is missing
44
- * Supports both global and sibling scope
45
- */
46
- const requiredWithoutAnyRule = {
47
- name: "requiredWithoutAny",
48
- description: "The field is required if any of the specified fields is missing",
49
- sortOrder: -2,
50
- requiresValue: false,
51
- defaultErrorMessage: "The :input is required",
52
- async validate(value, context) {
53
- const { fields, scope = "global" } = this.context.options;
54
- const source = scope === "sibling" ? context.parent : context.allValues;
55
- // Check if any field is missing
56
- const anyMissing = fields.some(field => reinforcements.get(source, field) === undefined);
57
- // Field is required if any other field is missing
58
- if (supportiveIs.isEmpty(value) && anyMissing) {
59
- return validationHelpers.invalidRule(this, context);
60
- }
61
- return validationHelpers.VALID_RULE;
62
- },
63
- };exports.requiredWithoutAllRule=requiredWithoutAllRule;exports.requiredWithoutAnyRule=requiredWithoutAnyRule;exports.requiredWithoutRule=requiredWithoutRule;//# sourceMappingURL=required-without-rules.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"required-without-rules.js","sources":["../../../src/rules/conditional/required-without-rules.ts"],"sourcesContent":[null],"names":["getFieldValue","isEmpty","invalidRule","VALID_RULE","get"],"mappings":"2OAKA;;;AAGG;AACU,MAAA,mBAAmB,GAG3B;AACH,IAAA,IAAI,EAAE,iBAAiB;AACvB,IAAA,WAAW,EAAE,mDAAmD;IAChE,SAAS,EAAE,CAAC,CAAC;AACb,IAAA,aAAa,EAAE,KAAK;AACpB,IAAA,mBAAmB,EAAE,wBAAwB;AAC7C,IAAA,MAAM,QAAQ,CAAC,KAAU,EAAE,OAAO,EAAA;QAChC,MAAM,UAAU,GAAGA,2BAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;;QAGhD,IAAIC,oBAAO,CAAC,KAAK,CAAC,IAAI,UAAU,KAAK,SAAS,EAAE;AAC9C,YAAA,OAAOC,6BAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACnC,SAAA;AAED,QAAA,OAAOC,4BAAU,CAAC;KACnB;EACD;AAEF;;;AAGG;AACU,MAAA,sBAAsB,GAG9B;AACH,IAAA,IAAI,EAAE,oBAAoB;AAC1B,IAAA,WAAW,EAAE,2DAA2D;IACxE,SAAS,EAAE,CAAC,CAAC;AACb,IAAA,aAAa,EAAE,KAAK;AACpB,IAAA,mBAAmB,EAAE,wBAAwB;AAC7C,IAAA,MAAM,QAAQ,CAAC,KAAU,EAAE,OAAO,EAAA;AAChC,QAAA,MAAM,EAAE,MAAM,EAAE,KAAK,GAAG,QAAQ,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;AAC1D,QAAA,MAAM,MAAM,GAAG,KAAK,KAAK,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;;AAGxE,QAAA,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,IAAIC,kBAAG,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,SAAS,CAAC,CAAC;;AAG3E,QAAA,IAAIH,oBAAO,CAAC,KAAK,CAAC,IAAI,UAAU,EAAE;AAChC,YAAA,OAAOC,6BAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACnC,SAAA;AAED,QAAA,OAAOC,4BAAU,CAAC;KACnB;EACD;AAEF;;;AAGG;AACU,MAAA,sBAAsB,GAG9B;AACH,IAAA,IAAI,EAAE,oBAAoB;AAC1B,IAAA,WAAW,EACT,iEAAiE;IACnE,SAAS,EAAE,CAAC,CAAC;AACb,IAAA,aAAa,EAAE,KAAK;AACpB,IAAA,mBAAmB,EAAE,wBAAwB;AAC7C,IAAA,MAAM,QAAQ,CAAC,KAAU,EAAE,OAAO,EAAA;AAChC,QAAA,MAAM,EAAE,MAAM,EAAE,KAAK,GAAG,QAAQ,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;AAC1D,QAAA,MAAM,MAAM,GAAG,KAAK,KAAK,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;;AAGxE,QAAA,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,IAAIC,kBAAG,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,SAAS,CAAC,CAAC;;AAG1E,QAAA,IAAIH,oBAAO,CAAC,KAAK,CAAC,IAAI,UAAU,EAAE;AAChC,YAAA,OAAOC,6BAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACnC,SAAA;AAED,QAAA,OAAOC,4BAAU,CAAC;KACnB;"}
@@ -1,8 +0,0 @@
1
- import type { SchemaRule } from "../../types";
2
- /**
3
- * Equal rule - value must be equal to a specific value
4
- */
5
- export declare const equalRule: SchemaRule<{
6
- value: any;
7
- }>;
8
- //# sourceMappingURL=equal.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"equal.d.ts","sourceRoot":"","sources":["../../../src/rules/core/equal.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,UAAU,CAAC;IAAE,KAAK,EAAE,GAAG,CAAA;CAAE,CAShD,CAAC"}
@@ -1,13 +0,0 @@
1
- 'use strict';require('@mongez/reinforcements');var validationHelpers=require('../../helpers/validation-helpers.js');/**
2
- * Equal rule - value must be equal to a specific value
3
- */
4
- const equalRule = {
5
- name: "equal",
6
- defaultErrorMessage: "The :input must be equal to :value",
7
- async validate(value, context) {
8
- if (value !== this.context.options.value) {
9
- return validationHelpers.invalidRule(this, context);
10
- }
11
- return validationHelpers.VALID_RULE;
12
- },
13
- };exports.equalRule=equalRule;//# sourceMappingURL=equal.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"equal.js","sources":["../../../src/rules/core/equal.ts"],"sourcesContent":[null],"names":["invalidRule","VALID_RULE"],"mappings":"oHAGA;;AAEG;AACU,MAAA,SAAS,GAA+B;AACnD,IAAA,IAAI,EAAE,OAAO;AACb,IAAA,mBAAmB,EAAE,oCAAoC;AACzD,IAAA,MAAM,QAAQ,CAAC,KAAU,EAAE,OAAO,EAAA;QAChC,IAAI,KAAK,KAAK,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE;AACxC,YAAA,OAAOA,6BAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACnC,SAAA;AACD,QAAA,OAAOC,4BAAU,CAAC;KACnB;"}
@@ -1,6 +0,0 @@
1
- import type { SchemaRule } from "../../types";
2
- /**
3
- * Forbidden rule - value must not be present
4
- */
5
- export declare const forbiddenRule: SchemaRule;
6
- //# sourceMappingURL=forbidden.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"forbidden.d.ts","sourceRoot":"","sources":["../../../src/rules/core/forbidden.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,UAS3B,CAAC"}
@@ -1,13 +0,0 @@
1
- 'use strict';var supportiveIs=require('@mongez/supportive-is');require('@mongez/reinforcements');var validationHelpers=require('../../helpers/validation-helpers.js');/**
2
- * Forbidden rule - value must not be present
3
- */
4
- const forbiddenRule = {
5
- name: "forbidden",
6
- defaultErrorMessage: "The :input is forbidden",
7
- async validate(value, context) {
8
- if (!supportiveIs.isEmpty(value)) {
9
- return validationHelpers.invalidRule(this, context);
10
- }
11
- return validationHelpers.VALID_RULE;
12
- },
13
- };exports.forbiddenRule=forbiddenRule;//# sourceMappingURL=forbidden.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"forbidden.js","sources":["../../../src/rules/core/forbidden.ts"],"sourcesContent":[null],"names":["isEmpty","invalidRule","VALID_RULE"],"mappings":"sKAIA;;AAEG;AACU,MAAA,aAAa,GAAe;AACvC,IAAA,IAAI,EAAE,WAAW;AACjB,IAAA,mBAAmB,EAAE,yBAAyB;AAC9C,IAAA,MAAM,QAAQ,CAAC,KAAU,EAAE,OAAO,EAAA;AAChC,QAAA,IAAI,CAACA,oBAAO,CAAC,KAAK,CAAC,EAAE;AACnB,YAAA,OAAOC,6BAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACnC,SAAA;AACD,QAAA,OAAOC,4BAAU,CAAC;KACnB;"}
@@ -1,6 +0,0 @@
1
- export * from "./equal";
2
- export * from "./forbidden";
3
- export * from "./required";
4
- export * from "./union";
5
- export * from "./when";
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/rules/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC"}
@@ -1,11 +0,0 @@
1
- import type { SchemaRule } from "../../types";
2
- /**
3
- * Required rule - value must be present and not empty
4
- */
5
- export declare const requiredRule: SchemaRule;
6
- /**
7
- * Present rule - key must exist in the data, but value can be anything
8
- * (empty string, null, undefined are all valid as long as the key exists)
9
- */
10
- export declare const presentRule: SchemaRule;
11
- //# sourceMappingURL=required.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"required.d.ts","sourceRoot":"","sources":["../../../src/rules/core/required.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,UAW1B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,UAYzB,CAAC"}
@@ -1,31 +0,0 @@
1
- 'use strict';var supportiveIs=require('@mongez/supportive-is');require('@mongez/reinforcements');var validationHelpers=require('../../helpers/validation-helpers.js');/**
2
- * Required rule - value must be present and not empty
3
- */
4
- const requiredRule = {
5
- name: "required",
6
- defaultErrorMessage: "The :input is required",
7
- requiresValue: false,
8
- sortOrder: -2,
9
- async validate(value, context) {
10
- if (supportiveIs.isEmpty(value)) {
11
- return validationHelpers.invalidRule(this, context);
12
- }
13
- return validationHelpers.VALID_RULE;
14
- },
15
- };
16
- /**
17
- * Present rule - key must exist in the data, but value can be anything
18
- * (empty string, null, undefined are all valid as long as the key exists)
19
- */
20
- const presentRule = {
21
- name: "present",
22
- defaultErrorMessage: "The :input field is required",
23
- requiresValue: false,
24
- sortOrder: -2,
25
- async validate(value, context) {
26
- if (value === undefined) {
27
- return validationHelpers.invalidRule(this, context);
28
- }
29
- return validationHelpers.VALID_RULE;
30
- },
31
- };exports.presentRule=presentRule;exports.requiredRule=requiredRule;//# sourceMappingURL=required.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"required.js","sources":["../../../src/rules/core/required.ts"],"sourcesContent":[null],"names":["isEmpty","invalidRule","VALID_RULE"],"mappings":"sKAIA;;AAEG;AACU,MAAA,YAAY,GAAe;AACtC,IAAA,IAAI,EAAE,UAAU;AAChB,IAAA,mBAAmB,EAAE,wBAAwB;AAC7C,IAAA,aAAa,EAAE,KAAK;IACpB,SAAS,EAAE,CAAC,CAAC;AACb,IAAA,MAAM,QAAQ,CAAC,KAAU,EAAE,OAAO,EAAA;AAChC,QAAA,IAAIA,oBAAO,CAAC,KAAK,CAAC,EAAE;AAClB,YAAA,OAAOC,6BAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACnC,SAAA;AACD,QAAA,OAAOC,4BAAU,CAAC;KACnB;EACD;AAEF;;;AAGG;AACU,MAAA,WAAW,GAAe;AACrC,IAAA,IAAI,EAAE,SAAS;AACf,IAAA,mBAAmB,EAAE,8BAA8B;AACnD,IAAA,aAAa,EAAE,KAAK;IACpB,SAAS,EAAE,CAAC,CAAC;AACb,IAAA,MAAM,QAAQ,CAAC,KAAU,EAAE,OAAO,EAAA;QAChC,IAAI,KAAK,KAAK,SAAS,EAAE;AACvB,YAAA,OAAOD,6BAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACnC,SAAA;AAED,QAAA,OAAOC,4BAAU,CAAC;KACnB;"}