File tree Expand file tree Collapse file tree 5 files changed +19
-8
lines changed
Expand file tree Collapse file tree 5 files changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,10 @@ import Imports from './modules/imports'
55
66class VueScriptParser {
77 constructor ( vueScript = '' ) {
8+
9+ //set original script
10+ this . script = vueScript
11+
812 //load imports
913 let importsProcessor = new Imports ( vueScript )
1014 this . imports = importsProcessor . imports
@@ -20,6 +24,13 @@ class VueScriptParser {
2024 //load methods
2125 let methodsProcessor = new Methods ( vueScript )
2226 this . methods = methodsProcessor . methods
27+
28+ }
29+ addVariable ( ) {
30+
31+ }
32+ removeVariable ( ) {
33+
2334 }
2435}
2536
Original file line number Diff line number Diff line change 22import Vue from 'vue'
33class Data {
44 constructor ( vueScript = '' ) {
5- this . data = this . setData ( vueScript )
5+ this . data = this . dataReader ( vueScript )
66 }
77
8- setData ( vueScript = '' ) {
8+ dataReader ( vueScript = '' ) {
99 let dataRegx = / d a t a \s * \( \s * \) \s * \{ \s * r e t u r n \s * { ( [ ^ ] * ) } / g
1010 let processedData = this . extractAndUpdateData ( vueScript , dataRegx )
1111
Original file line number Diff line number Diff line change 11class Imports {
22 constructor ( vueScript = '' ) {
3- this . imports = this . setImports ( vueScript ) || [ ]
3+ this . imports = this . importsReader ( vueScript ) || [ ]
44 }
5- setImports ( vueScript ) {
5+ importsReader ( vueScript ) {
66 return vueScript . match ( / i m p o r t .* / g)
77 }
88
Original file line number Diff line number Diff line change @@ -2,9 +2,9 @@ import { scriptSectionProcessing } from './common'
22
33class Methods {
44 constructor ( vueScript = '' ) {
5- this . methods = this . setMethod ( vueScript )
5+ this . methods = this . methodsReader ( vueScript )
66 }
7- setMethod ( vueScript = '' ) {
7+ methodsReader ( vueScript = '' ) {
88 let regx = / m e t h o d s \s * : \s * { ( [ ^ ] * ) } / g
99 let matchMethods = vueScript . match ( regx )
1010 if ( ! matchMethods ) {
Original file line number Diff line number Diff line change @@ -2,9 +2,9 @@ import { scriptSectionProcessing } from './common'
22class Mounted {
33 constructor ( vueScript ) {
44 let regx = / m o u n t e d \s * \( \s * \) \s * { ( [ ^ ] * ) } / g
5- this . mounted = this . extractAndUpdateMounted ( regx , vueScript )
5+ this . mounted = this . mountedReader ( regx , vueScript )
66 }
7- extractAndUpdateMounted ( regx , vueScript ) {
7+ mountedReader ( regx , vueScript ) {
88 let newScript = ''
99 let matchMounted = vueScript . match ( regx )
1010 if ( ! matchMounted ) {
You can’t perform that action at this time.
0 commit comments