Correctly cache tagged template objects in modules by DanielRosenwasser · Pull Request #18300 · microsoft/TypeScript
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, you can go for even less readable, and do return Object.defineProperty ? Object.defineProperty(cooked, "raw", { value: raw }) : (cooked.raw = raw, cooked);. Can cram the entire helper into one line and it's not bad, actually:
var __makeTemplateObject = (this && this.__makeTemplateObject) || (cooked, raw) => Object.defineProperty ? Object.defineProperty(cooked, "raw", { value: raw }) : (cooked.raw = raw, cooked);
Too bad we don't transpile helpers 👅