@rockster/class-pipe 0.0.1

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 (430) hide show
  1. package/contexts/validate-context.d.ts +5 -0
  2. package/contexts/validate-context.js +6 -0
  3. package/contexts/validate-context.js.map +1 -0
  4. package/decorators/array/index.d.ts +1 -0
  5. package/decorators/array/index.js +18 -0
  6. package/decorators/array/index.js.map +1 -0
  7. package/decorators/array/is-array.decorator.d.ts +6 -0
  8. package/decorators/array/is-array.decorator.js +62 -0
  9. package/decorators/array/is-array.decorator.js.map +1 -0
  10. package/decorators/common/expose.decorator.d.ts +6 -0
  11. package/decorators/common/expose.decorator.js +20 -0
  12. package/decorators/common/expose.decorator.js.map +1 -0
  13. package/decorators/common/if.decorator.d.ts +3 -0
  14. package/decorators/common/if.decorator.js +21 -0
  15. package/decorators/common/if.decorator.js.map +1 -0
  16. package/decorators/common/index.d.ts +6 -0
  17. package/decorators/common/index.js +23 -0
  18. package/decorators/common/index.js.map +1 -0
  19. package/decorators/common/is-optional.decorator.d.ts +4 -0
  20. package/decorators/common/is-optional.decorator.js +16 -0
  21. package/decorators/common/is-optional.decorator.js.map +1 -0
  22. package/decorators/common/is-required.decorator.d.ts +5 -0
  23. package/decorators/common/is-required.decorator.js +52 -0
  24. package/decorators/common/is-required.decorator.js.map +1 -0
  25. package/decorators/common/transform-input.decorator.d.ts +2 -0
  26. package/decorators/common/transform-input.decorator.js +13 -0
  27. package/decorators/common/transform-input.decorator.js.map +1 -0
  28. package/decorators/common/transform-output.decorator.d.ts +2 -0
  29. package/decorators/common/transform-output.decorator.js +13 -0
  30. package/decorators/common/transform-output.decorator.js.map +1 -0
  31. package/decorators/date/index.d.ts +4 -0
  32. package/decorators/date/index.js +21 -0
  33. package/decorators/date/index.js.map +1 -0
  34. package/decorators/date/is-after.decorator.d.ts +4 -0
  35. package/decorators/date/is-after.decorator.js +55 -0
  36. package/decorators/date/is-after.decorator.js.map +1 -0
  37. package/decorators/date/is-before.decorator.d.ts +4 -0
  38. package/decorators/date/is-before.decorator.js +55 -0
  39. package/decorators/date/is-before.decorator.js.map +1 -0
  40. package/decorators/date/is-date.decorator.d.ts +4 -0
  41. package/decorators/date/is-date.decorator.js +62 -0
  42. package/decorators/date/is-date.decorator.js.map +1 -0
  43. package/decorators/date/is-time.decorator.d.ts +4 -0
  44. package/decorators/date/is-time.decorator.js +64 -0
  45. package/decorators/date/is-time.decorator.js.map +1 -0
  46. package/decorators/index.d.ts +6 -0
  47. package/decorators/index.js +23 -0
  48. package/decorators/index.js.map +1 -0
  49. package/decorators/number/index.d.ts +6 -0
  50. package/decorators/number/index.js +23 -0
  51. package/decorators/number/index.js.map +1 -0
  52. package/decorators/number/is-decimal.decorator.d.ts +4 -0
  53. package/decorators/number/is-decimal.decorator.js +61 -0
  54. package/decorators/number/is-decimal.decorator.js.map +1 -0
  55. package/decorators/number/is-divisible-by.decorator.d.ts +4 -0
  56. package/decorators/number/is-divisible-by.decorator.js +58 -0
  57. package/decorators/number/is-divisible-by.decorator.js.map +1 -0
  58. package/decorators/number/is-float.decorator.d.ts +4 -0
  59. package/decorators/number/is-float.decorator.js +66 -0
  60. package/decorators/number/is-float.decorator.js.map +1 -0
  61. package/decorators/number/is-int.decorator.d.ts +4 -0
  62. package/decorators/number/is-int.decorator.js +64 -0
  63. package/decorators/number/is-int.decorator.js.map +1 -0
  64. package/decorators/number/is-numeric.decorator.d.ts +4 -0
  65. package/decorators/number/is-numeric.decorator.js +64 -0
  66. package/decorators/number/is-numeric.decorator.js.map +1 -0
  67. package/decorators/number/is-octal.decorator.d.ts +4 -0
  68. package/decorators/number/is-octal.decorator.js +55 -0
  69. package/decorators/number/is-octal.decorator.js.map +1 -0
  70. package/decorators/object/index.d.ts +2 -0
  71. package/decorators/object/index.js +19 -0
  72. package/decorators/object/index.js.map +1 -0
  73. package/decorators/object/is-object.decorator.d.ts +4 -0
  74. package/decorators/object/is-object.decorator.js +58 -0
  75. package/decorators/object/is-object.decorator.js.map +1 -0
  76. package/decorators/object/is-type.decorator.d.ts +2 -0
  77. package/decorators/object/is-type.decorator.js +19 -0
  78. package/decorators/object/is-type.decorator.js.map +1 -0
  79. package/decorators/string/contains.decorator.d.ts +4 -0
  80. package/decorators/string/contains.decorator.js +55 -0
  81. package/decorators/string/contains.decorator.js.map +1 -0
  82. package/decorators/string/index.d.ts +68 -0
  83. package/decorators/string/index.js +85 -0
  84. package/decorators/string/index.js.map +1 -0
  85. package/decorators/string/is-alpha.decorator.d.ts +4 -0
  86. package/decorators/string/is-alpha.decorator.js +55 -0
  87. package/decorators/string/is-alpha.decorator.js.map +1 -0
  88. package/decorators/string/is-alphanumeric.decorator.d.ts +4 -0
  89. package/decorators/string/is-alphanumeric.decorator.js +55 -0
  90. package/decorators/string/is-alphanumeric.decorator.js.map +1 -0
  91. package/decorators/string/is-ascii.decorator.d.ts +4 -0
  92. package/decorators/string/is-ascii.decorator.js +55 -0
  93. package/decorators/string/is-ascii.decorator.js.map +1 -0
  94. package/decorators/string/is-base-32.decorator.d.ts +4 -0
  95. package/decorators/string/is-base-32.decorator.js +55 -0
  96. package/decorators/string/is-base-32.decorator.js.map +1 -0
  97. package/decorators/string/is-base-58.decorator.d.ts +4 -0
  98. package/decorators/string/is-base-58.decorator.js +55 -0
  99. package/decorators/string/is-base-58.decorator.js.map +1 -0
  100. package/decorators/string/is-base-64.decorator.d.ts +4 -0
  101. package/decorators/string/is-base-64.decorator.js +55 -0
  102. package/decorators/string/is-base-64.decorator.js.map +1 -0
  103. package/decorators/string/is-bic.decorator.d.ts +4 -0
  104. package/decorators/string/is-bic.decorator.js +55 -0
  105. package/decorators/string/is-bic.decorator.js.map +1 -0
  106. package/decorators/string/is-boolean.d.ts +5 -0
  107. package/decorators/string/is-boolean.js +57 -0
  108. package/decorators/string/is-boolean.js.map +1 -0
  109. package/decorators/string/is-btc-address.decorator.d.ts +4 -0
  110. package/decorators/string/is-btc-address.decorator.js +55 -0
  111. package/decorators/string/is-btc-address.decorator.js.map +1 -0
  112. package/decorators/string/is-byte-length.d.ts +4 -0
  113. package/decorators/string/is-byte-length.js +60 -0
  114. package/decorators/string/is-byte-length.js.map +1 -0
  115. package/decorators/string/is-credit-card.decorator.d.ts +4 -0
  116. package/decorators/string/is-credit-card.decorator.js +55 -0
  117. package/decorators/string/is-credit-card.decorator.js.map +1 -0
  118. package/decorators/string/is-data-uri.decorator.d.ts +4 -0
  119. package/decorators/string/is-data-uri.decorator.js +55 -0
  120. package/decorators/string/is-data-uri.decorator.js.map +1 -0
  121. package/decorators/string/is-domain.decorator.d.ts +4 -0
  122. package/decorators/string/is-domain.decorator.js +70 -0
  123. package/decorators/string/is-domain.decorator.js.map +1 -0
  124. package/decorators/string/is-ean.decorator.d.ts +4 -0
  125. package/decorators/string/is-ean.decorator.js +55 -0
  126. package/decorators/string/is-ean.decorator.js.map +1 -0
  127. package/decorators/string/is-email.decorator.d.ts +4 -0
  128. package/decorators/string/is-email.decorator.js +65 -0
  129. package/decorators/string/is-email.decorator.js.map +1 -0
  130. package/decorators/string/is-ethereum-address.decorator.d.ts +4 -0
  131. package/decorators/string/is-ethereum-address.decorator.js +55 -0
  132. package/decorators/string/is-ethereum-address.decorator.js.map +1 -0
  133. package/decorators/string/is-full-width.decorator.d.ts +4 -0
  134. package/decorators/string/is-full-width.decorator.js +55 -0
  135. package/decorators/string/is-full-width.decorator.js.map +1 -0
  136. package/decorators/string/is-half-width.decorator.d.ts +4 -0
  137. package/decorators/string/is-half-width.decorator.js +55 -0
  138. package/decorators/string/is-half-width.decorator.js.map +1 -0
  139. package/decorators/string/is-hash.decorator.d.ts +4 -0
  140. package/decorators/string/is-hash.decorator.js +58 -0
  141. package/decorators/string/is-hash.decorator.js.map +1 -0
  142. package/decorators/string/is-hex-color.decorator.d.ts +4 -0
  143. package/decorators/string/is-hex-color.decorator.js +55 -0
  144. package/decorators/string/is-hex-color.decorator.js.map +1 -0
  145. package/decorators/string/is-hexadecimal.decorator.d.ts +4 -0
  146. package/decorators/string/is-hexadecimal.decorator.js +55 -0
  147. package/decorators/string/is-hexadecimal.decorator.js.map +1 -0
  148. package/decorators/string/is-hsl.decorator.d.ts +4 -0
  149. package/decorators/string/is-hsl.decorator.js +55 -0
  150. package/decorators/string/is-hsl.decorator.js.map +1 -0
  151. package/decorators/string/is-iban.decorator.d.ts +4 -0
  152. package/decorators/string/is-iban.decorator.js +55 -0
  153. package/decorators/string/is-iban.decorator.js.map +1 -0
  154. package/decorators/string/is-identity-card.decorator.d.ts +4 -0
  155. package/decorators/string/is-identity-card.decorator.js +58 -0
  156. package/decorators/string/is-identity-card.decorator.js.map +1 -0
  157. package/decorators/string/is-imei.decorator.d.ts +4 -0
  158. package/decorators/string/is-imei.decorator.js +55 -0
  159. package/decorators/string/is-imei.decorator.js.map +1 -0
  160. package/decorators/string/is-in.decorator.d.ts +5 -0
  161. package/decorators/string/is-in.decorator.js +62 -0
  162. package/decorators/string/is-in.decorator.js.map +1 -0
  163. package/decorators/string/is-ip-range.decorator.d.ts +4 -0
  164. package/decorators/string/is-ip-range.decorator.js +58 -0
  165. package/decorators/string/is-ip-range.decorator.js.map +1 -0
  166. package/decorators/string/is-ip.decorator.d.ts +4 -0
  167. package/decorators/string/is-ip.decorator.js +58 -0
  168. package/decorators/string/is-ip.decorator.js.map +1 -0
  169. package/decorators/string/is-isbn.decorator.d.ts +4 -0
  170. package/decorators/string/is-isbn.decorator.js +58 -0
  171. package/decorators/string/is-isbn.decorator.js.map +1 -0
  172. package/decorators/string/is-isin.decorator.d.ts +4 -0
  173. package/decorators/string/is-isin.decorator.js +55 -0
  174. package/decorators/string/is-isin.decorator.js.map +1 -0
  175. package/decorators/string/is-iso-31661-alpha2.decorator.d.ts +4 -0
  176. package/decorators/string/is-iso-31661-alpha2.decorator.js +55 -0
  177. package/decorators/string/is-iso-31661-alpha2.decorator.js.map +1 -0
  178. package/decorators/string/is-iso-31661-alpha3.decorator.d.ts +4 -0
  179. package/decorators/string/is-iso-31661-alpha3.decorator.js +55 -0
  180. package/decorators/string/is-iso-31661-alpha3.decorator.js.map +1 -0
  181. package/decorators/string/is-iso-4217.decorator.d.ts +4 -0
  182. package/decorators/string/is-iso-4217.decorator.js +55 -0
  183. package/decorators/string/is-iso-4217.decorator.js.map +1 -0
  184. package/decorators/string/is-iso-8601.decorator.d.ts +4 -0
  185. package/decorators/string/is-iso-8601.decorator.js +55 -0
  186. package/decorators/string/is-iso-8601.decorator.js.map +1 -0
  187. package/decorators/string/is-isrc.decorator.d.ts +4 -0
  188. package/decorators/string/is-isrc.decorator.js +55 -0
  189. package/decorators/string/is-isrc.decorator.js.map +1 -0
  190. package/decorators/string/is-issn.decorator.d.ts +4 -0
  191. package/decorators/string/is-issn.decorator.js +55 -0
  192. package/decorators/string/is-issn.decorator.js.map +1 -0
  193. package/decorators/string/is-json.decorator.d.ts +4 -0
  194. package/decorators/string/is-json.decorator.js +56 -0
  195. package/decorators/string/is-json.decorator.js.map +1 -0
  196. package/decorators/string/is-jwt.decorator.d.ts +4 -0
  197. package/decorators/string/is-jwt.decorator.js +55 -0
  198. package/decorators/string/is-jwt.decorator.js.map +1 -0
  199. package/decorators/string/is-lat-long.decorator.d.ts +4 -0
  200. package/decorators/string/is-lat-long.decorator.js +55 -0
  201. package/decorators/string/is-lat-long.decorator.js.map +1 -0
  202. package/decorators/string/is-length.decorator.d.ts +4 -0
  203. package/decorators/string/is-length.decorator.js +60 -0
  204. package/decorators/string/is-length.decorator.js.map +1 -0
  205. package/decorators/string/is-locale.decorator.d.ts +4 -0
  206. package/decorators/string/is-locale.decorator.js +55 -0
  207. package/decorators/string/is-locale.decorator.js.map +1 -0
  208. package/decorators/string/is-lowercase.decorator.d.ts +4 -0
  209. package/decorators/string/is-lowercase.decorator.js +55 -0
  210. package/decorators/string/is-lowercase.decorator.js.map +1 -0
  211. package/decorators/string/is-mac-address.decorator.d.ts +4 -0
  212. package/decorators/string/is-mac-address.decorator.js +58 -0
  213. package/decorators/string/is-mac-address.decorator.js.map +1 -0
  214. package/decorators/string/is-md5.decorator.d.ts +4 -0
  215. package/decorators/string/is-md5.decorator.js +55 -0
  216. package/decorators/string/is-md5.decorator.js.map +1 -0
  217. package/decorators/string/is-megnet-uri.decorator.d.ts +4 -0
  218. package/decorators/string/is-megnet-uri.decorator.js +55 -0
  219. package/decorators/string/is-megnet-uri.decorator.js.map +1 -0
  220. package/decorators/string/is-mime-type.decorator.d.ts +4 -0
  221. package/decorators/string/is-mime-type.decorator.js +55 -0
  222. package/decorators/string/is-mime-type.decorator.js.map +1 -0
  223. package/decorators/string/is-mobile-phone.decorator.d.ts +4 -0
  224. package/decorators/string/is-mobile-phone.decorator.js +60 -0
  225. package/decorators/string/is-mobile-phone.decorator.js.map +1 -0
  226. package/decorators/string/is-mongo-id.decorator.d.ts +4 -0
  227. package/decorators/string/is-mongo-id.decorator.js +55 -0
  228. package/decorators/string/is-mongo-id.decorator.js.map +1 -0
  229. package/decorators/string/is-multibyte.decorator.d.ts +4 -0
  230. package/decorators/string/is-multibyte.decorator.js +55 -0
  231. package/decorators/string/is-multibyte.decorator.js.map +1 -0
  232. package/decorators/string/is-passport-number.decorator.d.ts +4 -0
  233. package/decorators/string/is-passport-number.decorator.js +60 -0
  234. package/decorators/string/is-passport-number.decorator.js.map +1 -0
  235. package/decorators/string/is-port.decorator.d.ts +4 -0
  236. package/decorators/string/is-port.decorator.js +55 -0
  237. package/decorators/string/is-port.decorator.js.map +1 -0
  238. package/decorators/string/is-postal-code.decorator.d.ts +4 -0
  239. package/decorators/string/is-postal-code.decorator.js +60 -0
  240. package/decorators/string/is-postal-code.decorator.js.map +1 -0
  241. package/decorators/string/is-rfc3339.decorator.d.ts +4 -0
  242. package/decorators/string/is-rfc3339.decorator.js +55 -0
  243. package/decorators/string/is-rfc3339.decorator.js.map +1 -0
  244. package/decorators/string/is-rgb-color.decorator.d.ts +4 -0
  245. package/decorators/string/is-rgb-color.decorator.js +64 -0
  246. package/decorators/string/is-rgb-color.decorator.js.map +1 -0
  247. package/decorators/string/is-sem-ver.decorator.d.ts +4 -0
  248. package/decorators/string/is-sem-ver.decorator.js +55 -0
  249. package/decorators/string/is-sem-ver.decorator.js.map +1 -0
  250. package/decorators/string/is-slug.decorator.d.ts +4 -0
  251. package/decorators/string/is-slug.decorator.js +55 -0
  252. package/decorators/string/is-slug.decorator.js.map +1 -0
  253. package/decorators/string/is-string.decorator.d.ts +6 -0
  254. package/decorators/string/is-string.decorator.js +55 -0
  255. package/decorators/string/is-string.decorator.js.map +1 -0
  256. package/decorators/string/is-strong-password.decorator.d.ts +6 -0
  257. package/decorators/string/is-strong-password.decorator.js +76 -0
  258. package/decorators/string/is-strong-password.decorator.js.map +1 -0
  259. package/decorators/string/is-surrogate-pair.decorator.d.ts +4 -0
  260. package/decorators/string/is-surrogate-pair.decorator.js +55 -0
  261. package/decorators/string/is-surrogate-pair.decorator.js.map +1 -0
  262. package/decorators/string/is-tax-id.decorator.d.ts +4 -0
  263. package/decorators/string/is-tax-id.decorator.js +60 -0
  264. package/decorators/string/is-tax-id.decorator.js.map +1 -0
  265. package/decorators/string/is-uppercase.decorator.d.ts +4 -0
  266. package/decorators/string/is-uppercase.decorator.js +55 -0
  267. package/decorators/string/is-uppercase.decorator.js.map +1 -0
  268. package/decorators/string/is-url.decorator.d.ts +4 -0
  269. package/decorators/string/is-url.decorator.js +55 -0
  270. package/decorators/string/is-url.decorator.js.map +1 -0
  271. package/decorators/string/is-uuid.decorator.d.ts +4 -0
  272. package/decorators/string/is-uuid.decorator.js +60 -0
  273. package/decorators/string/is-uuid.decorator.js.map +1 -0
  274. package/decorators/string/is-variable-width.decorator.d.ts +4 -0
  275. package/decorators/string/is-variable-width.decorator.js +55 -0
  276. package/decorators/string/is-variable-width.decorator.js.map +1 -0
  277. package/decorators/string/is-vat.decorator.d.ts +4 -0
  278. package/decorators/string/is-vat.decorator.js +57 -0
  279. package/decorators/string/is-vat.decorator.js.map +1 -0
  280. package/decorators/string/is-whitelisted.decorator.d.ts +4 -0
  281. package/decorators/string/is-whitelisted.decorator.js +58 -0
  282. package/decorators/string/is-whitelisted.decorator.js.map +1 -0
  283. package/decorators/string/matches.decorator.d.ts +4 -0
  284. package/decorators/string/matches.decorator.js +58 -0
  285. package/decorators/string/matches.decorator.js.map +1 -0
  286. package/env.d.ts +12 -0
  287. package/env.js +26 -0
  288. package/env.js.map +1 -0
  289. package/functions/check-optional.d.ts +2 -0
  290. package/functions/check-optional.js +14 -0
  291. package/functions/check-optional.js.map +1 -0
  292. package/functions/check.d.ts +124 -0
  293. package/functions/check.js +12 -0
  294. package/functions/check.js.map +1 -0
  295. package/functions/copy-validators.d.ts +1 -0
  296. package/functions/copy-validators.js +22 -0
  297. package/functions/copy-validators.js.map +1 -0
  298. package/functions/create-if-condition.d.ts +4 -0
  299. package/functions/create-if-condition.js +8 -0
  300. package/functions/create-if-condition.js.map +1 -0
  301. package/functions/get-docs.d.ts +3 -0
  302. package/functions/get-docs.js +33 -0
  303. package/functions/get-docs.js.map +1 -0
  304. package/functions/get-expose-properties.d.ts +1 -0
  305. package/functions/get-expose-properties.js +13 -0
  306. package/functions/get-expose-properties.js.map +1 -0
  307. package/functions/get-message.d.ts +2 -0
  308. package/functions/get-message.js +8 -0
  309. package/functions/get-message.js.map +1 -0
  310. package/functions/get-properties.d.ts +1 -0
  311. package/functions/get-properties.js +10 -0
  312. package/functions/get-properties.js.map +1 -0
  313. package/functions/get-property-type.d.ts +3 -0
  314. package/functions/get-property-type.js +20 -0
  315. package/functions/get-property-type.js.map +1 -0
  316. package/functions/get-validation-properties.d.ts +1 -0
  317. package/functions/get-validation-properties.js +36 -0
  318. package/functions/get-validation-properties.js.map +1 -0
  319. package/functions/is-not-empty.d.ts +1 -0
  320. package/functions/is-not-empty.js +8 -0
  321. package/functions/is-not-empty.js.map +1 -0
  322. package/functions/is-property-optional.d.ts +2 -0
  323. package/functions/is-property-optional.js +23 -0
  324. package/functions/is-property-optional.js.map +1 -0
  325. package/functions/is-string.d.ts +1 -0
  326. package/functions/is-string.js +12 -0
  327. package/functions/is-string.js.map +1 -0
  328. package/functions/push-or-throw-if-has-error.d.ts +13 -0
  329. package/functions/push-or-throw-if-has-error.js +16 -0
  330. package/functions/push-or-throw-if-has-error.js.map +1 -0
  331. package/functions/register-validator.d.ts +2 -0
  332. package/functions/register-validator.js +65 -0
  333. package/functions/register-validator.js.map +1 -0
  334. package/functions/should-expose-property.d.ts +2 -0
  335. package/functions/should-expose-property.js +16 -0
  336. package/functions/should-expose-property.js.map +1 -0
  337. package/functions/transform.d.ts +11 -0
  338. package/functions/transform.js +97 -0
  339. package/functions/transform.js.map +1 -0
  340. package/functions/try-validate.d.ts +1 -0
  341. package/functions/try-validate.js +13 -0
  342. package/functions/try-validate.js.map +1 -0
  343. package/index.d.ts +13 -0
  344. package/index.js +30 -0
  345. package/index.js.map +1 -0
  346. package/interfaces/custom-validator.d.ts +16 -0
  347. package/interfaces/custom-validator.js +3 -0
  348. package/interfaces/custom-validator.js.map +1 -0
  349. package/interfaces/enum/index.d.ts +1 -0
  350. package/interfaces/enum/index.js +18 -0
  351. package/interfaces/enum/index.js.map +1 -0
  352. package/interfaces/enum/property-type.d.ts +9 -0
  353. package/interfaces/enum/property-type.js +14 -0
  354. package/interfaces/enum/property-type.js.map +1 -0
  355. package/interfaces/get-type-handle.d.ts +2 -0
  356. package/interfaces/get-type-handle.js +3 -0
  357. package/interfaces/get-type-handle.js.map +1 -0
  358. package/interfaces/if-check.d.ts +9 -0
  359. package/interfaces/if-check.js +3 -0
  360. package/interfaces/if-check.js.map +1 -0
  361. package/interfaces/ignore-handle.d.ts +11 -0
  362. package/interfaces/ignore-handle.js +3 -0
  363. package/interfaces/ignore-handle.js.map +1 -0
  364. package/interfaces/index.d.ts +17 -0
  365. package/interfaces/index.js +34 -0
  366. package/interfaces/index.js.map +1 -0
  367. package/interfaces/object.d.ts +2 -0
  368. package/interfaces/object.js +3 -0
  369. package/interfaces/object.js.map +1 -0
  370. package/interfaces/options.d.ts +3 -0
  371. package/interfaces/options.js +3 -0
  372. package/interfaces/options.js.map +1 -0
  373. package/interfaces/property-error.d.ts +6 -0
  374. package/interfaces/property-error.js +12 -0
  375. package/interfaces/property-error.js.map +1 -0
  376. package/interfaces/property.d.ts +29 -0
  377. package/interfaces/property.js +3 -0
  378. package/interfaces/property.js.map +1 -0
  379. package/interfaces/transform-handle.d.ts +8 -0
  380. package/interfaces/transform-handle.js +3 -0
  381. package/interfaces/transform-handle.js.map +1 -0
  382. package/interfaces/validate-options.d.ts +12 -0
  383. package/interfaces/validate-options.js +3 -0
  384. package/interfaces/validate-options.js.map +1 -0
  385. package/interfaces/validation-args.d.ts +5 -0
  386. package/interfaces/validation-args.js +3 -0
  387. package/interfaces/validation-args.js.map +1 -0
  388. package/interfaces/validator-config.d.ts +10 -0
  389. package/interfaces/validator-config.js +3 -0
  390. package/interfaces/validator-config.js.map +1 -0
  391. package/interfaces/validator-object-doc.d.ts +7 -0
  392. package/interfaces/validator-object-doc.js +3 -0
  393. package/interfaces/validator-object-doc.js.map +1 -0
  394. package/interfaces/validator-options.d.ts +4 -0
  395. package/interfaces/validator-options.js +3 -0
  396. package/interfaces/validator-options.js.map +1 -0
  397. package/interfaces/validator-property-doc.d.ts +13 -0
  398. package/interfaces/validator-property-doc.js +3 -0
  399. package/interfaces/validator-property-doc.js.map +1 -0
  400. package/interfaces/validator.d.ts +15 -0
  401. package/interfaces/validator.js +3 -0
  402. package/interfaces/validator.js.map +1 -0
  403. package/package.json +32 -0
  404. package/validate/create-validation-error.d.ts +7 -0
  405. package/validate/create-validation-error.js +15 -0
  406. package/validate/create-validation-error.js.map +1 -0
  407. package/validate/get-defaults.d.ts +5 -0
  408. package/validate/get-defaults.js +27 -0
  409. package/validate/get-defaults.js.map +1 -0
  410. package/validate/get-subtype.d.ts +12 -0
  411. package/validate/get-subtype.js +47 -0
  412. package/validate/get-subtype.js.map +1 -0
  413. package/validate/index.d.ts +1 -0
  414. package/validate/index.js +18 -0
  415. package/validate/index.js.map +1 -0
  416. package/validate/transform-input.d.ts +9 -0
  417. package/validate/transform-input.js +27 -0
  418. package/validate/transform-input.js.map +1 -0
  419. package/validate/validate-array-item.d.ts +17 -0
  420. package/validate/validate-array-item.js +46 -0
  421. package/validate/validate-array-item.js.map +1 -0
  422. package/validate/validate-item.d.ts +16 -0
  423. package/validate/validate-item.js +47 -0
  424. package/validate/validate-item.js.map +1 -0
  425. package/validate/validate-property.d.ts +16 -0
  426. package/validate/validate-property.js +30 -0
  427. package/validate/validate-property.js.map +1 -0
  428. package/validate/validate.d.ts +6 -0
  429. package/validate/validate.js +118 -0
  430. package/validate/validate.js.map +1 -0
package/env.js ADDED
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const class_memory_1 = require("@rockster/class-memory");
4
+ require("@rockster/common/utils");
5
+ global.classPipe = {
6
+ bail: false,
7
+ storage: (0, class_memory_1.createStorage)('classPipe', {
8
+ onCreateProperty: (property) => {
9
+ if (!property.validatorsConfigs) {
10
+ property.validators = [];
11
+ }
12
+ if (!property.validatorsConfigs) {
13
+ property.validatorsConfigs = [];
14
+ }
15
+ if (!property.transform) {
16
+ property.transform = {};
17
+ }
18
+ if (!property.ifChecks) {
19
+ property.ifChecks = [];
20
+ }
21
+ return property;
22
+ }
23
+ }),
24
+ customValidators: {}
25
+ };
26
+ //# sourceMappingURL=env.js.map
package/env.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env.js","sourceRoot":"","sources":["../env.ts"],"names":[],"mappings":";;AAAA,yDAGgC;AAMhC,kCAAgC;AAYhC,MAAM,CAAC,SAAS,GAAG;IAChB,IAAI,EAAE,KAAK;IACX,OAAO,EAAE,IAAA,4BAAa,EAAC,WAAW,EAAE;QACjC,gBAAgB,EAAE,CAAC,QAAQ,EAAE,EAAE;YAC5B,IAAI,CAAC,QAAQ,CAAC,iBAAiB,EAAE,CAAC;gBAC/B,QAAQ,CAAC,UAAU,GAAG,EAAE,CAAC;YAC5B,CAAC;YACD,IAAI,CAAC,QAAQ,CAAC,iBAAiB,EAAE,CAAC;gBAC/B,QAAQ,CAAC,iBAAiB,GAAG,EAAE,CAAC;YACnC,CAAC;YACD,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;gBACvB,QAAQ,CAAC,SAAS,GAAG,EAAE,CAAC;YAC3B,CAAC;YACD,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;gBACtB,QAAQ,CAAC,QAAQ,GAAG,EAAE,CAAC;YAC1B,CAAC;YACD,OAAO,QAAQ,CAAC;QACnB,CAAC;KACH,CAAC;IACF,gBAAgB,EAAE,EAAE;CACtB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { IProperty } from "../interfaces";
2
+ export declare const checkOptional: (propertyValue: any, property: IProperty) => boolean;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkOptional = void 0;
4
+ const validate_context_1 = require("../contexts/validate-context");
5
+ const is_property_optional_1 = require("./is-property-optional");
6
+ const checkOptional = (propertyValue, property) => {
7
+ var _a;
8
+ const ctx = validate_context_1.validateContextStore.getStore();
9
+ const groups = (_a = ctx === null || ctx === void 0 ? void 0 : ctx.groups) !== null && _a !== void 0 ? _a : [];
10
+ const isOptional = (0, is_property_optional_1.isPropertyOptional)(property, groups);
11
+ return isOptional && isNullOrUndefined(propertyValue);
12
+ };
13
+ exports.checkOptional = checkOptional;
14
+ //# sourceMappingURL=check-optional.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-optional.js","sourceRoot":"","sources":["../../functions/check-optional.ts"],"names":[],"mappings":";;;AAAA,mEAAoE;AAEpE,iEAA4D;AAErD,MAAM,aAAa,GAAG,CAC1B,aAAa,EACb,QAAmB,EACpB,EAAE;;IACD,MAAM,GAAG,GAAG,uCAAoB,CAAC,QAAQ,EAAE,CAAC;IAC5C,MAAM,MAAM,GAAG,MAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,MAAM,mCAAI,EAAE,CAAC;IACjC,MAAM,UAAU,GAAG,IAAA,yCAAkB,EAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACxD,OAAO,UAAU,IAAI,iBAAiB,CAAC,aAAa,CAAC,CAAC;AACzD,CAAC,CAAC;AARW,QAAA,aAAa,iBAQxB"}
@@ -0,0 +1,124 @@
1
+ export declare const check: {
2
+ isString: (value: string, emptyAllowed?: boolean) => boolean;
3
+ isNotEmpty: (value: string) => boolean;
4
+ contains(str: string, seed: any, options?: import("validator").ContainsOptions): boolean;
5
+ equals(str: string, comparison: string): boolean;
6
+ isAbaRouting(str: string): boolean;
7
+ isAfter(str: string, date?: string): boolean;
8
+ isAlpha(str: string, locale?: import("validator").AlphaLocale, options?: import("validator").IsAlphaOptions): boolean;
9
+ isAlphanumeric(str: string, locale?: import("validator").AlphanumericLocale, options?: import("validator").IsAlphanumericOptions): boolean;
10
+ isAscii(str: string): boolean;
11
+ isBase32(str: string): boolean;
12
+ isBase58(str: string): boolean;
13
+ isBase64(str: string, options?: import("validator").IsBase64Options): boolean;
14
+ isBefore(str: string, date?: string): boolean;
15
+ isBIC(str: string): boolean;
16
+ isByteLength(str: string, options?: import("validator").IsByteLengthOptions): boolean;
17
+ isCreditCard(str: string, options?: import("validator").IsCreditCardOptions): boolean;
18
+ isCurrency(str: string, options?: import("validator").IsCurrencyOptions): boolean;
19
+ isEthereumAddress(str: string): boolean;
20
+ isBtcAddress(str: string): boolean;
21
+ isDataURI(str: string): boolean;
22
+ isDate(str: string, options?: import("validator").IsDateOptions): boolean;
23
+ isDecimal(str: string, options?: import("validator").IsDecimalOptions): boolean;
24
+ isDivisibleBy(str: string, number: number): boolean;
25
+ isMailtoURI(str: string, options?: import("validator").IsEmailOptions): boolean;
26
+ isEmpty(str: string, options?: import("validator").IsEmptyOptions): boolean;
27
+ isFloat(str: string, options?: import("validator").IsFloatOptions): boolean;
28
+ isFullWidth(str: string): boolean;
29
+ isHalfWidth(str: string): boolean;
30
+ isHash(str: string, algorithm: import("validator").HashAlgorithm): boolean;
31
+ isHexadecimal(str: string): boolean;
32
+ isHexColor(str: string): boolean;
33
+ isHSL(str: string): boolean;
34
+ isRgbColor(str: string, options?: import("validator").IsRgbColorOptions): boolean;
35
+ isIdentityCard(str: string, locale?: "any" | import("validator").IdentityCardLocale): boolean;
36
+ isIMEI(str: string, options?: import("validator").IsIMEIOptions): boolean;
37
+ isIn(str: string, values: any[]): boolean;
38
+ isInt(str: string, options?: import("validator").IsIntOptions): boolean;
39
+ isIP(str: string, version?: import("validator").IPVersion): boolean;
40
+ isIPRange(str: string, version?: import("validator").IPVersion): boolean;
41
+ isISBN(str: string, version?: import("validator").ISBNVersion): boolean;
42
+ isEAN(str: string): boolean;
43
+ isISIN(str: string): boolean;
44
+ isISO15924(str: string): boolean;
45
+ isISO31661Alpha3(str: string): boolean;
46
+ isISO31661Numeric(str: string): boolean;
47
+ isISO6346(str: string): boolean;
48
+ isISO8601(str: string, options?: import("validator").IsISO8601Options): boolean;
49
+ isISSN(str: string, options?: import("validator").IsISSNOptions): boolean;
50
+ isISRC(str: string): boolean;
51
+ isRFC3339(str: string): boolean;
52
+ isJSON(str: string): boolean;
53
+ isJWT(str: string): boolean;
54
+ isLatLong(str: string): boolean;
55
+ isLength(str: string, options?: import("validator").IsLengthOptions): boolean;
56
+ isLicensePlate(str: string, locale: import("validator").LicensePlateLocale): boolean;
57
+ isLicensePlate(str: string, locale: string): unknown;
58
+ isLocale(str: string): boolean;
59
+ isLowercase(str: string): boolean;
60
+ isLuhnNumber(str: string): boolean;
61
+ isMACAddress(str: string, options?: import("validator").IsMACAddressOptions): boolean;
62
+ isMagnetURI(str: string): boolean;
63
+ isMD5(str: string): boolean;
64
+ isMimeType(str: string): boolean;
65
+ isMobilePhone(str: string, locale?: "any" | import("validator").MobilePhoneLocale | import("validator").MobilePhoneLocale[], options?: import("validator").IsMobilePhoneOptions): boolean;
66
+ isMongoId(str: string): boolean;
67
+ isMultibyte(str: string): boolean;
68
+ isNumeric(str: string, options?: import("validator").IsNumericOptions): boolean;
69
+ isOctal(str: string): boolean;
70
+ isPassportNumber(str: string, countryCode?: string): boolean;
71
+ isPort(str: string): boolean;
72
+ isPostalCode(str: string, locale: "any" | import("validator").PostalCodeLocale): boolean;
73
+ isSemVer(str: string): boolean;
74
+ isStrongPassword(str: string, options?: import("validator").StrongPasswordOptions & {
75
+ returnScore?: false | undefined;
76
+ }): boolean;
77
+ isStrongPassword(str: string, options: import("validator").StrongPasswordOptions & {
78
+ returnScore: true;
79
+ }): number;
80
+ isSurrogatePair(str: string): boolean;
81
+ isTime(str: string, options?: import("validator").IsTimeOptions): boolean;
82
+ isUppercase(str: string): boolean;
83
+ isULID(str: string): boolean;
84
+ isUUID(str: string, version?: import("validator").UUIDVersion): boolean;
85
+ isVariableWidth(str: string): boolean;
86
+ isVAT(str: string, countryCode: string): boolean;
87
+ isWhitelisted(str: string, chars: string | string[]): boolean;
88
+ matches(str: string, pattern: RegExp): boolean;
89
+ matches(str: string, pattern: string, modifiers?: string): boolean;
90
+ isSlug(str: string): boolean;
91
+ blacklist(input: string, chars: string): string;
92
+ escape(input: string): string;
93
+ unescape(input: string): string;
94
+ ltrim(input: string, chars?: string): string;
95
+ normalizeEmail(email: string, options?: import("validator").NormalizeEmailOptions): string | false;
96
+ rtrim(input: string, chars?: string): string;
97
+ stripLow(input: string, keep_new_lines?: boolean): string;
98
+ toBoolean(input: string, strict?: boolean): boolean;
99
+ toDate(input: string): Date | null;
100
+ toFloat(input: string): number;
101
+ toInt(input: string, radix?: number): number;
102
+ trim(input: string, chars?: string): string;
103
+ whitelist(input: string, chars: string): string;
104
+ toString(input: any): string;
105
+ version: string;
106
+ isAlphaLocales: import("validator").AlphaLocale[];
107
+ isAlphanumericLocales: import("validator").AlphanumericLocale[];
108
+ isIBAN: typeof import("validator/lib/isIBAN").default;
109
+ ibanLocales: typeof import("validator/lib/isIBAN").locales;
110
+ isBoolean: typeof import("validator/lib/isBoolean").default;
111
+ isEmail: typeof import("validator/lib/isEmail").default;
112
+ isFloatLocales: import("validator").FloatLocale[];
113
+ isFQDN: typeof import("validator/lib/isFQDN").default;
114
+ isISO31661Alpha2: typeof import("validator/lib/isISO31661Alpha2").default;
115
+ isFreightContainerID: typeof import("validator").isISO6346;
116
+ isISO6391: typeof import("validator/lib/isISO6391").default;
117
+ isISO4217: typeof import("validator/lib/isISO4217").default;
118
+ isMobilePhoneLocales: import("validator").MobilePhoneLocale[];
119
+ isPostalCodeLocales: import("validator").PostalCodeLocale[];
120
+ isURL: typeof import("validator/lib/isURL").default;
121
+ isTaxID: typeof import("validator/lib/isTaxID").default;
122
+ _default: typeof import("validator");
123
+ default: typeof import("validator");
124
+ };
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.check = void 0;
7
+ const validator_1 = __importDefault(require("validator"));
8
+ const is_string_1 = require("./is-string");
9
+ const is_not_empty_1 = require("./is-not-empty");
10
+ exports.check = Object.assign(Object.assign({}, validator_1.default), { isString: is_string_1.isString,
11
+ isNotEmpty: is_not_empty_1.isNotEmpty });
12
+ //# sourceMappingURL=check.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check.js","sourceRoot":"","sources":["../../functions/check.ts"],"names":[],"mappings":";;;;;;AAAA,0DAAkC;AAClC,2CAAuC;AACvC,iDAA4C;AAE/B,QAAA,KAAK,mCACZ,mBAAS,KACZ,QAAQ,EAAR,oBAAQ;IACR,UAAU,EAAV,yBAAU,IACX"}
@@ -0,0 +1 @@
1
+ export declare const copyValidators: (source: any, propertyKey: string, target: any) => void;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.copyValidators = void 0;
4
+ const copyValidators = (source, propertyKey, target) => {
5
+ const property = classPipe
6
+ .storage
7
+ .findProperty(source, propertyKey);
8
+ if (!property) {
9
+ return;
10
+ }
11
+ const copyProperty = classPipe
12
+ .storage
13
+ .createProperty(target.prototype, propertyKey);
14
+ copyProperty.isArray = property.isArray;
15
+ copyProperty.isOptional = property.isOptional;
16
+ copyProperty.subtype = property.subtype;
17
+ copyProperty.type = property.type;
18
+ copyProperty.validators = property.validators;
19
+ copyProperty.validatorsConfigs = property.validatorsConfigs;
20
+ };
21
+ exports.copyValidators = copyValidators;
22
+ //# sourceMappingURL=copy-validators.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy-validators.js","sourceRoot":"","sources":["../../functions/copy-validators.ts"],"names":[],"mappings":";;;AAAO,MAAM,cAAc,GAAG,CAC3B,MAAM,EACN,WAAmB,EACnB,MAAM,EACP,EAAE;IACD,MAAM,QAAQ,GAAG,SAAS;SACtB,OAAO;SACP,YAAY,CACV,MAAM,EACN,WAAW,CACb,CAAC;IACL,IAAI,CAAC,QAAQ,EAAE,CAAC;QAAC,OAAO;IAAC,CAAC;IAC1B,MAAM,YAAY,GAAG,SAAS;SAC1B,OAAO;SACP,cAAc,CACZ,MAAM,CAAC,SAAS,EAChB,WAAW,CACb,CAAC;IACL,YAAY,CAAC,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC;IACxC,YAAY,CAAC,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC;IAC9C,YAAY,CAAC,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC;IACxC,YAAY,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;IAClC,YAAY,CAAC,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC;IAC9C,YAAY,CAAC,iBAAiB,GAAG,QAAQ,CAAC,iBAAiB,CAAC;AAC/D,CAAC,CAAA;AAxBY,QAAA,cAAc,kBAwB1B"}
@@ -0,0 +1,4 @@
1
+ import { GetTypeCallback } from "@rockster/common";
2
+ import { IfCheckHandle } from "../interfaces/if-check";
3
+ export type IfCondition<TValue, TRoot> = [IfCheckHandle<TValue, TRoot>, GetTypeCallback, string];
4
+ export declare const createIfCondition: <TValue, TRoot>(args_0: IfCheckHandle<TValue, TRoot>, args_1: GetTypeCallback, args_2: string) => IfCondition<TValue, TRoot>;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createIfCondition = void 0;
4
+ const createIfCondition = (...args) => {
5
+ return args;
6
+ };
7
+ exports.createIfCondition = createIfCondition;
8
+ //# sourceMappingURL=create-if-condition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-if-condition.js","sourceRoot":"","sources":["../../functions/create-if-condition.ts"],"names":[],"mappings":";;;AAKO,MAAM,iBAAiB,GAAG,CAC9B,GAAG,IAA+B,EACnC,EAAE;IACD,OAAO,IAAI,CAAC;AACf,CAAC,CAAA;AAJY,QAAA,iBAAiB,qBAI7B"}
@@ -0,0 +1,3 @@
1
+ import { IValidatorObjectDoc } from "../interfaces/validator-object-doc";
2
+ import { Instantiable } from "@rockster/common";
3
+ export declare const getDocs: (target: Instantiable) => IValidatorObjectDoc;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getDocs = void 0;
4
+ const createProperty = (property) => {
5
+ var _a;
6
+ return ({
7
+ name: property.propertyKey,
8
+ type: property.type,
9
+ subtype: (_a = property.subtype) === null || _a === void 0 ? void 0 : _a.name,
10
+ isOptional: property.isOptional,
11
+ isArray: property.isArray,
12
+ validators: property.validatorsConfigs,
13
+ });
14
+ };
15
+ const getDocs = (target) => {
16
+ const docs = {
17
+ name: target.name,
18
+ objectClass: target,
19
+ properties: []
20
+ };
21
+ const properties = classPipe
22
+ .storage
23
+ .getProperties(target);
24
+ if (!properties) {
25
+ return docs;
26
+ }
27
+ properties.forEach((property) => {
28
+ docs.properties.push(createProperty(property));
29
+ });
30
+ return docs;
31
+ };
32
+ exports.getDocs = getDocs;
33
+ //# sourceMappingURL=get-docs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-docs.js","sourceRoot":"","sources":["../../functions/get-docs.ts"],"names":[],"mappings":";;;AAQA,MAAM,cAAc,GAAG,CACpB,QAAiC,EAClC,EAAE;;IAAC,OAAA,CAAC;QACH,IAAI,EAAE,QAAQ,CAAC,WAAW;QAC1B,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,OAAO,EAAE,MAAA,QAAQ,CAAC,OAAO,0CAAE,IAAI;QAC/B,UAAU,EAAE,QAAQ,CAAC,UAAU;QAC/B,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,UAAU,EAAE,QAAQ,CAAC,iBAAiB;KACxC,CAA0B,CAAA;CAAA,CAAC;AAErB,MAAM,OAAO,GAAG,CAAC,MAAoB,EAAE,EAAE;IAC7C,MAAM,IAAI,GAAG;QACV,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,WAAW,EAAE,MAAM;QACnB,UAAU,EAAE,EAAE;KACO,CAAC;IACzB,MAAM,UAAU,GAAG,SAAS;SACxB,OAAO;SACP,aAAa,CAAC,MAAM,CAAC,CAAC;IAC1B,IAAI,CAAC,UAAU,EAAE,CAAC;QACf,OAAO,IAAI,CAAC;IACf,CAAC;IACD,UAAU,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC7B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AACf,CAAC,CAAA;AAhBY,QAAA,OAAO,WAgBnB"}
@@ -0,0 +1 @@
1
+ export declare const getExposeProperties: (target: any) => import("@rockster/class-memory").PropertyNote<import("..").IProperty>[];
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getExposeProperties = void 0;
4
+ const getExposeProperties = (target) => {
5
+ return classPipe
6
+ .storage
7
+ .getProperties(target)
8
+ .filter((property) => {
9
+ return property.expose;
10
+ });
11
+ };
12
+ exports.getExposeProperties = getExposeProperties;
13
+ //# sourceMappingURL=get-expose-properties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-expose-properties.js","sourceRoot":"","sources":["../../functions/get-expose-properties.ts"],"names":[],"mappings":";;;AAAO,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,EAAE;IAC3C,OAAO,SAAS;SACZ,OAAO;SACP,aAAa,CAAC,MAAM,CAAC;SACrB,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE;QAClB,OAAO,QAAQ,CAAC,MAAM,CAAA;IACzB,CAAC,CAAC,CAAC;AACT,CAAC,CAAA;AAPY,QAAA,mBAAmB,uBAO/B"}
@@ -0,0 +1,2 @@
1
+ import { IValidatorOptions } from "../interfaces/validator-options";
2
+ export declare const getMessage: (message: string, options: IValidatorOptions) => string;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getMessage = void 0;
4
+ const getMessage = (message, options) => {
5
+ return (options === null || options === void 0 ? void 0 : options.message) || message;
6
+ };
7
+ exports.getMessage = getMessage;
8
+ //# sourceMappingURL=get-message.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-message.js","sourceRoot":"","sources":["../../functions/get-message.ts"],"names":[],"mappings":";;;AAEO,MAAM,UAAU,GAAG,CACvB,OAAe,EACf,OAA0B,EAC3B,EAAE;IACD,OAAO,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,KAAI,OAAO,CAAC;AACtC,CAAC,CAAA;AALY,QAAA,UAAU,cAKtB"}
@@ -0,0 +1 @@
1
+ export declare const getProperties: (target: any) => import("@rockster/class-memory").PropertyNote<import("..").IProperty>[];
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getProperties = void 0;
4
+ const getProperties = (target) => {
5
+ return classPipe
6
+ .storage
7
+ .getProperties(target);
8
+ };
9
+ exports.getProperties = getProperties;
10
+ //# sourceMappingURL=get-properties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-properties.js","sourceRoot":"","sources":["../../functions/get-properties.ts"],"names":[],"mappings":";;;AAAO,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,EAAE;IACrC,OAAO,SAAS;SACZ,OAAO;SACP,aAAa,CAAC,MAAM,CAAC,CAAC;AAC7B,CAAC,CAAA;AAJY,QAAA,aAAa,iBAIzB"}
@@ -0,0 +1,3 @@
1
+ import { PropertyNote } from '@rockster/class-memory';
2
+ import { IProperty } from '../interfaces/property';
3
+ export declare const getPropertyType: (property: PropertyNote<IProperty>) => void;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getPropertyType = void 0;
4
+ const getPropertyType = (property) => {
5
+ var _a, _b;
6
+ const type = (_b = (_a = property
7
+ .metadata["design:type"]) === null || _a === void 0 ? void 0 : _a.name) === null || _b === void 0 ? void 0 : _b.toLowerCase();
8
+ const isArray = type === 'array';
9
+ if (isArray) {
10
+ property.isArray = {};
11
+ }
12
+ if (!property.type) {
13
+ if (type !== 'object'
14
+ && type !== 'function') {
15
+ property.type = type;
16
+ }
17
+ }
18
+ };
19
+ exports.getPropertyType = getPropertyType;
20
+ //# sourceMappingURL=get-property-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-property-type.js","sourceRoot":"","sources":["../../functions/get-property-type.ts"],"names":[],"mappings":";;;AAGO,MAAM,eAAe,GAAG,CAAC,QAAiC,EAAE,EAAE;;IAElE,MAAM,IAAI,GAAG,MAAA,MAAA,QAAQ;SACjB,QAAQ,CAAC,aAAa,CAAC,0CACtB,IAAI,0CACJ,WAAW,EAAE,CAAC;IAEnB,MAAM,OAAO,GAAG,IAAI,KAAK,OAAO,CAAC;IAEjC,IAAI,OAAO,EAAE,CAAC;QACX,QAAQ,CAAC,OAAO,GAAG,EAAE,CAAC;IACzB,CAAC;IAED,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QAElB,IAAI,IAAI,KAAK,QAAQ;eACf,IAAI,KAAK,UAAU,EAAE,CAAC;YACzB,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;QACxB,CAAC;IACJ,CAAC;AACJ,CAAC,CAAA;AApBY,QAAA,eAAe,mBAoB3B"}
@@ -0,0 +1 @@
1
+ export declare const getValidationProperties: (target: any) => import("@rockster/class-memory").PropertyNote<import("..").IProperty>[];
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getValidationProperties = void 0;
4
+ const validate_context_1 = require("../contexts/validate-context");
5
+ const getValidationProperties = (target) => {
6
+ var _a;
7
+ const ctx = validate_context_1.validateContextStore.getStore();
8
+ const groups = (_a = ctx === null || ctx === void 0 ? void 0 : ctx.groups) !== null && _a !== void 0 ? _a : [];
9
+ return classPipe
10
+ .storage
11
+ .getProperties(target)
12
+ .filter((property) => {
13
+ var _a, _b;
14
+ if (!property.isOptional && !property.isRequired)
15
+ return false;
16
+ if (!property.optionalGroups && !property.requiredGroups)
17
+ return true;
18
+ const pgOpt = (_a = property.optionalGroups) !== null && _a !== void 0 ? _a : [];
19
+ const pgReq = (_b = property.requiredGroups) !== null && _b !== void 0 ? _b : [];
20
+ const ug = groups;
21
+ if (ug.length > 0) {
22
+ if (pgReq.some(g => ug.includes(g)))
23
+ return true;
24
+ if (pgOpt.some(g => ug.includes(g)))
25
+ return true;
26
+ return false;
27
+ }
28
+ if (property.isRequired)
29
+ return true;
30
+ if (property.isOptional)
31
+ return true;
32
+ return false;
33
+ });
34
+ };
35
+ exports.getValidationProperties = getValidationProperties;
36
+ //# sourceMappingURL=get-validation-properties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-validation-properties.js","sourceRoot":"","sources":["../../functions/get-validation-properties.ts"],"names":[],"mappings":";;;AAAA,mEAAoE;AAE7D,MAAM,uBAAuB,GAAG,CAAC,MAAM,EAAE,EAAE;;IAC/C,MAAM,GAAG,GAAG,uCAAoB,CAAC,QAAQ,EAAE,CAAC;IAC5C,MAAM,MAAM,GAAG,MAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,MAAM,mCAAI,EAAE,CAAC;IAEjC,OAAO,SAAS;SACZ,OAAO;SACP,aAAa,CAAC,MAAM,CAAC;SACrB,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE;;QAElB,IAAI,CAAC,QAAQ,CAAC,UAAU,IAAI,CAAC,QAAQ,CAAC,UAAU;YAAE,OAAO,KAAK,CAAC;QAC/D,IAAI,CAAC,QAAQ,CAAC,cAAc,IAAI,CAAC,QAAQ,CAAC,cAAc;YAAE,OAAO,IAAI,CAAC;QAEtE,MAAM,KAAK,GAAG,MAAA,QAAQ,CAAC,cAAc,mCAAI,EAAE,CAAC;QAC5C,MAAM,KAAK,GAAG,MAAA,QAAQ,CAAC,cAAc,mCAAI,EAAE,CAAC;QAC5C,MAAM,EAAE,GAAG,MAAM,CAAC;QAElB,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACjB,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;gBAAE,OAAO,IAAI,CAAC;YACjD,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;gBAAE,OAAO,IAAI,CAAC;YACjD,OAAO,KAAK,CAAC;QAChB,CAAC;QAED,IAAI,QAAQ,CAAC,UAAU;YAAE,OAAO,IAAI,CAAC;QACrC,IAAI,QAAQ,CAAC,UAAU;YAAE,OAAO,IAAI,CAAC;QAErC,OAAO,KAAK,CAAC;IAChB,CAAC,CAAC,CAAC;AACT,CAAC,CAAA;AA3BY,QAAA,uBAAuB,2BA2BnC"}
@@ -0,0 +1 @@
1
+ export declare const isNotEmpty: (value: string) => boolean;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isNotEmpty = void 0;
4
+ const isNotEmpty = (value) => {
5
+ return value !== '';
6
+ };
7
+ exports.isNotEmpty = isNotEmpty;
8
+ //# sourceMappingURL=is-not-empty.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-not-empty.js","sourceRoot":"","sources":["../../functions/is-not-empty.ts"],"names":[],"mappings":";;;AAAO,MAAM,UAAU,GAAG,CAAC,KAAa,EAAE,EAAE;IACzC,OAAO,KAAK,KAAK,EAAE,CAAC;AACvB,CAAC,CAAA;AAFY,QAAA,UAAU,cAEtB"}
@@ -0,0 +1,2 @@
1
+ import { IProperty } from "../interfaces";
2
+ export declare const isPropertyOptional: (property: IProperty, groups?: string[]) => boolean;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isPropertyOptional = void 0;
4
+ const isPropertyOptional = (property, groups = []) => {
5
+ var _a, _b;
6
+ const pgOpt = (_a = property.optionalGroups) !== null && _a !== void 0 ? _a : [];
7
+ const pgReq = (_b = property.requiredGroups) !== null && _b !== void 0 ? _b : [];
8
+ if (groups.length > 0) {
9
+ const hasReq = pgReq.some(g => groups.includes(g));
10
+ if (hasReq)
11
+ return false;
12
+ const hasOpt = pgOpt.some(g => groups.includes(g));
13
+ if (hasOpt)
14
+ return true;
15
+ }
16
+ if (property.isRequired)
17
+ return false;
18
+ if (property.isOptional)
19
+ return true;
20
+ return false;
21
+ };
22
+ exports.isPropertyOptional = isPropertyOptional;
23
+ //# sourceMappingURL=is-property-optional.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-property-optional.js","sourceRoot":"","sources":["../../functions/is-property-optional.ts"],"names":[],"mappings":";;;AAEO,MAAM,kBAAkB,GAAG,CAC/B,QAAmB,EACnB,SAAmB,EAAE,EACtB,EAAE;;IACD,MAAM,KAAK,GAAG,MAAA,QAAQ,CAAC,cAAc,mCAAI,EAAE,CAAC;IAC5C,MAAM,KAAK,GAAG,MAAA,QAAQ,CAAC,cAAc,mCAAI,EAAE,CAAC;IAE5C,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACrB,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QACnD,IAAI,MAAM;YAAE,OAAO,KAAK,CAAC;QAEzB,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QACnD,IAAI,MAAM;YAAE,OAAO,IAAI,CAAC;IAC3B,CAAC;IAED,IAAI,QAAQ,CAAC,UAAU;QAAE,OAAO,KAAK,CAAC;IACtC,IAAI,QAAQ,CAAC,UAAU;QAAE,OAAO,IAAI,CAAC;IAErC,OAAO,KAAK,CAAC;AAChB,CAAC,CAAC;AAnBW,QAAA,kBAAkB,sBAmB7B"}
@@ -0,0 +1 @@
1
+ export declare const isString: (value: string, emptyAllowed?: boolean) => boolean;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isString = void 0;
4
+ const isString = (value, emptyAllowed = true) => {
5
+ if (!emptyAllowed) {
6
+ return typeof value === 'string'
7
+ && value !== '';
8
+ }
9
+ return typeof value === 'string';
10
+ };
11
+ exports.isString = isString;
12
+ //# sourceMappingURL=is-string.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-string.js","sourceRoot":"","sources":["../../functions/is-string.ts"],"names":[],"mappings":";;;AAAO,MAAM,QAAQ,GAAG,CACrB,KAAa,EACb,YAAY,GAAG,IAAI,EACpB,EAAE;IACD,IAAI,CAAC,YAAY,EAAE,CAAC;QACjB,OAAO,OAAO,KAAK,KAAK,QAAQ;eAC1B,KAAK,KAAK,EAAE,CAAC;IACtB,CAAC;IACD,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC;AACpC,CAAC,CAAA;AATY,QAAA,QAAQ,YASpB"}
@@ -0,0 +1,13 @@
1
+ import { PropertyError } from "../interfaces";
2
+ import { IValidatorOptions } from "../interfaces/validator-options";
3
+ export declare const pushOrThrowIfHasError: ({ hasError, errors, message, options, propertyKey, value, classData, parent, index }: {
4
+ hasError: boolean;
5
+ errors: PropertyError[];
6
+ message: string;
7
+ options: IValidatorOptions;
8
+ propertyKey: string;
9
+ parent: string;
10
+ value: any;
11
+ classData: any;
12
+ index: string;
13
+ }) => void;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pushOrThrowIfHasError = void 0;
4
+ const interfaces_1 = require("../interfaces");
5
+ const pushOrThrowIfHasError = ({ hasError, errors, message, options, propertyKey, value, classData, parent, index }) => {
6
+ if (hasError) {
7
+ const display = `${parent}${propertyKey}${index}`;
8
+ const error = new interfaces_1.PropertyError(message, display);
9
+ if ((options === null || options === void 0 ? void 0 : options.bail) || classPipe.bail) {
10
+ throw error;
11
+ }
12
+ errors.push(error);
13
+ }
14
+ };
15
+ exports.pushOrThrowIfHasError = pushOrThrowIfHasError;
16
+ //# sourceMappingURL=push-or-throw-if-has-error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"push-or-throw-if-has-error.js","sourceRoot":"","sources":["../../functions/push-or-throw-if-has-error.ts"],"names":[],"mappings":";;;AAAA,8CAA8C;AAGvC,MAAM,qBAAqB,GAAG,CAAC,EACnC,QAAQ,EACR,MAAM,EACN,OAAO,EACP,OAAO,EACP,WAAW,EACX,KAAK,EACL,SAAS,EACT,MAAM,EACN,KAAK,EAWP,EAAE,EAAE;IAEF,IAAI,QAAQ,EAAE,CAAC;QAEZ,MAAM,OAAO,GAAG,GAAG,MAAM,GAAG,WAAW,GAAG,KAAK,EAAE,CAAC;QAClD,MAAM,KAAK,GACR,IAAI,0BAAa,CACd,OAAO,EACP,OAAO,CACT,CAAC;QAEL,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,KAAI,SAAS,CAAC,IAAI,EAAE,CAAC;YACnC,MAAM,KAAK,CAAC;QACf,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;AACJ,CAAC,CAAA;AArCY,QAAA,qBAAqB,yBAqCjC"}
@@ -0,0 +1,2 @@
1
+ import { CustomValidator } from "../interfaces";
2
+ export declare const registerValidator: (customValidator: CustomValidator, params?: {}) => (target: any, propertyKey: string) => void;
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerValidator = void 0;
4
+ const class_injector_1 = require("@rockster/class-injector");
5
+ const check_optional_1 = require("./check-optional");
6
+ const push_or_throw_if_has_error_1 = require("./push-or-throw-if-has-error");
7
+ const registerValidator = (customValidator, params = {}) => {
8
+ if (!classPipe.customValidators[customValidator.name]) {
9
+ (0, class_injector_1.createInstance)(customValidator.validator)
10
+ .then((value) => {
11
+ classPipe
12
+ .customValidators[customValidator.name] = value;
13
+ });
14
+ }
15
+ return (target, propertyKey) => {
16
+ const message = customValidator.message;
17
+ const property = classPipe
18
+ .storage
19
+ .createProperty(target, propertyKey);
20
+ property.type = customValidator.type || property.type;
21
+ property.validatorsConfigs.push({
22
+ name: customValidator.name,
23
+ library: 'validator',
24
+ type: 'custom',
25
+ args: [],
26
+ message,
27
+ originalMessage: customValidator.message,
28
+ replaces: {}
29
+ });
30
+ property.validators.push({
31
+ message,
32
+ async validate({ classData, errors, parent, index, params: customParams }) {
33
+ const value = classData[propertyKey];
34
+ const isOptional = (0, check_optional_1.checkOptional)(value, property);
35
+ if (isOptional) {
36
+ return;
37
+ }
38
+ try {
39
+ const validator = classPipe
40
+ .customValidators[customValidator.name];
41
+ await validator.validate({
42
+ payload: classData,
43
+ value: value,
44
+ params: Object.assign(Object.assign({}, params), customParams)
45
+ });
46
+ }
47
+ catch (error) {
48
+ (0, push_or_throw_if_has_error_1.pushOrThrowIfHasError)({
49
+ hasError: true,
50
+ classData,
51
+ message: error.message || message,
52
+ errors,
53
+ options: params,
54
+ parent,
55
+ propertyKey,
56
+ value,
57
+ index
58
+ });
59
+ }
60
+ }
61
+ });
62
+ };
63
+ };
64
+ exports.registerValidator = registerValidator;
65
+ //# sourceMappingURL=register-validator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-validator.js","sourceRoot":"","sources":["../../functions/register-validator.ts"],"names":[],"mappings":";;;AAAA,6DAA0D;AAE1D,qDAAiD;AACjD,6EAAqE;AAE9D,MAAM,iBAAiB,GAAG,CAC9B,eAAgC,EAChC,MAAM,GAAG,EAAE,EACZ,EAAE;IACD,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC;QACrD,IAAA,+BAAc,EAAC,eAAe,CAAC,SAAS,CAAC;aACrC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;YACb,SAAS;iBACL,gBAAgB,CAChB,eAAe,CAAC,IAAI,CAAC,GAAG,KAAyB,CAAC;QACzD,CAAC,CAAC,CAAC;IACT,CAAC;IAED,OAAO,CAAC,MAAM,EAAE,WAAmB,EAAE,EAAE;QACpC,MAAM,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC;QACxC,MAAM,QAAQ,GAAG,SAAS;aACtB,OAAO;aACP,cAAc,CACZ,MAAM,EACN,WAAW,CACb,CAAC;QACL,QAAQ,CAAC,IAAI,GAAG,eAAe,CAAC,IAAI,IAAI,QAAQ,CAAC,IAAI,CAAC;QACtD,QAAQ,CAAC,iBAAiB,CAAC,IAAI,CAAC;YAC7B,IAAI,EAAE,eAAe,CAAC,IAAI;YAC1B,OAAO,EAAE,WAAW;YACpB,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,EAAE;YACR,OAAO;YACP,eAAe,EAAE,eAAe,CAAC,OAAO;YACxC,QAAQ,EAAE,EAAG;SACf,CAAC,CAAC;QAEH,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC;YACtB,OAAO;YACP,KAAK,CAAC,QAAQ,CAAC,EACZ,SAAS,EACT,MAAM,EACN,MAAM,EACN,KAAK,EACL,MAAM,EAAE,YAAY,EACtB;gBACE,MAAM,KAAK,GAAG,SAAS,CAAC,WAAW,CAAC,CAAC;gBACrC,MAAM,UAAU,GAAG,IAAA,8BAAa,EAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;gBAClD,IAAI,UAAU,EAAE,CAAC;oBAAC,OAAO;gBAAC,CAAC;gBAC3B,IAAI,CAAC;oBACF,MAAM,SAAS,GAAG,SAAS;yBACvB,gBAAgB,CAChB,eAAe,CAAC,IAAI,CAAC,CAAC;oBAC1B,MAAM,SAAS,CAAC,QAAQ,CAAC;wBACtB,OAAO,EAAE,SAAS;wBAClB,KAAK,EAAE,KAAK;wBACZ,MAAM,kCACA,MAAM,GACN,YAAY,CACjB;qBACH,CAAC,CAAC;gBACN,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACd,IAAA,kDAAqB,EAAC;wBACnB,QAAQ,EAAE,IAAI;wBACd,SAAS;wBACT,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,OAAO;wBACjC,MAAM;wBACN,OAAO,EAAE,MAAM;wBACf,MAAM;wBACN,WAAW;wBACX,KAAK;wBACL,KAAK;qBACP,CAAC,CAAC;gBACN,CAAC;YACJ,CAAC;SACH,CAAC,CAAC;IACN,CAAC,CAAA;AACJ,CAAC,CAAA;AAxEY,QAAA,iBAAiB,qBAwE7B"}
@@ -0,0 +1,2 @@
1
+ import { IProperty } from "../interfaces";
2
+ export declare const shouldExposeProperty: (property: IProperty, groups: string[]) => boolean;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.shouldExposeProperty = void 0;
4
+ const shouldExposeProperty = (property, groups) => {
5
+ var _a;
6
+ if (!property.expose)
7
+ return false;
8
+ const pg = (_a = property.exposeGroups) !== null && _a !== void 0 ? _a : [];
9
+ if (groups.length === 0)
10
+ return true;
11
+ if (pg.length === 0)
12
+ return true;
13
+ return pg.some(g => groups.includes(g));
14
+ };
15
+ exports.shouldExposeProperty = shouldExposeProperty;
16
+ //# sourceMappingURL=should-expose-property.js.map