Skip to content

Commit

Permalink
Fix for vuePropRegex
Browse files Browse the repository at this point in the history
  • Loading branch information
max-leuthaeuser committed Mar 17, 2023
1 parent 98239bc commit 281331c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const vueCleaningRegex = /<\/*script.*>|<style[\s\S]*style>|<\/*br>/ig;
const vueTemplateRegex = /(<template.*>)([\s\S]*)(<\/template>)/ig;
const vueCommentRegex = /<\!--[\s\S]*?-->/ig;
const vueBindRegex = /(:\[)([\s\S]*?)(\])/ig;
const vuePropRegex = /([ .:@])([a-zA-Z]*?=)/ig;
const vuePropRegex = /\s([.:@])([a-zA-Z]*?=)/ig;

/**
* Convert a single vue file to AST
Expand All @@ -122,7 +122,7 @@ const toVueAst = (file) => {
grC.replaceAll(/\S/g, " ")
})
.replace(vuePropRegex, function(match, grA, grB){
return grA.replace(/[ .:@]/g, " ") + grB
return grA.replace(/[.:@]/g, " ") + grB
})
.replace(vueTemplateRegex, function(match, grA, grB, grC){
return grA +
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@joernio/astgen",
"version": "2.17.0",
"version": "2.18.0",
"description": "Generate JS/TS AST in json format with Babel",
"exports": "./index.js",
"keywords": [
Expand Down

0 comments on commit 281331c

Please sign in to comment.