How to use the typedi.Container.remove function in typedi

To help you get started, we’ve selected a few typedi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wemaintain / auto-relay / packages / core / src / services / auto-relay-config.service.ts View on Github external
constructor(
    config: AutoRelayConfigArgs
  ) {
    if (!config) throw new Error(`No config supplied to AutoRelay`)
    Container.remove(PAGINATION_OBJECT, CONNECTIONARGS_OBJECT)

    this._registerOrm(config)

    if ((config as AutoRelayConfigArgsExistingModel).objects) {
      this._declareExistingObjects(config as AutoRelayConfigArgsExistingModel)
    } else {
      const configNoModel: AutoRelayConfigArgsNoModel = config;

      configNoModel.microserviceName = configNoModel.microserviceName ? String(configNoModel.microserviceName) : ''
      if ( configNoModel.microserviceName) {
        configNoModel.microserviceName =  configNoModel.microserviceName![0].toUpperCase() +  configNoModel.microserviceName!.substring(1)
      }

      AutoRelayConfig.generateObjects(config, true)
      Container.set(PREFIX, configNoModel.microserviceName)
      if (configNoModel.extends && configNoModel.extends.connection) {