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

Function provider

packages/context/src/binding-decorator.ts:101–115  ·  view source on GitHub ↗
(
    ...specs: BindingSpec[]
  )

Source from the content-addressed store, hash-verified

99 * A list of binding scope/tags or template functions to configure the binding
100 */
101 export function provider(
102 ...specs: BindingSpec[]
103 ): (target: Constructor<unknown>) => void {
104 return (target: Constructor<unknown>) => {
105 if (!isProviderClass(target)) {
106 throw new Error(`Target ${target} is not a Provider`);
107 }
108 injectable(
109 // Set up the default for providers
110 asProvider(target),
111 // Call other template functions
112 ...specs,
113 )(target);
114 };
115 }
116}
117
118/**

Callers

nothing calls this directly

Calls 3

isProviderClassFunction · 0.90
asProviderFunction · 0.90
injectableFunction · 0.85

Tested by

no test coverage detected