typescript nested object code example
Example 1: creating object of type nested
interface EndpointAuth {
login: string;
}
interface Endpoint {
auth: EndpointAuth;
}
const endpoints: Endpoint = {
auth: {
login: "http://localhost:8079/auth/login"
}
};
Example 2: typescript get objects nested in object
var obj: type = Object.values(<object>)[<indexOfNested>]