Skip to content

Commit

Permalink
style(resolveConfig): add tsdoc to some values and interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
hasezoey committed May 3, 2022
1 parent ba0349c commit 9b9f327
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/mongodb-memory-server-core/src/util/resolveConfig.ts
Expand Up @@ -7,6 +7,7 @@ import { isNullOrUndefined } from './utils';

const log = debug('MongoMS:ResolveConfig');

/** Enum of all possible config options */
export enum ResolveConfigVariables {
DOWNLOAD_DIR = 'DOWNLOAD_DIR',
PLATFORM = 'PLATFORM',
Expand All @@ -26,9 +27,11 @@ export enum ResolveConfigVariables {
USE_ARCHIVE_NAME_FOR_BINARY_NAME = 'USE_ARCHIVE_NAME_FOR_BINARY_NAME',
}

/** The Prefix for Environmental values */
export const ENV_CONFIG_PREFIX = 'MONGOMS_';
/** This Value exists here, because "defaultValues" can be changed with "setDefaultValue", but this property is constant */
export const DEFAULT_VERSION = '5.0.8';
/** Default values for some config options that require explicit setting, it is constant so that the default values cannot be interfered with */
export const defaultValues = new Map<ResolveConfigVariables, string>([
// apply app-default values here
[ResolveConfigVariables.VERSION, DEFAULT_VERSION],
Expand All @@ -39,6 +42,7 @@ export const defaultValues = new Map<ResolveConfigVariables, string>([
[ResolveConfigVariables.USE_ARCHIVE_NAME_FOR_BINARY_NAME, 'false'],
]);

/** Interface for storing information about the found package.json from `findPackageJson` */
interface PackageJSON {
/** The Path where the package.json was found (directory, not the file) */
filePath: string;
Expand All @@ -57,6 +61,7 @@ export function setDefaultValue(key: ResolveConfigVariables, value: string): voi
}

// let packageJsonConfig: Record<string, string> = {};
/** Cache the found package.json file */
let packagejson: PackageJSON | undefined = undefined;
/**
* Find the nearest package.json (that has an non-empty config field) for the provided directory
Expand Down

0 comments on commit 9b9f327

Please sign in to comment.