MCPcopy Index your code
hub / github.com/loopbackio/loopback-next / inspectInjections

Function inspectInjections

packages/context/src/inject.ts:722–741  ·  view source on GitHub ↗
(binding: Readonly<Binding<unknown>>)

Source from the content-addressed store, hash-verified

720 * @param binding - Binding object
721 */
722export 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

Callers 1

inspectMethod · 0.90

Calls 4

inspectInjectionFunction · 0.85
keysMethod · 0.65

Tested by

no test coverage detected