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

Function getNamespace

packages/context/src/binding-inspector.ts:302–309  ·  view source on GitHub ↗

* Find/infer binding key namespace for a type * @param type - Artifact type, such as `controller`, `datasource`, or `server` * @param typeNamespaces - An object mapping type names to namespaces

(type: string, typeNamespaces = DEFAULT_TYPE_NAMESPACES)

Source from the content-addressed store, hash-verified

300 * @param typeNamespaces - An object mapping type names to namespaces
301 */
302function getNamespace(type: string, typeNamespaces = DEFAULT_TYPE_NAMESPACES) {
303 if (type in typeNamespaces) {
304 return typeNamespaces[type];
305 } else {
306 // Return the plural form
307 return `${type}s`;
308 }
309}
310
311/**
312 * Build the binding key for a class with optional binding metadata.

Callers 1

buildBindingKeyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected