sparse-intern-71089
12/21/2020, 11:43 PMlittle-cartoon-10569
12/21/2020, 11:46 PM! to the result of the function call?little-cartoon-10569
12/21/2020, 11:48 PMstring and allow it to throw an exception when it previously returned undefined, that would fix it...little-cartoon-10569
12/21/2020, 11:48 PM| undefined is a good thing to avoid...worried-queen-62794
12/21/2020, 11:50 PM!. undefined is a legitimate value.worried-queen-62794
12/21/2020, 11:50 PMlittle-cartoon-10569
12/21/2020, 11:52 PMlittle-cartoon-10569
12/21/2020, 11:53 PMworried-queen-62794
12/21/2020, 11:54 PMfoo?: Input<string> . I have a boolean which when true I will pass foo: "bar" and when false then foo: undefined. This worked fine until I had to lift the boolean into an Input<boolean> and now I can't get it to work.worried-queen-62794
12/21/2020, 11:55 PMOutput had a filter method then it would work.little-cartoon-10569
12/21/2020, 11:55 PMworried-queen-62794
12/21/2020, 11:56 PMstring. It would have to be a string | undefined as it is an optional value.little-cartoon-10569
12/21/2020, 11:58 PMfoo: variable ?? undefined?little-cartoon-10569
12/21/2020, 11:58 PMundefined.little-cartoon-10569
12/21/2020, 11:59 PMfoo: variablelittle-cartoon-10569
12/22/2020, 12:00 AMworried-queen-62794
12/22/2020, 12:03 AMworried-queen-62794
12/22/2020, 12:13 AMinterface A {
  something: pulumi.Output<boolean>
}
class B {
  constructor(anotherThing?: Input<string>) {
    // ...
  }
}
function bar(bool?: boolean) {
  new B(bool ? "This is another thing" : undefined)
}
function foo(a?: Input<boolean>) {
  new B(pulumi.output(a).apply(bool => bool ? "This is another thing" : undefined))
}
const a: A = undefined!;
foo(a?.something);worried-queen-62794
12/22/2020, 12:20 AMbar works and looks pretty normal (ok maybe it wouldn't be optional but often it is when there is an args type and there is a default). It doesn't seem like much of a jump to go to foo.worried-queen-62794
12/22/2020, 12:28 AMPromise<boolean> to Promise<string> | undefinedworried-queen-62794
12/22/2020, 12:40 AMclass B {
  constructor(anotherThing?: Input<string | undefined>) {
    // ...
  }
}
In which case I can use ! and lie to the compiler.little-cartoon-10569
12/22/2020, 1:12 AMbar() function; just pass in the string. And I suppose it's just because it's an MCVE, but pulumi.interpolate is suitable for the foo() function.little-cartoon-10569
12/22/2020, 1:13 AMworried-queen-62794
12/22/2020, 2:22 AMboolean is forever trapped inside the Output. In Scala it is the same as trying to do Future[Boolean] => Option[Future[String]] which can't be done (at least not in a pure way). I assume Kotlin is the same.little-cartoon-10569
12/22/2020, 2:27 AMlittle-cartoon-10569
12/22/2020, 2:28 AM