Browse Source

chore: updates cjs build

e22m4u 1 year ago
parent
commit
de6340f3ac
1 changed files with 6 additions and 3 deletions
  1. 6 3
      src/service-container.js

+ 6 - 3
src/service-container.js

@@ -1,3 +1,4 @@
+import {Service} from './service.js';
 import {InvalidArgumentError} from './errors/index.js';
 
 /**
@@ -63,7 +64,9 @@ export class ServiceContainer {
     // новый экземпляр
     if (!service || args.length) {
       service =
-        ctor.kind === 'Service' ? new ctor(this, ...args) : new ctor(...args);
+        ctor.kind === Service.kind
+          ? new ctor(this, ...args)
+          : new ctor(...args);
       this._services.set(ctor, service);
       // instantiates from a factory function
     } else if (typeof service === 'function') {
@@ -100,7 +103,7 @@ export class ServiceContainer {
         ctor,
       );
     const factory = () =>
-      ctor.kind === 'Service' ? new ctor(this, ...args) : new ctor(...args);
+      ctor.kind === Service.kind ? new ctor(this, ...args) : new ctor(...args);
     this._services.set(ctor, factory);
     return this;
   }
@@ -120,7 +123,7 @@ export class ServiceContainer {
         ctor,
       );
     const service =
-      ctor.kind === 'Service' ? new ctor(this, ...args) : new ctor(...args);
+      ctor.kind === Service.kind ? new ctor(this, ...args) : new ctor(...args);
     this._services.set(ctor, service);
     return this;
   }