Skip to content

Commit

Permalink
Merge pull request #291 from romamd/fix-issue-275
Browse files Browse the repository at this point in the history
Fix issue #275: Unable to app.get(ConfigService) in main.ts with node 12.16
  • Loading branch information
bashleigh authored Apr 3, 2020
2 parents 5453a55 + d628b6a commit 8a4002a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/decorators/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const ProxyProperty = (propertyName: string) =>
function classDecorator<T extends { new (...args: any[]): {} }>(
constructor: T,
) {
return class extends constructor {
const decorated = class extends constructor {
constructor(...args: any[]) {
super(...args);

Expand All @@ -22,4 +22,9 @@ export const ProxyProperty = (propertyName: string) =>
});
}
};
/**
* fix for node 12.16.0 issue: https://github.com/microsoft/TypeScript/issues/37157
* */
Object.defineProperty(decorated, 'name', { value: constructor.name });
return decorated;
};

0 comments on commit 8a4002a

Please sign in to comment.