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) {
return (
prop.typeSimple.endsWith('?') ||
((prop.typeSimple === 'string' || prop.typeSimple.includes('enum')) && !prop.isRequired)
);
const { isRequired, typeSimple } = prop;
if (typeSimple === 'string' || typeSimple.includes('enum')) {
return !isRequired;
} else {
return typeSimple.endsWith('?');
}
}
export function parseBaseTypeWithGenericTypes(type: string): string[] {

Loading…
Cancel
Save