curved-kitchen-24115
04/03/2023, 10:29 PMlet hostAnnotation: { [key: string]: string } = {};
if (cfg.get("traefikHosts")) {
hostAnnotation = {
"somekey": (
cfg.require("hosts") as unknown as string[]
).join(","),
};
}
I get: TypeError: cfg.require(...).join
is not a function
I cannot for the life of me work out how to make the type checker happy 😞steep-toddler-94095
04/03/2023, 10:44 PMrequire
gives back a string. Use requireObject
instead:
new Config().requireObject<string[]>('hosts')
curved-kitchen-24115
04/03/2023, 10:44 PM