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

Function asProvider

packages/context/src/binding-inspector.ts:81–89  ·  view source on GitHub ↗
(
  target: Constructor<Provider<T>>,
)

Source from the content-addressed store, hash-verified

79 * @typeParam T - Value type
80 */
81export function asProvider<T>(
82 target: Constructor<Provider<T>>,
83): BindingTemplate<T> {
84 return function bindAsProvider(binding) {
85 binding.toProvider(target).tag(ContextTags.PROVIDER, {
86 [ContextTags.TYPE]: ContextTags.PROVIDER,
87 });
88 };
89}
90
91/**
92 * A factory function to create a template function to bind the target class

Callers 2

providerFunction · 0.90
asClassOrProviderFunction · 0.85

Calls 2

tagMethod · 0.80
toProviderMethod · 0.80

Tested by

no test coverage detected