zazoomauro/node-dependency-injection

View on GitHub
lib/CompilerPass/RemovePass.js

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
export default class RemovePass {
  /**
   * @param {ContainerBuilder} container
   */
  async process (container) {
    for (const [id, definition] of container.definitions) {
      if (definition.public === false) {
        container.remove(id)
      }
    }
  }
}