(binding: Readonly<Binding<unknown>>)
| 720 | * @param binding - Binding object |
| 721 | */ |
| 722 | export function inspectInjections(binding: Readonly<Binding<unknown>>) { |
| 723 | const json: JSONObject = {}; |
| 724 | const ctor = binding.valueConstructor ?? binding.providerConstructor; |
| 725 | if (ctor == null) return json; |
| 726 | const constructorInjections = describeInjectedArguments(ctor, '').map( |
| 727 | inspectInjection, |
| 728 | ); |
| 729 | if (constructorInjections.length) { |
| 730 | json.constructorArguments = constructorInjections; |
| 731 | } |
| 732 | const propertyInjections = describeInjectedProperties(ctor.prototype); |
| 733 | const properties: JSONObject = {}; |
| 734 | for (const p in propertyInjections) { |
| 735 | properties[p] = inspectInjection(propertyInjections[p]); |
| 736 | } |
| 737 | if (Object.keys(properties).length) { |
| 738 | json.properties = properties; |
| 739 | } |
| 740 | return json; |
| 741 | } |
| 742 | |
| 743 | /** |
| 744 | * Inspect an injection |
no test coverage detected