babel-helper-vue-jsx-merge-props
Advanced tools
Comparing version 2.0.0 to 2.0.1
16
index.js
@@ -1,2 +0,2 @@ | ||
var nestRE = /^(attrs|props|on|nativeOn|class|style)$/ | ||
var nestRE = /^(attrs|props|on|nativeOn|class|style|hook)$/ | ||
@@ -10,3 +10,8 @@ module.exports = function mergeJSXProps (objs) { | ||
if (aa && nestRE.test(key)) { | ||
if (Array.isArray(aa)) { | ||
if (key === 'on' || key === 'nativeOn' || key === 'hook') { | ||
// merge functions | ||
for (nestedKey in bb) { | ||
aa[nestedKey] = mergeFn(aa[nestedKey], bb[nestedKey]) | ||
} | ||
} else if (Array.isArray(aa)) { | ||
a[key] = aa.concat(bb) | ||
@@ -27,1 +32,8 @@ } else if (Array.isArray(bb)) { | ||
} | ||
function mergeFn (a, b) { | ||
return function () { | ||
a.apply(this, arguments) | ||
b.apply(this, arguments) | ||
} | ||
} |
{ | ||
"name": "babel-helper-vue-jsx-merge-props", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "babel helper for vue jsx spread.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1479
35