Browse Source

fix: skip property if ref is same as interface ref

pull/5295/head
Arman Ozak 6 years ago
parent
commit
f540ed503f
  1. 6
      npm/ng-packs/packages/schematics/src/utils/model.ts

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

@ -133,7 +133,11 @@ export function createImportRefToInterfaceReducerCreator(params: ModelGeneratorP
return _interface.properties
.reduce<string[]>((refs, prop) => {
prop.refs.forEach(type => !types[type]?.isEnum && refs.push(type));
prop.refs.forEach(type => {
if (types[type]?.isEnum || type === _interface.ref) return;
refs.push(type);
});
return refs;
}, [])
.concat(base ? parseGenerics(typeDef.baseType!).toGenerics() : [])

Loading…
Cancel
Save