Skip to content

Commit

Permalink
Merge pull request #1919 from foxadb/refactor-missing-return-types
Browse files Browse the repository at this point in the history
refactor: add missing return types to functions
  • Loading branch information
kamilmysliwiec authored Jan 17, 2025
2 parents 6411b7d + f0e0de9 commit 1c54dde
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
10 changes: 7 additions & 3 deletions lib/config.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,9 @@ export class ConfigModule {
return config;
}

private static assignVariablesToProcess(config: Record<string, unknown>) {
private static assignVariablesToProcess(
config: Record<string, unknown>,
): void {
if (!isObject(config)) {
return;
}
Expand All @@ -225,13 +227,15 @@ export class ConfigModule {
host: Record<string, any>,
item: Record<string, any>,
provider: FactoryProvider,
) {
): void {
const factoryRef = provider.useFactory;
const token = getRegistrationToken(factoryRef);
mergeConfigObject(host, item, token);
}

private static getSchemaValidationOptions(options: ConfigModuleOptions) {
private static getSchemaValidationOptions(
options: ConfigModuleOptions,
): Record<string, any> {
if (options.validationOptions) {
if (typeof options.validationOptions.allowUnknown === 'undefined') {
options.validationOptions.allowUnknown = true;
Expand Down
2 changes: 1 addition & 1 deletion lib/config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ export class ConfigService<
return options && options?.infer && Object.keys(options).length === 1;
}

private updateInterpolatedEnv(propertyPath: string, value: string) {
private updateInterpolatedEnv(propertyPath: string, value: string): void {
let config: ReturnType<typeof dotenv.parse> = {};
for (const envFilePath of this.envFilePaths) {
if (fs.existsSync(envFilePath)) {
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/get-config-token.util.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @publicApi
*/
export function getConfigToken(token: string) {
export function getConfigToken(token: string): string {
return `CONFIGURATION(${token})`;
}
2 changes: 1 addition & 1 deletion lib/utils/merge-configs.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export function mergeConfigObject(
host: Record<string, any>,
partial: Record<string, any>,
token?: string,
) {
): Record<string, any> | undefined {
if (token) {
set(host, token, partial);
return partial;
Expand Down

0 comments on commit 1c54dde

Please sign in to comment.