@buka/nestjs-kit 4.3.0 → 4.3.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.
package/dist/index.mjs CHANGED
@@ -2608,6 +2608,7 @@ function Jsonb(options) {
2608
2608
  * 瞬态属性装饰器,标记属性不持久化到数据库。
2609
2609
  *
2610
2610
  * 等效于 MikroORM `@Property({ persist: false })`,适用于仅在运行时使用的计算属性。
2611
+ * 同时向 ModelRegister 注册,以便类型系统正确识别该属性。
2611
2612
  *
2612
2613
  * @param options - 必须通过 `type` 指定属性类型(MikroORM v7 要求)
2613
2614
  *
@@ -2621,10 +2622,17 @@ function Jsonb(options) {
2621
2622
  * ```
2622
2623
  */
2623
2624
  function Transient(options) {
2624
- return Property$1({
2625
- persist: false,
2626
- type: options.type
2627
- });
2625
+ return (target, propertyName) => {
2626
+ ModelRegister.addProperty(target.constructor, propertyName, {
2627
+ kind: "scalar",
2628
+ optional: false,
2629
+ lazy: false
2630
+ });
2631
+ return Property$1({
2632
+ persist: false,
2633
+ type: options.type
2634
+ })(target, propertyName);
2635
+ };
2628
2636
  }
2629
2637
  //#endregion
2630
2638
  //#region src/modules/mikro-orm/decorators/columns/embedded.column.ts