Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-transform-vue-jsx

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-vue-jsx - npm Package Compare versions

Comparing version 1.1.1 to 2.0.0

README.md

6

index.js

@@ -112,5 +112,5 @@ var esutils = require('esutils')

if (!objs[0]._isSpread) {
objs[0] = groupProps(objs[0].properties, t)
}
objs = objs.map(function (o) {
return o._isSpread ? o : groupProps(o.properties, t)
})

@@ -117,0 +117,0 @@ if (objs.length === 1) {

var makeMap = require('./make-map')
var isTopLevel = makeMap(
'class,style,staticClass,staticAttrs,' +
'key,ref,slot,transition'
)
var isTopLevel = makeMap('class,staticClass,style,key,ref,slot')
function normalizePrefix (prefix) {
if (prefix === 'prop' || prefix === 'directive') {
return prefix + 's'
} else {
return prefix
}
}
module.exports = function groupProps (props, t) {

@@ -20,10 +9,10 @@ var newProps = []

var name = prop.key.value || prop.key.name
var prefixIndex
if (isTopLevel(name)) {
// top-level special props
newProps.push(prop)
} else if (name.indexOf('-') > 0) {
} else if ((prefixIndex = name.indexOf('-')) > 0) {
// nested
var split = name.split('-')
var prefix = normalizePrefix(split[0])
var suffix = split[1]
var prefix = name.slice(0, prefixIndex)
var suffix = name.slice(prefixIndex + 1)
var nestedProp = t.objectProperty(t.identifier(suffix), prop.value)

@@ -30,0 +19,0 @@ var nestedObject = currentNestedObjects[prefix]

{
"name": "babel-plugin-transform-vue-jsx",
"version": "1.1.1",
"version": "2.0.0",
"description": "Babel plugin for Vue 2.0 JSX",

@@ -39,3 +39,3 @@ "main": "index.js",

"babel-cli": "^6.10.1",
"babel-helper-vue-jsx-merge-props": "^1.0.0",
"babel-helper-vue-jsx-merge-props": "^2.0.0",
"babel-loader": "^6.2.4",

@@ -42,0 +42,0 @@ "babel-plugin-syntax-jsx": "^6.8.0",

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