@tstdl/base 0.78.0-beta4 → 0.78.0-beta42

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 (388) hide show
  1. package/api/client/client.d.ts +2 -1
  2. package/api/client/client.js +6 -13
  3. package/api/client/client.js.map +1 -1
  4. package/api/response.js.map +1 -1
  5. package/api/server/gateway.js +7 -5
  6. package/api/server/gateway.js.map +1 -1
  7. package/api/types.d.ts +22 -9
  8. package/api/types.js +1 -2
  9. package/api/types.js.map +1 -1
  10. package/api/utils.d.ts +9 -0
  11. package/api/utils.js +15 -0
  12. package/api/utils.js.map +1 -0
  13. package/application/application.js.map +1 -1
  14. package/container/container.js.map +1 -1
  15. package/container/decorators.d.ts +1 -1
  16. package/container/decorators.js.map +1 -1
  17. package/css/theme/theme.service.js.map +1 -1
  18. package/data-structures/iterable-weak-map.js +1 -1
  19. package/data-structures/iterable-weak-map.js.map +1 -1
  20. package/data-structures/linked-list.js.map +1 -1
  21. package/data-structures/sorted-array-list.js.map +1 -1
  22. package/database/mongo/classes.js.map +1 -1
  23. package/database/mongo/mongo-entity-repository.js +2 -2
  24. package/database/mongo/mongo-entity-repository.js.map +1 -1
  25. package/distributed-loop/distributed-loop.js.map +1 -1
  26. package/distributed-loop/provider.js.map +1 -1
  27. package/enumerable/async-enumerable.d.ts +2 -1
  28. package/enumerable/async-enumerable.js +3 -0
  29. package/enumerable/async-enumerable.js.map +1 -1
  30. package/enumerable/enumerable-methods.d.ts +1 -0
  31. package/enumerable/enumerable.d.ts +1 -0
  32. package/enumerable/enumerable.js +12 -18
  33. package/enumerable/enumerable.js.map +1 -1
  34. package/error/custom.error.d.ts +1 -1
  35. package/error/custom.error.js +8 -6
  36. package/error/custom.error.js.map +1 -1
  37. package/examples/api/basic-overview.js +0 -1
  38. package/examples/api/basic-overview.js.map +1 -1
  39. package/examples/mail/basic.js +12 -7
  40. package/examples/mail/basic.js.map +1 -1
  41. package/examples/mail/templates/hello-name.d.ts +2 -0
  42. package/examples/mail/templates/hello-name.js +11 -0
  43. package/examples/mail/templates/hello-name.js.map +1 -0
  44. package/examples/pdf/basic.js +6 -3
  45. package/examples/pdf/basic.js.map +1 -1
  46. package/examples/pdf/templates/hello-name.d.ts +1 -4
  47. package/examples/pdf/templates/hello-name.js +16 -4
  48. package/examples/pdf/templates/hello-name.js.map +1 -1
  49. package/examples/reflection/basic.js +1 -1
  50. package/examples/reflection/basic.js.map +1 -1
  51. package/http/client/adapters/got-http-client.adapter.js.map +1 -1
  52. package/http/client/adapters/undici-http-client.adapter.js.map +1 -1
  53. package/http/client/adapters/utils.js +20 -8
  54. package/http/client/adapters/utils.js.map +1 -1
  55. package/http/client/http-client-request.d.ts +13 -3
  56. package/http/client/http-client-request.js +4 -0
  57. package/http/client/http-client-request.js.map +1 -1
  58. package/http/client/http-client.d.ts +0 -3
  59. package/http/client/http-client.js +31 -24
  60. package/http/client/http-client.js.map +1 -1
  61. package/http/http-headers.d.ts +2 -0
  62. package/http/http-headers.js +6 -0
  63. package/http/http-headers.js.map +1 -1
  64. package/http/server/node/node-http-server.js.map +1 -1
  65. package/image-service/image-service.js.map +1 -1
  66. package/image-service/imgproxy/imgproxy-image-service.js.map +1 -1
  67. package/key-value-store/mongo/mongo-key-value-store.provider.js.map +1 -1
  68. package/key-value-store/mongo/mongo-key-value.repository.js.map +1 -1
  69. package/key-value-store/mongo/mongo-key-value.store.js.map +1 -1
  70. package/lock/mongo/lock.js.map +1 -1
  71. package/lock/mongo/mongo-lock-repository.js.map +1 -1
  72. package/lock/mongo/provider.js.map +1 -1
  73. package/logger/console/logger.js.map +1 -1
  74. package/mail/clients/nodemailer.mail-client.js.map +1 -1
  75. package/mail/index.d.ts +0 -3
  76. package/mail/index.js +0 -3
  77. package/mail/index.js.map +1 -1
  78. package/mail/mail.service.d.ts +3 -5
  79. package/mail/mail.service.js +8 -14
  80. package/mail/mail.service.js.map +1 -1
  81. package/mail/models/mail-template.model.d.ts +11 -10
  82. package/mail/models/mail-template.model.js +7 -0
  83. package/mail/models/mail-template.model.js.map +1 -1
  84. package/mail/module.d.ts +1 -5
  85. package/mail/module.js +2 -11
  86. package/mail/module.js.map +1 -1
  87. package/mail/repositories/mongo-mail-log.repository.js.map +1 -1
  88. package/mail/tokens.d.ts +0 -3
  89. package/mail/tokens.js +1 -2
  90. package/mail/tokens.js.map +1 -1
  91. package/message-bus/local/local-message-bus-provider.js.map +1 -1
  92. package/message-bus/local/local-message-bus.js.map +1 -1
  93. package/migration/migrator.js.map +1 -1
  94. package/migration/mongo/migration-state-repository.js.map +1 -1
  95. package/module/modules/web-server.module.js.map +1 -1
  96. package/object-storage/s3/s3.object-storage-provider.js.map +1 -1
  97. package/object-storage/s3/s3.object-storage.js.map +1 -1
  98. package/openid-connect/cached-oidc-configuration.service.js.map +1 -1
  99. package/openid-connect/mongo-oidc-state.repository.js.map +1 -1
  100. package/openid-connect/oidc-configuration.service.d.ts +2 -1
  101. package/openid-connect/oidc-configuration.service.js +5 -3
  102. package/openid-connect/oidc-configuration.service.js.map +1 -1
  103. package/openid-connect/oidc.service-model.d.ts +11 -3
  104. package/openid-connect/oidc.service.d.ts +6 -3
  105. package/openid-connect/oidc.service.js +69 -23
  106. package/openid-connect/oidc.service.js.map +1 -1
  107. package/package.json +7 -8
  108. package/pdf/pdf.service.d.ts +48 -10
  109. package/pdf/pdf.service.js +114 -4
  110. package/pdf/pdf.service.js.map +1 -1
  111. package/promise/deferred-promise.d.ts +2 -15
  112. package/promise/deferred-promise.js +5 -10
  113. package/promise/deferred-promise.js.map +1 -1
  114. package/promise/index.d.ts +1 -0
  115. package/promise/index.js +1 -0
  116. package/promise/index.js.map +1 -1
  117. package/promise/lazy-promise.d.ts +11 -0
  118. package/promise/lazy-promise.js +31 -0
  119. package/promise/lazy-promise.js.map +1 -0
  120. package/queue/mongo/mongo-job.repository.js +1 -1
  121. package/queue/mongo/mongo-job.repository.js.map +1 -1
  122. package/queue/mongo/queue.js.map +1 -1
  123. package/queue/mongo/queue.provider.js.map +1 -1
  124. package/reflection/decorator-data.js +1 -1
  125. package/reflection/decorator-data.js.map +1 -1
  126. package/reflection/decorators.d.ts +2 -2
  127. package/reflection/decorators.js +7 -7
  128. package/reflection/decorators.js.map +1 -1
  129. package/reflection/registry.d.ts +8 -8
  130. package/reflection/registry.js +1 -1
  131. package/reflection/registry.js.map +1 -1
  132. package/reflection/types.d.ts +3 -2
  133. package/reflection/utils.d.ts +7 -2
  134. package/reflection/utils.js +38 -12
  135. package/reflection/utils.js.map +1 -1
  136. package/schema/array-constraints/maximum-length.js +2 -2
  137. package/schema/array-constraints/maximum-length.js.map +1 -1
  138. package/schema/array-constraints/minimum-length.js +2 -2
  139. package/schema/array-constraints/minimum-length.js.map +1 -1
  140. package/schema/coercers/default-value.coercer.d.ts +1 -1
  141. package/schema/coercers/default-value.coercer.js +1 -1
  142. package/schema/coercers/default-value.coercer.js.map +1 -1
  143. package/schema/coercers/uint8-array.coercer.js +4 -3
  144. package/schema/coercers/uint8-array.coercer.js.map +1 -1
  145. package/schema/constraints/enumeration.js +2 -2
  146. package/schema/constraints/enumeration.js.map +1 -1
  147. package/schema/constraints/generic.js +2 -2
  148. package/schema/constraints/generic.js.map +1 -1
  149. package/schema/constraints/integer.js +3 -3
  150. package/schema/constraints/integer.js.map +1 -1
  151. package/schema/constraints/literal.js +2 -2
  152. package/schema/constraints/literal.js.map +1 -1
  153. package/schema/constraints/maximum-date.js +3 -3
  154. package/schema/constraints/maximum-date.js.map +1 -1
  155. package/schema/constraints/maximum-length.js +2 -2
  156. package/schema/constraints/maximum-length.js.map +1 -1
  157. package/schema/constraints/maximum.js +3 -3
  158. package/schema/constraints/maximum.js.map +1 -1
  159. package/schema/constraints/minimum-date.js +3 -3
  160. package/schema/constraints/minimum-date.js.map +1 -1
  161. package/schema/constraints/minimum-length.js +2 -2
  162. package/schema/constraints/minimum-length.js.map +1 -1
  163. package/schema/constraints/minimum.js +3 -3
  164. package/schema/constraints/minimum.js.map +1 -1
  165. package/schema/constraints/pattern.js +3 -3
  166. package/schema/constraints/pattern.js.map +1 -1
  167. package/schema/decorators/array.d.ts +2 -2
  168. package/schema/decorators/array.js +1 -1
  169. package/schema/decorators/array.js.map +1 -1
  170. package/schema/decorators/defaulted.d.ts +2 -2
  171. package/schema/decorators/defaulted.js +1 -1
  172. package/schema/decorators/defaulted.js.map +1 -1
  173. package/schema/decorators/optional.d.ts +3 -1
  174. package/schema/decorators/optional.js +2 -2
  175. package/schema/decorators/optional.js.map +1 -1
  176. package/schema/decorators/property.d.ts +1 -1
  177. package/schema/decorators/property.js +3 -1
  178. package/schema/decorators/property.js.map +1 -1
  179. package/schema/decorators/types.d.ts +4 -4
  180. package/schema/decorators/utils.d.ts +3 -2
  181. package/schema/decorators/utils.js +4 -8
  182. package/schema/decorators/utils.js.map +1 -1
  183. package/schema/schema.d.ts +8 -10
  184. package/schema/schema.error.d.ts +1 -0
  185. package/schema/schema.error.js +1 -1
  186. package/schema/schema.error.js.map +1 -1
  187. package/schema/schema.js +131 -164
  188. package/schema/schema.js.map +1 -1
  189. package/schema/schemas/any.d.ts +2 -2
  190. package/schema/schemas/any.js +2 -2
  191. package/schema/schemas/any.js.map +1 -1
  192. package/schema/schemas/array.d.ts +2 -1
  193. package/schema/schemas/array.js +1 -1
  194. package/schema/schemas/array.js.map +1 -1
  195. package/schema/schemas/assign.d.ts +5 -5
  196. package/schema/schemas/boolean.js +2 -2
  197. package/schema/schemas/boolean.js.map +1 -1
  198. package/schema/schemas/date.js +2 -2
  199. package/schema/schemas/date.js.map +1 -1
  200. package/schema/schemas/defaulted.d.ts +3 -2
  201. package/schema/schemas/defaulted.js.map +1 -1
  202. package/schema/schemas/enumeration.js +2 -2
  203. package/schema/schemas/enumeration.js.map +1 -1
  204. package/schema/schemas/exclude.d.ts +4 -1
  205. package/schema/schemas/exclude.js +6 -11
  206. package/schema/schemas/exclude.js.map +1 -1
  207. package/schema/schemas/index.d.ts +2 -0
  208. package/schema/schemas/index.js +2 -0
  209. package/schema/schemas/index.js.map +1 -1
  210. package/schema/schemas/instance.d.ts +2 -2
  211. package/schema/schemas/instance.js +1 -1
  212. package/schema/schemas/instance.js.map +1 -1
  213. package/schema/schemas/literal.js +2 -2
  214. package/schema/schemas/literal.js.map +1 -1
  215. package/schema/schemas/nullable.d.ts +3 -2
  216. package/schema/schemas/nullable.js.map +1 -1
  217. package/schema/schemas/number.d.ts +1 -1
  218. package/schema/schemas/number.js +2 -2
  219. package/schema/schemas/number.js.map +1 -1
  220. package/schema/schemas/object.d.ts +2 -3
  221. package/schema/schemas/object.js.map +1 -1
  222. package/schema/schemas/omit.d.ts +4 -0
  223. package/schema/schemas/omit.js +17 -0
  224. package/schema/schemas/omit.js.map +1 -0
  225. package/schema/schemas/readable-stream.d.ts +2 -2
  226. package/schema/schemas/readable-stream.js +2 -2
  227. package/schema/schemas/readable-stream.js.map +1 -1
  228. package/schema/schemas/record.d.ts +3 -2
  229. package/schema/schemas/record.js.map +1 -1
  230. package/schema/schemas/regexp.js +2 -2
  231. package/schema/schemas/regexp.js.map +1 -1
  232. package/schema/schemas/string.js +2 -2
  233. package/schema/schemas/string.js.map +1 -1
  234. package/schema/schemas/transform.d.ts +3 -2
  235. package/schema/schemas/transform.js.map +1 -1
  236. package/schema/schemas/uint8-array.d.ts +2 -3
  237. package/schema/schemas/uint8-array.js +3 -3
  238. package/schema/schemas/uint8-array.js.map +1 -1
  239. package/schema/schemas/union.d.ts +9 -8
  240. package/schema/schemas/union.js +1 -1
  241. package/schema/schemas/union.js.map +1 -1
  242. package/schema/schemas/unknown.d.ts +2 -2
  243. package/schema/schemas/unknown.js +2 -2
  244. package/schema/schemas/unknown.js.map +1 -1
  245. package/schema/transformers/generic.d.ts +4 -4
  246. package/schema/transformers/generic.js.map +1 -1
  247. package/schema/transformers/lowercase.js +1 -1
  248. package/schema/transformers/lowercase.js.map +1 -1
  249. package/schema/transformers/trim.js +1 -1
  250. package/schema/transformers/trim.js.map +1 -1
  251. package/schema/transformers/uppercase.js +1 -1
  252. package/schema/transformers/uppercase.js.map +1 -1
  253. package/schema/types.d.ts +53 -39
  254. package/schema/types.js +49 -34
  255. package/schema/types.js.map +1 -1
  256. package/schema/utils/schema.d.ts +13 -5
  257. package/schema/utils/schema.js +86 -26
  258. package/schema/utils/schema.js.map +1 -1
  259. package/schema/utils/value-type.d.ts +3 -1
  260. package/schema/utils/value-type.js +32 -2
  261. package/schema/utils/value-type.js.map +1 -1
  262. package/search-index/elastic/config.js.map +1 -1
  263. package/search-index/elastic/model/index-mapping.d.ts +2 -1
  264. package/search-index/elastic/model/index-mapping.js.map +1 -1
  265. package/search-index/elastic/search-index.js +1 -1
  266. package/search-index/elastic/search-index.js.map +1 -1
  267. package/serializer/serializable.d.ts +4 -4
  268. package/serializer/serializable.js.map +1 -1
  269. package/templates/index.d.ts +2 -0
  270. package/templates/index.js +2 -0
  271. package/templates/index.js.map +1 -1
  272. package/templates/module.d.ts +3 -1
  273. package/templates/module.js +31 -8
  274. package/templates/module.js.map +1 -1
  275. package/templates/providers/file.provider-template.d.ts +16 -0
  276. package/templates/providers/{file-template.provider.js → file.provider-template.js} +22 -15
  277. package/templates/providers/file.provider-template.js.map +1 -0
  278. package/templates/providers/memory.template-provider.d.ts +8 -0
  279. package/templates/providers/{memory-template.provider.base.js → memory.template-provider.js} +8 -6
  280. package/templates/providers/memory.template-provider.js.map +1 -0
  281. package/templates/renderers/handlebars.template-renderer.d.ts +38 -6
  282. package/templates/renderers/handlebars.template-renderer.js +47 -3
  283. package/templates/renderers/handlebars.template-renderer.js.map +1 -1
  284. package/templates/renderers/mjml.template-renderer.d.ts +6 -6
  285. package/templates/renderers/mjml.template-renderer.js +8 -9
  286. package/templates/renderers/mjml.template-renderer.js.map +1 -1
  287. package/templates/renderers/string.template-renderer.d.ts +8 -0
  288. package/{mail/template-providers/memory-mail-template.provider.js → templates/renderers/string.template-renderer.js} +13 -7
  289. package/templates/renderers/string.template-renderer.js.map +1 -0
  290. package/templates/resolvers/file.template-resolver.d.ts +23 -0
  291. package/templates/resolvers/file.template-resolver.js +63 -0
  292. package/templates/resolvers/file.template-resolver.js.map +1 -0
  293. package/templates/resolvers/string.template-resolver.d.ts +13 -0
  294. package/templates/resolvers/string.template-resolver.js +44 -0
  295. package/templates/resolvers/string.template-resolver.js.map +1 -0
  296. package/templates/template-renderer.provider.js +7 -19
  297. package/templates/template-renderer.provider.js.map +1 -1
  298. package/templates/template-resolver.provider.d.ts +8 -0
  299. package/templates/template-resolver.provider.js +48 -0
  300. package/templates/template-resolver.provider.js.map +1 -0
  301. package/templates/template.model.d.ts +14 -4
  302. package/templates/template.model.js +42 -0
  303. package/templates/template.model.js.map +1 -1
  304. package/templates/template.renderer.d.ts +14 -3
  305. package/templates/template.renderer.js +3 -0
  306. package/templates/template.renderer.js.map +1 -1
  307. package/templates/template.resolver.d.ts +5 -0
  308. package/templates/template.resolver.js +7 -0
  309. package/templates/template.resolver.js.map +1 -0
  310. package/templates/template.service.d.ts +10 -4
  311. package/templates/template.service.js +19 -6
  312. package/templates/template.service.js.map +1 -1
  313. package/templates/tokens.d.ts +3 -2
  314. package/templates/tokens.js +2 -1
  315. package/templates/tokens.js.map +1 -1
  316. package/types.d.ts +6 -4
  317. package/utils/array/array.d.ts +1 -2
  318. package/utils/array/array.js.map +1 -1
  319. package/utils/async-iterable-helpers/includes.d.ts +2 -0
  320. package/utils/async-iterable-helpers/includes.js +13 -0
  321. package/utils/async-iterable-helpers/includes.js.map +1 -0
  322. package/utils/async-iterable-helpers/index.d.ts +1 -0
  323. package/utils/async-iterable-helpers/index.js +1 -0
  324. package/utils/async-iterable-helpers/index.js.map +1 -1
  325. package/utils/clone.js +4 -0
  326. package/utils/clone.js.map +1 -1
  327. package/utils/compression.d.ts +13 -13
  328. package/utils/compression.js +10 -9
  329. package/utils/compression.js.map +1 -1
  330. package/utils/encoding.js +1 -1
  331. package/utils/encoding.js.map +1 -1
  332. package/utils/enum.js +3 -3
  333. package/utils/enum.js.map +1 -1
  334. package/utils/function/memoize.d.ts +1 -0
  335. package/utils/function/memoize.js +7 -4
  336. package/utils/function/memoize.js.map +1 -1
  337. package/utils/helpers.d.ts +0 -2
  338. package/utils/helpers.js +1 -12
  339. package/utils/helpers.js.map +1 -1
  340. package/utils/index.d.ts +1 -0
  341. package/utils/index.js +1 -0
  342. package/utils/index.js.map +1 -1
  343. package/utils/iterable-helpers/includes.d.ts +1 -0
  344. package/utils/iterable-helpers/includes.js +9 -0
  345. package/utils/iterable-helpers/includes.js.map +1 -0
  346. package/utils/iterable-helpers/index.d.ts +1 -0
  347. package/utils/iterable-helpers/index.js +1 -0
  348. package/utils/iterable-helpers/index.js.map +1 -1
  349. package/utils/object/property-name.d.ts +2 -2
  350. package/utils/throw.d.ts +2 -0
  351. package/utils/throw.js +15 -0
  352. package/utils/throw.js.map +1 -0
  353. package/utils/type-guards.d.ts +13 -1
  354. package/utils/type-guards.js +29 -5
  355. package/utils/type-guards.js.map +1 -1
  356. package/web-types.d.ts +28 -0
  357. package/web-types.js +3 -0
  358. package/web-types.js.map +1 -0
  359. package/mail/mail-template-renderer.provider.d.ts +0 -8
  360. package/mail/mail-template-renderer.provider.js +0 -60
  361. package/mail/mail-template-renderer.provider.js.map +0 -1
  362. package/mail/mail-template.provider.d.ts +0 -4
  363. package/mail/mail-template.provider.js +0 -7
  364. package/mail/mail-template.provider.js.map +0 -1
  365. package/mail/mail-template.renderer.d.ts +0 -10
  366. package/mail/mail-template.renderer.js +0 -7
  367. package/mail/mail-template.renderer.js.map +0 -1
  368. package/mail/template-providers/file-mail-template.provider.d.ts +0 -24
  369. package/mail/template-providers/file-mail-template.provider.js +0 -51
  370. package/mail/template-providers/file-mail-template.provider.js.map +0 -1
  371. package/mail/template-providers/memory-mail-template.provider.d.ts +0 -6
  372. package/mail/template-providers/memory-mail-template.provider.js.map +0 -1
  373. package/mail/template-renderers/handlebars.mail-template-renderer.d.ts +0 -13
  374. package/mail/template-renderers/handlebars.mail-template-renderer.js +0 -49
  375. package/mail/template-renderers/handlebars.mail-template-renderer.js.map +0 -1
  376. package/mail/template-renderers/mjml.mail-template-renderer.d.ts +0 -14
  377. package/mail/template-renderers/mjml.mail-template-renderer.js +0 -63
  378. package/mail/template-renderers/mjml.mail-template-renderer.js.map +0 -1
  379. package/templates/providers/file-template.provider.base.d.ts +0 -12
  380. package/templates/providers/file-template.provider.base.js +0 -50
  381. package/templates/providers/file-template.provider.base.js.map +0 -1
  382. package/templates/providers/file-template.provider.d.ts +0 -22
  383. package/templates/providers/file-template.provider.js.map +0 -1
  384. package/templates/providers/memory-template.provider.base.d.ts +0 -9
  385. package/templates/providers/memory-template.provider.base.js.map +0 -1
  386. package/templates/providers/memory-template.provider.d.ts +0 -4
  387. package/templates/providers/memory-template.provider.js +0 -18
  388. package/templates/providers/memory-template.provider.js.map +0 -1
@@ -1,4 +1,7 @@
1
1
  import type { OneOrMany, Record } from "../../types";
2
2
  import type { Simplify } from 'type-fest';
3
3
  import type { ObjectSchema } from '../types';
4
- export declare function exclude<T extends Record, K extends keyof T>(schema: ObjectSchema<T>, key: OneOrMany<K>): ObjectSchema<Simplify<Omit<T, K>>>;
4
+ /**
5
+ * @deprecated use {@link omit}
6
+ */
7
+ export declare function exclude<T extends Record, K extends keyof T>(schema: ObjectSchema<T>, keys: OneOrMany<K>): ObjectSchema<Simplify<Omit<T, K>>>;
@@ -1,17 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.exclude = void 0;
4
- const array_1 = require("../../utils/array/array");
5
- const types_1 = require("../types");
6
- function exclude(schema, key) {
7
- const keys = (0, array_1.toArray)(key);
8
- const entries = Object.entries(schema.properties);
9
- const pickedEntries = entries.filter(([propertyKey]) => !keys.includes(propertyKey));
10
- const pickedSchema = (0, types_1.objectSchema)({
11
- ...schema,
12
- properties: Object.fromEntries(pickedEntries)
13
- });
14
- return pickedSchema;
4
+ const omit_1 = require("./omit");
5
+ /**
6
+ * @deprecated use {@link omit}
7
+ */
8
+ function exclude(schema, keys) {
9
+ return (0, omit_1.omit)(schema, keys);
15
10
  }
16
11
  exports.exclude = exclude;
17
12
  //# sourceMappingURL=exclude.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"exclude.js","sourceRoot":"","sources":["../../../source/schema/schemas/exclude.ts"],"names":[],"mappings":";;;AACA,mDAA8C;AAG9C,oCAAwC;AAExC,SAAgB,OAAO,CAAsC,MAAuB,EAAE,GAAiB;IACrG,MAAM,IAAI,GAAG,IAAA,eAAO,EAAC,GAAG,CAAC,CAAC;IAE1B,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAClD,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAgB,CAAC,CAAC,CAAC;IAE1F,MAAM,YAAY,GAAG,IAAA,oBAAY,EAAC;QAChC,GAAG,MAAM;QACT,UAAU,EAAE,MAAM,CAAC,WAAW,CAAC,aAAa,CAA8B;KAC3E,CAAC,CAAC;IAEH,OAAO,YAAmD,CAAC;AAC7D,CAAC;AAZD,0BAYC"}
1
+ {"version":3,"file":"exclude.js","sourceRoot":"","sources":["../../../source/schema/schemas/exclude.ts"],"names":[],"mappings":";;;AAGA,iCAA8B;AAE9B;;GAEG;AACH,SAAgB,OAAO,CAAsC,MAAuB,EAAE,IAAkB;IACtG,OAAO,IAAA,WAAI,EAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AAC5B,CAAC;AAFD,0BAEC"}
@@ -4,6 +4,7 @@ export * from './assign';
4
4
  export * from './boolean';
5
5
  export * from './constraint';
6
6
  export * from './date';
7
+ export * from './defaulted';
7
8
  export * from './enumeration';
8
9
  export * from './exclude';
9
10
  export * from './instance';
@@ -11,6 +12,7 @@ export * from './literal';
11
12
  export * from './nullable';
12
13
  export * from './number';
13
14
  export * from './object';
15
+ export * from './omit';
14
16
  export * from './optional';
15
17
  export * from './pick';
16
18
  export * from './readable-stream';
@@ -20,6 +20,7 @@ __exportStar(require("./assign"), exports);
20
20
  __exportStar(require("./boolean"), exports);
21
21
  __exportStar(require("./constraint"), exports);
22
22
  __exportStar(require("./date"), exports);
23
+ __exportStar(require("./defaulted"), exports);
23
24
  __exportStar(require("./enumeration"), exports);
24
25
  __exportStar(require("./exclude"), exports);
25
26
  __exportStar(require("./instance"), exports);
@@ -27,6 +28,7 @@ __exportStar(require("./literal"), exports);
27
28
  __exportStar(require("./nullable"), exports);
28
29
  __exportStar(require("./number"), exports);
29
30
  __exportStar(require("./object"), exports);
31
+ __exportStar(require("./omit"), exports);
30
32
  __exportStar(require("./optional"), exports);
31
33
  __exportStar(require("./pick"), exports);
32
34
  __exportStar(require("./readable-stream"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/schema/schemas/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAsB;AACtB,0CAAwB;AACxB,2CAAyB;AACzB,4CAA0B;AAC1B,+CAA6B;AAC7B,yCAAuB;AACvB,gDAA8B;AAC9B,4CAA0B;AAC1B,6CAA2B;AAC3B,4CAA0B;AAC1B,6CAA2B;AAC3B,2CAAyB;AACzB,2CAAyB;AACzB,6CAA2B;AAC3B,yCAAuB;AACvB,oDAAkC;AAClC,2CAAyB;AACzB,2CAAyB;AACzB,2CAAyB;AACzB,8CAA4B;AAC5B,gDAA8B;AAC9B,0CAAwB;AACxB,4CAA0B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/schema/schemas/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAsB;AACtB,0CAAwB;AACxB,2CAAyB;AACzB,4CAA0B;AAC1B,+CAA6B;AAC7B,yCAAuB;AACvB,8CAA4B;AAC5B,gDAA8B;AAC9B,4CAA0B;AAC1B,6CAA2B;AAC3B,4CAA0B;AAC1B,6CAA2B;AAC3B,2CAAyB;AACzB,2CAAyB;AACzB,yCAAuB;AACvB,6CAA2B;AAC3B,yCAAuB;AACvB,oDAAkC;AAClC,2CAAyB;AACzB,2CAAyB;AACzB,2CAAyB;AACzB,8CAA4B;AAC5B,gDAA8B;AAC9B,0CAAwB;AACxB,4CAA0B"}
@@ -1,2 +1,2 @@
1
- import type { ValueSchema, ValueType } from '../types';
2
- export declare function instance<T>(type: Extract<ValueType<T>, Function>): ValueSchema<T>;
1
+ import type { NormalizeValueType, TypeSchema, ValueType } from '../types';
2
+ export declare function instance<T>(type: ValueType<T>): TypeSchema<NormalizeValueType<T>>;
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.instance = void 0;
5
5
  const types_1 = require("../types");
6
6
  function instance(type) {
7
- return (0, types_1.valueSchema)(type);
7
+ return (0, types_1.typeSchema)(type);
8
8
  }
9
9
  exports.instance = instance;
10
10
  //# sourceMappingURL=instance.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"instance.js","sourceRoot":"","sources":["../../../source/schema/schemas/instance.ts"],"names":[],"mappings":";AAAA,iDAAiD;;;AAGjD,oCAAuC;AAEvC,SAAgB,QAAQ,CAAI,IAAqC;IAC/D,OAAO,IAAA,mBAAW,EAAC,IAAI,CAAC,CAAC;AAC3B,CAAC;AAFD,4BAEC"}
1
+ {"version":3,"file":"instance.js","sourceRoot":"","sources":["../../../source/schema/schemas/instance.ts"],"names":[],"mappings":";AAAA,iDAAiD;;;AAGjD,oCAAsC;AAEtC,SAAgB,QAAQ,CAAI,IAAkB;IAC5C,OAAO,IAAA,kBAAU,EAAI,IAAI,CAAC,CAAC;AAC7B,CAAC;AAFD,4BAEC"}
@@ -7,13 +7,13 @@ const decorators_1 = require("../decorators");
7
7
  const types_1 = require("../types");
8
8
  const utils_1 = require("../utils");
9
9
  function literal(value) {
10
- return (0, types_1.valueSchema)((0, utils_1.getValueType)(value), {
10
+ return (0, types_1.valueSchema)((0, types_1.typeSchema)((0, utils_1.getValueType)(value)), {
11
11
  valueConstraints: new constraints_1.LiteralConstraint(value)
12
12
  });
13
13
  }
14
14
  exports.literal = literal;
15
15
  function Literal(value) {
16
- return (0, decorators_1.createSchemaPropertyDecoratorFromValueType)(literal(value));
16
+ return (0, decorators_1.createSchemaPropertyDecoratorFromSchema)(literal(value));
17
17
  }
18
18
  exports.Literal = Literal;
19
19
  //# sourceMappingURL=literal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"literal.js","sourceRoot":"","sources":["../../../source/schema/schemas/literal.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,gDAAmD;AACnD,8CAA2E;AAE3E,oCAAuC;AACvC,oCAAwC;AAExC,SAAgB,OAAO,CAAI,KAAQ;IACjC,OAAO,IAAA,mBAAW,EAAM,IAAA,oBAAY,EAAC,KAAK,CAAC,EAAE;QAC3C,gBAAgB,EAAE,IAAI,+BAAiB,CAAC,KAAK,CAAC;KAC/C,CAAC,CAAC;AACL,CAAC;AAJD,0BAIC;AAED,SAAgB,OAAO,CAAC,KAAU;IAChC,OAAO,IAAA,uDAA0C,EAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;AACpE,CAAC;AAFD,0BAEC"}
1
+ {"version":3,"file":"literal.js","sourceRoot":"","sources":["../../../source/schema/schemas/literal.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,gDAAmD;AACnD,8CAAwE;AAExE,oCAAmD;AACnD,oCAAwC;AAExC,SAAgB,OAAO,CAAI,KAAQ;IACjC,OAAO,IAAA,mBAAW,EAAM,IAAA,kBAAU,EAAC,IAAA,oBAAY,EAAC,KAAK,CAAC,CAAC,EAAE;QACvD,gBAAgB,EAAE,IAAI,+BAAiB,CAAC,KAAK,CAAC;KAC/C,CAAC,CAAC;AACL,CAAC;AAJD,0BAIC;AAED,SAAgB,OAAO,CAAC,KAAU;IAChC,OAAO,IAAA,oDAAuC,EAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;AACjE,CAAC;AAFD,0BAEC"}
@@ -1,2 +1,3 @@
1
- import type { ValueSchema, ValueType } from '../types';
2
- export declare function nullable<T, O>(schema: ValueType<T, O>): ValueSchema<T, O | null>;
1
+ import type { Schema } from '../schema';
2
+ import type { ValueSchema } from '../types';
3
+ export declare function nullable<T, O>(schema: Schema<T, O>): ValueSchema<T | null, O | null>;
@@ -1 +1 @@
1
- {"version":3,"file":"nullable.js","sourceRoot":"","sources":["../../../source/schema/schemas/nullable.ts"],"names":[],"mappings":";;;AACA,oCAAuC;AAEvC,SAAgB,QAAQ,CAAO,MAAuB;IACpD,OAAO,IAAA,mBAAW,EAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AACjD,CAAC;AAFD,4BAEC"}
1
+ {"version":3,"file":"nullable.js","sourceRoot":"","sources":["../../../source/schema/schemas/nullable.ts"],"names":[],"mappings":";;;AAEA,oCAAuC;AAEvC,SAAgB,QAAQ,CAAO,MAAoB;IACjD,OAAO,IAAA,mBAAW,EAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAoC,CAAC;AACpF,CAAC;AAFD,4BAEC"}
@@ -1,5 +1,5 @@
1
1
  import type { Decorator } from "../../reflection";
2
- import type { Coercible, ValueSchema } from '../types';
2
+ import { Coercible, ValueSchema } from '../types';
3
3
  export declare type NumberOptions = Coercible & {
4
4
  minimum?: number;
5
5
  maximum?: number;
@@ -19,7 +19,7 @@ function number(options = {}) {
19
19
  if (options.integer == true) {
20
20
  constraints.push(integer_1.integerConstraint);
21
21
  }
22
- return (0, types_1.valueSchema)(globalThis.Number, {
22
+ return (0, types_1.valueSchema)((0, types_1.typeSchema)(globalThis.Number), {
23
23
  array: false,
24
24
  optional: false,
25
25
  nullable: false,
@@ -29,7 +29,7 @@ function number(options = {}) {
29
29
  }
30
30
  exports.number = number;
31
31
  function Number(options) {
32
- return (0, decorators_1.createSchemaPropertyDecoratorFromValueType)(number(options));
32
+ return (0, decorators_1.createSchemaPropertyDecoratorFromSchema)(number(options));
33
33
  }
34
34
  exports.Number = Number;
35
35
  //# sourceMappingURL=number.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"number.js","sourceRoot":"","sources":["../../../source/schema/schemas/number.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,yDAAgD;AAChD,oDAA2D;AAC3D,oDAA2D;AAC3D,oDAA2D;AAC3D,8CAA2E;AAE3E,oCAAuC;AAQvC,SAAgB,MAAM,CAAC,UAAyB,EAAE;IAChD,MAAM,WAAW,GAA4B,EAAE,CAAC;IAEhD,IAAI,IAAA,uBAAS,EAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QAC9B,WAAW,CAAC,IAAI,CAAC,IAAI,2BAAiB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;KAC1D;IAED,IAAI,IAAA,uBAAS,EAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QAC9B,WAAW,CAAC,IAAI,CAAC,IAAI,2BAAiB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;KAC1D;IAED,IAAI,OAAO,CAAC,OAAO,IAAI,IAAI,EAAE;QAC3B,WAAW,CAAC,IAAI,CAAC,2BAAiB,CAAC,CAAC;KACrC;IAED,OAAO,IAAA,mBAAW,EAAC,UAAU,CAAC,MAAM,EAAE;QACpC,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,gBAAgB,EAAE,WAAW;KAC9B,CAAC,CAAC;AACL,CAAC;AAtBD,wBAsBC;AAED,SAAgB,MAAM,CAAC,OAAuB;IAC5C,OAAO,IAAA,uDAA0C,EAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;AACrE,CAAC;AAFD,wBAEC"}
1
+ {"version":3,"file":"number.js","sourceRoot":"","sources":["../../../source/schema/schemas/number.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,yDAAgD;AAChD,oDAA2D;AAC3D,oDAA2D;AAC3D,oDAA2D;AAC3D,8CAAwE;AACxE,oCAAkG;AAQlG,SAAgB,MAAM,CAAC,UAAyB,EAAE;IAChD,MAAM,WAAW,GAA4B,EAAE,CAAC;IAEhD,IAAI,IAAA,uBAAS,EAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QAC9B,WAAW,CAAC,IAAI,CAAC,IAAI,2BAAiB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;KAC1D;IAED,IAAI,IAAA,uBAAS,EAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QAC9B,WAAW,CAAC,IAAI,CAAC,IAAI,2BAAiB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;KAC1D;IAED,IAAI,OAAO,CAAC,OAAO,IAAI,IAAI,EAAE;QAC3B,WAAW,CAAC,IAAI,CAAC,2BAAiB,CAAC,CAAC;KACrC;IAED,OAAO,IAAA,mBAAW,EAAC,IAAA,kBAAU,EAAC,UAAU,CAAC,MAAM,CAAC,EAAE;QAChD,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,gBAAgB,EAAE,WAAW;KAC9B,CAAC,CAAC;AACL,CAAC;AAtBD,wBAsBC;AAED,SAAgB,MAAM,CAAC,OAAuB;IAC5C,OAAO,IAAA,oDAAuC,EAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;AAClE,CAAC;AAFD,wBAEC"}
@@ -1,6 +1,5 @@
1
- import type { Record, TypedOmit } from "../../types";
2
- import type { PartialOnUndefinedDeep } from 'type-fest';
1
+ import type { Record, SimplifiedOptionalize, TypedOmit } from "../../types";
3
2
  import type { ObjectSchema, ObjectSchemaProperties } from '../types';
4
3
  export declare type ObjectOptions<T extends Record = Record> = TypedOmit<ObjectSchema<T>, 'properties'>;
5
4
  export declare function explicitObject<T extends Record>(properties: ObjectSchemaProperties<T>, options?: ObjectOptions<T>): ObjectSchema<T>;
6
- export declare function object<T extends Record, O = T>(properties: ObjectSchemaProperties<T>, options?: ObjectOptions<T>): ObjectSchema<T, PartialOnUndefinedDeep<O>>;
5
+ export declare function object<T extends Record>(properties: ObjectSchemaProperties<T>, options?: ObjectOptions<T>): ObjectSchema<SimplifiedOptionalize<T>, SimplifiedOptionalize<T>>;
@@ -1 +1 @@
1
- {"version":3,"file":"object.js","sourceRoot":"","sources":["../../../source/schema/schemas/object.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAKzD,oCAAwC;AAIxC,SAAgB,cAAc,CAAmB,UAAqC,EAAE,OAA0B;IAChH,OAAO,MAAM,CAAC,UAAU,EAAE,OAAO,CAA2B,CAAC;AAC/D,CAAC;AAFD,wCAEC;AAED,SAAgB,MAAM,CAA0B,UAAqC,EAAE,OAA0B;IAC/G,OAAO,IAAA,oBAAY,EAAC;QAClB,UAAU;QACV,GAAG,OAAO;KACX,CAA0D,CAAC;AAC9D,CAAC;AALD,wBAKC"}
1
+ {"version":3,"file":"object.js","sourceRoot":"","sources":["../../../source/schema/schemas/object.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAIzD,oCAAwC;AAIxC,SAAgB,cAAc,CAAmB,UAAqC,EAAE,OAA0B;IAChH,OAAO,MAAM,CAAC,UAAU,EAAE,OAAO,CAA2B,CAAC;AAC/D,CAAC;AAFD,wCAEC;AAED,SAAgB,MAAM,CAAmB,UAAqC,EAAE,OAA0B;IACxG,OAAO,IAAA,oBAAY,EAAC;QAClB,UAAU;QACV,GAAG,OAAO;KACX,CAAgF,CAAC;AACpF,CAAC;AALD,wBAKC"}
@@ -0,0 +1,4 @@
1
+ import type { OneOrMany, Record } from "../../types";
2
+ import type { Simplify } from 'type-fest';
3
+ import type { ObjectSchema } from '../types';
4
+ export declare function omit<T extends Record, K extends keyof T>(schema: ObjectSchema<T>, keys: OneOrMany<K>): ObjectSchema<Simplify<Omit<T, K>>>;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.omit = void 0;
4
+ const array_1 = require("../../utils/array/array");
5
+ const types_1 = require("../types");
6
+ function omit(schema, keys) {
7
+ const keyArray = (0, array_1.toArray)(keys);
8
+ const entries = Object.entries(schema.properties);
9
+ const pickedEntries = entries.filter(([propertyKey]) => !keyArray.includes(propertyKey));
10
+ const pickedSchema = (0, types_1.objectSchema)({
11
+ ...schema,
12
+ properties: Object.fromEntries(pickedEntries)
13
+ });
14
+ return pickedSchema;
15
+ }
16
+ exports.omit = omit;
17
+ //# sourceMappingURL=omit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"omit.js","sourceRoot":"","sources":["../../../source/schema/schemas/omit.ts"],"names":[],"mappings":";;;AACA,mDAA8C;AAG9C,oCAAwC;AAExC,SAAgB,IAAI,CAAsC,MAAuB,EAAE,IAAkB;IACnG,MAAM,QAAQ,GAAG,IAAA,eAAO,EAAC,IAAI,CAAC,CAAC;IAE/B,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAClD,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,WAAgB,CAAC,CAAC,CAAC;IAE9F,MAAM,YAAY,GAAG,IAAA,oBAAY,EAAC;QAChC,GAAG,MAAM;QACT,UAAU,EAAE,MAAM,CAAC,WAAW,CAAC,aAAa,CAA8B;KAC3E,CAAC,CAAC;IAEH,OAAO,YAAmD,CAAC;AAC7D,CAAC;AAZD,oBAYC"}
@@ -1,4 +1,4 @@
1
1
  import type { Decorator } from "../../reflection";
2
- import type { ValueSchema } from '../types';
3
- export declare function readableStream(): ValueSchema<globalThis.ReadableStream>;
2
+ import type { TypeSchema } from '../types';
3
+ export declare function readableStream(): TypeSchema<globalThis.ReadableStream>;
4
4
  export declare function ReadableStream(): Decorator<'property' | 'accessor'>;
@@ -5,11 +5,11 @@ exports.ReadableStream = exports.readableStream = void 0;
5
5
  const decorators_1 = require("../decorators");
6
6
  const types_1 = require("../types");
7
7
  function readableStream() {
8
- return (0, types_1.valueSchema)(globalThis.ReadableStream);
8
+ return (0, types_1.typeSchema)(globalThis.ReadableStream);
9
9
  }
10
10
  exports.readableStream = readableStream;
11
11
  function ReadableStream() {
12
- return (0, decorators_1.createSchemaPropertyDecoratorFromValueType)(readableStream());
12
+ return (0, decorators_1.createSchemaPropertyDecoratorFromSchema)(readableStream());
13
13
  }
14
14
  exports.ReadableStream = ReadableStream;
15
15
  //# sourceMappingURL=readable-stream.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"readable-stream.js","sourceRoot":"","sources":["../../../source/schema/schemas/readable-stream.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,8CAA2E;AAE3E,oCAAuC;AAEvC,SAAgB,cAAc;IAC5B,OAAO,IAAA,mBAAW,EAAC,UAAU,CAAC,cAAc,CAAC,CAAC;AAChD,CAAC;AAFD,wCAEC;AAED,SAAgB,cAAc;IAC5B,OAAO,IAAA,uDAA0C,EAAC,cAAc,EAAE,CAAC,CAAC;AACtE,CAAC;AAFD,wCAEC"}
1
+ {"version":3,"file":"readable-stream.js","sourceRoot":"","sources":["../../../source/schema/schemas/readable-stream.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,8CAAwE;AAExE,oCAAsC;AAEtC,SAAgB,cAAc;IAC5B,OAAO,IAAA,kBAAU,EAAC,UAAU,CAAC,cAAc,CAAC,CAAC;AAC/C,CAAC;AAFD,wCAEC;AAED,SAAgB,cAAc;IAC5B,OAAO,IAAA,oDAAuC,EAAC,cAAc,EAAE,CAAC,CAAC;AACnE,CAAC;AAFD,wCAEC"}
@@ -1,4 +1,5 @@
1
1
  import type { OneOrMany, Record, TypedOmit } from "../../types";
2
- import type { ObjectSchema, ValueType } from '../types';
2
+ import type { Schema } from '../schema';
3
+ import type { ObjectSchema } from '../types';
3
4
  export declare type RecordOptions<T extends Record = Record> = TypedOmit<ObjectSchema<T>, 'properties' | 'allowUnknownProperties' | 'mask'>;
4
- export declare function record<T, O>(valueType: OneOrMany<ValueType<T, O>>, options?: RecordOptions): ObjectSchema<Record<any, O>>;
5
+ export declare function record<T, O>(valueType: OneOrMany<Schema<T, O>>, options?: RecordOptions): ObjectSchema<Record<any, O>>;
@@ -1 +1 @@
1
- {"version":3,"file":"record.js","sourceRoot":"","sources":["../../../source/schema/schemas/record.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAIzD,oCAAwC;AAIxC,SAAgB,MAAM,CAAO,SAAqC,EAAE,OAAuB;IACzF,OAAO,IAAA,oBAAY,EAAC;QAClB,UAAU,EAAE,EAAE;QACd,sBAAsB,EAAE,SAAS;QACjC,GAAG,OAAO;KACX,CAAiB,CAAC;AACrB,CAAC;AAND,wBAMC"}
1
+ {"version":3,"file":"record.js","sourceRoot":"","sources":["../../../source/schema/schemas/record.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAKzD,oCAAwC;AAIxC,SAAgB,MAAM,CAAO,SAAkC,EAAE,OAAuB;IACtF,OAAO,IAAA,oBAAY,EAAC;QAClB,UAAU,EAAE,EAAE;QACd,sBAAsB,EAAE,SAAS;QACjC,GAAG,OAAO;KACX,CAAiB,CAAC;AACrB,CAAC;AAND,wBAMC"}
@@ -5,13 +5,13 @@ exports.RegExp = exports.regexp = void 0;
5
5
  const decorators_1 = require("../decorators");
6
6
  const types_1 = require("../types");
7
7
  function regexp(options = {}) {
8
- return (0, types_1.valueSchema)(globalThis.RegExp, {
8
+ return (0, types_1.valueSchema)((0, types_1.typeSchema)(globalThis.RegExp), {
9
9
  coerce: options.coerce
10
10
  });
11
11
  }
12
12
  exports.regexp = regexp;
13
13
  function RegExp(options) {
14
- return (0, decorators_1.createSchemaPropertyDecoratorFromValueType)(regexp(options));
14
+ return (0, decorators_1.createSchemaPropertyDecoratorFromSchema)(regexp(options));
15
15
  }
16
16
  exports.RegExp = RegExp;
17
17
  //# sourceMappingURL=regexp.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"regexp.js","sourceRoot":"","sources":["../../../source/schema/schemas/regexp.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,8CAA2E;AAG3E,oCAAuC;AAIvC,SAAgB,MAAM,CAAC,UAA+B,EAAE;IACtD,OAAO,IAAA,mBAAW,EAAC,UAAU,CAAC,MAAM,EAAE;QACpC,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB,CAAC,CAAC;AACL,CAAC;AAJD,wBAIC;AAED,SAAgB,MAAM,CAAC,OAA6B;IAClD,OAAO,IAAA,uDAA0C,EAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;AACrE,CAAC;AAFD,wBAEC"}
1
+ {"version":3,"file":"regexp.js","sourceRoot":"","sources":["../../../source/schema/schemas/regexp.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,8CAAwE;AAGxE,oCAAmD;AAInD,SAAgB,MAAM,CAAC,UAA+B,EAAE;IACtD,OAAO,IAAA,mBAAW,EAAC,IAAA,kBAAU,EAAC,UAAU,CAAC,MAAM,CAAC,EAAE;QAChD,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB,CAAC,CAAC;AACL,CAAC;AAJD,wBAIC;AAED,SAAgB,MAAM,CAAC,OAA6B;IAClD,OAAO,IAAA,oDAAuC,EAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;AAClE,CAAC;AAFD,wBAEC"}
@@ -29,7 +29,7 @@ function string(options = {}) {
29
29
  if ((0, type_guards_1.isDefined)(options.uppercase)) {
30
30
  transformers.push(new transformers_1.UppercaseTransformer());
31
31
  }
32
- return (0, types_1.valueSchema)(globalThis.String, {
32
+ return (0, types_1.valueSchema)((0, types_1.typeSchema)(globalThis.String), {
33
33
  coerce: options.coerce,
34
34
  valueConstraints: constraints,
35
35
  transformers
@@ -37,7 +37,7 @@ function string(options = {}) {
37
37
  }
38
38
  exports.string = string;
39
39
  function String(options) {
40
- return (0, decorators_1.createSchemaPropertyDecoratorFromValueType)(string(options));
40
+ return (0, decorators_1.createSchemaPropertyDecoratorFromSchema)(string(options));
41
41
  }
42
42
  exports.String = String;
43
43
  //# sourceMappingURL=string.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"string.js","sourceRoot":"","sources":["../../../source/schema/schemas/string.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,yDAAgD;AAChD,gDAAqG;AACrG,8CAA2E;AAC3E,kDAA8F;AAE9F,oCAAuC;AA4BvC,SAAgB,MAAM,CAAC,UAAyB,EAAE;IAChD,MAAM,WAAW,GAA4B,EAAE,CAAC;IAChD,MAAM,YAAY,GAA6B,EAAE,CAAC;IAElD,IAAI,IAAA,uBAAS,EAAC,OAAO,CAAC,aAAa,CAAC,EAAE;QACpC,WAAW,CAAC,IAAI,CAAC,IAAI,qCAAuB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC;KACtE;IAED,IAAI,IAAA,uBAAS,EAAC,OAAO,CAAC,aAAa,CAAC,EAAE;QACpC,WAAW,CAAC,IAAI,CAAC,IAAI,qCAAuB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC;KACtE;IAED,IAAI,IAAA,uBAAS,EAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QAC9B,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;QAC9D,WAAW,CAAC,IAAI,CAAC,IAAI,+BAAiB,CAAC,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC;KACvE;IAED,IAAI,IAAA,uBAAS,EAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QAC3B,YAAY,CAAC,IAAI,CAAC,IAAI,8BAAe,EAAE,CAAC,CAAC;KAC1C;IAED,IAAI,IAAA,uBAAS,EAAC,OAAO,CAAC,SAAS,CAAC,EAAE;QAChC,YAAY,CAAC,IAAI,CAAC,IAAI,mCAAoB,EAAE,CAAC,CAAC;KAC/C;IAED,IAAI,IAAA,uBAAS,EAAC,OAAO,CAAC,SAAS,CAAC,EAAE;QAChC,YAAY,CAAC,IAAI,CAAC,IAAI,mCAAoB,EAAE,CAAC,CAAC;KAC/C;IAED,OAAO,IAAA,mBAAW,EAAS,UAAU,CAAC,MAAM,EAAE;QAC5C,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,gBAAgB,EAAE,WAAW;QAC7B,YAAY;KACb,CAAC,CAAC;AACL,CAAC;AAlCD,wBAkCC;AAED,SAAgB,MAAM,CAAC,OAAuB;IAC5C,OAAO,IAAA,uDAA0C,EAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;AACrE,CAAC;AAFD,wBAEC"}
1
+ {"version":3,"file":"string.js","sourceRoot":"","sources":["../../../source/schema/schemas/string.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,yDAAgD;AAChD,gDAAqG;AACrG,8CAAwE;AACxE,kDAA8F;AAE9F,oCAAmD;AA4BnD,SAAgB,MAAM,CAAC,UAAyB,EAAE;IAChD,MAAM,WAAW,GAA4B,EAAE,CAAC;IAChD,MAAM,YAAY,GAA6B,EAAE,CAAC;IAElD,IAAI,IAAA,uBAAS,EAAC,OAAO,CAAC,aAAa,CAAC,EAAE;QACpC,WAAW,CAAC,IAAI,CAAC,IAAI,qCAAuB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC;KACtE;IAED,IAAI,IAAA,uBAAS,EAAC,OAAO,CAAC,aAAa,CAAC,EAAE;QACpC,WAAW,CAAC,IAAI,CAAC,IAAI,qCAAuB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC;KACtE;IAED,IAAI,IAAA,uBAAS,EAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QAC9B,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;QAC9D,WAAW,CAAC,IAAI,CAAC,IAAI,+BAAiB,CAAC,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC;KACvE;IAED,IAAI,IAAA,uBAAS,EAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QAC3B,YAAY,CAAC,IAAI,CAAC,IAAI,8BAAe,EAAE,CAAC,CAAC;KAC1C;IAED,IAAI,IAAA,uBAAS,EAAC,OAAO,CAAC,SAAS,CAAC,EAAE;QAChC,YAAY,CAAC,IAAI,CAAC,IAAI,mCAAoB,EAAE,CAAC,CAAC;KAC/C;IAED,IAAI,IAAA,uBAAS,EAAC,OAAO,CAAC,SAAS,CAAC,EAAE;QAChC,YAAY,CAAC,IAAI,CAAC,IAAI,mCAAoB,EAAE,CAAC,CAAC;KAC/C;IAED,OAAO,IAAA,mBAAW,EAAC,IAAA,kBAAU,EAAC,UAAU,CAAC,MAAM,CAAC,EAAE;QAChD,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,gBAAgB,EAAE,WAAW;QAC7B,YAAY;KACb,CAAC,CAAC;AACL,CAAC;AAlCD,wBAkCC;AAED,SAAgB,MAAM,CAAC,OAAuB;IAC5C,OAAO,IAAA,oDAAuC,EAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;AAClE,CAAC;AAFD,wBAEC"}
@@ -1,4 +1,5 @@
1
- import type { OneOrMany } from "../../types";
1
+ import type { AbstractConstructor, OneOrMany } from "../../types";
2
+ import type { Schema } from '../schema';
2
3
  import type { GenericTransformFunction } from '../transformers/generic';
3
4
  import type { ValueSchema, ValueType } from '../types';
4
- export declare function transform<T, O, TransformOutput>(schema: OneOrMany<ValueType<T, O>>, sourceType: OneOrMany<ValueType<T, O>>, targetType: ValueType<TransformOutput>, transformFunction: GenericTransformFunction<O, TransformOutput>): ValueSchema<TransformOutput>;
5
+ export declare function transform<T, O, TransformOutput>(schema: OneOrMany<Schema<T, O>>, sourceType: OneOrMany<ValueType<T>>, targetType: AbstractConstructor<TransformOutput>, transformFunction: GenericTransformFunction<O, TransformOutput>): ValueSchema<TransformOutput>;
@@ -1 +1 @@
1
- {"version":3,"file":"transform.js","sourceRoot":"","sources":["../../../source/schema/schemas/transform.ts"],"names":[],"mappings":";;;AAEA,qDAA6D;AAE7D,oCAAuC;AAEvC,SAAgB,SAAS,CAAwB,MAAkC,EAAE,UAAsC,EAAE,UAAsC,EAAE,iBAA+D;IAClO,OAAO,IAAA,mBAAW,EAAC,MAAM,EAAE;QACzB,YAAY,EAAE,IAAI,4BAAkB,CAAC,UAAU,EAAE,UAAU,EAAE,iBAAiB,CAAC;KAChF,CAAqB,CAAC;AACzB,CAAC;AAJD,8BAIC"}
1
+ {"version":3,"file":"transform.js","sourceRoot":"","sources":["../../../source/schema/schemas/transform.ts"],"names":[],"mappings":";;;AAGA,qDAA6D;AAE7D,oCAAuC;AAEvC,SAAgB,SAAS,CAAwB,MAA+B,EAAE,UAAmC,EAAE,UAAgD,EAAE,iBAA+D;IACtO,OAAO,IAAA,mBAAW,EAAC,MAAM,EAAE;QACzB,YAAY,EAAE,IAAI,4BAAkB,CAAC,UAAU,EAAE,UAAU,EAAE,iBAAiB,CAAC;KAChF,CAAqB,CAAC;AACzB,CAAC;AAJD,8BAIC"}
@@ -1,9 +1,8 @@
1
1
  import type { Decorator } from "../../reflection";
2
- import type { Schema } from '../schema';
3
- import type { Coercible } from '../types';
2
+ import type { Coercible, ValueSchema } from '../types';
4
3
  export declare type Uint8ArraySchemaOptions = Coercible & {
5
4
  minimumLength?: number;
6
5
  maximumLength?: number;
7
6
  };
8
- export declare function uint8Array(options?: Uint8ArraySchemaOptions): Schema<globalThis.Uint8Array>;
7
+ export declare function uint8Array(options?: Uint8ArraySchemaOptions): ValueSchema<globalThis.Uint8Array>;
9
8
  export declare function Uint8Array(options?: Uint8ArraySchemaOptions): Decorator<'property' | 'accessor'>;
@@ -6,7 +6,7 @@ const type_guards_1 = require("../../utils/type-guards");
6
6
  const uint8_array_coercer_1 = require("../coercers/uint8-array.coercer");
7
7
  const maximum_length_1 = require("../constraints/maximum-length");
8
8
  const minimum_length_1 = require("../constraints/minimum-length");
9
- const decorators_1 = require("../decorators");
9
+ const utils_1 = require("../decorators/utils");
10
10
  const types_1 = require("../types");
11
11
  function uint8Array(options = {}) {
12
12
  const constraints = [];
@@ -16,14 +16,14 @@ function uint8Array(options = {}) {
16
16
  if ((0, type_guards_1.isDefined)(options.maximumLength)) {
17
17
  constraints.push(new maximum_length_1.MaximumLengthConstraint(options.maximumLength));
18
18
  }
19
- return (0, types_1.valueSchema)(globalThis.Uint8Array, {
19
+ return (0, types_1.valueSchema)((0, types_1.typeSchema)(globalThis.Uint8Array), {
20
20
  coercers: (options.coerce == true) ? uint8_array_coercer_1.uint8ArrayCoercer : undefined,
21
21
  valueConstraints: constraints
22
22
  });
23
23
  }
24
24
  exports.uint8Array = uint8Array;
25
25
  function Uint8Array(options) {
26
- return (0, decorators_1.createSchemaPropertyDecoratorFromValueType)(uint8Array(options));
26
+ return (0, utils_1.createSchemaPropertyDecoratorFromSchema)(uint8Array(options));
27
27
  }
28
28
  exports.Uint8Array = Uint8Array;
29
29
  //# sourceMappingURL=uint8-array.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"uint8-array.js","sourceRoot":"","sources":["../../../source/schema/schemas/uint8-array.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,yDAAgD;AAChD,yEAAoE;AACpE,kEAAwE;AACxE,kEAAwE;AACxE,8CAA2E;AAG3E,oCAAuC;AAOvC,SAAgB,UAAU,CAAC,UAAmC,EAAE;IAC9D,MAAM,WAAW,GAA4B,EAAE,CAAC;IAEhD,IAAI,IAAA,uBAAS,EAAC,OAAO,CAAC,aAAa,CAAC,EAAE;QACpC,WAAW,CAAC,IAAI,CAAC,IAAI,wCAAuB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC;KACtE;IAED,IAAI,IAAA,uBAAS,EAAC,OAAO,CAAC,aAAa,CAAC,EAAE;QACpC,WAAW,CAAC,IAAI,CAAC,IAAI,wCAAuB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC;KACtE;IAED,OAAO,IAAA,mBAAW,EAAC,UAAU,CAAC,UAAU,EAAE;QACxC,QAAQ,EAAE,CAAC,OAAO,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,uCAAiB,CAAC,CAAC,CAAC,SAAS;QAClE,gBAAgB,EAAE,WAAW;KAC9B,CAAC,CAAC;AACL,CAAC;AAfD,gCAeC;AAED,SAAgB,UAAU,CAAC,OAAiC;IAC1D,OAAO,IAAA,uDAA0C,EAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;AACzE,CAAC;AAFD,gCAEC"}
1
+ {"version":3,"file":"uint8-array.js","sourceRoot":"","sources":["../../../source/schema/schemas/uint8-array.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,yDAAgD;AAChD,yEAAoE;AACpE,kEAAwE;AACxE,kEAAwE;AACxE,+CAA8E;AAE9E,oCAAmD;AAOnD,SAAgB,UAAU,CAAC,UAAmC,EAAE;IAC9D,MAAM,WAAW,GAA4B,EAAE,CAAC;IAEhD,IAAI,IAAA,uBAAS,EAAC,OAAO,CAAC,aAAa,CAAC,EAAE;QACpC,WAAW,CAAC,IAAI,CAAC,IAAI,wCAAuB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC;KACtE;IAED,IAAI,IAAA,uBAAS,EAAC,OAAO,CAAC,aAAa,CAAC,EAAE;QACpC,WAAW,CAAC,IAAI,CAAC,IAAI,wCAAuB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC;KACtE;IAED,OAAO,IAAA,mBAAW,EAAC,IAAA,kBAAU,EAAC,UAAU,CAAC,UAAU,CAAC,EAAE;QACpD,QAAQ,EAAE,CAAC,OAAO,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,uCAAiB,CAAC,CAAC,CAAC,SAAS;QAClE,gBAAgB,EAAE,WAAW;KAC9B,CAAC,CAAC;AACL,CAAC;AAfD,gCAeC;AAED,SAAgB,UAAU,CAAC,OAAiC;IAC1D,OAAO,IAAA,+CAAuC,EAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;AACtE,CAAC;AAFD,gCAEC"}
@@ -1,9 +1,10 @@
1
1
  import type { Decorator } from "../../reflection";
2
- import type { ValueSchema, ValueType } from '../types';
3
- export declare function union<T1, O1, T2, O2>(schema1: ValueType<T1, O1>, schema2: ValueType<T2, O2>): ValueSchema<T1 | T2, O1 | O2>;
4
- export declare function union<T1, O1, T2, O2, T3, O3>(schema1: ValueType<T1, O1>, schema2: ValueType<T2, O2>, schema3: ValueType<T3, O3>): ValueSchema<T1 | T2 | T3, O1 | O2 | O3>;
5
- export declare function union<T1, O1, T2, O2, T3, O3, T4, O4>(schema1: ValueType<T1, O1>, schema2: ValueType<T2, O2>, schema3: ValueType<T3, O3>, schema4: ValueType<T4, O4>): ValueSchema<T1 | T2 | T3 | T4, O1 | O2 | O3 | O4>;
6
- export declare function union<T1, O1, T2, O2, T3, O3, T4, O4, T5, O5>(schema1: ValueType<T1, O1>, schema2: ValueType<T2, O2>, schema3: ValueType<T3, O3>, schema4: ValueType<T4, O4>, schema5: ValueType<T5, O5>): ValueSchema<T1 | T2 | T3 | T4 | T5, O1 | O2 | O3 | O4 | O5>;
7
- export declare function union<T1, O1, T2, O2, T3, O3, T4, O4, T5, O5, T6, O6>(schema1: ValueType<T1, O1>, schema2: ValueType<T2, O2>, schema3: ValueType<T3, O3>, schema4: ValueType<T4, O4>, schema5: ValueType<T5, O5>, schema6: ValueType<T6>): ValueSchema<T1 | T2 | T3 | T4 | T5 | T6, O1 | O2 | O3 | O4 | O5 | O6>;
8
- export declare function union(...schemas: ValueType[]): ValueSchema;
9
- export declare function Union(...schemas: ValueType[]): Decorator<'property' | 'accessor'>;
2
+ import type { Schema } from '../schema';
3
+ import type { ValueSchema } from '../types';
4
+ export declare function union<T1, O1, T2, O2>(schema1: Schema<T1, O1>, schema2: Schema<T2, O2>): ValueSchema<T1 | T2, O1 | O2>;
5
+ export declare function union<T1, O1, T2, O2, T3, O3>(schema1: Schema<T1, O1>, schema2: Schema<T2, O2>, schema3: Schema<T3, O3>): ValueSchema<T1 | T2 | T3, O1 | O2 | O3>;
6
+ export declare function union<T1, O1, T2, O2, T3, O3, T4, O4>(schema1: Schema<T1, O1>, schema2: Schema<T2, O2>, schema3: Schema<T3, O3>, schema4: Schema<T4, O4>): ValueSchema<T1 | T2 | T3 | T4, O1 | O2 | O3 | O4>;
7
+ export declare function union<T1, O1, T2, O2, T3, O3, T4, O4, T5, O5>(schema1: Schema<T1, O1>, schema2: Schema<T2, O2>, schema3: Schema<T3, O3>, schema4: Schema<T4, O4>, schema5: Schema<T5, O5>): ValueSchema<T1 | T2 | T3 | T4 | T5, O1 | O2 | O3 | O4 | O5>;
8
+ export declare function union<T1, O1, T2, O2, T3, O3, T4, O4, T5, O5, T6, O6>(schema1: Schema<T1, O1>, schema2: Schema<T2, O2>, schema3: Schema<T3, O3>, schema4: Schema<T4, O4>, schema5: Schema<T5, O5>, schema6: Schema<T6>): ValueSchema<T1 | T2 | T3 | T4 | T5 | T6, O1 | O2 | O3 | O4 | O5 | O6>;
9
+ export declare function union(...schemas: Schema[]): ValueSchema;
10
+ export declare function Union(...schemas: Schema[]): Decorator<'property' | 'accessor'>;
@@ -11,7 +11,7 @@ function union(...schemas) {
11
11
  }
12
12
  exports.union = union;
13
13
  function Union(...schemas) {
14
- return (0, decorators_1.createSchemaPropertyDecoratorFromValueType)(union(...schemas));
14
+ return (0, decorators_1.createSchemaPropertyDecoratorFromSchema)(union(...schemas));
15
15
  }
16
16
  exports.Union = Union;
17
17
  //# sourceMappingURL=union.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"union.js","sourceRoot":"","sources":["../../../source/schema/schemas/union.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,yDAA6C;AAC7C,8CAA2E;AAE3E,oCAAuC;AAQvC,SAAgB,KAAK,CAAC,GAAG,OAAoB;IAC3C,IAAA,oBAAM,EAAC,OAAO,CAAC,MAAM,IAAI,CAAC,EAAE,qCAAqC,CAAC,CAAC;IACnE,OAAO,IAAA,mBAAW,EAAC,OAAO,CAAC,CAAC;AAC9B,CAAC;AAHD,sBAGC;AAED,SAAgB,KAAK,CAAC,GAAG,OAAoB;IAC3C,OAAO,IAAA,uDAA0C,EAAC,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;AACvE,CAAC;AAFD,sBAEC"}
1
+ {"version":3,"file":"union.js","sourceRoot":"","sources":["../../../source/schema/schemas/union.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,yDAA6C;AAC7C,8CAAwE;AAGxE,oCAAuC;AAQvC,SAAgB,KAAK,CAAC,GAAG,OAAiB;IACxC,IAAA,oBAAM,EAAC,OAAO,CAAC,MAAM,IAAI,CAAC,EAAE,qCAAqC,CAAC,CAAC;IACnE,OAAO,IAAA,mBAAW,EAAC,OAAO,CAAC,CAAC;AAC9B,CAAC;AAHD,sBAGC;AAED,SAAgB,KAAK,CAAC,GAAG,OAAiB;IACxC,OAAO,IAAA,oDAAuC,EAAC,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;AACpE,CAAC;AAFD,sBAEC"}
@@ -1,4 +1,4 @@
1
1
  import type { Decorator } from "../../reflection";
2
- import type { ValueSchema } from '../types';
3
- export declare function unknown(): ValueSchema<unknown>;
2
+ import type { TypeSchema } from '../types';
3
+ export declare function unknown(): TypeSchema<unknown>;
4
4
  export declare function Unknwon(): Decorator<'property' | 'accessor'>;
@@ -5,11 +5,11 @@ exports.Unknwon = exports.unknown = void 0;
5
5
  const decorators_1 = require("../decorators");
6
6
  const types_1 = require("../types");
7
7
  function unknown() {
8
- return (0, types_1.valueSchema)('any');
8
+ return (0, types_1.typeSchema)('any');
9
9
  }
10
10
  exports.unknown = unknown;
11
11
  function Unknwon() {
12
- return (0, decorators_1.createSchemaPropertyDecoratorFromValueType)(unknown());
12
+ return (0, decorators_1.createSchemaPropertyDecoratorFromSchema)(unknown());
13
13
  }
14
14
  exports.Unknwon = Unknwon;
15
15
  //# sourceMappingURL=unknown.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"unknown.js","sourceRoot":"","sources":["../../../source/schema/schemas/unknown.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,8CAA2E;AAE3E,oCAAuC;AAEvC,SAAgB,OAAO;IACrB,OAAO,IAAA,mBAAW,EAAC,KAAK,CAAC,CAAC;AAC5B,CAAC;AAFD,0BAEC;AAED,SAAgB,OAAO;IACrB,OAAO,IAAA,uDAA0C,EAAC,OAAO,EAAE,CAAC,CAAC;AAC/D,CAAC;AAFD,0BAEC"}
1
+ {"version":3,"file":"unknown.js","sourceRoot":"","sources":["../../../source/schema/schemas/unknown.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,8CAAwE;AAExE,oCAAsC;AAEtC,SAAgB,OAAO;IACrB,OAAO,IAAA,kBAAU,EAAC,KAAK,CAAC,CAAC;AAC3B,CAAC;AAFD,0BAEC;AAED,SAAgB,OAAO;IACrB,OAAO,IAAA,oDAAuC,EAAC,OAAO,EAAE,CAAC,CAAC;AAC5D,CAAC;AAFD,0BAEC"}
@@ -1,13 +1,13 @@
1
1
  import type { Decorator } from "../../reflection";
2
- import type { OneOrMany, TypedOmit } from "../../types";
2
+ import type { AbstractConstructor, OneOrMany, TypedOmit } from "../../types";
3
3
  import type { TransformResult, ValueType } from '../types';
4
4
  import { SchemaValueTransformer } from '../types';
5
5
  export declare type GenericTransformFunction<T, O> = (value: T) => TypedOmit<TransformResult<O>, 'success'>;
6
6
  export declare class GenericTransformer<T, O, TransformOutput> extends SchemaValueTransformer<T, O, TransformOutput> {
7
- readonly sourceType: OneOrMany<ValueType<T, O>>;
7
+ readonly sourceType: OneOrMany<ValueType<T>>;
8
8
  readonly targetType: ValueType<TransformOutput>;
9
9
  readonly transformFunction: GenericTransformFunction<O, TransformOutput>;
10
- constructor(sourceType: OneOrMany<ValueType<T, O>>, targetType: ValueType<TransformOutput>, transformFunction: GenericTransformFunction<O, TransformOutput>);
10
+ constructor(sourceType: OneOrMany<ValueType<T>>, targetType: AbstractConstructor<TransformOutput>, transformFunction: GenericTransformFunction<O, TransformOutput>);
11
11
  transform(value: O): TransformResult<TransformOutput>;
12
12
  }
13
- export declare function Transform<T, O, TransformOutput>(sourceType: OneOrMany<ValueType<T, O>>, targetType: ValueType, transformFunction: GenericTransformFunction<O, TransformOutput>): Decorator<'property' | 'accessor'>;
13
+ export declare function Transform<T, O, TransformOutput>(sourceType: OneOrMany<AbstractConstructor<T>>, targetType: AbstractConstructor, transformFunction: GenericTransformFunction<O, TransformOutput>): Decorator<'property' | 'accessor'>;
@@ -1 +1 @@
1
- {"version":3,"file":"generic.js","sourceRoot":"","sources":["../../../source/schema/transformers/generic.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAIzD,yDAAgD;AAChD,8CAAsE;AAEtE,oCAAkD;AAIlD,MAAa,kBAA0C,SAAQ,8BAA6C;IAK1G,YAAY,UAAsC,EAAE,UAAsC,EAAE,iBAA+D;QACzJ,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;IAC7C,CAAC;IAED,SAAS,CAAC,KAAQ;QAChB,MAAM,MAAM,GAAG,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;QAE7C,IAAI,IAAA,uBAAS,EAAC,MAAM,CAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC;SAChD;QAED,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,KAAM,EAAE,CAAC;IACjD,CAAC;CACF;AAtBD,gDAsBC;AAED,SAAgB,SAAS,CAAwB,UAAsC,EAAE,UAAqB,EAAE,iBAA+D;IAC7K,OAAO,IAAA,kDAAqC,EAAC,IAAI,kBAAkB,CAAC,UAAU,EAAE,UAAU,EAAE,iBAAiB,CAAC,CAAC,CAAC;AAClH,CAAC;AAFD,8BAEC"}
1
+ {"version":3,"file":"generic.js","sourceRoot":"","sources":["../../../source/schema/transformers/generic.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAIzD,yDAAgD;AAChD,8CAAsE;AAEtE,oCAAkD;AAIlD,MAAa,kBAA0C,SAAQ,8BAA6C;IAK1G,YAAY,UAAmC,EAAE,UAAgD,EAAE,iBAA+D;QAChK,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;IAC7C,CAAC;IAED,SAAS,CAAC,KAAQ;QAChB,MAAM,MAAM,GAAG,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;QAE7C,IAAI,IAAA,uBAAS,EAAC,MAAM,CAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC;SAChD;QAED,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,KAAM,EAAE,CAAC;IACjD,CAAC;CACF;AAtBD,gDAsBC;AAED,SAAgB,SAAS,CAAwB,UAA6C,EAAE,UAA+B,EAAE,iBAA+D;IAC9L,OAAO,IAAA,kDAAqC,EAAC,IAAI,kBAAkB,CAAC,UAAU,EAAE,UAAU,EAAE,iBAAiB,CAAC,CAAC,CAAC;AAClH,CAAC;AAFD,8BAEC"}
@@ -16,7 +16,7 @@ class LowercaseTransformer extends types_1.SchemaValueTransformer {
16
16
  }
17
17
  exports.LowercaseTransformer = LowercaseTransformer;
18
18
  function Lowercase() {
19
- return (0, decorators_1.createSchemaValueTransformerDecorator)(new LowercaseTransformer(), { type: String });
19
+ return (0, decorators_1.createSchemaValueTransformerDecorator)(new LowercaseTransformer(), { schema: (0, types_1.typeSchema)(String) });
20
20
  }
21
21
  exports.Lowercase = Lowercase;
22
22
  //# sourceMappingURL=lowercase.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"lowercase.js","sourceRoot":"","sources":["../../../source/schema/transformers/lowercase.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,8CAAsE;AAEtE,oCAAkD;AAElD,MAAa,oBAAqB,SAAQ,8BAA8C;IAAxF;;QACW,eAAU,GAAG,MAAM,CAAC;QACpB,eAAU,GAAG,MAAM,CAAC;IAK/B,CAAC;IAHC,SAAS,CAAC,KAAa;QACrB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;IACvD,CAAC;CACF;AAPD,oDAOC;AAED,SAAgB,SAAS;IACvB,OAAO,IAAA,kDAAqC,EAAC,IAAI,oBAAoB,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;AAC7F,CAAC;AAFD,8BAEC"}
1
+ {"version":3,"file":"lowercase.js","sourceRoot":"","sources":["../../../source/schema/transformers/lowercase.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,8CAAsE;AAEtE,oCAA8D;AAE9D,MAAa,oBAAqB,SAAQ,8BAA8C;IAAxF;;QACW,eAAU,GAAG,MAAM,CAAC;QACpB,eAAU,GAAG,MAAM,CAAC;IAK/B,CAAC;IAHC,SAAS,CAAC,KAAa;QACrB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;IACvD,CAAC;CACF;AAPD,oDAOC;AAED,SAAgB,SAAS;IACvB,OAAO,IAAA,kDAAqC,EAAC,IAAI,oBAAoB,EAAE,EAAE,EAAE,MAAM,EAAE,IAAA,kBAAU,EAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAC3G,CAAC;AAFD,8BAEC"}
@@ -16,7 +16,7 @@ class TrimTransformer extends types_1.SchemaValueTransformer {
16
16
  }
17
17
  exports.TrimTransformer = TrimTransformer;
18
18
  function Trim() {
19
- return (0, decorators_1.createSchemaValueTransformerDecorator)(new TrimTransformer(), { type: String });
19
+ return (0, decorators_1.createSchemaValueTransformerDecorator)(new TrimTransformer(), { schema: (0, types_1.typeSchema)(String) });
20
20
  }
21
21
  exports.Trim = Trim;
22
22
  //# sourceMappingURL=trim.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"trim.js","sourceRoot":"","sources":["../../../source/schema/transformers/trim.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,8CAAsE;AAEtE,oCAAkD;AAElD,MAAa,eAAgB,SAAQ,8BAA8C;IAAnF;;QACW,eAAU,GAAG,MAAM,CAAC;QACpB,eAAU,GAAG,MAAM,CAAC;IAK/B,CAAC;IAHC,SAAS,CAAC,KAAa;QACrB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;IAChD,CAAC;CACF;AAPD,0CAOC;AAED,SAAgB,IAAI;IAClB,OAAO,IAAA,kDAAqC,EAAC,IAAI,eAAe,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;AACxF,CAAC;AAFD,oBAEC"}
1
+ {"version":3,"file":"trim.js","sourceRoot":"","sources":["../../../source/schema/transformers/trim.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,8CAAsE;AAEtE,oCAA8D;AAE9D,MAAa,eAAgB,SAAQ,8BAA8C;IAAnF;;QACW,eAAU,GAAG,MAAM,CAAC;QACpB,eAAU,GAAG,MAAM,CAAC;IAK/B,CAAC;IAHC,SAAS,CAAC,KAAa;QACrB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;IAChD,CAAC;CACF;AAPD,0CAOC;AAED,SAAgB,IAAI;IAClB,OAAO,IAAA,kDAAqC,EAAC,IAAI,eAAe,EAAE,EAAE,EAAE,MAAM,EAAE,IAAA,kBAAU,EAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AACtG,CAAC;AAFD,oBAEC"}
@@ -16,7 +16,7 @@ class UppercaseTransformer extends types_1.SchemaValueTransformer {
16
16
  }
17
17
  exports.UppercaseTransformer = UppercaseTransformer;
18
18
  function Uppercase() {
19
- return (0, decorators_1.createSchemaValueTransformerDecorator)(new UppercaseTransformer(), { type: String });
19
+ return (0, decorators_1.createSchemaValueTransformerDecorator)(new UppercaseTransformer(), { schema: (0, types_1.typeSchema)(String) });
20
20
  }
21
21
  exports.Uppercase = Uppercase;
22
22
  //# sourceMappingURL=uppercase.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"uppercase.js","sourceRoot":"","sources":["../../../source/schema/transformers/uppercase.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,8CAAsE;AAEtE,oCAAkD;AAElD,MAAa,oBAAqB,SAAQ,8BAA8C;IAAxF;;QACW,eAAU,GAAG,MAAM,CAAC;QACpB,eAAU,GAAG,MAAM,CAAC;IAK/B,CAAC;IAHC,SAAS,CAAC,KAAa;QACrB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;IACvD,CAAC;CACF;AAPD,oDAOC;AAED,SAAgB,SAAS;IACvB,OAAO,IAAA,kDAAqC,EAAC,IAAI,oBAAoB,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;AAC7F,CAAC;AAFD,8BAEC"}
1
+ {"version":3,"file":"uppercase.js","sourceRoot":"","sources":["../../../source/schema/transformers/uppercase.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,8CAAsE;AAEtE,oCAA8D;AAE9D,MAAa,oBAAqB,SAAQ,8BAA8C;IAAxF;;QACW,eAAU,GAAG,MAAM,CAAC;QACpB,eAAU,GAAG,MAAM,CAAC;IAK/B,CAAC;IAHC,SAAS,CAAC,KAAa;QACrB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;IACvD,CAAC;CACF;AAPD,oDAOC;AAED,SAAgB,SAAS;IACvB,OAAO,IAAA,kDAAqC,EAAC,IAAI,oBAAoB,EAAE,EAAE,EAAE,MAAM,EAAE,IAAA,kBAAU,EAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAC3G,CAAC;AAFD,8BAEC"}