react-obsidian 0.0.39 → 0.0.41
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/clearGraphs.js +2 -2
- package/dist/clearGraphs.js.map +1 -1
- package/dist/src/GraphProperties.js +9 -10
- package/dist/src/GraphProperties.js.map +1 -1
- package/dist/src/Obsidian.js +15 -18
- package/dist/src/Obsidian.js.map +1 -1
- package/dist/src/ProvidedPropertiesStore.js +13 -14
- package/dist/src/ProvidedPropertiesStore.js.map +1 -1
- package/dist/src/ReferenceCounter.js +9 -10
- package/dist/src/ReferenceCounter.js.map +1 -1
- package/dist/src/decorators/Graph.js +3 -4
- package/dist/src/decorators/Graph.js.map +1 -1
- package/dist/src/decorators/LifecycleBound.js +1 -1
- package/dist/src/decorators/LifecycleBound.js.map +1 -1
- package/dist/src/decorators/Memoize.js +3 -3
- package/dist/src/decorators/Memoize.js.map +1 -1
- package/dist/src/decorators/Singleton.js +1 -1
- package/dist/src/decorators/Singleton.js.map +1 -1
- package/dist/src/decorators/inject/Inject.js +4 -4
- package/dist/src/decorators/inject/Inject.js.map +1 -1
- package/dist/src/decorators/inject/Injectable.js +2 -2
- package/dist/src/decorators/inject/Injectable.js.map +1 -1
- package/dist/src/decorators/inject/LateInject.js +3 -3
- package/dist/src/decorators/inject/LateInject.js.map +1 -1
- package/dist/src/decorators/provides/MemoizeDescriptor.js +5 -9
- package/dist/src/decorators/provides/MemoizeDescriptor.js.map +1 -1
- package/dist/src/decorators/provides/Provides.js +3 -4
- package/dist/src/decorators/provides/Provides.js.map +1 -1
- package/dist/src/graph/ObjectGraph.js +19 -24
- package/dist/src/graph/ObjectGraph.js.map +1 -1
- package/dist/src/graph/PropertyRetriever.d.ts.map +1 -1
- package/dist/src/graph/PropertyRetriever.js +18 -23
- package/dist/src/graph/PropertyRetriever.js.map +1 -1
- package/dist/src/graph/ProviderBinder.js +3 -3
- package/dist/src/graph/ProviderBinder.js.map +1 -1
- package/dist/src/graph/ServiceLocatorFactory.js +9 -12
- package/dist/src/graph/ServiceLocatorFactory.js.map +1 -1
- package/dist/src/graph/registry/DefaultGraphResolver.js +5 -25
- package/dist/src/graph/registry/DefaultGraphResolver.js.map +1 -1
- package/dist/src/graph/registry/GraphMiddleware.js +3 -23
- package/dist/src/graph/registry/GraphMiddleware.js.map +1 -1
- package/dist/src/graph/registry/GraphMiddlewareChain.js +12 -14
- package/dist/src/graph/registry/GraphMiddlewareChain.js.map +1 -1
- package/dist/src/graph/registry/GraphRegistry.js +38 -41
- package/dist/src/graph/registry/GraphRegistry.js.map +1 -1
- package/dist/src/graph/registry/Middleware.js +11 -19
- package/dist/src/graph/registry/Middleware.js.map +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/injectors/class/ClassInjector.js +25 -40
- package/dist/src/injectors/class/ClassInjector.js.map +1 -1
- package/dist/src/injectors/class/ConstructorArgs.js +11 -12
- package/dist/src/injectors/class/ConstructorArgs.js.map +1 -1
- package/dist/src/injectors/class/InjectionMetadata.js +21 -22
- package/dist/src/injectors/class/InjectionMetadata.js.map +1 -1
- package/dist/src/injectors/class/LateInjector.js +12 -15
- package/dist/src/injectors/class/LateInjector.js.map +1 -1
- package/dist/src/injectors/components/ComponentInjector.js +18 -21
- package/dist/src/injectors/components/ComponentInjector.js.map +1 -1
- package/dist/src/injectors/components/InjectComponent.js +3 -3
- package/dist/src/injectors/components/InjectComponent.js.map +1 -1
- package/dist/src/injectors/components/PropsInjector.js +7 -9
- package/dist/src/injectors/components/PropsInjector.js.map +1 -1
- package/dist/src/injectors/components/useGraph.js +10 -10
- package/dist/src/injectors/components/useGraph.js.map +1 -1
- package/dist/src/injectors/hooks/HookInjector.js +12 -16
- package/dist/src/injectors/hooks/HookInjector.js.map +1 -1
- package/dist/src/injectors/hooks/InjectHook.js +2 -2
- package/dist/src/injectors/hooks/InjectHook.js.map +1 -1
- package/dist/src/observable/MediatorObservable.js +23 -34
- package/dist/src/observable/MediatorObservable.js.map +1 -1
- package/dist/src/observable/Observable.js +16 -22
- package/dist/src/observable/Observable.js.map +1 -1
- package/dist/src/observable/useObserver.js +4 -4
- package/dist/src/observable/useObserver.js.map +1 -1
- package/dist/src/utils/React.js +1 -1
- package/dist/src/utils/React.js.map +1 -1
- package/dist/test/fixtures/GraphWithOnBind.js +16 -36
- package/dist/test/fixtures/GraphWithOnBind.js.map +1 -1
- package/dist/test/fixtures/InjectedComponent.js +4 -7
- package/dist/test/fixtures/InjectedComponent.js.map +1 -1
- package/dist/test/fixtures/LifecycleBoundGraph.js +23 -42
- package/dist/test/fixtures/LifecycleBoundGraph.js.map +1 -1
- package/dist/test/fixtures/MainGraph.js +25 -45
- package/dist/test/fixtures/MainGraph.js.map +1 -1
- package/dist/test/fixtures/SingletonGraph.js +21 -39
- package/dist/test/fixtures/SingletonGraph.js.map +1 -1
- package/dist/test/fixtures/StringProvider.js +4 -6
- package/dist/test/fixtures/StringProvider.js.map +1 -1
- package/dist/test/fixtures/Subgraph.js +41 -61
- package/dist/test/fixtures/Subgraph.js.map +1 -1
- package/dist/test/fixtures/ThrowingMainGraph.js +15 -35
- package/dist/test/fixtures/ThrowingMainGraph.js.map +1 -1
- package/dist/test/fixtures/UniqueNumberGraph.js +27 -45
- package/dist/test/fixtures/UniqueNumberGraph.js.map +1 -1
- package/dist/testkit/index.js +12 -35
- package/dist/testkit/index.js.map +1 -1
- package/dist/transformers/babel-plugin-obsidian/helpers/index.js +11 -11
- package/dist/transformers/babel-plugin-obsidian/helpers/index.js.map +1 -1
- package/dist/transformers/babel-plugin-obsidian/index.js +8 -12
- package/dist/transformers/babel-plugin-obsidian/index.js.map +1 -1
- package/dist/transformers/babel-plugin-obsidian/unmagler/index.js +2 -2
- package/dist/transformers/babel-plugin-obsidian/unmagler/index.js.map +1 -1
- package/dist/transformers/babel-plugin-obsidian/unmagler/method.js +3 -3
- package/dist/transformers/babel-plugin-obsidian/unmagler/method.js.map +1 -1
- package/dist/transformers/babel-plugin-obsidian/unmagler/property.js +2 -2
- package/dist/transformers/babel-plugin-obsidian/unmagler/property.js.map +1 -1
- package/documentation/package-lock.json +1818 -87
- package/documentation/package.json +1 -0
- package/documentation/src/theme/SearchBar.js +22 -0
- package/package.json +2 -2
- package/src/graph/PropertyRetriever.ts +1 -4
- package/tsconfig.base.json +1 -1
- package/dist/src/graph/UnresolvedDependencyExceptionFactory.d.ts +0 -5
- package/dist/src/graph/UnresolvedDependencyExceptionFactory.d.ts.map +0 -1
- package/dist/src/graph/UnresolvedDependencyExceptionFactory.js +0 -14
- package/dist/src/graph/UnresolvedDependencyExceptionFactory.js.map +0 -1
- package/dist/test/fixtures/MissingDependencyGraph.d.ts +0 -10
- package/dist/test/fixtures/MissingDependencyGraph.d.ts.map +0 -1
- package/dist/test/fixtures/MissingDependencyGraph.js +0 -59
- package/dist/test/fixtures/MissingDependencyGraph.js.map +0 -1
- package/src/graph/UnresolvedDependencyExceptionFactory.ts +0 -8
|
@@ -1,19 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -27,37 +12,32 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
13
|
};
|
|
29
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
function MainGraph() {
|
|
37
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
38
|
-
}
|
|
39
|
-
MainGraph.prototype.someString = function (stringProvider) {
|
|
15
|
+
const src_1 = require("../../src");
|
|
16
|
+
const injectedValues_1 = __importDefault(require("./injectedValues"));
|
|
17
|
+
const StringProvider_1 = __importDefault(require("./StringProvider"));
|
|
18
|
+
const Subgraph_1 = __importDefault(require("./Subgraph"));
|
|
19
|
+
let MainGraph = class MainGraph extends src_1.ObjectGraph {
|
|
20
|
+
someString(stringProvider) {
|
|
40
21
|
return stringProvider.theString;
|
|
41
|
-
}
|
|
42
|
-
|
|
22
|
+
}
|
|
23
|
+
anotherString() {
|
|
43
24
|
return injectedValues_1.default.anotherString;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}(src_1.ObjectGraph));
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, src_1.Provides)(),
|
|
29
|
+
__metadata("design:type", Function),
|
|
30
|
+
__metadata("design:paramtypes", [StringProvider_1.default]),
|
|
31
|
+
__metadata("design:returntype", String)
|
|
32
|
+
], MainGraph.prototype, "someString", null);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, src_1.Provides)(),
|
|
35
|
+
__metadata("design:type", Function),
|
|
36
|
+
__metadata("design:paramtypes", []),
|
|
37
|
+
__metadata("design:returntype", String)
|
|
38
|
+
], MainGraph.prototype, "anotherString", null);
|
|
39
|
+
MainGraph = __decorate([
|
|
40
|
+
(0, src_1.Graph)({ subgraphs: [Subgraph_1.default] })
|
|
41
|
+
], MainGraph);
|
|
62
42
|
exports.default = MainGraph;
|
|
63
43
|
//# sourceMappingURL=MainGraph.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MainGraph.js","sourceRoot":"","sources":["../../../test/fixtures/MainGraph.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MainGraph.js","sourceRoot":"","sources":["../../../test/fixtures/MainGraph.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,mCAKmB;AACnB,sEAA8C;AAC9C,sEAA8C;AAC9C,0DAAkC;AAKnB,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,iBAAW;IAEhD,UAAU,CAAC,cAA8B;QACvC,OAAO,cAAc,CAAC,SAAS,CAAC;IAClC,CAAC;IAGD,aAAa;QACX,OAAO,wBAAc,CAAC,aAAa,CAAC;IACtC,CAAC;CACF,CAAA;AATC;IAAC,IAAA,cAAQ,GAAE;;qCACgB,wBAAc;;2CAExC;AAED;IAAC,IAAA,cAAQ,GAAE;;;;8CAGV;AATkB,SAAS;IAD7B,IAAA,WAAK,EAAC,EAAE,SAAS,EAAE,CAAC,kBAAQ,CAAC,EAAE,CAAC;GACZ,SAAS,CAU7B;kBAVoB,SAAS"}
|
|
@@ -1,19 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -24,30 +9,27 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
24
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
10
|
};
|
|
26
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
_this.id = (0, lodash_1.uniqueId)();
|
|
35
|
-
return _this;
|
|
12
|
+
const lodash_1 = require("lodash");
|
|
13
|
+
const Singleton_1 = require("../../src/decorators/Singleton");
|
|
14
|
+
const src_1 = require("../../src");
|
|
15
|
+
let SingletonGraph = class SingletonGraph extends src_1.ObjectGraph {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.id = (0, lodash_1.uniqueId)();
|
|
36
19
|
}
|
|
37
|
-
|
|
38
|
-
return
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}(src_1.ObjectGraph));
|
|
20
|
+
instanceId() {
|
|
21
|
+
return `graph${this.id}`;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, src_1.Provides)(),
|
|
26
|
+
__metadata("design:type", Function),
|
|
27
|
+
__metadata("design:paramtypes", []),
|
|
28
|
+
__metadata("design:returntype", String)
|
|
29
|
+
], SingletonGraph.prototype, "instanceId", null);
|
|
30
|
+
SingletonGraph = __decorate([
|
|
31
|
+
(0, Singleton_1.Singleton)(),
|
|
32
|
+
(0, src_1.Graph)()
|
|
33
|
+
], SingletonGraph);
|
|
52
34
|
exports.default = SingletonGraph;
|
|
53
35
|
//# sourceMappingURL=SingletonGraph.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SingletonGraph.js","sourceRoot":"","sources":["../../../test/fixtures/SingletonGraph.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SingletonGraph.js","sourceRoot":"","sources":["../../../test/fixtures/SingletonGraph.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,mCAAkC;AAClC,8DAA2D;AAC3D,mCAAyD;AAG1C,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,iBAAW;IAAxC;;QACL,OAAE,GAAG,IAAA,iBAAQ,GAAE,CAAC;IAM1B,CAAC;IAHC,UAAU;QACR,OAAO,QAAQ,IAAI,CAAC,EAAE,EAAE,CAAC;IAC3B,CAAC;CACF,CAAA;AAJC;IAAC,IAAA,cAAQ,GAAE;;;;gDAGV;AANkB,cAAc;IADlC,IAAA,qBAAS,GAAE;IAAE,IAAA,WAAK,GAAE;GACA,cAAc,CAOlC;kBAPoB,cAAc"}
|
|
@@ -3,13 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
if (theString === void 0) { theString = injectedValues_1.default.fromStringProvider; }
|
|
6
|
+
const injectedValues_1 = __importDefault(require("./injectedValues"));
|
|
7
|
+
class StringProvider {
|
|
8
|
+
constructor(theString = injectedValues_1.default.fromStringProvider) {
|
|
10
9
|
this.theString = theString;
|
|
11
10
|
}
|
|
12
|
-
|
|
13
|
-
}());
|
|
11
|
+
}
|
|
14
12
|
exports.default = StringProvider;
|
|
15
13
|
//# sourceMappingURL=StringProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StringProvider.js","sourceRoot":"","sources":["../../../test/fixtures/StringProvider.ts"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"StringProvider.js","sourceRoot":"","sources":["../../../test/fixtures/StringProvider.ts"],"names":[],"mappings":";;;;;AAAA,sEAA8C;AAE9C,MAAqB,cAAc;IACjC,YAA4B,YAAoB,wBAAc,CAAC,kBAAkB;QAArD,cAAS,GAAT,SAAS,CAA4C;IAAI,CAAC;CACvF;AAFD,iCAEC"}
|
|
@@ -1,19 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -27,55 +12,50 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
13
|
};
|
|
29
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
function Subgraph() {
|
|
37
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
38
|
-
}
|
|
39
|
-
Subgraph.prototype.stringProvider = function () {
|
|
15
|
+
const lodash_1 = require("lodash");
|
|
16
|
+
const src_1 = require("../../src");
|
|
17
|
+
const injectedValues_1 = __importDefault(require("./injectedValues"));
|
|
18
|
+
const StringProvider_1 = __importDefault(require("./StringProvider"));
|
|
19
|
+
let Subgraph = class Subgraph extends src_1.ObjectGraph {
|
|
20
|
+
stringProvider() {
|
|
40
21
|
return new StringProvider_1.default();
|
|
41
|
-
}
|
|
42
|
-
|
|
22
|
+
}
|
|
23
|
+
stringFromSubgraph() {
|
|
43
24
|
return injectedValues_1.default.fromSubgraph;
|
|
44
|
-
}
|
|
45
|
-
|
|
25
|
+
}
|
|
26
|
+
unusedDependency() {
|
|
46
27
|
throw Error('This dependency should not have been resolved since it is not required by anyone.');
|
|
47
|
-
}
|
|
48
|
-
|
|
28
|
+
}
|
|
29
|
+
instanceId() {
|
|
49
30
|
return (0, lodash_1.uniqueId)('graph');
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}(src_1.ObjectGraph));
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, src_1.Provides)(),
|
|
35
|
+
__metadata("design:type", Function),
|
|
36
|
+
__metadata("design:paramtypes", []),
|
|
37
|
+
__metadata("design:returntype", StringProvider_1.default)
|
|
38
|
+
], Subgraph.prototype, "stringProvider", null);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, src_1.Provides)(),
|
|
41
|
+
__metadata("design:type", Function),
|
|
42
|
+
__metadata("design:paramtypes", []),
|
|
43
|
+
__metadata("design:returntype", String)
|
|
44
|
+
], Subgraph.prototype, "stringFromSubgraph", null);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, src_1.Provides)(),
|
|
47
|
+
__metadata("design:type", Function),
|
|
48
|
+
__metadata("design:paramtypes", []),
|
|
49
|
+
__metadata("design:returntype", String)
|
|
50
|
+
], Subgraph.prototype, "unusedDependency", null);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, src_1.Provides)(),
|
|
53
|
+
__metadata("design:type", Function),
|
|
54
|
+
__metadata("design:paramtypes", []),
|
|
55
|
+
__metadata("design:returntype", String)
|
|
56
|
+
], Subgraph.prototype, "instanceId", null);
|
|
57
|
+
Subgraph = __decorate([
|
|
58
|
+
(0, src_1.Graph)()
|
|
59
|
+
], Subgraph);
|
|
80
60
|
exports.default = Subgraph;
|
|
81
61
|
//# sourceMappingURL=Subgraph.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Subgraph.js","sourceRoot":"","sources":["../../../test/fixtures/Subgraph.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Subgraph.js","sourceRoot":"","sources":["../../../test/fixtures/Subgraph.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,mCAAkC;AAClC,mCAAyD;AACzD,sEAA8C;AAC9C,sEAA8C;AAG/B,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,iBAAW;IAE/C,cAAc;QACZ,OAAO,IAAI,wBAAc,EAAE,CAAC;IAC9B,CAAC;IAGD,kBAAkB;QAChB,OAAO,wBAAc,CAAC,YAAY,CAAC;IACrC,CAAC;IAGD,gBAAgB;QACd,MAAM,KAAK,CAAC,mFAAmF,CAAC,CAAC;IACnG,CAAC;IAGD,UAAU;QACR,OAAO,IAAA,iBAAQ,EAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;CACF,CAAA;AAnBC;IAAC,IAAA,cAAQ,GAAE;;;oCACO,wBAAc;8CAE/B;AAED;IAAC,IAAA,cAAQ,GAAE;;;;kDAGV;AAED;IAAC,IAAA,cAAQ,GAAE;;;;gDAGV;AAED;IAAC,IAAA,cAAQ,GAAE;;;;0CAGV;AAnBkB,QAAQ;IAD5B,IAAA,WAAK,GAAE;GACa,QAAQ,CAoB5B;kBApBoB,QAAQ"}
|
|
@@ -1,19 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -27,26 +12,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
13
|
};
|
|
29
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
function ThrowingMainGraph() {
|
|
35
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
36
|
-
}
|
|
37
|
-
ThrowingMainGraph.prototype.someString = function () {
|
|
15
|
+
const src_1 = require("../../src");
|
|
16
|
+
const MainGraph_1 = __importDefault(require("./MainGraph"));
|
|
17
|
+
let ThrowingMainGraph = class ThrowingMainGraph extends MainGraph_1.default {
|
|
18
|
+
someString() {
|
|
38
19
|
throw new Error('This graph has no valid providers');
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}(MainGraph_1.default));
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, src_1.Provides)(),
|
|
24
|
+
__metadata("design:type", Function),
|
|
25
|
+
__metadata("design:paramtypes", []),
|
|
26
|
+
__metadata("design:returntype", String)
|
|
27
|
+
], ThrowingMainGraph.prototype, "someString", null);
|
|
28
|
+
ThrowingMainGraph = __decorate([
|
|
29
|
+
(0, src_1.Graph)()
|
|
30
|
+
], ThrowingMainGraph);
|
|
51
31
|
exports.default = ThrowingMainGraph;
|
|
52
32
|
//# sourceMappingURL=ThrowingMainGraph.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThrowingMainGraph.js","sourceRoot":"","sources":["../../../test/fixtures/ThrowingMainGraph.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ThrowingMainGraph.js","sourceRoot":"","sources":["../../../test/fixtures/ThrowingMainGraph.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,mCAA4C;AAC5C,4DAAoC;AAGrB,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,mBAAS;IAE7C,UAAU;QACjB,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;IACvD,CAAC;CACF,CAAA;AAJC;IAAC,IAAA,cAAQ,GAAE;;;;mDAGV;AAJkB,iBAAiB;IADrC,IAAA,WAAK,GAAE;GACa,iBAAiB,CAKrC;kBALoB,iBAAiB"}
|
|
@@ -1,19 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -25,38 +10,35 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
25
10
|
};
|
|
26
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
12
|
exports.UniqueNumberGraph = void 0;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
_this.uniqueNumberGenerator = uniqueNumberGenerator;
|
|
34
|
-
return _this;
|
|
13
|
+
const src_1 = require("../../src");
|
|
14
|
+
let UniqueNumberGraph = class UniqueNumberGraph extends src_1.ObjectGraph {
|
|
15
|
+
constructor(uniqueNumberGenerator) {
|
|
16
|
+
super();
|
|
17
|
+
this.uniqueNumberGenerator = uniqueNumberGenerator;
|
|
35
18
|
}
|
|
36
|
-
|
|
19
|
+
singletonNumber() {
|
|
37
20
|
return this.uniqueNumberGenerator();
|
|
38
|
-
}
|
|
39
|
-
|
|
21
|
+
}
|
|
22
|
+
instanceNumber() {
|
|
40
23
|
return this.uniqueNumberGenerator();
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}(src_1.ObjectGraph));
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, src_1.Provides)(),
|
|
28
|
+
(0, src_1.Singleton)(),
|
|
29
|
+
__metadata("design:type", Function),
|
|
30
|
+
__metadata("design:paramtypes", []),
|
|
31
|
+
__metadata("design:returntype", Number)
|
|
32
|
+
], UniqueNumberGraph.prototype, "singletonNumber", null);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, src_1.Provides)(),
|
|
35
|
+
__metadata("design:type", Function),
|
|
36
|
+
__metadata("design:paramtypes", []),
|
|
37
|
+
__metadata("design:returntype", Number)
|
|
38
|
+
], UniqueNumberGraph.prototype, "instanceNumber", null);
|
|
39
|
+
UniqueNumberGraph = __decorate([
|
|
40
|
+
(0, src_1.Graph)(),
|
|
41
|
+
__metadata("design:paramtypes", [Function])
|
|
42
|
+
], UniqueNumberGraph);
|
|
61
43
|
exports.UniqueNumberGraph = UniqueNumberGraph;
|
|
62
44
|
//# sourceMappingURL=UniqueNumberGraph.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UniqueNumberGraph.js","sourceRoot":"","sources":["../../../test/fixtures/UniqueNumberGraph.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UniqueNumberGraph.js","sourceRoot":"","sources":["../../../test/fixtures/UniqueNumberGraph.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAKmB;AAGZ,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,iBAAW;IAChD,YAAoB,qBAAmC;QACrD,KAAK,EAAE,CAAC;QADU,0BAAqB,GAArB,qBAAqB,CAAc;IAEvD,CAAC;IAGD,eAAe;QACb,OAAO,IAAI,CAAC,qBAAqB,EAAE,CAAC;IACtC,CAAC;IAGD,cAAc;QACZ,OAAO,IAAI,CAAC,qBAAqB,EAAE,CAAC;IACtC,CAAC;CACF,CAAA;AATC;IAAC,IAAA,cAAQ,GAAE;IAAE,IAAA,eAAS,GAAE;;;;wDAGvB;AAED;IAAC,IAAA,cAAQ,GAAE;;;;uDAGV;AAbU,iBAAiB;IAD7B,IAAA,WAAK,GAAE;;GACK,iBAAiB,CAc7B;AAdY,8CAAiB"}
|
package/dist/testkit/index.js
CHANGED
|
@@ -1,48 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
4
|
};
|
|
20
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
6
|
exports.testKit = void 0;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var graphMiddleware = new /** @class */ (function (_super) {
|
|
30
|
-
__extends(class_1, _super);
|
|
31
|
-
function class_1() {
|
|
32
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
33
|
-
}
|
|
34
|
-
class_1.prototype.resolve = function (resolveChain, Graph, props) {
|
|
7
|
+
const ObjectGraph_1 = require("../src/graph/ObjectGraph");
|
|
8
|
+
const GraphMiddleware_1 = require("../src/graph/registry/GraphMiddleware");
|
|
9
|
+
const GraphRegistry_1 = __importDefault(require("../src/graph/registry/GraphRegistry"));
|
|
10
|
+
class TestKit {
|
|
11
|
+
mockGraphs(graphNameToGraph) {
|
|
12
|
+
const graphMiddleware = new class extends GraphMiddleware_1.GraphMiddleware {
|
|
13
|
+
resolve(resolveChain, Graph, props) {
|
|
35
14
|
if (graphNameToGraph[Graph.name]) {
|
|
36
|
-
|
|
15
|
+
const GraphOrGenerator = graphNameToGraph[Graph.name];
|
|
37
16
|
return (0, ObjectGraph_1.isGraph)(GraphOrGenerator) ? new GraphOrGenerator(props) : GraphOrGenerator(props);
|
|
38
17
|
}
|
|
39
18
|
return resolveChain.proceed(Graph, props);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
}(GraphMiddleware_1.GraphMiddleware))();
|
|
19
|
+
}
|
|
20
|
+
}();
|
|
43
21
|
GraphRegistry_1.default.addGraphMiddleware(graphMiddleware);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
}());
|
|
22
|
+
}
|
|
23
|
+
}
|
|
47
24
|
exports.testKit = new TestKit();
|
|
48
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../testkit/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../testkit/index.ts"],"names":[],"mappings":";;;;;;AACA,0DAAgE;AAChE,2EAAwE;AAExE,wFAAgE;AAEhE,MAAM,OAAO;IACJ,UAAU,CAAC,gBAA4F;QAC5G,MAAM,eAAe,GAAG,IAAI,KAAM,SAAQ,iCAAe;YACvD,OAAO,CAAQ,YAA+B,EAAE,KAAiC,EAAE,KAAa;gBAC9F,IAAI,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;oBAChC,MAAM,gBAAgB,GAAG,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;oBACtD,OAAO,IAAA,qBAAO,EAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,IAAI,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;iBAC1F;gBACD,OAAO,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YAC5C,CAAC;SACF,EAAE,CAAC;QACJ,uBAAa,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAC;IACpD,CAAC;CACF;AAEY,QAAA,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC"}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.passParamNameAsInjectArgument = exports.paramsToDestructuringAssignment = exports.getDecoratorName = exports.getDecoratorByName = exports.getMethodName = exports.getDecoratorArgument = exports.addNameToProviderArguments = exports.providerIsNotNamed = void 0;
|
|
4
4
|
/* eslint-disable no-param-reassign */
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
const core_1 = require("@babel/core");
|
|
6
|
+
const lodash_1 = require("lodash");
|
|
7
|
+
const never = '';
|
|
8
8
|
function providerIsNotNamed(decorator) {
|
|
9
|
-
|
|
9
|
+
const argument = getDecoratorArgument(decorator);
|
|
10
10
|
if (core_1.types.isObjectExpression(argument)) {
|
|
11
|
-
return argument.properties.find(
|
|
11
|
+
return argument.properties.find((p) => {
|
|
12
12
|
if (core_1.types.isObjectProperty(p)) {
|
|
13
13
|
return core_1.types.isIdentifier(p.key) && p.key.name === 'name';
|
|
14
14
|
}
|
|
@@ -20,14 +20,14 @@ function providerIsNotNamed(decorator) {
|
|
|
20
20
|
exports.providerIsNotNamed = providerIsNotNamed;
|
|
21
21
|
function addNameToProviderArguments(node, decorator) {
|
|
22
22
|
var _a;
|
|
23
|
-
|
|
23
|
+
const argument = (_a = getDecoratorArgument(decorator)) !== null && _a !== void 0 ? _a : core_1.types.objectExpression([]);
|
|
24
24
|
argument.properties.push(core_1.types.objectProperty(core_1.types.identifier('name'), core_1.types.stringLiteral(getMethodName(node))));
|
|
25
25
|
decorator.expression.arguments = [argument];
|
|
26
26
|
}
|
|
27
27
|
exports.addNameToProviderArguments = addNameToProviderArguments;
|
|
28
28
|
function getDecoratorArgument(decorator) {
|
|
29
29
|
if (core_1.types.isCallExpression(decorator.expression)) {
|
|
30
|
-
return decorator.expression.arguments.find(
|
|
30
|
+
return decorator.expression.arguments.find((a) => core_1.types.isObjectExpression(a));
|
|
31
31
|
}
|
|
32
32
|
return undefined;
|
|
33
33
|
}
|
|
@@ -35,11 +35,11 @@ exports.getDecoratorArgument = getDecoratorArgument;
|
|
|
35
35
|
function getMethodName(node) {
|
|
36
36
|
if (core_1.types.isIdentifier(node.key))
|
|
37
37
|
return node.key.name;
|
|
38
|
-
throw new Error(
|
|
38
|
+
throw new Error(`Tried to get class name but encountered unexpected key of type: ${node.key.type}`);
|
|
39
39
|
}
|
|
40
40
|
exports.getMethodName = getMethodName;
|
|
41
41
|
function getDecoratorByName(decorators, decoratorName) {
|
|
42
|
-
return decorators === null || decorators === void 0 ? void 0 : decorators.find(
|
|
42
|
+
return decorators === null || decorators === void 0 ? void 0 : decorators.find((decorator) => (0, lodash_1.get)(decorator, 'expression.callee.name') === decoratorName);
|
|
43
43
|
}
|
|
44
44
|
exports.getDecoratorByName = getDecoratorByName;
|
|
45
45
|
function getDecoratorName(decorator) {
|
|
@@ -48,8 +48,8 @@ function getDecoratorName(decorator) {
|
|
|
48
48
|
exports.getDecoratorName = getDecoratorName;
|
|
49
49
|
function paramsToDestructuringAssignment(params) {
|
|
50
50
|
return core_1.types.objectPattern(params
|
|
51
|
-
.filter(
|
|
52
|
-
.map(
|
|
51
|
+
.filter((p) => core_1.types.isIdentifier(p))
|
|
52
|
+
.map((p) => core_1.types.objectProperty(core_1.types.identifier(p.name), core_1.types.identifier(p.name))));
|
|
53
53
|
}
|
|
54
54
|
exports.paramsToDestructuringAssignment = paramsToDestructuringAssignment;
|
|
55
55
|
function passParamNameAsInjectArgument(node, decorator) {
|