New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@espkg/mina2vue

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@espkg/mina2vue - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

src/mf-script-transformer.js

9

package.json
{
"name": "@espkg/mina2vue",
"version": "0.2.0",
"version": "0.3.0",
"description": "Convert native wxml, wxss eg. to .vue files",
"main": "index.js",
"directories": {
"lib": "lib",
"src": "src",
"test": "test"

@@ -46,3 +46,6 @@ },

"webpack-cli": "^3.3.10"
}
},
"files": [
"src"
]
}

@@ -6,2 +6,3 @@ import parser from '@babel/parser'

import minaScriptTransformer from './mina-script-transformer'
import MFScriptTransformer from './mf-script-transformer'
import vueGenerator from './vue-generator'

@@ -32,3 +33,4 @@ import styleTransformer from './style-transformer'

})
const distAST = minaScriptTransformer(scriptAST)
let distAST = minaScriptTransformer(scriptAST)
distAST = MFScriptTransformer(distAST)
const distCode = generator.default(distAST).code

@@ -35,0 +37,0 @@

@@ -67,4 +67,4 @@ import t from '@babel/types'

t.identifier('mounted'),
prop.value.params,
prop.value.body
prop.value ? prop.value.params : prop.params,
prop.value ? prop.value.body : prop.body
))

@@ -156,15 +156,9 @@ break

},
MemberExpression (path) {
const { node } = path
ThisExpression (path) {
// this.data.foo -> this.foo
if (t.isMemberExpression(node.object) &&
t.isThisExpression(node.object.object) &&
node.object.property.name === 'data'
const parentNode = path.parentPath.node
if (t.isMemberExpression(path.parentPath.node) &&
parentNode.property.name === 'data'
) {
path.replaceWith(
t.memberExpression(
t.thisExpression(),
t.identifier(node.property.name)
)
)
path.parentPath.replaceWith(t.ThisExpression())
}

@@ -171,0 +165,0 @@ }

@@ -24,2 +24,6 @@ function dynamicValue (value) {

case 'mf-page':
node.name = 'div'
break
default:

@@ -117,3 +121,3 @@ }

node.attribs[`@${eventName}`] = value
node.attribs[`@${eventName}`] = `${value}($event)`
delete node.attribs[attribute]

@@ -196,2 +200,4 @@ }

handleWXAttribute(value, attribute, node)
} else if (attribute === 'mfConfig') {
delete node.attribs[attribute]
} else {

@@ -198,0 +204,0 @@ handleElseAttribute(value, attribute, node)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc