import { TraderHelper } from "https://deno.land/x/sptaki@1.2.0/helpers/mod.ts";
Validates that the provided traderEnumValue exists in the Traders enum. If the value is valid, it returns the same enum value, effectively serving as a trader ID; otherwise, it logs an error and returns an empty string. This method provides a runtime check to prevent undefined behavior when using the enum as a dictionary key.
For example, instead of this:
const traderId = Traders[Traders.PRAPOR];
You can use safely use this:
const traderId = this.traderHelper.getValidTraderIdByEnumValue(Traders.PRAPOR);
Parameters
traderEnumValue: Traders
The trader enum value to validate