react-obsidian 0.0.40 → 0.0.42
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/CircularDependenciesDetector.d.ts +10 -0
- package/dist/src/graph/CircularDependenciesDetector.d.ts.map +1 -0
- package/dist/src/graph/CircularDependenciesDetector.js +24 -0
- package/dist/src/graph/CircularDependenciesDetector.js.map +1 -0
- package/dist/src/graph/ObjectGraph.d.ts +2 -1
- package/dist/src/graph/ObjectGraph.d.ts.map +1 -1
- package/dist/src/graph/ObjectGraph.js +20 -25
- package/dist/src/graph/ObjectGraph.js.map +1 -1
- package/dist/src/graph/PropertyRetriever.d.ts +2 -1
- package/dist/src/graph/PropertyRetriever.d.ts.map +1 -1
- package/dist/src/graph/PropertyRetriever.js +28 -20
- package/dist/src/graph/PropertyRetriever.js.map +1 -1
- package/dist/src/graph/PropertyRetrieverDelegate.d.ts +2 -1
- package/dist/src/graph/PropertyRetrieverDelegate.d.ts.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/VisitedNodes.d.ts +9 -0
- package/dist/src/graph/VisitedNodes.d.ts.map +1 -0
- package/dist/src/graph/VisitedNodes.js +28 -0
- package/dist/src/graph/VisitedNodes.js.map +1 -0
- 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/CircularDependencyFromSubgraph.d.ts +5 -0
- package/dist/test/fixtures/CircularDependencyFromSubgraph.d.ts.map +1 -0
- package/dist/test/fixtures/CircularDependencyFromSubgraph.js +30 -0
- package/dist/test/fixtures/CircularDependencyFromSubgraph.js.map +1 -0
- package/dist/test/fixtures/CircularDependencyGraph.d.ts +5 -0
- package/dist/test/fixtures/CircularDependencyGraph.d.ts.map +1 -0
- package/dist/test/fixtures/CircularDependencyGraph.js +29 -0
- package/dist/test/fixtures/CircularDependencyGraph.js.map +1 -0
- package/dist/test/fixtures/CircularDependencyGraph2.d.ts +7 -0
- package/dist/test/fixtures/CircularDependencyGraph2.d.ts.map +1 -0
- package/dist/test/fixtures/CircularDependencyGraph2.js +47 -0
- package/dist/test/fixtures/CircularDependencyGraph2.js.map +1 -0
- 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/SubgraphWithCircularDependency.d.ts +6 -0
- package/dist/test/fixtures/SubgraphWithCircularDependency.d.ts.map +1 -0
- package/dist/test/fixtures/SubgraphWithCircularDependency.js +39 -0
- package/dist/test/fixtures/SubgraphWithCircularDependency.js.map +1 -0
- 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 +1819 -88
- package/documentation/package.json +1 -0
- package/documentation/src/theme/SearchBar.js +21 -0
- package/package.json +2 -2
- package/src/graph/CircularDependenciesDetector.ts +23 -0
- package/src/graph/ObjectGraph.ts +7 -2
- package/src/graph/PropertyRetriever.ts +29 -6
- package/src/graph/PropertyRetrieverDelegate.ts +7 -1
- package/src/graph/VisitedNodes.ts +25 -0
- package/tsconfig.base.json +1 -1
|
@@ -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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubgraphWithCircularDependency.d.ts","sourceRoot":"","sources":["../../../test/fixtures/SubgraphWithCircularDependency.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,WAAW,EAGZ,MAAM,WAAW,CAAC;AAEnB,qBACa,8BAA+B,SAAQ,WAAW;IAE7D,IAAI,CAAC,IAAI,EAAE,GAAG,GAAG,GAAG;IAKpB,IAAI,CAAC,IAAI,EAAE,GAAG,GAAG,GAAG;CAGrB"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SubgraphWithCircularDependency = void 0;
|
|
13
|
+
const src_1 = require("../../src");
|
|
14
|
+
let SubgraphWithCircularDependency = class SubgraphWithCircularDependency extends src_1.ObjectGraph {
|
|
15
|
+
dep2(dep3) {
|
|
16
|
+
return dep3;
|
|
17
|
+
}
|
|
18
|
+
dep3(dep2) {
|
|
19
|
+
return dep2;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, src_1.Provides)(),
|
|
24
|
+
__metadata("design:type", Function),
|
|
25
|
+
__metadata("design:paramtypes", [Object]),
|
|
26
|
+
__metadata("design:returntype", Object)
|
|
27
|
+
], SubgraphWithCircularDependency.prototype, "dep2", null);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, src_1.Provides)(),
|
|
30
|
+
__metadata("design:type", Function),
|
|
31
|
+
__metadata("design:paramtypes", [Object]),
|
|
32
|
+
__metadata("design:returntype", Object)
|
|
33
|
+
], SubgraphWithCircularDependency.prototype, "dep3", null);
|
|
34
|
+
SubgraphWithCircularDependency = __decorate([
|
|
35
|
+
(0, src_1.Singleton)(),
|
|
36
|
+
(0, src_1.Graph)()
|
|
37
|
+
], SubgraphWithCircularDependency);
|
|
38
|
+
exports.SubgraphWithCircularDependency = SubgraphWithCircularDependency;
|
|
39
|
+
//# sourceMappingURL=SubgraphWithCircularDependency.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubgraphWithCircularDependency.js","sourceRoot":"","sources":["../../../test/fixtures/SubgraphWithCircularDependency.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAKmB;AAGZ,IAAM,8BAA8B,GAApC,MAAM,8BAA+B,SAAQ,iBAAW;IAE7D,IAAI,CAAC,IAAS;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IAGD,IAAI,CAAC,IAAS;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAA;AATC;IAAC,IAAA,cAAQ,GAAE;;;;0DAGV;AAED;IAAC,IAAA,cAAQ,GAAE;;;;0DAGV;AATU,8BAA8B;IAD1C,IAAA,eAAS,GAAE;IAAE,IAAA,WAAK,GAAE;GACR,8BAA8B,CAU1C;AAVY,wEAA8B"}
|
|
@@ -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) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../transformers/babel-plugin-obsidian/helpers/index.ts"],"names":[],"mappings":";;;AAAA,sCAAsC;AACtC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../transformers/babel-plugin-obsidian/helpers/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -3,37 +3,33 @@ 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
|
-
|
|
6
|
+
const unmagler_1 = __importDefault(require("./unmagler"));
|
|
7
|
+
const providerArgumentsTransformer = {
|
|
8
8
|
visitor: {
|
|
9
|
-
Program
|
|
9
|
+
Program(path) {
|
|
10
10
|
path.traverse(internalVisitor);
|
|
11
11
|
},
|
|
12
12
|
},
|
|
13
13
|
};
|
|
14
|
-
|
|
14
|
+
const internalVisitor = {
|
|
15
15
|
ClassMethod: {
|
|
16
|
-
enter
|
|
17
|
-
var node = _a.node;
|
|
16
|
+
enter({ node }) {
|
|
18
17
|
unmagler_1.default.saveClassMethod('Provides', node);
|
|
19
18
|
},
|
|
20
19
|
},
|
|
21
20
|
ClassProperty: {
|
|
22
|
-
enter
|
|
23
|
-
var node = _a.node;
|
|
21
|
+
enter({ node }) {
|
|
24
22
|
unmagler_1.default.saveClassProperty('Inject', node);
|
|
25
23
|
unmagler_1.default.saveClassProperty('LateInject', node);
|
|
26
24
|
},
|
|
27
25
|
},
|
|
28
26
|
Identifier: {
|
|
29
|
-
enter
|
|
30
|
-
var node = _a.node;
|
|
27
|
+
enter({ node }) {
|
|
31
28
|
unmagler_1.default.saveIdentifier('Inject', node);
|
|
32
29
|
},
|
|
33
30
|
},
|
|
34
31
|
TSParameterProperty: {
|
|
35
|
-
enter
|
|
36
|
-
var node = _a.node;
|
|
32
|
+
enter({ node }) {
|
|
37
33
|
unmagler_1.default.saveTSParameterProperty('Inject', node);
|
|
38
34
|
},
|
|
39
35
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../transformers/babel-plugin-obsidian/index.ts"],"names":[],"mappings":";;;;;AASA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../transformers/babel-plugin-obsidian/index.ts"],"names":[],"mappings":";;;;;AASA,0DAAkC;AAElC,MAAM,4BAA4B,GAAc;IAC9C,OAAO,EAAE;QACP,OAAO,CAAC,IAAuB;YAC7B,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;QACjC,CAAC;KACF;CACF,CAAC;AAEF,MAAM,eAAe,GAAG;IACtB,WAAW,EAAE;QACX,KAAK,CAAC,EAAE,IAAI,EAAyB;YACnC,kBAAQ,CAAC,eAAe,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QAC7C,CAAC;KACF;IACD,aAAa,EAAE;QACb,KAAK,CAAC,EAAE,IAAI,EAA2B;YACrC,kBAAQ,CAAC,iBAAiB,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;YAC3C,kBAAQ,CAAC,iBAAiB,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;QACjD,CAAC;KACF;IACD,UAAU,EAAE;QACV,KAAK,CAAC,EAAE,IAAI,EAAwB;YAClC,kBAAQ,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QAC1C,CAAC;KACF;IACD,mBAAmB,EAAE;QACnB,KAAK,CAAC,EAAE,IAAI,EAAiC;YAC3C,kBAAQ,CAAC,uBAAuB,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACnD,CAAC;KACF;CACF,CAAC;AAEF,SAAwB,MAAM;IAC5B,OAAO,4BAA4B,CAAC;AACtC,CAAC;AAFD,yBAEC"}
|
|
@@ -3,8 +3,8 @@ 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
|
-
|
|
6
|
+
const method_1 = __importDefault(require("./method"));
|
|
7
|
+
const property_1 = __importDefault(require("./property"));
|
|
8
8
|
exports.default = {
|
|
9
9
|
saveClassMethod: method_1.default,
|
|
10
10
|
saveClassProperty: property_1.default,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../transformers/babel-plugin-obsidian/unmagler/index.ts"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../transformers/babel-plugin-obsidian/unmagler/index.ts"],"names":[],"mappings":";;;;;AAAA,sDAAkC;AAClC,0DAAsC;AAEtC,kBAAe;IACb,eAAe,EAAE,gBAAU;IAC3B,iBAAiB,EAAE,kBAAY;IAC/B,cAAc,EAAE,kBAAY;IAC5B,uBAAuB,EAAE,kBAAY;CACtC,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
const helpers_1 = require("../helpers");
|
|
4
4
|
function saveMethod(name, node) {
|
|
5
|
-
|
|
5
|
+
const decorator = (0, helpers_1.getDecoratorByName)(node.decorators, name);
|
|
6
6
|
if ((0, helpers_1.getDecoratorName)(decorator) === name) {
|
|
7
7
|
convertProviderParamsToDestructuringAssignment(node);
|
|
8
8
|
saveUnmangledMethodNameInProviderArguments(node, decorator);
|
|
@@ -12,7 +12,7 @@ function convertProviderParamsToDestructuringAssignment(node) {
|
|
|
12
12
|
if (node.params.length === 0) {
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
const destructuredParams = (0, helpers_1.paramsToDestructuringAssignment)(node.params);
|
|
16
16
|
// eslint-disable-next-line no-param-reassign
|
|
17
17
|
node.params.length = 0;
|
|
18
18
|
node.params.push(destructuredParams);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"method.js","sourceRoot":"","sources":["../../../../transformers/babel-plugin-obsidian/unmagler/method.ts"],"names":[],"mappings":";;AACA,
|
|
1
|
+
{"version":3,"file":"method.js","sourceRoot":"","sources":["../../../../transformers/babel-plugin-obsidian/unmagler/method.ts"],"names":[],"mappings":";;AACA,wCAMoB;AAEpB,SAAS,UAAU,CAAC,IAAY,EAAE,IAAiB;IACjD,MAAM,SAAS,GAAG,IAAA,4BAAkB,EAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAC5D,IAAI,IAAA,0BAAgB,EAAC,SAAS,CAAC,KAAK,IAAI,EAAE;QACxC,8CAA8C,CAAC,IAAI,CAAC,CAAC;QACrD,0CAA0C,CAAC,IAAI,EAAE,SAAU,CAAC,CAAC;KAC9D;AACH,CAAC;AAED,SAAS,8CAA8C,CAAC,IAAiB;IACvE,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;QAAE,OAAO;KAAE;IACzC,MAAM,kBAAkB,GAAG,IAAA,yCAA+B,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACxE,6CAA6C;IAC7C,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;IACvB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;AACvC,CAAC;AAED,SAAS,0CAA0C,CAAC,IAAiB,EAAE,SAAoB;IACzF,IAAI,IAAA,4BAAkB,EAAC,SAAS,CAAC,EAAE;QACjC,IAAA,oCAA0B,EAAC,IAAI,EAAE,SAAS,CAAC,CAAC;KAC7C;AACH,CAAC;AACD,kBAAe,UAAU,CAAC"}
|