Adrián Mouly
09/01/2021, 3:29 AMaddRoute
, which instances a Function
construct, and also defines new environment variables…
Are the first ones replaced by the second ones? or both are merged?Adrián Mouly
09/01/2021, 3:58 AMError: The "defaultFunctionProps" cannot be applied if an instance of a Function construct is passed in. Make sure to define all the routes using FunctionProps, so the Api construct can apply the "defaultFunctionProps" to them.
Frank
Frank
Adrián Mouly
09/01/2021, 4:08 AMenvironment
?Adrián Mouly
09/01/2021, 4:09 AMAdrián Mouly
09/01/2021, 4:09 AMAdrián Mouly
09/01/2021, 4:10 AMAdrián Mouly
09/01/2021, 4:10 AMFrank
Adrián Mouly
09/01/2021, 4:10 AMAdrián Mouly
09/01/2021, 4:10 AMAdrián Mouly
09/01/2021, 4:11 AM[key: string]: FunctionDefinition | ApiFunctionRouteProps | ApiHttpRouteProps | ApiAlbRouteProps;
Frank
environment
Adrián Mouly
09/01/2021, 4:12 AMthdxr
09/01/2021, 4:14 AMthdxr
09/01/2021, 4:15 AMAdrián Mouly
09/01/2021, 4:16 AMAdrián Mouly
09/01/2021, 4:16 AMAdrián Mouly
09/01/2021, 4:16 AMAdrián Mouly
09/01/2021, 4:17 AMthdxr
09/01/2021, 4:17 AMAdrián Mouly
09/01/2021, 4:17 AMthdxr
09/01/2021, 4:17 AMAdrián Mouly
09/01/2021, 4:17 AMAdrián Mouly
09/01/2021, 4:17 AMthdxr
09/01/2021, 4:18 AMtype Rectangle = {
kind: "square";
width: number;
height: number;
};
type Circle = {
kind: "circle";
radius: number;
};
type Shape = Rectangle | Circle
function test(s: Shape) {
console.log(s.height) // type error
if (s.kind === "square") {
s.height // valid
}
}
thdxr
09/01/2021, 4:18 AMAdrián Mouly
09/01/2021, 4:21 AMAdrián Mouly
09/01/2021, 4:21 AM