UNPKG

@dudousxd/nestjs-diagnostics

Version:

A standard convention for @dudousxd/nestjs-* libs to emit observability events over node:diagnostics_channel.

16 lines • 873 B
/** * The stable DI token for the capability `<lib>:<name>`, built from the canonical * `@dudousxd/nestjs-<lib>:<name>` name. Because it goes through the global symbol * registry (`Symbol.for`), a producer and a consumer living in different libs — * neither importing the other — resolve the SAME symbol. Mirrors the event * transport's `channelName(lib, event)`, on the other side of the same protocol. * * The naming is a convention, not an exclusive factory: a token spelled by hand * with the same string IS the same symbol, which is what lets a lib adopt this * without a breaking change. `CONTEXT_ACCESSOR` in `context-accessor.ts` is * exactly that case — `capability('context', 'accessor')` resolves to it. */ export function capability(lib, name) { return Symbol.for(`@dudousxd/nestjs-${lib}:${name}`); } //# sourceMappingURL=capability.js.map