@e22m4u/js-repository-mongodb-adapter 0.6.3 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -292,17 +292,19 @@ var _ServiceContainer = class _ServiceContainer {
292
292
  "The first argument of ServicesContainer.get must be a class constructor, but %v given.",
293
293
  ctor
294
294
  );
295
- if (!this._services.has(ctor) && this._parent && this._parent.has(ctor)) {
296
- return this._parent.get(ctor);
297
- }
295
+ const isCtorRegistered = this._services.has(ctor);
298
296
  let service = this._services.get(ctor);
297
+ let inheritedCtor = void 0;
299
298
  if (!service) {
300
299
  const ctors = this._services.keys();
301
- const inheritedCtor = ctors.find((v) => v.prototype instanceof ctor);
302
- if (inheritedCtor) {
303
- service = this._services.get(inheritedCtor);
304
- ctor = inheritedCtor;
305
- }
300
+ const inheritedCtor2 = ctors.find((v) => v.prototype instanceof ctor);
301
+ if (inheritedCtor2) service = this._services.get(inheritedCtor2);
302
+ }
303
+ if (!service && !isCtorRegistered && !inheritedCtor && this._parent && this._parent.has(ctor)) {
304
+ return this._parent.get(ctor, ...args);
305
+ }
306
+ if (!service && !isCtorRegistered && inheritedCtor) {
307
+ ctor = inheritedCtor;
306
308
  }
307
309
  if (!service || args.length) {
308
310
  service = Array.isArray(ctor.kinds) && ctor.kinds.includes(SERVICE_CLASS_NAME) ? new ctor(this, ...args) : new ctor(...args);
@@ -337,10 +339,10 @@ var _ServiceContainer = class _ServiceContainer {
337
339
  */
338
340
  has(ctor) {
339
341
  if (this._services.has(ctor)) return true;
340
- if (this._parent) return this._parent.has(ctor);
341
342
  const ctors = this._services.keys();
342
343
  const inheritedCtor = ctors.find((v) => v.prototype instanceof ctor);
343
344
  if (inheritedCtor) return true;
345
+ if (this._parent) return this._parent.has(ctor);
344
346
  return false;
345
347
  }
346
348
  /**
@@ -558,12 +560,12 @@ var _Debuggable = class _Debuggable {
558
560
  * @returns {Function}
559
561
  */
560
562
  getDebuggerFor(method) {
561
- return this.debug.withHash().withNs(method.name);
563
+ const name = method.name || "anonymous";
564
+ return this.debug.withHash().withNs(name);
562
565
  }
563
566
  /**
564
567
  * Constructor.
565
568
  *
566
- * @param {object|undefined} container
567
569
  * @param {DebuggableOptions|undefined} options
568
570
  */
569
571
  constructor(options = void 0) {
@@ -575,10 +577,12 @@ var _Debuggable = class _Debuggable {
575
577
  } else {
576
578
  this.debug = createDebugger(className);
577
579
  }
578
- const noEnvNs = Boolean(options.noEnvNs);
579
- if (noEnvNs) this.debug = this.debug.withoutEnvNs();
580
+ const noEnvironmentNamespace = Boolean(options.noEnvironmentNamespace);
581
+ if (noEnvironmentNamespace) this.debug = this.debug.withoutEnvNs();
580
582
  this.ctorDebug = this.debug.withNs("constructor").withHash();
581
- this.ctorDebug(_Debuggable.INSTANTIATION_MESSAGE);
583
+ const noInstantiationMessage = Boolean(options.noInstantiationMessage);
584
+ if (!noInstantiationMessage)
585
+ this.ctorDebug(_Debuggable.INSTANTIATION_MESSAGE);
582
586
  }
583
587
  };
584
588
  __name(_Debuggable, "Debuggable");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e22m4u/js-repository-mongodb-adapter",
3
- "version": "0.6.3",
3
+ "version": "0.7.0",
4
4
  "description": "MongoDB адаптер для @e22m4u/js-repository",
5
5
  "author": "Mikhail Evstropov <e22m4u@yandex.ru>",
6
6
  "license": "MIT",
@@ -38,28 +38,28 @@
38
38
  "prepare": "husky"
39
39
  },
40
40
  "dependencies": {
41
- "mongodb": "6.19.0"
41
+ "mongodb": "6.20.0"
42
42
  },
43
43
  "peerDependencies": {
44
- "@e22m4u/js-format": "~0.1.0",
45
- "@e22m4u/js-repository": "~0.5.0"
44
+ "@e22m4u/js-format": "~0.2.0",
45
+ "@e22m4u/js-repository": "~0.6.0"
46
46
  },
47
47
  "devDependencies": {
48
- "@commitlint/cli": "~19.8.1",
49
- "@commitlint/config-conventional": "~19.8.1",
50
- "@eslint/js": "~9.34.0",
48
+ "@commitlint/cli": "~20.1.0",
49
+ "@commitlint/config-conventional": "~20.0.0",
50
+ "@eslint/js": "~9.38.0",
51
51
  "c8": "~10.1.3",
52
- "chai": "~6.0.1",
52
+ "chai": "~6.2.0",
53
53
  "chai-as-promised": "~8.0.2",
54
- "dotenv": "~17.2.1",
55
- "esbuild": "~0.25.9",
56
- "eslint": "~9.34.0",
54
+ "dotenv": "~17.2.3",
55
+ "esbuild": "~0.25.11",
56
+ "eslint": "~9.38.0",
57
57
  "eslint-config-prettier": "~10.1.8",
58
58
  "eslint-plugin-chai-expect": "~3.1.0",
59
- "eslint-plugin-mocha": "~11.1.0",
60
- "globals": "~16.3.0",
59
+ "eslint-plugin-mocha": "~11.2.0",
60
+ "globals": "~16.4.0",
61
61
  "husky": "~9.1.7",
62
- "mocha": "~11.7.1",
62
+ "mocha": "~11.7.4",
63
63
  "prettier": "~3.6.2",
64
64
  "rimraf": "~6.0.1"
65
65
  }
@@ -19,9 +19,9 @@ import {InvalidOperatorValueError} from '@e22m4u/js-repository';
19
19
 
20
20
  /**
21
21
  * Mongodb option names.
22
- * 6.19.0
22
+ * 6.20
23
23
  *
24
- * https://mongodb.github.io/node-mongodb-native/6.19/interfaces/MongoClientOptions.html
24
+ * https://mongodb.github.io/node-mongodb-native/6.20/interfaces/MongoClientOptions.html
25
25
  *
26
26
  * @type {string[]}
27
27
  */