Snippet of Code:
enum Environment {
Production = 'production',
Development = 'development',
Test = 'test'
}
export class Config {
public constructor(EnvProd: Environment = Environment.Production, EnvEnum = Environment) {
Config.createConsoleLog(EnvProd, EnvEnum, console);
}
private static createConsoleLog(EnvProd: Environment, EnvEnum: Environment, console: Console): void {
console.log(EnvProd, EnvEnum);
}
}
Encountered the following error:
karlm@karl-Dell-Precision-M3800:~/dev/sg$ npx ts-node application/libs/config/index.ts
⨯ Unable to compile TypeScript:
application/libs/config/index.ts:9:42 - error TS2345: Argument of type 'typeof Environment' is not assignable to parameter of type 'Environment'.
9 Config.createConsoleLog(EnvProd, EnvEnum, console);
~~~~~~~
Struggling to resolve this error in my code.