Functions

@system-inc/base-foundation · 515c140 · 3 symbols

Records that ctor is a member of the module named by moduleKey. A class belongs to exactly one module — declaring a second, different module throws.

called by the injectable-family class decorators

declareModuleMembership(ctor: AnyClass, moduleKey: BaseModuleKey<unknown>): void

View source ↗

Gets the type or token that caused the injection error.

We could modify tsyringe to return the extact token in the error, but this is a workaround for now.

extractTypeOrTokenFromErrorMessage(message: string): string | null

View source ↗

The module key ctor declared membership in, or undefined if it never declared one. Walks the prototype chain, so a subclass inherits its base class's membership unless it declares its own.

getModuleMembership(ctor: AnyClass): BaseModuleKey<unknown> | undefined

View source ↗