@e22m4u/js-repository 0.1.21 → 0.1.22

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e22m4u/js-repository",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
4
4
  "description": "Модуль для работы с базами данных для Node.js",
5
5
  "type": "module",
6
6
  "types": "./src/index.d.ts",
@@ -18,8 +18,8 @@
18
18
  "lint": "tsc && eslint ./src",
19
19
  "lint:fix": "tsc && eslint ./src --fix",
20
20
  "format": "prettier --write \"./src/**/*.js\"",
21
- "test": "npm run lint && c8 --reporter=text-summary mocha",
22
- "test:coverage": "npm run lint && c8 --reporter=text mocha",
21
+ "test": "npm run lint && c8 --reporter=text-summary mocha --bail",
22
+ "test:coverage": "npm run lint && c8 --reporter=text mocha --bail",
23
23
  "build:cjs": "node build-cjs.js",
24
24
  "prepare": "husky"
25
25
  },
@@ -54,7 +54,13 @@ function findAdapterCtorInModule(module) {
54
54
  let adapterCtor;
55
55
  if (!module || typeof module !== 'object' || Array.isArray(module)) return;
56
56
  for (const ctor of Object.values(module)) {
57
- if (typeof ctor === 'function' && ctor.prototype instanceof Adapter) {
57
+ console.log(ctor);
58
+ if (
59
+ typeof ctor === 'function' &&
60
+ ctor.prototype &&
61
+ typeof ctor.prototype === 'object' &&
62
+ ctor.prototype.className === Adapter.name
63
+ ) {
58
64
  adapterCtor = ctor;
59
65
  break;
60
66
  }
@@ -14,6 +14,15 @@ import {PropertyUniquenessDecorator} from './decorator/index.js';
14
14
  * Adapter.
15
15
  */
16
16
  export class Adapter extends Service {
17
+ /**
18
+ * Class name.
19
+ *
20
+ * @type {string}
21
+ */
22
+ get className() {
23
+ return Adapter.name;
24
+ }
25
+
17
26
  /**
18
27
  * Settings.
19
28
  *