Describe the bug
Version: 16.0.0
To Reproduce
getExpressionOrThrow no longer exists on JsxElement in v16. This doesn't appear to be present in the release notes for the 16.0.0 breaking changes
import { SyntaxKind, JsxAttribute } from 'ts-morph'
function doJsxThing(n: JsxAttribute) {
const initializer = n.getInitializerOrThrow()
if (initializer.isKind(SyntaxKind.StringLiteral)) {
return
}
// no longer compiles
const expression = initializer.getExpressionOrThrow()
}
Expected behavior
I think the code should compile if this isn't an expected change. Otherwise would appreciate an alternative!