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I,CAC5B,CAAC,SAAS,OAAO,GAAG,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,GAAG,KAAK,CAC/C,SAAS,CAAC,KAAK,EAAE,MAAM,OAAO,KAAK,IAAI,GAAG,OAAO,GAAG,KAAK,CAAC;AAE3D,KAAK,oBAAoB,CAAC,SAAS,SAAS,SAAS,cAAc,EAAE,IAAI,mBAAmB,CAAC,YAAY,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAE9H;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,SAAS,SAAS,CAAC,cAAc,EAAE,cAAc,EAAE,GAAG,cAAc,EAAE,CAAC,EAC/G,GAAG,QAAQ,EAAE,SAAS,GACrB,cAAc,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC,CAkBjD;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,WAAW,CAAC,KAAK,SAAS,cAAc,EAAE,OAAO,EAAE,KAAK,GAAG,cAAc,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CA6BtH"} |
@@ -27,3 +27,3 @@ import { appendClassValidationRule, appendDtoFieldValidationRule, defineDtoFieldBindingMetadata, getClassValidationRules, getDtoBindingSchema, getDtoValidationSchema } from '@fluojs/core/internal'; | ||
| } | ||
| function copyDtoMetadata(source, target, include) { | ||
| function copyDtoMetadata(source, target, include, copyClassRules = false) { | ||
| for (const entry of getDtoBindingSchema(source)) { | ||
@@ -43,4 +43,6 @@ if (!include(entry.propertyKey)) { | ||
| } | ||
| for (const rule of getClassValidationRules(source)) { | ||
| appendClassValidationRule(target, rule); | ||
| if (copyClassRules) { | ||
| for (const rule of getClassValidationRules(source)) { | ||
| appendClassValidationRule(target, rule); | ||
| } | ||
| } | ||
@@ -155,3 +157,3 @@ } | ||
| for (const BaseDto of baseDtos) { | ||
| copyDtoMetadata(BaseDto, IntersectionDto, () => true); | ||
| copyDtoMetadata(BaseDto, IntersectionDto, () => true, true); | ||
| } | ||
@@ -206,6 +208,3 @@ return IntersectionDto; | ||
| } | ||
| for (const rule of getClassValidationRules(BaseDto)) { | ||
| appendClassValidationRule(PartialDto, rule); | ||
| } | ||
| return PartialDto; | ||
| } |
+2
-2
@@ -12,3 +12,3 @@ { | ||
| ], | ||
| "version": "1.0.0", | ||
| "version": "1.0.1", | ||
| "private": false, | ||
@@ -46,3 +46,3 @@ "license": "MIT", | ||
| "validator": "^13.15.26", | ||
| "@fluojs/core": "^1.0.0" | ||
| "@fluojs/core": "^1.0.1" | ||
| }, | ||
@@ -49,0 +49,0 @@ "devDependencies": { |
+5
-0
@@ -116,2 +116,7 @@ # @fluojs/validation | ||
| Mapped DTO helper는 위와 같은 문서화된 subclassing 패턴에서도 field-level | ||
| validation 및 binding metadata를 보존합니다. `PickType`, `OmitType`, | ||
| `PartialType`은 생략되었거나 optional이 된 필드에 의존할 수 있는 base | ||
| class-level validator를 derived DTO로 전달하지 않습니다. | ||
| ### Standard Schema 지원 | ||
@@ -118,0 +123,0 @@ |
+5
-0
@@ -120,2 +120,7 @@ # @fluojs/validation | ||
| Mapped DTO helpers preserve field-level validation and binding metadata through | ||
| the documented subclassing pattern shown above. `PickType`, `OmitType`, and | ||
| `PartialType` do not carry base class-level validators onto derived DTOs because | ||
| those validators can depend on fields that were omitted or made optional. | ||
| ### Standard Schema support | ||
@@ -122,0 +127,0 @@ |
107150
0.55%179
2.87%2304
-0.04%Updated