| 76 | return false; |
| 77 | }, |
| 78 | get(target, prop, receiver) { |
| 79 | const project = target.currentProject; |
| 80 | if (project[prop as keyof P]) { |
| 81 | const value = project[prop as keyof P]; |
| 82 | if (value instanceof Function) { |
| 83 | return value.bind(project); |
| 84 | } |
| 85 | |
| 86 | return value; |
| 87 | } |
| 88 | /* |
| 89 | * It would be nice to limit this to `serviceKeys` but there are issues with |
| 90 | * nestjs scheduler reflecting and being unable to get props. |
| 91 | * If we can fix that then we can move this above the project accessors |
| 92 | */ |
| 93 | if (prop in target /*(serviceKeys as Array<string | symbol>).includes(prop)*/) { |
| 94 | const result = target[prop as keyof IProjectUpgradeService<P>]; |
| 95 | |
| 96 | if (result instanceof Function) { |
| 97 | return result.bind(target); |
| 98 | } |
| 99 | |
| 100 | return result; |
| 101 | } |
| 102 | }, |
| 103 | }); |
| 104 | } |
| 105 | |