sparse-intern-71089
11/24/2023, 10:31 AMclever-sunset-76585
11/25/2023, 6:10 AMrhythmic-orange-74390
11/26/2023, 4:42 PMany
to achieve this
> const x: unknown = { a: { b: { x: "foo" }}};
undefined
> console.log((x as { a: {b: {x: string; }}}).a.b.x)
foo
> console.log((x as any).a.b.x)
foo
rhythmic-orange-74390
11/26/2023, 4:50 PMinterface A {
b: {
x: string;
}
}
const myA = config.requireObject<A>("a"); // generic cast
const x = myA.b.x;