@rxap/schematics-ts-morph 12.3.2-next.0 → 13.0.0-next.1
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/CHANGELOG.md +37 -0
- package/package.json +5 -4
- package/src/lib/add-method-class.js +2 -2
- package/src/lib/add-method-class.js.map +1 -1
- package/src/lib/add-provider-to-array.js +2 -2
- package/src/lib/add-provider-to-array.js.map +1 -1
- package/src/lib/coerce-method-class.js +2 -2
- package/src/lib/coerce-method-class.js.map +1 -1
- package/src/lib/find-component-module-source-file.js +2 -2
- package/src/lib/find-component-module-source-file.js.map +1 -1
- package/src/lib/find-component-source-file.js +2 -2
- package/src/lib/find-component-source-file.js.map +1 -1
- package/src/lib/nestjs/add-nest-controller.js +4 -4
- package/src/lib/nestjs/add-nest-controller.js.map +1 -1
- package/src/lib/nestjs/add-nest-provider-to-array.js +2 -2
- package/src/lib/nestjs/add-nest-provider-to-array.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,43 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [13.0.0-next.1](https://gitlab.com/rxap/packages/compare/@rxap/schematics-ts-morph@13.0.0-next.0...@rxap/schematics-ts-morph@13.0.0-next.1) (2022-03-23)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* remove rxap/utilities dependency ([d8dfe16](https://gitlab.com/rxap/packages/commit/d8dfe168f5d3afd5cd88d4fd143bd2c7b2c687b7))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [13.0.0-next.0](https://gitlab.com/rxap/packages/compare/@rxap/schematics-ts-morph@12.3.2...@rxap/schematics-ts-morph@13.0.0-next.0) (2022-02-19)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Build System
|
|
21
|
+
|
|
22
|
+
* upgrade to nrwl 13.x.x ([5cd07c1](https://gitlab.com/rxap/packages/commit/5cd07c19645528c787ef01a121a4a4367db78902))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### BREAKING CHANGES
|
|
26
|
+
|
|
27
|
+
* update the core nrwl packages to 13.x.x
|
|
28
|
+
|
|
29
|
+
Signed-off-by: Merzough Münker <mmuenker@digitaix.com>
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
## [12.3.2](https://gitlab.com/rxap/packages/compare/@rxap/schematics-ts-morph@12.3.2-next.0...@rxap/schematics-ts-morph@12.3.2) (2021-10-07)
|
|
36
|
+
|
|
37
|
+
**Note:** Version bump only for package @rxap/schematics-ts-morph
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
6
43
|
## [12.3.2-next.0](https://gitlab.com/rxap/packages/compare/@rxap/schematics-ts-morph@12.3.1...@rxap/schematics-ts-morph@12.3.2-next.0) (2021-09-16)
|
|
7
44
|
|
|
8
45
|
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rxap/schematics-ts-morph",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "13.0.0-next.1",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"
|
|
6
|
-
"
|
|
5
|
+
"tslib": "^2.3.1",
|
|
6
|
+
"semver": "^7.3.5"
|
|
7
7
|
},
|
|
8
8
|
"publishConfig": {
|
|
9
9
|
"directory": "../../dist/libs/ts-morph",
|
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
"migrations": "./migration.json"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"
|
|
38
|
+
"@rxap/schematics-utilities": "^13.0.0-next.1",
|
|
39
|
+
"ts-morph": "^13.0.3"
|
|
39
40
|
},
|
|
40
41
|
"typings": "./src/index.d.ts"
|
|
41
42
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AddMethodClass = exports.DEFAULT_ADD_METHOD_CLASS_OPTIONS = void 0;
|
|
4
4
|
const ts_morph_1 = require("ts-morph");
|
|
5
|
-
const
|
|
5
|
+
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
6
6
|
exports.DEFAULT_ADD_METHOD_CLASS_OPTIONS = {
|
|
7
7
|
structures: [],
|
|
8
8
|
returnType: 'any',
|
|
@@ -17,7 +17,7 @@ exports.DEFAULT_ADD_METHOD_CLASS_OPTIONS = {
|
|
|
17
17
|
function AddMethodClass(sourceFile, name, options = {}) {
|
|
18
18
|
var _a, _b;
|
|
19
19
|
const parameters = Object.assign({}, exports.DEFAULT_ADD_METHOD_CLASS_OPTIONS, options);
|
|
20
|
-
name =
|
|
20
|
+
name = schematics_utilities_1.CoerceSuffix(name, 'Method');
|
|
21
21
|
const decorators = (_a = options.decorators) !== null && _a !== void 0 ? _a : [];
|
|
22
22
|
if (!decorators.some(d => d.name === 'Injectable')) {
|
|
23
23
|
decorators.push({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-method-class.js","sourceRoot":"","sources":["../../../../../libs/ts-morph/src/lib/add-method-class.ts"],"names":[],"mappings":";;;AAAA,uCAUkB;AAClB
|
|
1
|
+
{"version":3,"file":"add-method-class.js","sourceRoot":"","sources":["../../../../../libs/ts-morph/src/lib/add-method-class.ts"],"names":[],"mappings":";;;AAAA,uCAUkB;AAClB,qEAA0D;AAa7C,QAAA,gCAAgC,GAAoC;IAC/E,UAAU,EAAE,EAAE;IACd,UAAU,EAAE,KAAK;IACjB,aAAa,EAAE,KAAK;IACpB,OAAO,EAAE,KAAK;IACd,UAAU,EAAE,IAAI;IAChB,UAAU,EAAE,EAAE;IACd,cAAc,EAAE,EAAE;IAClB,UAAU,EAAE,EAAE;IACd,KAA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H,UAAU,CAAC,qBAAqB,CAAC;QAC/B;YACE,YAAY,EAAK,CAAE,YAAY,CAAE;YACjC,eAAe,EAAE,eAAe;SACjC;QACD;YACE,YAAY,EAAK,CAAE,QAAQ,CAAE;YAC7B,eAAe,EAAE,sBAAsB;SACxC;KACF,CAAC,CAAC;IACH,UAAU,CAAC,qBAAqB,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;AAE1D,CAAC;AApDD,wCAoDC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AddProviderToArray = void 0;
|
|
4
4
|
const ts_morph_1 = require("ts-morph");
|
|
5
|
-
const
|
|
5
|
+
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
6
6
|
function AddProviderToArray(providerObject, providerArray, overwrite = false) {
|
|
7
7
|
if (typeof providerObject === 'string') {
|
|
8
8
|
if (!providerArray.getElements().some(element => element.getFullText().trim() === providerObject)) {
|
|
@@ -24,7 +24,7 @@ function AddProviderToArray(providerObject, providerArray, overwrite = false) {
|
|
|
24
24
|
providerArray.removeElement(index);
|
|
25
25
|
}
|
|
26
26
|
if (overwrite || index === -1) {
|
|
27
|
-
providerArray.addElement(ts_morph_1.Writers.object(
|
|
27
|
+
providerArray.addElement(ts_morph_1.Writers.object(schematics_utilities_1.DeleteUndefinedProperties({
|
|
28
28
|
provide: providerObject.provide,
|
|
29
29
|
useClass: providerObject.useClass,
|
|
30
30
|
useFactory: providerObject.useFactory,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-provider-to-array.js","sourceRoot":"","sources":["../../../../../libs/ts-morph/src/lib/add-provider-to-array.ts"],"names":[],"mappings":";;;AACA,uCAAwG;AACxG
|
|
1
|
+
{"version":3,"file":"add-provider-to-array.js","sourceRoot":"","sources":["../../../../../libs/ts-morph/src/lib/add-provider-to-array.ts"],"names":[],"mappings":";;;AACA,uCAAwG;AACxG,qEAAuE;AAEvE,SA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AC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;gBACzI,KAAK,EAAE,cAAc,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS;aACjI,CAAC,CAAC,CAAC,CAAC;SACN;KAEF;AAEH,CAAC;AAlDD,gDAkDC"}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CoerceMethodClass = void 0;
|
|
4
4
|
const add_method_class_1 = require("./add-method-class");
|
|
5
|
-
const
|
|
5
|
+
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
6
6
|
function CoerceMethodClass(sourceFile, name, options = {}) {
|
|
7
|
-
name =
|
|
7
|
+
name = schematics_utilities_1.CoerceSuffix(name, 'Method');
|
|
8
8
|
const hasClass = !!sourceFile.getClass(name);
|
|
9
9
|
if (!hasClass) {
|
|
10
10
|
add_method_class_1.AddMethodClass(sourceFile, name, options);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coerce-method-class.js","sourceRoot":"","sources":["../../../../../libs/ts-morph/src/lib/coerce-method-class.ts"],"names":[],"mappings":";;;AACA,yDAG4B;AAC5B
|
|
1
|
+
{"version":3,"file":"coerce-method-class.js","sourceRoot":"","sources":["../../../../../libs/ts-morph/src/lib/coerce-method-class.ts"],"names":[],"mappings":";;;AACA,yDAG4B;AAC5B,qEAA0D;AAE1D,SAAgB,iBAAiB,CAC/B,UAAsB,EACtB,IAAY,EACZ,UAAiC,EAAE;IAGnC,IAAI,GAAG,mCAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAEpC,MAAM,QAAQ,GAAG,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAE7C,IAAI,CAAC,QAAQ,EAAE;QACb,iCAAc,CAAC,UAAU,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;KAC3C;AAEH,CAAC;AAdD,8CAcC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FindComponentModuleSourceFile = void 0;
|
|
4
|
-
const
|
|
4
|
+
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
5
5
|
function FindComponentModuleSourceFile(name, project) {
|
|
6
|
-
return project.getSourceFileOrThrow(sourceFile => !!sourceFile.getClass(
|
|
6
|
+
return project.getSourceFileOrThrow(sourceFile => !!sourceFile.getClass(schematics_utilities_1.classify(name) + 'ComponentModule'));
|
|
7
7
|
}
|
|
8
8
|
exports.FindComponentModuleSourceFile = FindComponentModuleSourceFile;
|
|
9
9
|
//# sourceMappingURL=find-component-module-source-file.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-component-module-source-file.js","sourceRoot":"","sources":["../../../../../libs/ts-morph/src/lib/find-component-module-source-file.ts"],"names":[],"mappings":";;;AAIA
|
|
1
|
+
{"version":3,"file":"find-component-module-source-file.js","sourceRoot":"","sources":["../../../../../libs/ts-morph/src/lib/find-component-module-source-file.ts"],"names":[],"mappings":";;;AAIA,qEAAsD;AAEtD,SAAgB,6BAA6B,CAAC,IAAY,EAAE,OAAgB;IAC1E,OAAO,OAAO,CAAC,oBAAoB,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,+BAAQ,CAAC,IAAI,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC;AAC/G,CAAC;AAFD,sEAEC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FindComponentSourceFile = void 0;
|
|
4
|
-
const
|
|
4
|
+
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
5
5
|
function FindComponentSourceFile(name, project) {
|
|
6
|
-
const className =
|
|
6
|
+
const className = schematics_utilities_1.CoerceSuffix(schematics_utilities_1.classify(name), 'Component');
|
|
7
7
|
try {
|
|
8
8
|
return project.getSourceFileOrThrow(sourceFile => !!sourceFile.getClass(className));
|
|
9
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-component-source-file.js","sourceRoot":"","sources":["../../../../../libs/ts-morph/src/lib/find-component-source-file.ts"],"names":[],"mappings":";;;AAIA
|
|
1
|
+
{"version":3,"file":"find-component-source-file.js","sourceRoot":"","sources":["../../../../../libs/ts-morph/src/lib/find-component-source-file.ts"],"names":[],"mappings":";;;AAIA,qEAGoC;AAEpC,SAAgB,uBAAuB,CAAC,IAAY,EAAE,OAAgB;IACpE,MAAM,SAAS,GAAG,mCAAY,CAAC,+BAAQ,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC,CAAC;IAC5D,IAAI;QACF,OAAO,OAAO,CAAC,oBAAoB,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;KACrF;IAAC,OAAO,CAAC,EAAE;QAEV,OAAO,CAAC,KAAK,CAAC,yBAAyB,SAAS,yBAAyB,EAAE,OAAO;aAC/E,cAAc,EAAE;aAChB,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC;aAC3C,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CACvD,CAAC;QAEF,MAAM,CAAC,CAAC;KACT;AACH,CAAC;AAdD,0DAcC"}
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AddNestController = void 0;
|
|
4
4
|
const coerce_class_1 = require("../coerce-class");
|
|
5
|
-
const
|
|
5
|
+
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
6
6
|
const coerce_source_file_1 = require("../coerce-source-file");
|
|
7
7
|
const find_nest_module_source_file_1 = require("./find-nest-module-source-file");
|
|
8
8
|
const add_nest_module_controller_1 = require("./add-nest-module-controller");
|
|
9
9
|
function AddNestController(project, name, options = {}) {
|
|
10
10
|
var _a, _b;
|
|
11
|
-
const sourceFile = (_a = options.sourceFile) !== null && _a !== void 0 ? _a : coerce_source_file_1.CoerceSourceFile(project, `${
|
|
12
|
-
const controllerClass =
|
|
11
|
+
const sourceFile = (_a = options.sourceFile) !== null && _a !== void 0 ? _a : coerce_source_file_1.CoerceSourceFile(project, `${schematics_utilities_1.dasherize(name)}.controller.ts`);
|
|
12
|
+
const controllerClass = schematics_utilities_1.CoerceSuffix(schematics_utilities_1.classify(name), 'Controller');
|
|
13
13
|
coerce_class_1.CoerceClass(sourceFile, controllerClass, {
|
|
14
14
|
isExported: true,
|
|
15
15
|
decorators: [
|
|
16
16
|
{
|
|
17
17
|
name: 'Controller',
|
|
18
|
-
arguments: [w => { var _a; return w.quote((_a = options.prefix) !== null && _a !== void 0 ? _a :
|
|
18
|
+
arguments: [w => { var _a; return w.quote((_a = options.prefix) !== null && _a !== void 0 ? _a : schematics_utilities_1.dasherize(name)); }]
|
|
19
19
|
}
|
|
20
20
|
]
|
|
21
21
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-nest-controller.js","sourceRoot":"","sources":["../../../../../../libs/ts-morph/src/lib/nestjs/add-nest-controller.ts"],"names":[],"mappings":";;;AACA,kDAA8C;AAC9C
|
|
1
|
+
{"version":3,"file":"add-nest-controller.js","sourceRoot":"","sources":["../../../../../../libs/ts-morph/src/lib/nestjs/add-nest-controller.ts"],"names":[],"mappings":";;;AACA,kDAA8C;AAC9C,qEAA+E;AAC/E,8DAAyD;AACzD,iFAA0E;AAC1E,6EAAuE;AASvE,SAAgB,iBAAiB,CAC/B,OAAgB,EAChB,IAAY,EACZ,UAAoC,EAAE;;IAGtC,MAAM,UAAU,GAAG,MAAA,OAAO,CAAC,UAAU,mCAAI,qCAAgB,CAAC,OAAO,EAAE,GAAG,gCAAS,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAEvG,MAAM,eAAe,GAAG,mCAAY,CAAC,+BAAQ,CAAC,IAAI,CAAC,EAAE,YAAY,CAAC,CAAA;IAElE,0BAAW,CACT,UAAU,EACV,eAAe,EACf;QACE,UAAU,EAAE,IAAI;QAChB,UAAU,EAAE;YACV;gBACE,IAAI,EAAE,YAAY;gBAClB,SAAS,EAAE,CAAE,CAAC,CAAC,EAAE,WAAC,OAAA,CAAC,CAAC,KAAK,CAAC,MAAA,OAAO,CAAC,MAAM,mCAAI,gCAAS,CAAC,IAAI,CAAC,CAAC,CAAA,EAAA,CAAE;aAC/D;SACF;KACF,CACF,CAAC;IAEF,UAAU,CAAC,oBAAoB,CAAC;QAC9B,YAAY,EAAE,CAAE,YAAY,CAAE;QAC9B,eAAe,EAAE,gBAAgB;KAClC,CAAC,CAAC;IAEH,IAAI,OAAO,CAAC,WAAW,KAAK,KAAK,EAAE;QAEjC,MAAM,UAAU,GAAG,MAAA,OAAO,CAAC,UAAU,mCAAI,UAAU,CAAC,gBAAgB,EAAE,CAAC;QAEvE,IAAI,gBAAwC,CAAC;QAE7C,IAAI,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE;YAC7B,gBAAgB,GAAG,OAAO,CAAC,aAAa,CAAC,UAAU,CAAE,CAAC;SACvD;aAAM;YACL,gBAAgB,GAAG,uDAAwB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;SAClE;QAED,IAAI,CAAC,gBAAgB,EAAE;YACrB,MAAM,IAAI,KAAK,CAAC,kCAAkC,UAAU,GAAG,CAAC,CAAC;SAClE;QAED,oDAAuB,CACrB,gBAAgB,EAChB,eAAe,EACf;YACE;gBACE,YAAY,EAAE,CAAE,eAAe,CAAE;gBACjC,eAAe,EAAE,IAAI,GAAG,gBAAgB,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;aAC5F;SACF,CACF,CAAC;KAEH;IAED,OAAO,UAAU,CAAC;AAEpB,CAAC;AA5DD,8CA4DC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AddNestProviderToArray = void 0;
|
|
4
4
|
const ts_morph_1 = require("ts-morph");
|
|
5
|
-
const
|
|
5
|
+
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
6
6
|
function AddNestProviderToArray(providerObject, providerArray, overwrite = false) {
|
|
7
7
|
if (typeof providerObject === 'string') {
|
|
8
8
|
if (!providerArray.getElements().some(element => element.getFullText().trim() === providerObject)) {
|
|
@@ -24,7 +24,7 @@ function AddNestProviderToArray(providerObject, providerArray, overwrite = false
|
|
|
24
24
|
providerArray.removeElement(index);
|
|
25
25
|
}
|
|
26
26
|
if (overwrite || index === -1) {
|
|
27
|
-
providerArray.addElement(ts_morph_1.Writers.object(
|
|
27
|
+
providerArray.addElement(ts_morph_1.Writers.object(schematics_utilities_1.DeleteUndefinedProperties({
|
|
28
28
|
provide: providerObject.provide,
|
|
29
29
|
useClass: providerObject.useClass,
|
|
30
30
|
useFactory: providerObject.useFactory,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-nest-provider-to-array.js","sourceRoot":"","sources":["../../../../../../libs/ts-morph/src/lib/nestjs/add-nest-provider-to-array.ts"],"names":[],"mappings":";;;AACA,uCAAwG;AACxG
|
|
1
|
+
{"version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