From 911cffd55881ffa5ca92e3332c411b2d29659746 Mon Sep 17 00:00:00 2001 From: sumeyye Date: Tue, 21 Jan 2025 10:31:50 +0300 Subject: [PATCH] fix: use `isRequired` value directly to determine the property status --- npm/ng-packs/packages/schematics/src/utils/model.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/schematics/src/utils/model.ts b/npm/ng-packs/packages/schematics/src/utils/model.ts index 119323e95d..a1485858d4 100644 --- a/npm/ng-packs/packages/schematics/src/utils/model.ts +++ b/npm/ng-packs/packages/schematics/src/utils/model.ts @@ -182,7 +182,7 @@ export function createRefToImportReducerCreator(params: ModelGeneratorParams) { } function isOptionalProperty(prop: PropertyDef) { - return prop.typeSimple.endsWith('?') || (prop.typeSimple === 'string' && !prop.isRequired); + return prop.typeSimple.endsWith('?') || !prop.isRequired; } export function parseBaseTypeWithGenericTypes(type: string): string[] {