While attempting to update an object using the SDK and having 'strict' mode enabled in typescript, I encountered the following error:
const offer = client.offer(oldOfferDefinition!.id);
await offer.replace(newOfferDefinition);
error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'. Type 'undefined' is not assignable to type 'string'.
const offer = client.offer(oldOfferDefinition!.id);
I am confident that oldOfferDefinition contains an id with a value. How can I solve this compilation error?