Browse Source

fix: exit recursive interface generation when ref is cyclic

pull/5786/head
Arman Ozak 6 years ago
parent
commit
76417a276c
  1. 3
      npm/ng-packs/packages/schematics/src/utils/model.ts

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

@ -134,7 +134,8 @@ export function createImportRefToInterfaceReducerCreator(params: ModelGeneratorP
return _interface.properties
.reduce<string[]>((refs, prop) => {
prop.refs.forEach(type => {
if (types[type]?.isEnum || type === _interface.ref) return;
if (types[type]?.isEnum) return;
if (interfaces.some(i => i.ref === type)) return;
refs.push(type);
});

Loading…
Cancel
Save