Skip to content

Commit 281331c

Browse files
Fix for vuePropRegex
1 parent 98239bc commit 281331c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

index.js

Lines changed: 2 additions & 2 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 = /([ .:@])([a-zA-Z]*?=)/ig;
109+
const vuePropRegex = /\s([.:@])([a-zA-Z]*?=)/ig;
110110

111111
/**
112112
* Convert a single vue file to AST
@@ -122,7 +122,7 @@ const toVueAst = (file) => {
122122
grC.replaceAll(/\S/g, " ")
123123
})
124124
.replace(vuePropRegex, function(match, grA, grB){
125-
return grA.replace(/[ .:@]/g, " ") + grB
125+
return grA.replace(/[.:@]/g, " ") + grB
126126
})
127127
.replace(vueTemplateRegex, function(match, grA, grB, grC){
128128
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.17.0",
3+
"version": "2.18.0",
44
"description": "Generate JS/TS AST in json format with Babel",
55
"exports": "./index.js",
66
"keywords": [

0 commit comments

Comments
 (0)