Skip to content
This repository has been archived by the owner on Dec 25, 2024. It is now read-only.

Commit

Permalink
fix: allow use <= in script, close #68 (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoxiangmoe authored Nov 26, 2021
1 parent 595d749 commit 9799d56
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"@vue/ref-transform": "^3.2.21",
"@vue/shared": "^3.2.21",
"defu": "^5.0.0",
"htmlparser2": "^7.2.0",
"htmlparser2": "5.0.1",
"magic-string": "^0.25.7",
"unplugin": "^0.2.21"
},
Expand Down
22 changes: 20 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions test/__snapshots__/transform.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,26 @@ export default __sfc_main;
"
`;
exports[`transform fixtures test/fixtures/ScriptLessThanOrEqualTo.vue 1`] = `
"<script lang=\\"ts\\">
const __sfc_main = {};
__sfc_main.setup = (__props, __ctx) => {
const val: boolean = 1 <= 2;
return {
val
};
};
export default __sfc_main;
</script>
<template>
<div>{{ val }}</div>
</template>
"
`;
exports[`transform fixtures test/fixtures/ScriptOnly.vue 1`] = `
"<script lang=\\"ts\\">
// <script setup> in comment should not be matched
Expand Down
7 changes: 7 additions & 0 deletions test/fixtures/ScriptLessThanOrEqualTo.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<script setup lang="ts">
const val: boolean = 1 <= 2
</script>

<template>
<div>{{ val }}</div>
</template>

0 comments on commit 9799d56

Please sign in to comment.