Sam Hulick
08/06/2021, 4:17 PMenvironment
doesn’t show up as a property, but it should be. this might be a VS Code bug, seems likeFrank
Sam Hulick
08/06/2021, 4:36 PMFrank
Frank
Frank
thdxr
08/06/2021, 5:09 PMthdxr
08/06/2021, 5:10 PMFrank
thdxr
08/06/2021, 5:45 PMtype 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
08/06/2021, 5:46 PMthdxr
08/06/2021, 5:46 PMthdxr
08/06/2021, 5:48 PMradius
because it knows that's not what you wantFrank
thdxr
08/06/2021, 5:50 PMbundle
as well and have very nice developer experience where it shows them what options are available for a python bundle vs a go bundleFrank
instanceof
check is not reliable. ie. SST has the @aws-cdk/aws-s3
dependency, and users can also have @aws-cdk/aws-s3
as their dependency. If they are of different versions, the package is going to appear twice in side node_modules
.thdxr
08/06/2021, 5:51 PMthdxr
08/06/2021, 5:51 PMFrank