@e22m4u/js-repository 0.1.22 → 0.1.24
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/dist/cjs/index.cjs
CHANGED
|
@@ -5611,13 +5611,11 @@ var init_adapter = __esm({
|
|
|
5611
5611
|
init_decorator();
|
|
5612
5612
|
Adapter = class _Adapter extends Service {
|
|
5613
5613
|
/**
|
|
5614
|
-
*
|
|
5614
|
+
* Kind.
|
|
5615
5615
|
*
|
|
5616
5616
|
* @type {string}
|
|
5617
5617
|
*/
|
|
5618
|
-
|
|
5619
|
-
return _Adapter.name;
|
|
5620
|
-
}
|
|
5618
|
+
static kind = _Adapter.name;
|
|
5621
5619
|
/**
|
|
5622
5620
|
* Settings.
|
|
5623
5621
|
*
|
|
@@ -6202,7 +6200,7 @@ function findAdapterCtorInModule(module2) {
|
|
|
6202
6200
|
if (!module2 || typeof module2 !== "object" || Array.isArray(module2)) return;
|
|
6203
6201
|
for (const ctor of Object.values(module2)) {
|
|
6204
6202
|
console.log(ctor);
|
|
6205
|
-
if (typeof ctor === "function" && ctor.
|
|
6203
|
+
if (typeof ctor === "function" && ctor.kind === Adapter.name) {
|
|
6206
6204
|
adapterCtor = ctor;
|
|
6207
6205
|
break;
|
|
6208
6206
|
}
|
package/package.json
CHANGED
|
@@ -55,12 +55,7 @@ function findAdapterCtorInModule(module) {
|
|
|
55
55
|
if (!module || typeof module !== 'object' || Array.isArray(module)) return;
|
|
56
56
|
for (const ctor of Object.values(module)) {
|
|
57
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
|
+
if (typeof ctor === 'function' && ctor.kind === Adapter.name) {
|
|
64
59
|
adapterCtor = ctor;
|
|
65
60
|
break;
|
|
66
61
|
}
|
package/src/adapter/adapter.js
CHANGED
|
@@ -15,13 +15,11 @@ import {PropertyUniquenessDecorator} from './decorator/index.js';
|
|
|
15
15
|
*/
|
|
16
16
|
export class Adapter extends Service {
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* Kind.
|
|
19
19
|
*
|
|
20
20
|
* @type {string}
|
|
21
21
|
*/
|
|
22
|
-
|
|
23
|
-
return Adapter.name;
|
|
24
|
-
}
|
|
22
|
+
static kind = Adapter.name;
|
|
25
23
|
|
|
26
24
|
/**
|
|
27
25
|
* Settings.
|
|
@@ -15,6 +15,14 @@ import {PropertyUniquenessDecorator} from './decorator/index.js';
|
|
|
15
15
|
const sandbox = chai.spy.sandbox();
|
|
16
16
|
|
|
17
17
|
describe('Adapter', function () {
|
|
18
|
+
it('exposes static property "kind"', function () {
|
|
19
|
+
expect(Adapter.kind).to.be.eq(Adapter.name);
|
|
20
|
+
const MyAdapter1 = class extends Adapter {};
|
|
21
|
+
expect(MyAdapter1.kind).to.be.eq(Adapter.name);
|
|
22
|
+
class MyAdapter2 extends Adapter {}
|
|
23
|
+
expect(MyAdapter2.kind).to.be.eq(Adapter.name);
|
|
24
|
+
});
|
|
25
|
+
|
|
18
26
|
describe('constructor', function () {
|
|
19
27
|
afterEach(function () {
|
|
20
28
|
sandbox.restore();
|