@achs/env 3.1.0 → 3.1.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.
Files changed (138) hide show
  1. package/arguments.d.ts +25 -0
  2. package/arguments.d.ts.map +1 -0
  3. package/{src/arguments.ts → arguments.js} +8 -32
  4. package/arguments.js.map +1 -0
  5. package/commands/env.command.d.ts +8 -0
  6. package/commands/env.command.d.ts.map +1 -0
  7. package/commands/env.command.js +85 -0
  8. package/commands/env.command.js.map +1 -0
  9. package/commands/export.command.d.ts +8 -0
  10. package/commands/export.command.d.ts.map +1 -0
  11. package/commands/export.command.js +54 -0
  12. package/commands/export.command.js.map +1 -0
  13. package/{src/commands/index.ts → commands/index.d.ts} +1 -0
  14. package/commands/index.d.ts.map +1 -0
  15. package/commands/index.js +14 -0
  16. package/commands/index.js.map +1 -0
  17. package/commands/pull.command.d.ts +7 -0
  18. package/commands/pull.command.d.ts.map +1 -0
  19. package/commands/pull.command.js +39 -0
  20. package/commands/pull.command.js.map +1 -0
  21. package/commands/push.command.d.ts +7 -0
  22. package/commands/push.command.d.ts.map +1 -0
  23. package/commands/push.command.js +38 -0
  24. package/commands/push.command.js.map +1 -0
  25. package/commands/schema.command.d.ts +4 -0
  26. package/commands/schema.command.d.ts.map +1 -0
  27. package/commands/schema.command.js +18 -0
  28. package/commands/schema.command.js.map +1 -0
  29. package/exec.d.ts +3 -0
  30. package/exec.d.ts.map +1 -0
  31. package/exec.js +142 -0
  32. package/exec.js.map +1 -0
  33. package/{src/index.ts → index.d.ts} +1 -0
  34. package/index.d.ts.map +1 -0
  35. package/index.js +20 -0
  36. package/index.js.map +1 -0
  37. package/{src/interfaces/index.ts → interfaces/index.d.ts} +1 -0
  38. package/interfaces/index.d.ts.map +1 -0
  39. package/interfaces/index.js +18 -0
  40. package/interfaces/index.js.map +1 -0
  41. package/interfaces/loader.interface.d.ts +21 -0
  42. package/interfaces/loader.interface.d.ts.map +1 -0
  43. package/interfaces/loader.interface.js +3 -0
  44. package/interfaces/loader.interface.js.map +1 -0
  45. package/main.d.ts +3 -0
  46. package/main.d.ts.map +1 -0
  47. package/main.js +6 -0
  48. package/main.js.map +1 -0
  49. package/package.json +1 -1
  50. package/providers/app-settings.provider.d.ts +8 -0
  51. package/providers/app-settings.provider.d.ts.map +1 -0
  52. package/providers/app-settings.provider.js +50 -0
  53. package/providers/app-settings.provider.js.map +1 -0
  54. package/providers/azure-key-vault.provider.d.ts +20 -0
  55. package/providers/azure-key-vault.provider.d.ts.map +1 -0
  56. package/providers/azure-key-vault.provider.js +143 -0
  57. package/providers/azure-key-vault.provider.js.map +1 -0
  58. package/providers/index.d.ts +7 -0
  59. package/providers/index.d.ts.map +1 -0
  60. package/providers/index.js +30 -0
  61. package/providers/index.js.map +1 -0
  62. package/providers/local.provider.d.ts +8 -0
  63. package/providers/local.provider.d.ts.map +1 -0
  64. package/providers/local.provider.js +31 -0
  65. package/providers/local.provider.js.map +1 -0
  66. package/providers/package-json.provider.d.ts +8 -0
  67. package/providers/package-json.provider.d.ts.map +1 -0
  68. package/providers/package-json.provider.js +29 -0
  69. package/providers/package-json.provider.js.map +1 -0
  70. package/tsconfig.build.tsbuildinfo +1 -0
  71. package/utils/command.util.d.ts +13 -0
  72. package/utils/command.util.d.ts.map +1 -0
  73. package/utils/command.util.js +134 -0
  74. package/utils/command.util.js.map +1 -0
  75. package/{src/utils/index.ts → utils/index.d.ts} +1 -0
  76. package/utils/index.d.ts.map +1 -0
  77. package/utils/index.js +23 -0
  78. package/utils/index.js.map +1 -0
  79. package/utils/interpolate.util.d.ts +4 -0
  80. package/utils/interpolate.util.d.ts.map +1 -0
  81. package/utils/interpolate.util.js +33 -0
  82. package/utils/interpolate.util.js.map +1 -0
  83. package/utils/json.util.d.ts +5 -0
  84. package/utils/json.util.d.ts.map +1 -0
  85. package/utils/json.util.js +48 -0
  86. package/utils/json.util.js.map +1 -0
  87. package/utils/logger.d.ts +3 -0
  88. package/utils/logger.d.ts.map +1 -0
  89. package/{src/utils/logger.ts → utils/logger.js} +6 -6
  90. package/utils/logger.js.map +1 -0
  91. package/utils/normalize.util.d.ts +3 -0
  92. package/utils/normalize.util.d.ts.map +1 -0
  93. package/utils/normalize.util.js +61 -0
  94. package/utils/normalize.util.js.map +1 -0
  95. package/utils/schema.util.d.ts +11 -0
  96. package/utils/schema.util.d.ts.map +1 -0
  97. package/utils/schema.util.js +100 -0
  98. package/utils/schema.util.js.map +1 -0
  99. package/.eslintignore +0 -3
  100. package/.eslintrc.json +0 -329
  101. package/.vscode/extensions.json +0 -18
  102. package/.vscode/launch.json +0 -30
  103. package/.vscode/settings.json +0 -29
  104. package/jest.config.json +0 -28
  105. package/src/commands/env.command.ts +0 -139
  106. package/src/commands/export.command.ts +0 -88
  107. package/src/commands/pull.command.ts +0 -52
  108. package/src/commands/push.command.ts +0 -48
  109. package/src/commands/schema.command.ts +0 -31
  110. package/src/exec.ts +0 -221
  111. package/src/interfaces/loader.interface.ts +0 -66
  112. package/src/main.ts +0 -6
  113. package/src/providers/app-settings.provider.ts +0 -67
  114. package/src/providers/azure-key-vault.provider.ts +0 -277
  115. package/src/providers/index.ts +0 -29
  116. package/src/providers/local.provider.ts +0 -44
  117. package/src/providers/package-json.provider.ts +0 -39
  118. package/src/utils/command.util.ts +0 -223
  119. package/src/utils/interpolate.util.ts +0 -65
  120. package/src/utils/json.util.ts +0 -116
  121. package/src/utils/normalize.util.ts +0 -142
  122. package/src/utils/schema.util.ts +0 -191
  123. package/tests/env/appsettings.json +0 -32
  124. package/tests/env/dev.env.json +0 -12
  125. package/tests/env/dev.local.env.json +0 -9
  126. package/tests/env/env.schema.json +0 -225
  127. package/tests/env/keys.json +0 -7
  128. package/tests/env/settings/schema.json +0 -239
  129. package/tests/env/settings/settings.json +0 -22
  130. package/tests/env.int.test.ts +0 -42
  131. package/tests/exec.ts +0 -19
  132. package/tests/export.int.test.ts +0 -9
  133. package/tests/pull-push.int.test.ts +0 -15
  134. package/tests/run.js +0 -32
  135. package/tests/schema.int.test.ts +0 -9
  136. package/tests/setup.ts +0 -13
  137. package/tsconfig.build.json +0 -10
  138. package/tsconfig.json +0 -37
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.createValidators = exports.createValidator = exports.flatSchema = exports.schemaToJson = exports.isJsonSchemaObject = exports.schemaFrom = void 0;
7
+ const ajv_1 = __importDefault(require("ajv"));
8
+ const ajv_formats_1 = __importDefault(require("ajv-formats"));
9
+ const to_json_schema_1 = __importDefault(require("to-json-schema"));
10
+ const FORMAT_REGEXPS = {
11
+ 'ip-address': /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d{1,2})\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d{1,2})$/,
12
+ color: /^(#?([\dA-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\b\s*,\s*\b(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\b\s*,\s*\b(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/,
13
+ hostname: /^(?=.{1,255}$)[\dA-Za-z](?:(?:[\dA-Za-z]|-){0,61}[\dA-Za-z])?(?:\.[\dA-Za-z](?:(?:[\dA-Za-z]|-){0,61}[\dA-Za-z])?)*\.?$/,
14
+ alphanumeric: /^[\dA-Za-z]+$/,
15
+ 'utc-millisec': (input) => !Number.isNaN(+input),
16
+ alpha: /^[A-Za-z]+$/,
17
+ style: /\s*(.+?):\s*([^;]+);?/g,
18
+ phone: /^\+(?:\d ?){6,14}\d$/
19
+ };
20
+ function schemaFrom(json, options) {
21
+ return (0, to_json_schema_1.default)(json, {
22
+ required: false,
23
+ ...options,
24
+ postProcessFnc: (type, schema, value, defaultFunc) => {
25
+ var _a;
26
+ if (value !== json) {
27
+ schema.type = [type];
28
+ schema.nullable = (_a = options === null || options === void 0 ? void 0 : options.nullable) !== null && _a !== void 0 ? _a : false;
29
+ }
30
+ return defaultFunc(type, schema, value);
31
+ }
32
+ });
33
+ }
34
+ exports.schemaFrom = schemaFrom;
35
+ function isJsonSchemaObject(schema) {
36
+ if (schema.type === 'object')
37
+ return true;
38
+ return Array.isArray(schema.type) && schema.type.includes('object');
39
+ }
40
+ exports.isJsonSchemaObject = isJsonSchemaObject;
41
+ function schemaToJson(schema, container = {}) {
42
+ var _a;
43
+ if (isJsonSchemaObject(schema)) {
44
+ for (const key in schema.properties)
45
+ container[key] = schemaToJson(schema.properties[key]);
46
+ return container;
47
+ }
48
+ else {
49
+ return (_a = schema.default) !== null && _a !== void 0 ? _a : (schema.nullable ? null : undefined);
50
+ }
51
+ }
52
+ exports.schemaToJson = schemaToJson;
53
+ function flatSchema(schema, parentKey = '', nestingDelimiter = '__', container = {}) {
54
+ if (isJsonSchemaObject(schema)) {
55
+ for (const key in schema.properties) {
56
+ if (key[0] === '#')
57
+ continue;
58
+ const subKey = parentKey + (parentKey ? nestingDelimiter : '') + key;
59
+ container = {
60
+ ...container,
61
+ ...flatSchema(schema.properties[key], subKey, nestingDelimiter)
62
+ };
63
+ }
64
+ return container;
65
+ }
66
+ else {
67
+ return { [parentKey]: schema };
68
+ }
69
+ }
70
+ exports.flatSchema = flatSchema;
71
+ function createValidator(schema, enableFormats = true) {
72
+ const ajv = new ajv_1.default({
73
+ allErrors: true,
74
+ allowUnionTypes: true
75
+ });
76
+ if (enableFormats) {
77
+ (0, ajv_formats_1.default)(ajv, { mode: 'fast' });
78
+ for (const key in FORMAT_REGEXPS)
79
+ ajv.addFormat(key, FORMAT_REGEXPS[key]);
80
+ }
81
+ return ajv.compile(schema);
82
+ }
83
+ exports.createValidator = createValidator;
84
+ function createValidators(schemaLookup, enableFormats = true) {
85
+ const ajv = new ajv_1.default({
86
+ allErrors: true,
87
+ allowUnionTypes: true
88
+ });
89
+ if (enableFormats) {
90
+ (0, ajv_formats_1.default)(ajv, { mode: 'fast' });
91
+ for (const key in FORMAT_REGEXPS)
92
+ ajv.addFormat(key, FORMAT_REGEXPS[key]);
93
+ }
94
+ const validators = {};
95
+ for (const key in schemaLookup)
96
+ validators[key] = ajv.compile(schemaLookup[key]);
97
+ return validators;
98
+ }
99
+ exports.createValidators = createValidators;
100
+ //# sourceMappingURL=schema.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.util.js","sourceRoot":"","sources":["../../src/utils/schema.util.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAoE;AACpE,8DAAqC;AACrC,oEAAuD;AAEvD,MAAM,cAAc,GAA2B;IAC3C,YAAY,EACR,+EAA+E;IAEnF,KAAK,EAAE,8VAA8V;IAErW,QAAQ,EACJ,yHAAyH;IAE7H,YAAY,EAAE,eAAe;IAE7B,cAAc,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC;IAExD,KAAK,EAAE,aAAa;IAEpB,KAAK,EAAE,wBAAwB;IAE/B,KAAK,EAAE,sBAAsB;CAChC,CAAC;AAWF,SAAgB,UAAU,CACtB,IAA6B,EAC7B,OAA0C;IAE1C,OAAO,IAAA,wBAAY,EAAC,IAAI,EAAE;QACtB,QAAQ,EAAE,KAAK;QACf,GAAG,OAAO;QACV,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE;;YACjD,IAAI,KAAK,KAAK,IAAI,EAAE;gBAChB,MAAM,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC;gBACrB,MAAM,CAAC,QAAQ,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAA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B,UAAU,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;IAErD,OAAO,UAAU,CAAC;AACtB,CAAC;AAtBD,4CAsBC"}
package/.eslintignore DELETED
@@ -1,3 +0,0 @@
1
- .vscode/**/*
2
- dist/**/*
3
- *.js
package/.eslintrc.json DELETED
@@ -1,329 +0,0 @@
1
- {
2
- "root": true,
3
- "env": {
4
- "es6": true,
5
- "jest": true,
6
- "node": true,
7
- "es2021": true,
8
- "jest/globals": true
9
- },
10
- "parser": "@typescript-eslint/parser",
11
- "parserOptions": {
12
- "ecmaVersion": 12,
13
- "project": "tsconfig.json",
14
- "sourceType": "module",
15
- "ecmaFeatures": {
16
- "modules": true,
17
- "legacyDecorators": true
18
- }
19
- },
20
- "plugins": [
21
- "@typescript-eslint/eslint-plugin",
22
- "prettier",
23
- "sonarjs",
24
- "unicorn",
25
- "promise",
26
- "jest",
27
- "jest-formatting"
28
- ],
29
- "extends": [
30
- "plugin:@typescript-eslint/recommended",
31
- "plugin:prettier/recommended",
32
- "plugin:eslint-comments/recommended",
33
- "plugin:sonarjs/recommended"
34
- ],
35
- "rules": {
36
- "prettier/prettier": [
37
- "warn",
38
- {
39
- "useTabs": false,
40
- "tabWidth": 4,
41
- "printWidth": 80,
42
- "trailingComma": "none",
43
- "singleQuote": true,
44
- "semi": true,
45
- "bracketSpacing": true,
46
- "bracketSameLine": false,
47
- "quoteProps": "as-needed",
48
- "arrowParens": "always",
49
- "endOfLine": "auto"
50
- }
51
- ],
52
- "@typescript-eslint/explicit-function-return-type": "off",
53
- "@typescript-eslint/explicit-module-boundary-types": "off",
54
- "@typescript-eslint/interface-name-prefix": "off",
55
- "@typescript-eslint/no-empty-interface": [
56
- "error",
57
- {
58
- "allowSingleExtends": true
59
- }
60
- ],
61
- "@typescript-eslint/no-explicit-any": "off",
62
- "@typescript-eslint/no-non-null-assertion": "off",
63
- "@typescript-eslint/no-unused-vars": [
64
- "warn",
65
- {
66
- "args": "after-used",
67
- "caughtErrors": "all",
68
- "vars": "local",
69
- "varsIgnorePattern": "^_.*"
70
- }
71
- ],
72
- "array-callback-return": "error",
73
- "block-scoped-var": "warn",
74
- "block-spacing": "warn",
75
- "class-methods-use-this": "off",
76
- "comma-dangle": ["warn", "never"],
77
- "comma-spacing": [
78
- "warn",
79
- {
80
- "after": true,
81
- "before": false
82
- }
83
- ],
84
- "comma-style": ["warn", "last"],
85
- "curly": ["warn", "multi-or-nest", "consistent"],
86
- "default-case": "warn",
87
- "dot-location": ["warn", "property"],
88
- "dot-notation": "warn",
89
- "eqeqeq": "warn",
90
- "func-call-spacing": ["warn", "never"],
91
- "getter-return": [
92
- "error",
93
- {
94
- "allowImplicit": true
95
- }
96
- ],
97
- "jest-formatting/padding-around-all": "warn",
98
- "jest/no-disabled-tests": "warn",
99
- "jest/no-focused-tests": "error",
100
- "jest/no-identical-title": "error",
101
- "jest/prefer-to-have-length": "warn",
102
- "jest/valid-expect": "error",
103
- "key-spacing": [
104
- "warn",
105
- {
106
- "beforeColon": false
107
- }
108
- ],
109
- "lines-around-comment": [
110
- "warn",
111
- {
112
- "allowArrayStart": true,
113
- "allowBlockStart": true,
114
- "allowClassStart": true,
115
- "allowObjectStart": true,
116
- "beforeBlockComment": true,
117
- "beforeLineComment": false
118
- }
119
- ],
120
- "lines-between-class-members": ["warn", "always"],
121
- "no-console": "warn",
122
- "no-duplicate-case": "error",
123
- "no-empty": "error",
124
- "no-empty-pattern": "error",
125
- "no-eq-null": "warn",
126
- "no-extra-semi": "warn",
127
- "no-mixed-spaces-and-tabs": ["warn", "smart-tabs"],
128
- "no-multi-spaces": "warn",
129
- "no-multiple-empty-lines": [
130
- "warn",
131
- {
132
- "max": 1,
133
- "maxBOF": 0,
134
- "maxEOF": 0
135
- }
136
- ],
137
- "no-throw-literal": "error",
138
- "no-trailing-spaces": "warn",
139
- "no-unneeded-ternary": "warn",
140
- "no-unreachable": "error",
141
- "object-curly-spacing": ["warn", "always"],
142
- "object-shorthand": "warn",
143
- "padded-blocks": ["warn", "never"],
144
- "padding-line-between-statements": [
145
- "warn",
146
- {
147
- "blankLine": "always",
148
- "next": "return",
149
- "prev": "*"
150
- },
151
- {
152
- "blankLine": "always",
153
- "next": "class",
154
- "prev": "*"
155
- },
156
- {
157
- "blankLine": "never",
158
- "next": "import",
159
- "prev": "import"
160
- }
161
- ],
162
- "prefer-promise-reject-errors": "warn",
163
- "promise/always-return": "error",
164
- "promise/avoid-new": "off",
165
- "promise/catch-or-return": "error",
166
- "promise/no-callback-in-promise": "warn",
167
- "promise/no-native": "off",
168
- "promise/no-nesting": "warn",
169
- "promise/no-new-statics": "error",
170
- "promise/no-promise-in-callback": "warn",
171
- "promise/no-return-in-finally": "warn",
172
- "promise/no-return-wrap": "error",
173
- "promise/param-names": "error",
174
- "promise/valid-params": "off",
175
- "quote-props": ["warn", "as-needed"],
176
- "quotes": ["warn", "single", "avoid-escape"],
177
- "radix": ["warn", "as-needed"],
178
- "require-await": "error",
179
- "semi": ["error", "always"],
180
- "semi-spacing": "warn",
181
- "semi-style": ["warn", "last"],
182
- "sonarjs/cognitive-complexity": ["warn", 14],
183
- "sonarjs/max-switch-cases": ["warn", 10],
184
- "sonarjs/no-all-duplicated-branches": "error",
185
- "sonarjs/no-collapsible-if": "warn",
186
- "sonarjs/no-collection-size-mischeck": "error",
187
- "sonarjs/no-duplicate-string": "warn",
188
- "sonarjs/no-duplicated-branches": "error",
189
- "sonarjs/no-element-overwrite": "error",
190
- "sonarjs/no-extra-arguments": "warn",
191
- "sonarjs/no-identical-conditions": "error",
192
- "sonarjs/no-identical-expressions": "warn",
193
- "sonarjs/no-identical-functions": "warn",
194
- "sonarjs/no-inverted-boolean-check": "warn",
195
- "sonarjs/no-one-iteration-loop": "error",
196
- "sonarjs/no-redundant-boolean": "error",
197
- "sonarjs/no-redundant-jump": "error",
198
- "sonarjs/no-same-line-conditional": "error",
199
- "sonarjs/no-small-switch": "warn",
200
- "sonarjs/no-unused-collection": "warn",
201
- "sonarjs/no-use-of-empty-return-value": "error",
202
- "sonarjs/no-useless-catch": "warn",
203
- "sonarjs/prefer-immediate-return": "warn",
204
- "sonarjs/prefer-object-literal": "warn",
205
- "sonarjs/prefer-single-boolean-return": "warn",
206
- "sonarjs/prefer-while": "error",
207
- "sort-imports": "off",
208
- "sort-keys": ["off", "asc"],
209
- "space-before-blocks": "warn",
210
- "space-in-parens": ["warn", "never"],
211
- "spaced-comment": [
212
- "warn",
213
- "always",
214
- {
215
- "block": {
216
- "balanced": true,
217
- "exceptions": ["*"],
218
- "markers": ["!"]
219
- },
220
- "line": {
221
- "exceptions": ["-", "+"],
222
- "markers": ["/"]
223
- }
224
- }
225
- ],
226
- "switch-colon-spacing": "warn",
227
- "vars-on-top": "warn",
228
- "unicorn/better-regex": "error",
229
- "unicorn/catch-error-name": "error",
230
- "unicorn/consistent-destructuring": "error",
231
- "unicorn/consistent-function-scoping": "error",
232
- "unicorn/custom-error-definition": "off",
233
- "unicorn/empty-brace-spaces": "error",
234
- "unicorn/error-message": "error",
235
- "unicorn/escape-case": "error",
236
- "unicorn/expiring-todo-comments": "error",
237
- "unicorn/explicit-length-check": "error",
238
- "unicorn/filename-case": "error",
239
- "unicorn/import-index": "off",
240
- "unicorn/import-style": "error",
241
- "unicorn/new-for-builtins": "error",
242
- "unicorn/no-abusive-eslint-disable": "error",
243
- "unicorn/no-array-callback-reference": "error",
244
- "unicorn/no-array-for-each": "error",
245
- "unicorn/no-array-method-this-argument": "error",
246
- "unicorn/no-array-push-push": "error",
247
- "unicorn/no-array-reduce": "off",
248
- "unicorn/no-await-expression-member": "error",
249
- "unicorn/no-console-spaces": "error",
250
- "unicorn/no-document-cookie": "error",
251
- "unicorn/no-empty-file": "error",
252
- "unicorn/no-for-loop": "off",
253
- "unicorn/no-hex-escape": "error",
254
- "unicorn/no-instanceof-array": "error",
255
- "unicorn/no-invalid-remove-event-listener": "error",
256
- "unicorn/no-keyword-prefix": "off",
257
- "unicorn/no-lonely-if": "error",
258
- "no-nested-ternary": "off",
259
- "unicorn/no-nested-ternary": "error",
260
- "unicorn/no-new-array": "error",
261
- "unicorn/no-new-buffer": "error",
262
- "unicorn/no-null": "off",
263
- "unicorn/no-object-as-default-parameter": "error",
264
- "unicorn/no-process-exit": "off",
265
- "unicorn/no-static-only-class": "error",
266
- "unicorn/no-thenable": "error",
267
- "unicorn/no-this-assignment": "error",
268
- "unicorn/no-unreadable-array-destructuring": "error",
269
- "unicorn/no-unsafe-regex": "off",
270
- "unicorn/no-unused-properties": "off",
271
- "unicorn/no-useless-fallback-in-spread": "error",
272
- "unicorn/no-useless-length-check": "error",
273
- "unicorn/no-useless-promise-resolve-reject": "error",
274
- "unicorn/no-useless-spread": "error",
275
- "unicorn/no-useless-undefined": "error",
276
- "unicorn/no-zero-fractions": "error",
277
- "unicorn/number-literal-case": "error",
278
- "unicorn/numeric-separators-style": "error",
279
- "unicorn/prefer-add-event-listener": "error",
280
- "unicorn/prefer-array-find": "error",
281
- "unicorn/prefer-array-flat": "error",
282
- "unicorn/prefer-array-flat-map": "error",
283
- "unicorn/prefer-array-index-of": "error",
284
- "unicorn/prefer-array-some": "error",
285
- "unicorn/prefer-at": "off",
286
- "unicorn/prefer-code-point": "error",
287
- "unicorn/prefer-date-now": "error",
288
- "unicorn/prefer-default-parameters": "error",
289
- "unicorn/prefer-dom-node-append": "error",
290
- "unicorn/prefer-dom-node-dataset": "error",
291
- "unicorn/prefer-dom-node-remove": "error",
292
- "unicorn/prefer-dom-node-text-content": "error",
293
- "unicorn/prefer-export-from": "error",
294
- "unicorn/prefer-includes": "error",
295
- "unicorn/prefer-json-parse-buffer": "error",
296
- "unicorn/prefer-keyboard-event-key": "error",
297
- "unicorn/prefer-math-trunc": "error",
298
- "unicorn/prefer-modern-dom-apis": "error",
299
- "unicorn/prefer-module": "off",
300
- "unicorn/prefer-negative-index": "error",
301
- "unicorn/prefer-node-protocol": "off",
302
- "unicorn/prefer-number-properties": "error",
303
- "unicorn/prefer-object-from-entries": "error",
304
- "unicorn/prefer-optional-catch-binding": "error",
305
- "unicorn/prefer-prototype-methods": "error",
306
- "unicorn/prefer-query-selector": "error",
307
- "unicorn/prefer-reflect-apply": "error",
308
- "unicorn/prefer-regexp-test": "error",
309
- "unicorn/prefer-set-has": "error",
310
- "unicorn/prefer-spread": "error",
311
- "unicorn/prefer-string-replace-all": "off",
312
- "unicorn/prefer-string-slice": "error",
313
- "unicorn/prefer-string-starts-ends-with": "error",
314
- "unicorn/prefer-string-trim-start-end": "error",
315
- "unicorn/prefer-switch": "error",
316
- "unicorn/prefer-ternary": "off",
317
- "unicorn/prefer-top-level-await": "off",
318
- "unicorn/prefer-type-error": "error",
319
- "unicorn/prevent-abbreviations": "off",
320
- "unicorn/relative-url-style": "error",
321
- "unicorn/require-array-join-separator": "error",
322
- "unicorn/require-number-to-fixed-digits-argument": "error",
323
- "unicorn/require-post-message-target-origin": "off",
324
- "unicorn/string-content": "off",
325
- "unicorn/template-indent": "warn",
326
- "unicorn/text-encoding-identifier-case": "error",
327
- "unicorn/throw-new-error": "error"
328
- }
329
- }
@@ -1,18 +0,0 @@
1
- {
2
- "recommendations": [
3
- "abhijoybasak.nestjs-files",
4
- "adam-bender.commit-message-editor",
5
- "alefragnani.bookmarks",
6
- "bradgashler.htmltagwrap",
7
- "dbaeumer.vscode-eslint",
8
- "eamodio.gitlens",
9
- "exodiusstudios.comment-anchors",
10
- "manuelalabor.rxjs-debugging-for-vs-code",
11
- "oouo-diogo-perdigao.docthis",
12
- "rbbit.typescript-hero",
13
- "svipas.prettier-plus",
14
- "tyriar.windows-terminal",
15
- "waderyan.gitblame",
16
- "yatki.vscode-surround"
17
- ]
18
- }
@@ -1,30 +0,0 @@
1
- {
2
- "version": "0.2.0",
3
- "configurations": [
4
- {
5
- "name": "Test",
6
- "type": "node",
7
- "request": "launch",
8
- "cwd": "${workspaceFolder}",
9
- "sourceMaps": true,
10
- "restart": true,
11
- "disableOptimisticBPs": true,
12
- "runtimeExecutable": "npm",
13
- "runtimeArgs": [
14
- "run",
15
- "test",
16
- "${fileBasenameNoExtension}",
17
- "-no-cache"
18
- ],
19
- "outFiles": [
20
- "${workspaceFolder}/src/**/*.ts"
21
- ],
22
- "skipFiles": [
23
- "<node_internals>/**/*.js"
24
- ],
25
- "protocol": "inspector",
26
- "console": "integratedTerminal",
27
- "internalConsoleOptions": "neverOpen"
28
- }
29
- ]
30
- }
@@ -1,29 +0,0 @@
1
- {
2
- "editor.rulers": [80, 100],
3
- "explorer.sortOrder": "type",
4
- "files.exclude": {
5
- "**/*.log": true,
6
- "**/*.map.js": true,
7
- "**/.DS_Store": true,
8
- "**/.git": true,
9
- "**/.git/objects/**": true,
10
- "**/.git/subtree-cache/**": true,
11
- "**/.hg": true,
12
- "**/.history/**": true,
13
- "**/.svn": true,
14
- "**/CVS": true,
15
- "**/bower_components/**": true,
16
- "**/node_modules/**": true,
17
- "desktop.ini": true,
18
- "folderico*.ico": true
19
- },
20
- "files.insertFinalNewline": true,
21
- "files.trimTrailingWhitespace": true,
22
- "typescript.tsdk": "node_modules\\typescript\\lib",
23
- "[javascript]": {
24
- "editor.defaultFormatter": "dbaeumer.vscode-eslint"
25
- },
26
- "[typescript]": {
27
- "editor.defaultFormatter": "dbaeumer.vscode-eslint"
28
- }
29
- }
package/jest.config.json DELETED
@@ -1,28 +0,0 @@
1
- {
2
- "rootDir": ".",
3
- "roots": ["src", "tests"],
4
- "testEnvironment": "node",
5
- "globalSetup": "./tests/setup.ts",
6
- "bail": 1,
7
- "verbose": true,
8
- "clearMocks": true,
9
- "testTimeout": 30000,
10
- "slowTestThreshold": 10,
11
- "moduleDirectories": ["node_modules", "src"],
12
- "moduleFileExtensions": ["js", "json", "ts"],
13
- "testRegex": ".*\\.(spec|test)\\.ts$",
14
- "transform": {
15
- "^.+\\.(t|j)s$": "ts-jest"
16
- },
17
- "collectCoverageFrom": ["src/**/*.(t|j)s"],
18
- "coverageDirectory": "__reports__/coverage",
19
- "coveragePathIgnorePatterns": [
20
- "index.ts",
21
- "main.ts",
22
- ".d.ts",
23
- "tests",
24
- "__reports__",
25
- "__tests__",
26
- "__mocks__"
27
- ]
28
- }