Skip to content

Commit f955e30

Browse files
Fix for vuePropRegex
1 parent 571d836 commit f955e30

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

index.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ const vueCleaningRegex = /<\/*script.*>|<style[\s\S]*style>|<\/*br>/ig;
106106
const vueTemplateRegex = /(<template.*>)([\s\S]*)(<\/template>)/ig;
107107
const vueCommentRegex = /<\!--[\s\S]*?-->/ig;
108108
const vueBindRegex = /(:\[)([\s\S]*?)(\])/ig;
109-
const vuePropRegex = /([\s\S]*?)([.:@])([\s\S]*?)/ig;
109+
const vuePropRegex = /([.:@])([a-zA-Z]*?=)/ig;
110110

111111
/**
112112
* Convert a single vue file to AST
@@ -121,10 +121,8 @@ const toVueAst = (file) => {
121121
grB +
122122
grC.replaceAll(/\S/g, " ")
123123
})
124-
.replace(vuePropRegex, function(match, grA, grB, grC){
125-
return grA +
126-
grB.replaceAll(/\S/g, " ") +
127-
grC.replace(/[.:@]/g, "-")
124+
.replace(vuePropRegex, function(match, grA, grB){
125+
return grA.replace(/[.:@]/g, " ") + grB
128126
})
129127
.replace(vueTemplateRegex, function(match, grA, grB, grC){
130128
return grA +

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@joernio/astgen",
3-
"version": "2.15.0",
3+
"version": "2.16.0",
44
"description": "Generate JS/TS AST in json format with Babel",
55
"exports": "./index.js",
66
"keywords": [

0 commit comments

Comments
 (0)