@biorate/file-config 0.16.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 +27 -0
- package/LICENSE +22 -0
- package/README.md +73 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/src/errors.js +11 -0
- package/dist/src/errors.js.map +1 -0
- package/dist/src/index.js +61 -0
- package/dist/src/index.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/index.d.ts +8 -0
- package/index.ts +1 -0
- package/package.json +29 -0
- package/src/errors.ts +7 -0
- package/src/index.ts +108 -0
- package/tests/__mocks__/config.debug.json +3 -0
- package/tests/__mocks__/config.json +3 -0
- package/tests/__mocks__/index.ts +17 -0
- package/tests/__mocks__/package.json +8 -0
- package/tests/__snapshots__/index.spec.ts.snap +12 -0
- package/tests/index.spec.ts +13 -0
- package/tsconfig.build.json +5 -0
- package/tsconfig.json +6 -0
package/CHANGELOG.md
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# Change Log
|
2
|
+
|
3
|
+
All notable changes to this project will be documented in this file.
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
|
+
|
6
|
+
## [0.16.1](https://github.com/biorate/core/compare/v0.16.0...v0.16.1) (2022-02-01)
|
7
|
+
|
8
|
+
|
9
|
+
### Bug Fixes
|
10
|
+
|
11
|
+
* publishConfig added in package.json ([716a064](https://github.com/biorate/core/commit/716a06429e1a4325f50cf94b804f1d70d8a58cf5))
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
# [0.16.0](https://github.com/biorate/core/compare/v0.15.2...v0.16.0) (2022-02-01)
|
18
|
+
|
19
|
+
|
20
|
+
### Bug Fixes
|
21
|
+
|
22
|
+
* **config:** IConfig interface added ([b6e6bf1](https://github.com/biorate/core/commit/b6e6bf1fe267f0d87ad69581698ea72c90f5969d))
|
23
|
+
|
24
|
+
|
25
|
+
### Features
|
26
|
+
|
27
|
+
* **file-config:** module added ([02c9752](https://github.com/biorate/core/commit/02c97528ccd4e2a5aab0945f9f615c568a3b2717))
|
package/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2021-present Leonid Levkin (llevkin)
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
# File Config
|
2
|
+
|
3
|
+
Module for configuring the application using files,
|
4
|
+
extends [Config](https://biorate.github.io/core/classes/config.Config.html) base class.
|
5
|
+
|
6
|
+
### Examples:
|
7
|
+
|
8
|
+
In ***cwd*** of you app, near package.json, create 2 files:
|
9
|
+
<br />
|
10
|
+
<br />
|
11
|
+
|
12
|
+
```bash
|
13
|
+
# config.json
|
14
|
+
{
|
15
|
+
"app": "test"
|
16
|
+
}
|
17
|
+
```
|
18
|
+
<br />
|
19
|
+
|
20
|
+
```bash
|
21
|
+
# config.debug.json:
|
22
|
+
{
|
23
|
+
"title": "My awesome app"
|
24
|
+
}
|
25
|
+
```
|
26
|
+
|
27
|
+
```ts
|
28
|
+
import { Core, injectable, inject, container, Types } from '@biorate/inversion';
|
29
|
+
import { IConfig } from '@biorate/config';
|
30
|
+
import { FileConfig } from '@biorate/file-config';
|
31
|
+
|
32
|
+
@injectable()
|
33
|
+
class Root extends Core() {
|
34
|
+
@inject(Types.Config) public config: IConfig;
|
35
|
+
}
|
36
|
+
|
37
|
+
container.bind<IConfig>(Types.Config)
|
38
|
+
.to(FileConfig)
|
39
|
+
.inSingletonScope();
|
40
|
+
|
41
|
+
container.bind<Root>(Root).toSelf().inSingletonScope();
|
42
|
+
|
43
|
+
(async () => {
|
44
|
+
const root = await container.get(Root).$run();
|
45
|
+
|
46
|
+
console.log(root.config.get('package'));
|
47
|
+
// {
|
48
|
+
// "name": "file-config-test",
|
49
|
+
// "version": "0.0.0",
|
50
|
+
// "description": "Test package.json",
|
51
|
+
// "keywords": [],
|
52
|
+
// "author": "llevkin",
|
53
|
+
// "license": "MIT"
|
54
|
+
// }
|
55
|
+
|
56
|
+
console.log(root.config.get('app')); // test
|
57
|
+
console.log(root.config.get('title')); // My awesome app
|
58
|
+
})();
|
59
|
+
```
|
60
|
+
|
61
|
+
### Learn
|
62
|
+
|
63
|
+
- Documentation can be found here - [docs](https://biorate.github.io/core/modules/file-config.html).
|
64
|
+
|
65
|
+
### Release History
|
66
|
+
|
67
|
+
See the [CHANGELOG](https://github.com/biorate/core/blob/master/packages/%40biorate/file-config/CHANGELOG.md)
|
68
|
+
|
69
|
+
### License
|
70
|
+
|
71
|
+
[MIT](https://github.com/biorate/core/blob/master/packages/%40biorate/file-config/LICENSE)
|
72
|
+
|
73
|
+
Copyright (c) 2021-present [Leonid Levkin (llevkin)](mailto:llevkin@yandex.ru)
|
package/dist/index.js
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
5
|
+
}) : (function(o, m, k, k2) {
|
6
|
+
if (k2 === undefined) k2 = k;
|
7
|
+
o[k2] = m[k];
|
8
|
+
}));
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
11
|
+
};
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
13
|
+
__exportStar(require("./src"), exports);
|
14
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wCAAsB"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.ConfigFileNotFoundPathError = void 0;
|
4
|
+
const errors_1 = require("@biorate/errors");
|
5
|
+
class ConfigFileNotFoundPathError extends errors_1.BaseError {
|
6
|
+
constructor(name, reason) {
|
7
|
+
super("%s.json didn't find, [%s]", [name, reason]);
|
8
|
+
}
|
9
|
+
}
|
10
|
+
exports.ConfigFileNotFoundPathError = ConfigFileNotFoundPathError;
|
11
|
+
//# sourceMappingURL=errors.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAE5C,MAAa,2BAA4B,SAAQ,kBAAS;IACxD,YAAmB,IAAY,EAAE,MAAc;QAC7C,KAAK,CAAC,2BAA2B,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IACrD,CAAC;CACF;AAJD,kEAIC"}
|
@@ -0,0 +1,61 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
5
|
+
}) : (function(o, m, k, k2) {
|
6
|
+
if (k2 === undefined) k2 = k;
|
7
|
+
o[k2] = m[k];
|
8
|
+
}));
|
9
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
10
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
11
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
12
|
+
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;
|
13
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
14
|
+
};
|
15
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
16
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
17
|
+
};
|
18
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
20
|
+
};
|
21
|
+
var FileConfig_1;
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
23
|
+
exports.FileConfig = void 0;
|
24
|
+
const inversion_1 = require("@biorate/inversion");
|
25
|
+
const config_1 = require("@biorate/config");
|
26
|
+
const fs_1 = require("fs");
|
27
|
+
const errors_1 = require("./errors");
|
28
|
+
__exportStar(require("./errors"), exports);
|
29
|
+
let FileConfig = FileConfig_1 = class FileConfig extends config_1.Config {
|
30
|
+
static root(path) {
|
31
|
+
FileConfig_1._root = path;
|
32
|
+
return this;
|
33
|
+
}
|
34
|
+
load(file, namespace = null) {
|
35
|
+
try {
|
36
|
+
const data = JSON.parse((0, fs_1.readFileSync)(`${FileConfig_1._root}/${file}.json`, 'utf-8'));
|
37
|
+
this.merge(namespace ? { [namespace]: data } : data);
|
38
|
+
}
|
39
|
+
catch (e) {
|
40
|
+
console.warn(new errors_1.ConfigFileNotFoundPathError(file, e.message).message);
|
41
|
+
}
|
42
|
+
}
|
43
|
+
initialize() {
|
44
|
+
var _a;
|
45
|
+
this.load('package', 'package');
|
46
|
+
this.load('config');
|
47
|
+
this.load(`config.${(_a = process.env.NODE_ENV) !== null && _a !== void 0 ? _a : 'debug'}`);
|
48
|
+
}
|
49
|
+
};
|
50
|
+
FileConfig._root = process.cwd();
|
51
|
+
__decorate([
|
52
|
+
(0, inversion_1.init)(),
|
53
|
+
__metadata("design:type", Function),
|
54
|
+
__metadata("design:paramtypes", []),
|
55
|
+
__metadata("design:returntype", void 0)
|
56
|
+
], FileConfig.prototype, "initialize", null);
|
57
|
+
FileConfig = FileConfig_1 = __decorate([
|
58
|
+
(0, inversion_1.injectable)()
|
59
|
+
], FileConfig);
|
60
|
+
exports.FileConfig = FileConfig;
|
61
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAsD;AACtD,4CAAyC;AACzC,2BAAkC;AAClC,qCAAuD;AACvD,2CAAyB;AAoEzB,IAAa,UAAU,kBAAvB,MAAa,UAAW,SAAQ,eAAM;IAgB7B,MAAM,CAAC,IAAI,CAAC,IAAY;QAC7B,YAAU,CAAC,KAAK,GAAG,IAAI,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IAES,IAAI,CAAC,IAAY,EAAE,YAAoB,IAAI;QACnD,IAAI;YACF,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAA,iBAAY,EAAC,GAAG,YAAU,CAAC,KAAK,IAAI,IAAI,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;YACnF,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;SACtD;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,CAAC,IAAI,CAAC,IAAI,oCAA2B,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC;SACxE;IACH,CAAC;IAEiB,UAAU;;QAC1B,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QAChC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACpB,IAAI,CAAC,IAAI,CAAC,UAAU,MAAA,OAAO,CAAC,GAAG,CAAC,QAAQ,mCAAI,OAAO,EAAE,CAAC,CAAC;IACzD,CAAC;CACF,CAAA;AAlCgB,gBAAK,GAAG,OAAO,CAAC,GAAG,EAAG,CAAA;AA6B7B;IAAP,IAAA,gBAAI,GAAE;;;;4CAIN;AAlCU,UAAU;IADtB,IAAA,sBAAU,GAAE;GACA,UAAU,CAmCtB;AAnCY,gCAAU"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"program":{"fileNames":["../../../../node_modules/typescript/lib/lib.es5.d.ts","../../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../../node_modules/typescript/lib/lib.dom.d.ts","../../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../../../../node_modules/typescript/lib/lib.scripthost.d.ts","../../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2017.full.d.ts","../node_modules/reflect-metadata/index.d.ts","../node_modules/inversify/lib/constants/metadata_keys.d.ts","../node_modules/inversify/lib/interfaces/interfaces.d.ts","../node_modules/inversify/lib/container/container.d.ts","../node_modules/inversify/lib/constants/literal_types.d.ts","../node_modules/inversify/lib/container/container_module.d.ts","../node_modules/inversify/lib/annotation/injectable.d.ts","../node_modules/inversify/lib/annotation/tagged.d.ts","../node_modules/inversify/lib/annotation/named.d.ts","../node_modules/inversify/lib/annotation/inject.d.ts","../node_modules/inversify/lib/annotation/optional.d.ts","../node_modules/inversify/lib/annotation/unmanaged.d.ts","../node_modules/inversify/lib/annotation/multi_inject.d.ts","../node_modules/inversify/lib/annotation/target_name.d.ts","../node_modules/inversify/lib/annotation/post_construct.d.ts","../node_modules/inversify/lib/planning/metadata_reader.d.ts","../node_modules/inversify/lib/utils/id.d.ts","../node_modules/inversify/lib/annotation/decorator_utils.d.ts","../node_modules/inversify/lib/syntax/constraint_helpers.d.ts","../node_modules/inversify/lib/utils/serialization.d.ts","../node_modules/inversify/lib/utils/binding_utils.d.ts","../node_modules/inversify/lib/inversify.d.ts","../node_modules/inversify-inject-decorators/dts/index.d.ts","../node_modules/@biorate/inversion/interfaces.ts","../node_modules/@biorate/symbolic/src/index.ts","../node_modules/@biorate/symbolic/index.ts","../node_modules/@biorate/inversion/src/labels.ts","../node_modules/@biorate/inversion/src/inversify.ts","../../../../node_modules/@types/lodash/common/common.d.ts","../../../../node_modules/@types/lodash/common/array.d.ts","../../../../node_modules/@types/lodash/common/collection.d.ts","../../../../node_modules/@types/lodash/common/date.d.ts","../../../../node_modules/@types/lodash/common/function.d.ts","../../../../node_modules/@types/lodash/common/lang.d.ts","../../../../node_modules/@types/lodash/common/math.d.ts","../../../../node_modules/@types/lodash/common/number.d.ts","../../../../node_modules/@types/lodash/common/object.d.ts","../../../../node_modules/@types/lodash/common/seq.d.ts","../../../../node_modules/@types/lodash/common/string.d.ts","../../../../node_modules/@types/lodash/common/util.d.ts","../../../../node_modules/@types/lodash/index.d.ts","../node_modules/@biorate/tools/src/env.ts","../node_modules/@biorate/tools/src/path.ts","../node_modules/@biorate/tools/src/object.ts","../node_modules/@biorate/tools/interfaces.ts","../node_modules/@biorate/tools/src/define.ts","../node_modules/@biorate/tools/src/timer.ts","../node_modules/@biorate/tools/src/events.ts","../node_modules/@biorate/tools/src/index.ts","../node_modules/@biorate/tools/index.ts","../node_modules/@biorate/lifecycled/src/index.ts","../node_modules/@biorate/lifecycled/index.ts","../node_modules/@biorate/inversion/src/index.ts","../node_modules/@biorate/inversion/index.ts","../../errors/index.ts","../../config/src/errors.ts","../../config/src/interfaces.ts","../../config/src/index.ts","../../config/index.ts","../src/errors.ts","../src/index.ts","../index.ts","../../../../node_modules/@types/babel-types/index.d.ts","../../../../node_modules/@babel/types/lib/index.d.ts","../../../../node_modules/@types/babel__traverse/index.d.ts","../../../../node_modules/@types/babylon/index.d.ts","../../../../node_modules/@types/chai/index.d.ts","../../../../node_modules/@types/eslint/helpers.d.ts","../../../../node_modules/@types/json-schema/index.d.ts","../../../../node_modules/@types/estree/index.d.ts","../../../../node_modules/@types/eslint/index.d.ts","../../../../node_modules/@types/eslint-scope/index.d.ts","../../../../node_modules/@types/node/assert.d.ts","../../../../node_modules/@types/node/assert/strict.d.ts","../../../../node_modules/@types/node/globals.d.ts","../../../../node_modules/@types/node/async_hooks.d.ts","../../../../node_modules/@types/node/buffer.d.ts","../../../../node_modules/@types/node/child_process.d.ts","../../../../node_modules/@types/node/cluster.d.ts","../../../../node_modules/@types/node/console.d.ts","../../../../node_modules/@types/node/constants.d.ts","../../../../node_modules/@types/node/crypto.d.ts","../../../../node_modules/@types/node/dgram.d.ts","../../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../../node_modules/@types/node/dns.d.ts","../../../../node_modules/@types/node/dns/promises.d.ts","../../../../node_modules/@types/node/domain.d.ts","../../../../node_modules/@types/node/events.d.ts","../../../../node_modules/@types/node/fs.d.ts","../../../../node_modules/@types/node/fs/promises.d.ts","../../../../node_modules/@types/node/http.d.ts","../../../../node_modules/@types/node/http2.d.ts","../../../../node_modules/@types/node/https.d.ts","../../../../node_modules/@types/node/inspector.d.ts","../../../../node_modules/@types/node/module.d.ts","../../../../node_modules/@types/node/net.d.ts","../../../../node_modules/@types/node/os.d.ts","../../../../node_modules/@types/node/path.d.ts","../../../../node_modules/@types/node/perf_hooks.d.ts","../../../../node_modules/@types/node/process.d.ts","../../../../node_modules/@types/node/punycode.d.ts","../../../../node_modules/@types/node/querystring.d.ts","../../../../node_modules/@types/node/readline.d.ts","../../../../node_modules/@types/node/repl.d.ts","../../../../node_modules/@types/node/stream.d.ts","../../../../node_modules/@types/node/stream/promises.d.ts","../../../../node_modules/@types/node/stream/consumers.d.ts","../../../../node_modules/@types/node/stream/web.d.ts","../../../../node_modules/@types/node/string_decoder.d.ts","../../../../node_modules/@types/node/timers.d.ts","../../../../node_modules/@types/node/timers/promises.d.ts","../../../../node_modules/@types/node/tls.d.ts","../../../../node_modules/@types/node/trace_events.d.ts","../../../../node_modules/@types/node/tty.d.ts","../../../../node_modules/@types/node/url.d.ts","../../../../node_modules/@types/node/util.d.ts","../../../../node_modules/@types/node/v8.d.ts","../../../../node_modules/@types/node/vm.d.ts","../../../../node_modules/@types/node/wasi.d.ts","../../../../node_modules/@types/node/worker_threads.d.ts","../../../../node_modules/@types/node/zlib.d.ts","../../../../node_modules/@types/node/globals.global.d.ts","../../../../node_modules/@types/node/index.d.ts","../../../../node_modules/@types/minimatch/index.d.ts","../../../../node_modules/@types/glob/index.d.ts","../../../../node_modules/@types/graceful-fs/index.d.ts","../../../../node_modules/@types/istanbul-lib-coverage/index.d.ts","../../../../node_modules/@types/istanbul-lib-report/index.d.ts","../../../../node_modules/@types/istanbul-reports/index.d.ts","../../../../node_modules/@types/minimist/index.d.ts","../../../../node_modules/@types/mocha/index.d.ts","../../../../node_modules/@types/normalize-package-data/index.d.ts","../../../../node_modules/@types/parse-json/index.d.ts","../../../../node_modules/@types/prettier/index.d.ts","../../../../node_modules/@types/stack-utils/index.d.ts","../../../../node_modules/@types/yargs-parser/index.d.ts","../../../../node_modules/@types/yargs/index.d.ts"],"fileInfos":[{"version":"89f78430e422a0f06d13019d60d5a45b37ec2d28e67eb647f73b1b0d19a46b72","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940",{"version":"abba1071bfd89e55e88a054b0c851ea3e8a494c340d0f3fab19eb18f6afb0c9e","affectsGlobalScope":true},{"version":"927cb2b60048e1395b183bf74b2b80a75bdb1dbe384e1d9fac654313ea2fb136","affectsGlobalScope":true},{"version":"7fac8cb5fc820bc2a59ae11ef1c5b38d3832c6d0dfaec5acdb5569137d09a481","affectsGlobalScope":true},{"version":"097a57355ded99c68e6df1b738990448e0bf170e606707df5a7c0481ff2427cd","affectsGlobalScope":true},{"version":"d8996609230d17e90484a2dd58f22668f9a05a3bfe00bfb1d6271171e54a31fb","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"4378fc8122ec9d1a685b01eb66c46f62aba6b239ca7228bb6483bcf8259ee493","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"d071129cba6a5f2700be09c86c07ad2791ab67d4e5ed1eb301d6746c62745ea4","affectsGlobalScope":true},{"version":"10bbdc1981b8d9310ee75bfac28ee0477bb2353e8529da8cff7cb26c409cb5e8","affectsGlobalScope":true},"d2f31f19e1ba6ed59be9259d660a239d9a3fcbbc8e038c6b2009bde34b175fed",{"version":"8d6d51a5118d000ed3bfe6e1dd1335bebfff3fef23cd2af2f84a24d30f90cc90","affectsGlobalScope":true},"e72fe8c20f176ecfbb89b47e0956ad5af5c79d00a813db6adf32d7a323827bde","234ded1b44862f6c114c060f11e4cfd2fbace2a0988b886c4d2273da64721ca3","15c78ee71828fbcff296ef228440f459fefa3d7afaa4ed5dcf473ef67729ce28","223c30250c2d0774405136fe412f0c654acbd1f5ebc80d711d0a4413ced11520","d21addb8e9f07e85fe34b65dd38d156b2d29491585eb3a2d3754c85ff024dc78","45f14437278936644e7aa944a9d7b3213cc74173a9d0a6e78994de43caccb6d7","43769897ae7ca754acaffec5dfb909d10510fb2be0d0afa5cb4eec91b4c9805a","188fd1724740c445a782b9e953879097edef90434ff76fdc420acfbd58b1bcf6","3bdef47778e6ef0896e60bc227562685efedb3aee3fb132b5a968e892b0bff0b","f81c99df7c78e3ad3b6eacbaa5d5a2d36bcab1ea029b1998ede9151861502a9d","9fd895b4e65cc84529969de404b2221a95a955a57544febdc76189689696b040","c656a8d0be8f60c6818d5c60ec56fbe61de252cffb98b760dc0ba5518e85b86a","1f0a68bc4e44a72d2e3ce81967f6001df5d29428549b310054df0fa1bf588203","d9df733eeb4fc5ca64d6dfcaa3efc429a9fa7d183ce796df0e5049c1acd1eaa7","617d9598bd1dbc6b4e19ebabc5564b3fb9a95589f52eefb4c04396f292f7d1ef","c624c0d0d777a670e2b2d8003ec91519e93048963a3236aeab1ec55a8529c382","5436e41fb86218a81a15f6517dc47736924b4a31d1b04a2ca4405556a7bdd303","388e00b3c8426cf875a3b764a1d2f4d1669f05e587ad511fb7d61684e3fc5352","21a9fdf5ec213b187243a4fee33cce7055a0e25dd2ab6fd5eb53d9063bda1297","8ea54168630a0cbd9127985d4190ad962ad55123d78e855d7e505a7bf042bc2d","f15dd6db666e773db7ae7eba550607eeede04d16819dc7a5abf546f15a4b989a","961700b34af98c4b8049a6a8580195d3c5d07b7d82d3944587b8cabc70a00129","ae11ffbbb53d65a0b217333581526d5d280398df5c212d511f22ab2f5c6991f1","92e9e32485f6fea2ca0e00d30d7f66ce47402bfe0c6db4273e380daf6c0e63c8","80a3bbe0e4fdfaac2c0a8b92a3ed66d3ded5e8f454c5790c8d593872fc1197f1","665e3f8e4b15f4fa90b182edd6de96ce49676325024b12b29950bbc91827063b","4ed8ccafa3a843a420555d0a7d94751b235854f63cd0eb20b8b4f235bffa26e9","675e702f2032766a91eeadee64f51014c64688525da99dccd8178f0c599f13a8","fe4a2042d087990ebfc7dc0142d5aaf5a152e4baea86b45f283f103ec1e871ea","d88a479cccf787b4aa82362150fbeba5211a32dbfafa7b92ba6995ecaf9a1a89","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","c24ad9be9adf28f0927e3d9d9e9cec1c677022356f241ccbbfb97bfe8fb3d1a1","0ec0998e2d085e8ea54266f547976ae152c9dd6cdb9ac4d8a520a230f5ebae84","9364c7566b0be2f7b70ff5285eb34686f83ccb01bda529b82d23b2a844653bfb","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","ae9930989ed57478eb03b9b80ad3efa7a3eacdfeff0f78ecf7894c4963a64f93","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","3e59f00ab03c33717b3130066d4debb272da90eeded4935ff0604c2bc25a5cae","6ac6f24aff52e62c3950461aa17eab26e3a156927858e6b654baef0058b4cd1e",{"version":"0714e2046df66c0e93c3330d30dbc0565b3e8cd3ee302cf99e4ede6220e5fec8","affectsGlobalScope":true},"4eb9bbb381dd5cfbd9f21408444c38ad579cba4de3e1c857019091dbf7c9a031","e76aaff856531ff082869f9a820bb1a0b2d0713365396b3997c5fe9b457bb73c","bd642322f25c6eaccb1049adda0086b486da4084a3c112fa9499c66fc2873d3f","8498554c116ec8289c7fe33ed67e36ba801a7e8acdd04ce32c9e864448738bc0","135facafb712b318733713fafdb7e2768e459f96e4971908c75d52956ac645c4","dfd544a9e06dbdb0c7c0a52d5ae5f7ca980fe04c65cd0ee9de4860ac2d38374b","da53b3f81accffc2e119cf2b1e4a5da3bad86042fe9ce4169166750644de5c0c","629af5011267bde14d12c53db982af7392ae37957398227d64ec7281cfa032fa","e0538e0a052324c35c22e22f61f1fe733eed97e68cb6e00aeac901f5e6e4e95c","df11e2bb1c137dbef41c0d7f0631cf52243392b2beac0bddb12e143369cc5dd7","80a3bbe0e4fdfaac2c0a8b92a3ed66d3ded5e8f454c5790c8d593872fc1197f1","c4b26d58e06671d2c62928ee929e0f862bd6b4404199bd3a1fd87cea6cf8f3b5","80a3bbe0e4fdfaac2c0a8b92a3ed66d3ded5e8f454c5790c8d593872fc1197f1","d47a7e17d32b099d75e6288b67324de01a0587e5b8f2ed5c6289a8a7567e1be0","0e2becb7a24e44ae138fe34d93c7a6583d738cd3347720b725e986e9c59a6d19","bdfe71979c31b7fd6391fe3882cab028d3ee39fe751218580af0e056fb6734aa","8a87d493a8a9a2931c73bfeda885c0991149973a892c81908372211165275b0a","80a3bbe0e4fdfaac2c0a8b92a3ed66d3ded5e8f454c5790c8d593872fc1197f1","78c8e83c9f21ffd71caf9340f5c921e38dfd9cb8397859fa391c7d77d8635b00","49036c67dee5c327f19d968c8289c99531eb65ac68d0e8cce4055ac2c4a4e59c","80a3bbe0e4fdfaac2c0a8b92a3ed66d3ded5e8f454c5790c8d593872fc1197f1","75925c52e539a150d822acf3d43f41075d6c371215be27e0c81215a79a802fb4","d5d7b68f5369a210c235cd65458369888f8b839192d088c964f21cab3ac954db","3b043cf9a81854a72963fdb57d1884fc4da1cf5be69b5e0a4c5b751e58cb6d88","b76275b4a94b85da9e4b6b1f8c2b619b996560f9e6030a454260240210a39dd8",{"version":"c8747693e5872ad5ef3aa016731a06915e1c34dae987829d9aa5bd40c7a2c54b","affectsGlobalScope":true},{"version":"64d4b35c5456adf258d2cf56c341e203a073253f229ef3208fc0d5020253b241","affectsGlobalScope":true},"0359682c54e487c4cab2b53b2b4d35cc8dea4d9914bc6abcdb5701f8b8e745a4","7d7c8ef7d48a035142c07dae60545ecc0e4af4c337742760cb09726f2f8e31db","8566fa84085caa46340393b1704ecd368491918fb45bd688d6e89736aec73a2f","dc33ce27fbeaf0ea3da556c80a6cc8af9d13eb443088c8f25cdc39fca8e756f6","0d5a2ee1fdfa82740e0103389b9efd6bfe145a20018a2da3c02b89666181f4d9","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"92d63add669d18ebc349efbacd88966d6f2ccdddfb1b880b2db98ae3aa7bf7c4","affectsGlobalScope":true},"ccc94049a9841fe47abe5baef6be9a38fc6228807974ae675fb15dc22531b4be",{"version":"9acfe4d1ff027015151ce81d60797b04b52bffe97ad8310bb0ec2e8fd61e1303","affectsGlobalScope":true},"95843d5cfafced8f3f8a5ce57d2335f0bcd361b9483587d12a25e4bd403b8216","afc6e96061af46bcff47246158caee7e056f5288783f2d83d6858cd25be1c565",{"version":"34f5bcac12b36d70304b73de5f5aab3bb91bd9919f984be80579ebcad03a624e","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","2f520601649a893e6a49a8851ebfcf4be8ce090dc1281c2a08a871cb04e8251f","f50c975ab7b50e25a69e3d8a3773894125b44e9698924105f23b812bf7488baf","2b8c764f856a1dd0a9a2bf23e5efddbff157de8138b0754010be561ae5fcaa90","76650408392bf49a8fbf3e2b6b302712a92d76af77b06e2da1cc8077359c4409","0af3121e68297b2247dd331c0d24dba599e50736a7517a5622d5591aae4a3122","6972fca26f6e9bd56197568d4379f99071a90766e06b4fcb5920a0130a9202be",{"version":"4a2628e95962c8ab756121faa3ac2ed348112ff7a87b5c286dd2cc3326546b4c","affectsGlobalScope":true},"80793b2277f31baa199234daed806fff0fb11491d1ebd3357e520c3558063f00","a049a59a02009fc023684fcfaf0ac526fe36c35dcc5d2b7d620c1750ba11b083","196fee5541bfd59699dab615fee2ae7a6f5fe0a6337bcbbfd656ebf1ae329a63","160cc6e3d06938535bc887754afe5798c22d81ce83a9792ebfe2371a70f2ffc2","4b9a003b5c556c96784132945bb41c655ea11273b1917f5c8d0c154dd5fd20dd","a458dc78104cc80048ac24fdc02fe6dce254838094c2f25641b3f954d9721241",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"eecd493fc62c4dba3d988e2d7dff63299bf12ab49f5c9021dfef8dcc1ff2089e","abc1c425b2ad6720433f40f1877abfa4223f0f3dd486c9c28c492179ca183cb6","945a841f9a591197154c85386bc5a1467d42d325104bb36db51bc566bbb240be","10c39ce1df102994b47d4bc0c71aa9a6aea76f4651a5ec51914431f50bc883a1",{"version":"8207e7e6db9aa5fc7e61c8f17ba74cf9c115d26f51f91ee93f790815a7ea9dfb","affectsGlobalScope":true},"9f1069b9e2c051737b1f9b4f1baf50e4a63385a6a89c32235549ae87fc3d5492","ee18f2da7a037c6ceeb112a084e485aead9ea166980bf433474559eac1b46553","29c2706fa0cc49a2bd90c83234da33d08bb9554ecec675e91c1f85087f5a5324","0acbf26bf958f9e80c1ffa587b74749d2697b75b484062d36e103c137c562bc3","d7838022c7dab596357a9604b9c6adffe37dc34085ce0779c958ce9545bd7139","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff",{"version":"806ef4cac3b3d9fa4a48d849c8e084d7c72fcd7b16d76e06049a9ed742ff79c0","affectsGlobalScope":true},"a7971f9fb2a32ec7788ec6cda9d7a33c02023dfe9a62db2030ad1359649d8050","c33a6ea7147af60d8e98f1ac127047f4b0d4e2ce28b8f08ff3de07ca7cc00637",{"version":"b42b47e17b8ece2424ae8039feb944c2e3ba4b262986aebd582e51efbdca93dc","affectsGlobalScope":true},"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","2408611d9b4146e35d1dbd1f443ccd8e187c74614a54b80300728277529dbf11","998a3de5237518c0b3ac00a11b3b4417affb008aa20aedee52f3fdae3cb86151","ad41008ffe077206e1811fc873f4d9005b5fd7f6ab52bb6118fef600815a5cb4","d88ecca73348e7c337541c4b8b60a50aca5e87384f6b8a422fc6603c637e4c21","badae0df9a8016ac36994b0a0e7b82ba6aaa3528e175a8c3cb161e4683eec03e","c3db860bcaaaeb3bbc23f353bbda1f8ab82756c8d5e973bebb3953cb09ea68f2","235a53595bd20b0b0eeb1a29cb2887c67c48375e92f03749b2488fbd46d0b1a0","bc09393cd4cd13f69cf1366d4236fbae5359bb550f0de4e15767e9a91d63dfb1","9c266243b01545e11d2733a55ad02b4c00ecdbda99c561cd1674f96e89cdc958","c71155c05fc76ff948a4759abc1cb9feec036509f500174bc18dad4c7827a60c",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"1503a452a67127e5c2da794d1c7c44344d5038373aae16c9b03ac964db159edd","8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649","fd326577c62145816fe1acc306c734c2396487f76719d3785d4e825b34540b33","3ebae8c00411116a66fca65b08228ea0cf0b72724701f9b854442100aab55aba","8b06ac3faeacb8484d84ddb44571d8f410697f98d7bfa86c0fda60373a9f5215","7eb06594824ada538b1d8b48c3925a83e7db792f47a081a62cf3e5c4e23cf0ee","f5638f7c2f12a9a1a57b5c41b3c1ea7db3876c003bab68e6a57afd6bcc169af0","209e814e8e71aec74f69686a9506dd7610b97ab59dcee9446266446f72a76d05",{"version":"5f186a758a616c107c70e8918db4630d063bd782f22e6e0b17573b125765b40b","affectsGlobalScope":true},"6fa0008bf91a4cc9c8963bace4bba0bd6865cbfa29c3e3ccc461155660fb113a","2b8264b2fefd7367e0f20e2c04eed5d3038831fe00f5efbc110ff0131aab899b","501260c8b07a6e423fb6ebdea704e732ad529208e4fbbc517836fac8f8ae8895","b0d10e46cfe3f6c476b69af02eaa38e4ccc7430221ce3109ae84bb9fb8282298","f7e133b20ee2669b6c0e5d7f0cd510868c57cd64b283e68c7f598e30ce9d76d2","6ba73232c9d3267ca36ddb83e335d474d2c0e167481e3dec416c782894e11438"],"options":{"allowSyntheticDefaultImports":true,"declaration":false,"emitDecoratorMetadata":true,"experimentalDecorators":true,"jsx":2,"module":1,"outDir":"./","removeComments":true,"sourceMap":true,"target":4},"fileIdsList":[[159],[107,159],[106,159],[113,114,159],[111,112,113,159],[131,132,159,166,167],[132,159,166],[159,170],[159,171],[72,74,75,76,77,78,79,80,81,82,83,84,159],[72,73,75,76,77,78,79,80,81,82,83,84,159],[73,74,75,76,77,78,79,80,81,82,83,84,159],[72,73,74,76,77,78,79,80,81,82,83,84,159],[72,73,74,75,77,78,79,80,81,82,83,84,159],[72,73,74,75,76,78,79,80,81,82,83,84,159],[72,73,74,75,76,77,79,80,81,82,83,84,159],[72,73,74,75,76,77,78,80,81,82,83,84,159],[72,73,74,75,76,77,78,79,81,82,83,84,159],[72,73,74,75,76,77,78,79,80,82,83,84,159],[72,73,74,75,76,77,78,79,80,81,83,84,159],[72,73,74,75,76,77,78,79,80,81,82,84,159],[72,73,74,75,76,77,78,79,80,81,82,83,159],[116,159],[119,159],[120,125,159],[121,131,132,139,148,158,159],[121,122,131,139,159],[123,159],[124,125,132,140,159],[125,148,155,159],[126,128,131,139,159],[127,159],[128,129,159],[130,131,159],[131,159],[131,132,133,148,158,159],[131,132,133,148,159],[134,139,148,158,159],[131,132,134,135,139,148,155,158,159],[134,136,148,155,158,159],[116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165],[131,137,159],[138,158,159],[128,131,139,148,159],[140,159],[141,159],[119,142,159],[143,157,159,163],[144,159],[145,159],[131,146,159],[146,147,159,161],[131,148,149,150,159],[148,150,159],[148,149,159],[151,159],[152,159],[131,153,154,159],[153,154,159],[125,139,155,159],[156,159],[139,157,159],[120,134,145,158,159],[125,159],[148,159,160],[159,161],[159,162],[120,125,131,133,142,148,158,159,161,163],[148,159,164],[159,179],[101,159],[84,98,159],[84,99,100,159],[84,159],[104,159],[96,159],[44,70,71,95,159],[65,66,67,70,159],[69,159],[94,159],[44,84,93,159],[68,159],[88,92,159],[88,159],[85,86,87,89,90,91,159],[65,159],[46,159],[45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,159],[98,159],[97,102,103,132,159]],"referencedMap":[[107,1],[106,1],[108,2],[109,3],[110,1],[115,4],[111,1],[114,5],[113,1],[168,6],[169,7],[170,1],[171,8],[172,9],[112,1],[73,10],[74,11],[72,12],[75,13],[76,14],[77,15],[78,16],[79,17],[80,18],[81,19],[82,20],[83,21],[84,22],[167,1],[173,1],[174,1],[116,23],[117,23],[119,24],[120,25],[121,26],[122,27],[123,28],[124,29],[125,30],[126,31],[127,32],[128,33],[129,33],[130,34],[131,35],[132,36],[133,37],[118,1],[165,1],[134,38],[135,39],[136,40],[166,41],[137,42],[138,43],[139,44],[140,45],[141,46],[142,47],[143,48],[144,49],[145,50],[146,51],[147,52],[148,53],[150,54],[149,55],[151,56],[152,57],[153,58],[154,59],[155,60],[156,61],[157,62],[158,63],[159,64],[160,65],[161,66],[162,67],[163,68],[164,69],[175,1],[176,1],[177,1],[178,1],[179,1],[180,70],[8,1],[9,1],[13,1],[12,1],[2,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[21,1],[3,1],[4,1],[43,1],[25,1],[22,1],[23,1],[24,1],[26,1],[27,1],[28,1],[5,1],[29,1],[30,1],[31,1],[32,1],[6,1],[33,1],[34,1],[35,1],[36,1],[7,1],[41,1],[37,1],[38,1],[39,1],[40,1],[1,1],[42,1],[11,1],[10,1],[102,71],[99,72],[101,73],[100,74],[98,1],[105,75],[97,76],[67,1],[96,77],[71,78],[70,79],[95,80],[94,81],[69,82],[68,1],[93,83],[88,1],[89,84],[85,1],[91,1],[92,85],[87,1],[86,46],[90,1],[66,86],[61,87],[53,87],[50,1],[56,87],[52,1],[54,1],[58,1],[51,1],[57,1],[55,1],[48,87],[45,1],[47,87],[49,87],[46,1],[65,88],[59,87],[62,87],[64,86],[60,1],[63,87],[44,1],[103,89],[104,90]],"exportedModulesMap":[[107,1],[106,1],[108,2],[109,3],[110,1],[115,4],[111,1],[114,5],[113,1],[168,6],[169,7],[170,1],[171,8],[172,9],[112,1],[73,10],[74,11],[72,12],[75,13],[76,14],[77,15],[78,16],[79,17],[80,18],[81,19],[82,20],[83,21],[84,22],[167,1],[173,1],[174,1],[116,23],[117,23],[119,24],[120,25],[121,26],[122,27],[123,28],[124,29],[125,30],[126,31],[127,32],[128,33],[129,33],[130,34],[131,35],[132,36],[133,37],[118,1],[165,1],[134,38],[135,39],[136,40],[166,41],[137,42],[138,43],[139,44],[140,45],[141,46],[142,47],[143,48],[144,49],[145,50],[146,51],[147,52],[148,53],[150,54],[149,55],[151,56],[152,57],[153,58],[154,59],[155,60],[156,61],[157,62],[158,63],[159,64],[160,65],[161,66],[162,67],[163,68],[164,69],[175,1],[176,1],[177,1],[178,1],[179,1],[180,70],[8,1],[9,1],[13,1],[12,1],[2,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[21,1],[3,1],[4,1],[43,1],[25,1],[22,1],[23,1],[24,1],[26,1],[27,1],[28,1],[5,1],[29,1],[30,1],[31,1],[32,1],[6,1],[33,1],[34,1],[35,1],[36,1],[7,1],[41,1],[37,1],[38,1],[39,1],[40,1],[1,1],[42,1],[11,1],[10,1],[102,71],[99,72],[101,73],[100,74],[98,1],[105,75],[97,76],[67,1],[96,77],[71,78],[70,79],[95,80],[94,81],[69,82],[68,1],[93,83],[88,1],[89,84],[85,1],[91,1],[92,85],[87,1],[86,46],[90,1],[66,86],[61,87],[53,87],[50,1],[56,87],[52,1],[54,1],[58,1],[51,1],[57,1],[55,1],[48,87],[45,1],[47,87],[49,87],[46,1],[65,88],[59,87],[62,87],[64,86],[60,1],[63,87],[44,1],[103,89],[104,90]],"semanticDiagnosticsPerFile":[107,106,108,109,110,115,111,114,113,168,169,170,171,172,112,73,74,72,75,76,77,78,79,80,81,82,83,84,167,173,174,116,117,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,118,165,134,135,136,166,137,138,139,140,141,142,143,144,145,146,147,148,150,149,151,152,153,154,155,156,157,158,159,160,161,162,163,164,175,176,177,178,179,180,8,9,13,12,2,14,15,16,17,18,19,20,21,3,4,43,25,22,23,24,26,27,28,5,29,30,31,32,6,33,34,35,36,7,41,37,38,39,40,1,42,11,10,102,99,101,100,98,105,97,67,96,71,70,95,94,69,68,93,88,89,85,91,92,87,86,90,66,61,53,50,56,52,54,58,51,57,55,48,45,47,49,46,65,59,62,64,60,63,44,103,104]},"version":"4.5.5"}
|
package/index.d.ts
ADDED
package/index.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export * from './src';
|
package/package.json
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
{
|
2
|
+
"name": "@biorate/file-config",
|
3
|
+
"version": "0.16.1",
|
4
|
+
"description": "Module for configuring the application using files",
|
5
|
+
"main": "dist",
|
6
|
+
"scripts": {
|
7
|
+
"build": "npx tsc -p ./tsconfig.build.json --outDir ./dist",
|
8
|
+
"test": "npx nyc --reporter=lcov --reporter=text-summary -- npx mocha -r ts-node/register tests/**/*.spec.ts",
|
9
|
+
"prepublishOnly": "npm run build"
|
10
|
+
},
|
11
|
+
"repository": {
|
12
|
+
"type": "git",
|
13
|
+
"url": "git+https://github.com/biorate/core.git",
|
14
|
+
"directory": "packages/@biorate/file-config"
|
15
|
+
},
|
16
|
+
"publishConfig": {
|
17
|
+
"access": "public"
|
18
|
+
},
|
19
|
+
"homepage": "https://biorate.github.io/core",
|
20
|
+
"keywords": [],
|
21
|
+
"author": "llevkin",
|
22
|
+
"license": "MIT",
|
23
|
+
"dependencies": {
|
24
|
+
"@biorate/config": "0.16.1",
|
25
|
+
"@biorate/errors": "0.16.1",
|
26
|
+
"@biorate/inversion": "0.15.0"
|
27
|
+
},
|
28
|
+
"gitHead": "56133a9c94f3d02036870cd18df2e7f95720c3fe"
|
29
|
+
}
|
package/src/errors.ts
ADDED
package/src/index.ts
ADDED
@@ -0,0 +1,108 @@
|
|
1
|
+
import { init, injectable } from '@biorate/inversion';
|
2
|
+
import { Config } from '@biorate/config';
|
3
|
+
import { readFileSync } from 'fs';
|
4
|
+
import { ConfigFileNotFoundPathError } from './errors';
|
5
|
+
export * from './errors';
|
6
|
+
|
7
|
+
/**
|
8
|
+
* @description
|
9
|
+
* Module for configuring the application using files,
|
10
|
+
* extends [Config](https://biorate.github.io/core/classes/config.Config.html) base class.
|
11
|
+
*
|
12
|
+
* ### Features:
|
13
|
+
* - default configuration in config.json file
|
14
|
+
* - configuration depending on the NODE_ENV environment variable in config.{NODE_ENV}.json file
|
15
|
+
* - package.json data access in "package" namespace
|
16
|
+
*
|
17
|
+
* ### How to use:
|
18
|
+
* In ***cwd*** of you app, near package.json, create 2 files:
|
19
|
+
* <br />
|
20
|
+
* <br />
|
21
|
+
*
|
22
|
+
* ```bash
|
23
|
+
* # config.json
|
24
|
+
* {
|
25
|
+
* "app": "test"
|
26
|
+
* }
|
27
|
+
* ```
|
28
|
+
* <br />
|
29
|
+
*
|
30
|
+
* ```bash
|
31
|
+
* # config.debug.json:
|
32
|
+
* {
|
33
|
+
* "title": "My awesome app"
|
34
|
+
* }
|
35
|
+
* ```
|
36
|
+
*
|
37
|
+
* @example
|
38
|
+
* ```ts
|
39
|
+
* import { Core, injectable, inject, container, Types } from '@biorate/inversion';
|
40
|
+
* import { IConfig } from '@biorate/config';
|
41
|
+
* import { FileConfig } from '@biorate/file-config';
|
42
|
+
*
|
43
|
+
* @injectable()
|
44
|
+
* class Root extends Core() {
|
45
|
+
* @inject(Types.Config) public config: IConfig;
|
46
|
+
* }
|
47
|
+
*
|
48
|
+
* container.bind<IConfig>(Types.Config)
|
49
|
+
* .to(FileConfig)
|
50
|
+
* .inSingletonScope();
|
51
|
+
*
|
52
|
+
* container.bind<Root>(Root).toSelf().inSingletonScope();
|
53
|
+
*
|
54
|
+
* (async () => {
|
55
|
+
* const root = await container.get(Root).$run();
|
56
|
+
*
|
57
|
+
* console.log(root.config.get('package'));
|
58
|
+
* // {
|
59
|
+
* // "name": "file-config-test",
|
60
|
+
* // "version": "0.0.0",
|
61
|
+
* // "description": "Test package.json",
|
62
|
+
* // "keywords": [],
|
63
|
+
* // "author": "llevkin",
|
64
|
+
* // "license": "MIT"
|
65
|
+
* // }
|
66
|
+
*
|
67
|
+
* console.log(root.config.get('app')); // test
|
68
|
+
* console.log(root.config.get('title')); // My awesome app
|
69
|
+
* })();
|
70
|
+
* ```
|
71
|
+
*/
|
72
|
+
@injectable()
|
73
|
+
export class FileConfig extends Config {
|
74
|
+
private static _root = process.cwd();
|
75
|
+
|
76
|
+
/**
|
77
|
+
* @description Change application root. Application root is equal ***process.cwd()*** by default
|
78
|
+
* @example
|
79
|
+
* ```ts
|
80
|
+
* FileConfig.root('/www/my-app/');
|
81
|
+
* ```
|
82
|
+
* @example
|
83
|
+
* ```ts
|
84
|
+
* container.bind<IConfig>(Types.Config)
|
85
|
+
* .to(FileConfig.root('/www/my-app/'))
|
86
|
+
* .inSingletonScope();
|
87
|
+
* ```
|
88
|
+
*/
|
89
|
+
public static root(path: string) {
|
90
|
+
FileConfig._root = path;
|
91
|
+
return this;
|
92
|
+
}
|
93
|
+
|
94
|
+
protected load(file: string, namespace: string = null) {
|
95
|
+
try {
|
96
|
+
const data = JSON.parse(readFileSync(`${FileConfig._root}/${file}.json`, 'utf-8'));
|
97
|
+
this.merge(namespace ? { [namespace]: data } : data);
|
98
|
+
} catch (e) {
|
99
|
+
console.warn(new ConfigFileNotFoundPathError(file, e.message).message);
|
100
|
+
}
|
101
|
+
}
|
102
|
+
|
103
|
+
@init() protected initialize() {
|
104
|
+
this.load('package', 'package');
|
105
|
+
this.load('config');
|
106
|
+
this.load(`config.${process.env.NODE_ENV ?? 'debug'}`);
|
107
|
+
}
|
108
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { use } from 'chai';
|
2
|
+
import { jestSnapshotPlugin } from 'mocha-chai-jest-snapshot';
|
3
|
+
import { Core, injectable, inject, container, Types } from '@biorate/inversion';
|
4
|
+
import { IConfig } from '@biorate/config';
|
5
|
+
import { FileConfig } from '../..';
|
6
|
+
|
7
|
+
use(jestSnapshotPlugin());
|
8
|
+
|
9
|
+
@injectable()
|
10
|
+
class Root extends Core() {
|
11
|
+
@inject(Types.Config) public config: IConfig;
|
12
|
+
}
|
13
|
+
|
14
|
+
container.bind<IConfig>(Types.Config).to(FileConfig.root(__dirname)).inSingletonScope();
|
15
|
+
container.bind<Root>(Root).toSelf().inSingletonScope();
|
16
|
+
|
17
|
+
export const root = container.get(Root);
|
@@ -0,0 +1,12 @@
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
+
|
3
|
+
exports[`@biorate/file-config package.json 1`] = `
|
4
|
+
Object {
|
5
|
+
"author": "llevkin",
|
6
|
+
"description": "Test package.json",
|
7
|
+
"keywords": Array [],
|
8
|
+
"license": "MIT",
|
9
|
+
"name": "file-config-test",
|
10
|
+
"version": "0.0.0",
|
11
|
+
}
|
12
|
+
`;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { expect } from 'chai';
|
2
|
+
import { root } from './__mocks__';
|
3
|
+
|
4
|
+
describe('@biorate/file-config', () => {
|
5
|
+
before(async () => await root.$run());
|
6
|
+
|
7
|
+
it('config.json', () => expect(root.config.get('base')).to.be.a('boolean').equal(true));
|
8
|
+
|
9
|
+
it('config.debug.json', () =>
|
10
|
+
expect(root.config.get('environment')).to.be.a('boolean').equal(true));
|
11
|
+
|
12
|
+
it('package.json', () => expect(root.config.get('package')).toMatchSnapshot());
|
13
|
+
});
|