We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent afc6454 commit e996cf9Copy full SHA for e996cf9
npm/ng-packs/packages/schematics/src/utils/model.ts
@@ -187,12 +187,10 @@ export function createRefToImportReducerCreator(params: ModelGeneratorParams) {
187
}
188
189
function isOptionalProperty(prop: PropertyDef) {
190
- const { isRequired, typeSimple } = prop;
191
- if (typeSimple === 'string' || typeSimple.includes('enum')) {
192
- return !isRequired;
193
- } else {
194
- return typeSimple.endsWith('?');
195
- }
+ return (
+ prop.typeSimple.endsWith('?') ||
+ ((prop.typeSimple === 'string' || prop.typeSimple.includes('enum')) && !prop.isRequired)
+ );
196
197
198
export function parseBaseTypeWithGenericTypes(type: string): string[] {
0 commit comments