* 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)
| 300 | * @param typeNamespaces - An object mapping type names to namespaces |
| 301 | */ |
| 302 | function 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. |