baseUrl not set correctly for TypeScript with version 13.8.0.0
See original GitHub issueWe have a project which generates TS code using NSwag and today I updated to version 13.8.0.0, and it seems to have broken how baseUrl is set.
Where it previously, in the constructor, generated:
this.baseUrl = baseUrl ? baseUrl : this.getBaseUrl("");
It now generates:
this.baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
Notice the value isn’t actually set anywhere.
A quick search/replace to the following, fixed the problem:
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
I have made other changes to my code recently, but nothing I can think of would cause this other than upgrading the packages.
I’ll gladly provide more info, if you let me know what you need to know. I was just wondering, if what you were after, was:
this.baseUrl = baseUrl ?? this.getBaseUrl("");
Issue Analytics
- State:
- Created 3 years ago
- Comments:17 (10 by maintainers)
Thanks for the quick fix!
Sorry, I’m learning TypeScript as I debug… I had a “this.” in the condition. All good. 13.8.1 fixes it. 🙂
Thank you @johnnyreilly for your quick fix! 😉