Typed Dependency Injection tokens.
Each token is a unique Symbol used to register and resolve a service from the DIContainer. Centralising them here avoids "magic" inline Symbol literals and guarantees consistent identifiers across the whole application.
ISMS Policy: AC-003 (Least Privilege), SC-002 (Input Validation)
import { TOKENS } from './tokens.js';import { container } from './container.js';const metricsService = container.resolve<MetricsService>(TOKENS.MetricsService); Copy
import { TOKENS } from './tokens.js';import { container } from './container.js';const metricsService = container.resolve<MetricsService>(TOKENS.MetricsService);
Typed Dependency Injection tokens.
Each token is a unique Symbol used to register and resolve a service from the DIContainer. Centralising them here avoids "magic" inline Symbol literals and guarantees consistent identifiers across the whole application.
ISMS Policy: AC-003 (Least Privilege), SC-002 (Input Validation)
Example