Browse Source

update: readability

pull/22120/head
sumeyye 2 years ago
parent
commit
afc6454ea7
  1. 10
      npm/ng-packs/packages/schematics/src/utils/model.ts

10
npm/ng-packs/packages/schematics/src/utils/model.ts

@ -187,10 +187,12 @@ export function createRefToImportReducerCreator(params: ModelGeneratorParams) {
} }
function isOptionalProperty(prop: PropertyDef) { function isOptionalProperty(prop: PropertyDef) {
return ( const { isRequired, typeSimple } = prop;
prop.typeSimple.endsWith('?') || if (typeSimple === 'string' || typeSimple.includes('enum')) {
((prop.typeSimple === 'string' || prop.typeSimple.includes('enum')) && !prop.isRequired) return !isRequired;
); } else {
return typeSimple.endsWith('?');
}
} }
export function parseBaseTypeWithGenericTypes(type: string): string[] { export function parseBaseTypeWithGenericTypes(type: string): string[] {

Loading…
Cancel
Save