Browse Source

Merge pull request #5295 from abpframework/fix/5291

Avoided recursive types to cause an infinite loop in proxy generator schematics
pull/5310/head
Levent Arman Özak 6 years ago
committed by GitHub
parent
commit
33130f0756
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  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