@itgorillaz/configify 1.2.3 → 1.2.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itgorillaz/configify",
3
- "version": "1.2.3",
3
+ "version": "1.2.4",
4
4
  "description": "NestJS Config on Steroids",
5
5
  "author": "tommelo",
6
6
  "private": false,
@@ -42,12 +42,12 @@
42
42
  "@nestjs/cli": "^10.3.2",
43
43
  "@nestjs/schematics": "^10.1.1",
44
44
  "@nestjs/testing": "^10.3.7",
45
- "@types/jest": "29.5.12",
45
+ "@types/jest": "29.5.14",
46
46
  "@types/js-yaml": "^4.0.9",
47
- "@types/node": "20.14.10",
47
+ "@types/node": "22.9.0",
48
48
  "@types/supertest": "^6.0.2",
49
- "@typescript-eslint/eslint-plugin": "^7.4.0",
50
- "@typescript-eslint/parser": "^7.4.0",
49
+ "@typescript-eslint/eslint-plugin": "^8.1.0",
50
+ "@typescript-eslint/parser": "^8.1.0",
51
51
  "eslint": "^8.0.0 || ^9.0.0",
52
52
  "eslint-config-prettier": "^9.1.0",
53
53
  "eslint-plugin-prettier": "^5.1.3",
@@ -56,7 +56,7 @@
56
56
  "prettier-plugin-organize-imports": "^4.0.0",
57
57
  "source-map-support": "^0.5.20",
58
58
  "supertest": "^7.0.0",
59
- "ts-jest": "29.2.2",
59
+ "ts-jest": "29.2.5",
60
60
  "ts-loader": "^9.2.3",
61
61
  "ts-node": "^10.0.0",
62
62
  "tsconfig-paths": "4.2.0",
@@ -231,8 +231,8 @@ export class ConfigifyModule {
231
231
  * @returns {string[]} list of configuration files
232
232
  */
233
233
  private static resolveConfigurationFiles(path?: string | string[]): string[] {
234
- return []
235
- .concat(path, this.DEFAULT_CONFIG_FILES)
234
+ return ([] as string[])
235
+ .concat(path || [], this.DEFAULT_CONFIG_FILES)
236
236
  .filter(
237
237
  (file) =>
238
238
  fs.existsSync(file) && ConfigurationParserFactory.supports(file),
@@ -11,7 +11,7 @@ import {
11
11
  * with Configuration decorator.
12
12
  */
13
13
  export class ConfigurationRegistry {
14
- private static readonly registry = [];
14
+ private static readonly registry: Array<unknown> = [];
15
15
 
16
16
  /**
17
17
  * Registers a type.
@@ -12,7 +12,7 @@ export class ConfigurationParserFactory {
12
12
  /**
13
13
  * The supported file configuration parsers
14
14
  */
15
- private static readonly parsers = {
15
+ private static readonly parsers: Record<string, ConfigurationParser> = {
16
16
  env: new DotEnvConfigurationParser(),
17
17
  yml: new YamlConfigurationParser(),
18
18
  yaml: new YamlConfigurationParser(),
@@ -26,7 +26,7 @@ export class ConfigurationParserFactory {
26
26
  * @returns {ConfigurationParser} the configuration parser
27
27
  */
28
28
  static getParser(file: string): ConfigurationParser {
29
- const ext = this.getFileExt(file);
29
+ const ext = this.getFileExt(file) as keyof typeof this.parsers;
30
30
  return this.parsers[ext];
31
31
  }
32
32
 
@@ -38,7 +38,7 @@ export class ConfigurationParserFactory {
38
38
  */
39
39
  static supports(file: string): boolean {
40
40
  const ext = this.getFileExt(file);
41
- return this.parsers.hasOwnProperty(ext);
41
+ return ext ? this.parsers.hasOwnProperty(ext) : false;
42
42
  }
43
43
 
44
44
  /**
@@ -47,7 +47,7 @@ export class ConfigurationParserFactory {
47
47
  * @param {string} file the file name
48
48
  * @returns {string} the file extension
49
49
  */
50
- private static getFileExt(file: string): string {
50
+ private static getFileExt(file: string): string | undefined {
51
51
  return file.split('.').pop();
52
52
  }
53
53
  }
@@ -13,6 +13,6 @@ export class YamlConfigurationParser implements ConfigurationParser {
13
13
  * @returns {Record<string, any>} an object representation of the configuration file
14
14
  */
15
15
  public parse(file: string): Record<string, any> {
16
- return yaml.load(fs.readFileSync(file, 'utf-8'));
16
+ return yaml.load(fs.readFileSync(file, 'utf-8')) as Record<string, any>;
17
17
  }
18
18
  }
@@ -36,7 +36,7 @@ export class AwsParameterStoreConfigurationResolver
36
36
  if (errors && errors.length) {
37
37
  throw new Error(
38
38
  `Unable to resolve parameter:\n${errors
39
- .map((e) => `${e.key}: ${e.id} - ${e.error.message}`)
39
+ .map((e) => `${e.key}: ${e.id} - ${e.error?.message}`)
40
40
  .join('\n')}`,
41
41
  );
42
42
  }
@@ -39,7 +39,7 @@ export class AwsSecretsManagerConfigurationResolver
39
39
  if (errors && errors.length) {
40
40
  throw new Error(
41
41
  `Unable to resolve secrets:\n${errors
42
- .map((e) => `${e.key}: ${e.id} - ${e.error.message}`)
42
+ .map((e) => `${e.key}: ${e.id} - ${e.error?.message}`)
43
43
  .join('\n')}`,
44
44
  );
45
45
  }
@@ -37,7 +37,7 @@ export class Variables {
37
37
  * @returns {Record<string, unknown>} The expanded object
38
38
  */
39
39
  static expand(record: Record<string, unknown>): Record<string, unknown> {
40
- const expanded = {};
40
+ const expanded: Record<string, unknown> = {};
41
41
  for (const key in record) {
42
42
  const value = record[key];
43
43
  const interpolated = this.interpolate(value, record);
package/tsconfig.json CHANGED
@@ -12,10 +12,10 @@
12
12
  "baseUrl": "./",
13
13
  "incremental": true,
14
14
  "skipLibCheck": true,
15
- "strictNullChecks": false,
16
- "noImplicitAny": false,
17
- "strictBindCallApply": false,
18
- "forceConsistentCasingInFileNames": false,
19
- "noFallthroughCasesInSwitch": false
15
+ "strictNullChecks": true,
16
+ "noImplicitAny": true,
17
+ "strictBindCallApply": true,
18
+ "forceConsistentCasingInFileNames": true,
19
+ "noFallthroughCasesInSwitch": true
20
20
  }
21
21
  }