We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c0a6612 commit 2dcbee3Copy full SHA for 2dcbee3
2 files changed
package.json
@@ -12,7 +12,7 @@
12
"tools"
13
],
14
"license": "ISC",
15
- "version": "1.1.2",
+ "version": "1.1.3",
16
"engines": {
17
"vscode": "^1.52.0"
18
},
src/lib/ast.ts
@@ -44,8 +44,9 @@ export const templateToAst = (code: string) =>
44
template.ast(code, getParserOptions());
45
46
export const isJSX = (code: string) => {
47
- const firstChar = code.trim()[0];
48
- const lastChar = code.trim()[code.length - 1];
+ const trimmed = code.trim();
+ const firstChar = trimmed[0];
49
+ const lastChar = trimmed[trimmed.length - 1];
50
if (firstChar !== "<" || lastChar !== ">") return false;
51
52
const ast = jsxToAst(code);
0 commit comments